Data processing method and device, electronic equipment and storage medium

By filling the input statement with the data table matching, determining the target data table and generating query statements, the identification error problem caused by the large number of data tables is solved, and the accuracy of the query statement is improved.

CN119719128APending Publication Date: 2025-03-28BEIJING XIAOMI MOBILE SOFTWARE CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311265295.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-27
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

When there are many data tables and the names of the data tables are the same or similar, it is easy to cause data table identification errors, resulting in inaccurate query statements.

Method used

By performing slot filling processing on the input statement, slot information is obtained, and matching it with the entry information of each preset data table in the data table set, the target data table is determined, thereby generating an accurate query statement.

Benefits of technology

The accuracy of data table positioning and query statement accuracy are improved, and the problem of inaccurate query statements caused by inaccurate data table positioning in the prior art is solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119719128A_ABST
    Figure CN119719128A_ABST
Patent Text Reader

Abstract

The invention relates to a data processing method and device, electronic equipment and a storage medium, and the method comprises the steps: carrying out the slot filling processing of an input statement, and obtaining the slot information in each slot corresponding to the input statement; matching the slot position information with entry information in each preset data table in a data table set to obtain a matching result; determining a target data table from the data table set according to the matching result; and generating the query statement based on the target data table and the slot position information, thereby improving the accuracy of positioning the target data table and improving the accuracy of generating the query statement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of database data processing, and in particular to a data processing method and device, an electronic device, and a storage medium. Background Art

[0002] In the task-based dialogue of data question answering, the process of converting the natural language sentences input by the user into structured query language (SQL) is called NL2SQL. The NL2SQL technology is mainly divided into two categories, one is pipeline technology (pipeline), and the other is generative NL2SQL technology.

[0003] In the related art, when the number of data tables is small, the generative NL2SQL technology can be used to directly obtain the query statement; however, when the number of data tables is large, there are multiple data tables with the same or similar names, which can easily cause the problem of data table recognition errors, resulting in inaccurate generated query statements. Summary of the invention

[0004] In order to overcome the problems existing in the related art, the present disclosure provides a data processing method and device, an electronic device, and a storage medium to overcome the problems of inaccurate data table positioning and inaccurate generated query statements.

[0005] According to a first aspect of an embodiment of the present disclosure, there is provided a data processing method, including:

[0006] Performing slot filling processing on the input sentence to obtain slot information in each slot corresponding to the input sentence;

[0007] Matching the slot information with the entry information in each preset data table in the data table set to obtain a matching result;

[0008] Determining a target data table from the data table set according to the matching result;

[0009] A query statement is generated based on the target data table and the slot information.

[0010] In some embodiments, the matching of the slot information with the entry information in each preset data table in the data table set to obtain a matching result includes:

[0011] Compare each of the slot information with the corresponding each of the entry information in the preset data table, and determine the entry information that is the same as the slot information from the preset data table; wherein the entry name of each of the entry information in the preset data table corresponds to each of the slots;

[0012] Determining a target data table from the data table set according to the matching result includes:

[0013] The target data table is determined from the data table set based on the entry information in each of the preset data tables that is identical to the slot information.

[0014] In some embodiments, determining the target data table from the data table set based on the entry information identical to the slot information in each of the preset data tables includes:

[0015] Determine respectively the number of the entry information in each of the preset data tables that is the same as each of the slot information;

[0016] Based on the number, determining a contribution value of the preset data table;

[0017] The target data table is determined from the data table set based on the contribution values ​​of the respective preset data tables.

[0018] In some embodiments, determining the contribution value of the preset data table based on the number includes:

[0019] Determine the slot weight corresponding to each of the slot information respectively;

[0020] Performing weighted processing on the numbers corresponding to each piece of slot information based on the slot weight to obtain a weighted number corresponding to each piece of slot information;

[0021] Based on each of the weighted numbers, a contribution value of the preset data table is determined.

[0022] In some embodiments, determining the target data table from the data table set based on the contribution values ​​of the respective preset data tables includes:

[0023] Sorting the contribution values ​​to obtain a sorting result;

[0024] Based on the sorting result, the target data table is determined from the data table set.

[0025] In some embodiments, the method further comprises:

[0026] Execute the query statement for the target data table to obtain a query result;

[0027] Based on the query results, a target graph is generated.

[0028] In some embodiments, the method further comprises:

[0029] Get user statements;

[0030] Inputting the user sentence into a preprocessing model;

[0031] Based on the preprocessing model, the user sentence is expanded to obtain the input sentence.

[0032] According to a second aspect of an embodiment of the present disclosure, there is provided a data processing device, including:

[0033] A first determination module is configured to perform slot filling processing on the input sentence to obtain slot information in each slot corresponding to the input sentence;

[0034] A matching module, configured to match the slot information with the entry information in each preset data table in the data table set to obtain a matching result;

[0035] A second determination module is configured to determine a target data table from the data table set according to the matching result;

[0036] The first generating module is configured to generate a query statement based on the target data table and the slot information.

[0037] In some embodiments, the matching module is specifically configured as follows:

[0038] Compare each of the slot information with the corresponding each of the entry information in the preset data table, and determine the entry information that is the same as the slot information from the preset data table; wherein the entry name of each of the entry information in the preset data table corresponds to each of the slots;

[0039] The second determining module is specifically configured to:

[0040] The target data table is determined from the data table set based on the entry information in each of the preset data tables that is identical to the slot information.

[0041] In some embodiments, the second determining module further includes:

[0042] A first submodule is configured to respectively determine the number of entry information in each of the preset data tables that is the same as each of the slot information;

[0043] A second submodule is configured to determine a contribution value of the preset data table based on the number;

[0044] The third submodule is configured to determine the target data table from the data table set based on the contribution values ​​of each of the preset data tables.

[0045] In some embodiments, the second submodule further includes:

[0046] The first module is configured to respectively determine the slot weight corresponding to each of the slot information;

[0047] The second module is configured to perform weighted processing on the numbers corresponding to each slot information based on the slot weight to obtain a weighted number corresponding to each slot information;

[0048] The third module is configured to determine the contribution value of the preset data table based on each of the weighted numbers.

[0049] In some embodiments, the third submodule further includes:

[0050] A sorting module is configured to sort the contribution values ​​to obtain a sorting result;

[0051] The determination submodule is configured to determine the target data table from the data table set based on the sorting result.

[0052] In some embodiments, the data processing device further includes:

[0053] A query module, configured to execute the query statement for the target data table to obtain a query result;

[0054] The second generating module is configured to generate a target graph based on the query result.

[0055] In some embodiments, the data processing device further includes:

[0056] An acquisition module, configured to acquire user statements;

[0057] An input module, configured to input the user sentence into a preprocessing model;

[0058] The expansion module is configured to perform expansion processing on the user sentence based on the preprocessing model to obtain the input sentence.

[0059] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:

[0060] processor;

[0061] a memory for storing processor-executable instructions;

[0062] Wherein, the processor is configured to: when executing the executable command, implement the steps in any one of the data processing methods in the first aspect above.

[0063] According to a fourth aspect of an embodiment of the present disclosure, a non-transitory computer-readable storage medium is provided, including:

[0064] When the instructions in the storage medium are executed by a processor of an electronic device, the steps in any one of the data processing methods in the first aspect above are implemented.

[0065] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:

[0066] In the disclosed embodiment, slot filling processing is performed on an input statement to obtain slot information in each slot corresponding to the input statement; the slot information is matched with entry information in each preset data table in a data table set to obtain a matching result; based on the matching result, a target data table is determined from the data table set, thereby improving the accuracy of locating the target data table; based on the target data table and the slot information, a query statement is generated, thereby improving the accuracy of the generated query statement, thereby solving the problem in the prior art of inaccurate query statement generated due to inaccurate data table positioning.

[0067] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0069] Figure 1 A data processing method according to an exemplary embodiment is shown in FIG. Figure 1 ;

[0070] Figure 2 is a structural schematic diagram of generating a query statement according to an exemplary embodiment;

[0071] Figure 3 is a schematic diagram of a chart according to an exemplary embodiment;

[0072] Figure 4 A data processing method according to an exemplary embodiment is shown in FIG. Figure 2 ;

[0073] Figure 5 is a block diagram of a data processing device according to an exemplary embodiment;

[0074] Figure 6 A hardware structure frame of an electronic device according to an exemplary embodiment is shown Figure 1 ;

[0075] Figure 7 A hardware structure frame of an electronic device according to an exemplary embodiment is shown Figure 2 . DETAILED DESCRIPTION

[0076] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0077] Figure 1 A data processing method according to an exemplary embodiment is shown in FIG. Figure 1 ,like Figure 1 As shown, the data processing method mainly includes the following steps:

[0078] In step 101, slot filling processing is performed on the input sentence to obtain slot information in each slot corresponding to the input sentence;

[0079] In step 102, the slot information is matched with the entry information in each preset data table in the data table set to obtain a matching result;

[0080] In step 103, according to the matching result, a target data table is determined from the data table set;

[0081] In step 104, a query statement is generated based on the target data table and the slot information.

[0082] It should be noted that the data processing method proposed in the present disclosure can be applied to electronic devices. Here, the electronic device may include: terminal devices, for example, mobile terminals or fixed terminals. Among them, mobile terminals may include: mobile phones, tablet computers, laptop computers, wearable electronic devices and other devices. Fixed terminals may include: desktop computers, smart TVs, vehicle-mounted devices, etc. In other embodiments, the data processing method may also be applied to applications installed on electronic devices.

[0083] In other embodiments, the data processing method in the embodiments of the present disclosure may be configured in a data processing device, and the data processing device may be provided in an electronic device, and the embodiments of the present disclosure are not limited to this. It should be noted that the execution subject of the embodiments of the present disclosure may be a central processing unit (CPU) in an electronic device in terms of hardware, and may be a related background service in the electronic device in terms of software, and is not limited to this.

[0084] In some embodiments, the input sentence may be a natural sentence input by the user. Since the input sentence is not a structured language that the electronic device can understand, in order to convert the user's implicit intention into a displayed instruction, the input sentence can be converted into structured information that the machine can understand by filling in the slots, thereby assisting the electronic device to perform the corresponding operation.

[0085] It is understandable that the user's intention can usually be reflected by several aspects of key information. As long as part or all of the above key information can be clarified, the user's intention can be determined. To this end, in the embodiment of the present disclosure, slots are designed according to the above characteristics, and based on the slot filling method, the input sentence is segmented, and specific words are filled into the corresponding slots through semantic analysis and other methods to obtain the slot information in each slot corresponding to the input sentence.

[0086] Here, the slots may be pre-configured, or may be configured after receiving an input statement based on key elements that can indicate the user's intention, and the embodiments of the present disclosure are not limited to this.

[0087] It is worth noting that the input sentence can be text information directly input by the user, or it can be voice information input by the user, and the embodiments of the present disclosure are not limited to this.

[0088] Taking the input sentence as an example, which is voice information input by the user, after detecting the voice information input by the user, the language type of the voice information can be detected, and a voice standardization model matching the language type can be obtained. The voice standardization model is used to pre-process the voice information to generate standardized voice information; then a voice-to-text model matching the language type is obtained, and the voice-to-text conversion model is used to process the standardized voice to generate text information; finally, the text information is segmented by slot filling to obtain multiple words, and specific words are filled into corresponding slots by semantic analysis to obtain slot information in each slot corresponding to the input sentence.

[0089] In some embodiments, when the input sentence is text information, it is usually represented by "Query". First, the Query can be standardized, including Query preprocessing, Query completion and Query rewriting, wherein Query preprocessing can include at least one of uppercase and lowercase conversion, traditional Chinese character conversion, typo correction and special character processing, Query completion includes completion based on context information and completion based on historical query data, and Query rewriting includes synonym replacement. Finally, the standardized Query is slot filled to obtain the current slot information.

[0090] It is understandable that in order to reduce the amount of system calculations, after obtaining the input statement, the input statement can be converted through intent recognition, and the input statement can be classified according to the conversion result, so that complex input statements can be converted into simple modes.

[0091] In some embodiments, the slot types can be divided into dimensions and indicators, where dimensions are used to describe the characteristics and attributes of things. For example, time is a special dimension. By comparing before and after time, the changes of things can be observed; and indicators are units or methods used to measure the degree of development of things.

[0092] It should be explained that according to the data type, the dimension can be divided into qualitative dimension and quantitative dimension. The data type is character (text) data, which is a qualitative dimension, such as region and gender; the data type is numerical data, which is a quantitative dimension, such as income and consumption. At the same time, indicators can also be divided into counting indicators and composite indicators. Counting indicators include visitors and page views; composite indicators include visit depth and conversion rate.

[0093] In some embodiments, in order to better identify the needs of users, the slots are mainly divided into dimension slots, time slots and indicator slots. After receiving the user's input sentence, the input sentence is split based on the slot filling method to obtain multiple groups of words, and the multiple groups of words are filled into the dimension slots, time slots and indicator slots respectively based on the semantic recognition method to obtain the slot information of each slot, that is, dimension information, time information and indicator information.

[0094] It should be noted that after identifying the user's needs, it is necessary to locate the target data table corresponding to the user's needs. There are multiple preset data tables in the data table set. In order to locate the data table that best meets the user's needs, it is necessary to match the obtained slot information with the entry information in the preset data table in the data table set to obtain a matching result.

[0095] Here, the number of data table sets is set according to demand, and the embodiment of the present disclosure does not limit this.

[0096] It can be understood that the entry information in the preset data table refers to the list or inventory information in the preset data table, which usually includes the attributes and information values ​​of the entity object or thing, such as the name, age or gender of a person.

[0097] Therefore, the matching process of slot information and entry information is essentially a matching process between text information. In order to improve the efficiency of text information matching, some specific algorithms can be used, such as cosine similarity algorithm, Jaccard similarity algorithm, edit distance algorithm, etc.

[0098] It should be noted that in order to obtain accurate matching results, in the process of matching the slot information with the entry information in each preset data table, the slot information is matched with the entry information in each data table once respectively to avoid missing information data matching and ensure the integrity of the matching information data.

[0099] Here, the slot information may be matched with the entry information in each preset data table in sequence, or may be matched with the entry information in multiple preset data tables at the same time, which is not limited in the embodiment of the present disclosure.

[0100] In some embodiments, if the slot information includes: dimension information, time information and indicator information, the dimension information in the slot information is matched with the entry information in the preset data table, the time information in the slot information is matched with the entry information in the preset data table, and the indicator information in the slot information is matched with the entry information in the preset data table, so as to obtain a matching result.

[0101] Here, the matching result includes a result that the slot information corresponds to and is consistent with the entry information in each preset data table in the data set, and a result that the slot information corresponds to and is inconsistent with the entry information in each preset data table in the data set.

[0102] It is understandable that the target data table is a data table that meets the user's needs. Therefore, after obtaining multiple matching results, a preset data table with a high matching similarity between the slot information and the entry information should be selected from the data table set as the target data table.

[0103] It needs to be explained that in order to facilitate data query and update, and to manage and maintain it in a unified manner, data can be stored in a structured manner in a data table set. To retrieve data that meets specific requirements from the data table set, a unified data table set query statement SQL is required.

[0104] Since most query statement SQL generation methods use relatively independent encoding methods to encode natural language and data table set models respectively, they rarely consider the connection between existing data table set models and user questions. In addition, there are a large number of preset data tables in the data table set, and the same names often appear in different tables, which can easily cause ambiguity and lead to low accuracy of the generated query statements.

[0105] Therefore, in the embodiment of the present disclosure, based on the matching result between the slot information and the entry information in each preset data table in the data table set, the target data table is located from the data table set, and then based on the target data table and the slot information, a query statement is generated. This is conducive to improving the accuracy of the generated query statement.

[0106] It should be noted that after obtaining the target data table, multiple target statement fragments are generated based on user needs (i.e., the slot information) and the content in the target data table, and the target statement fragments are input into the NL2SQL model. The self-attention mechanism and forward neural network of the NL2SQL model are used to learn the mapping relationship between the input statement and the SQL statement, and the output layer of the NL2SQL model is used to generate a query statement (e.g., SQL statement).

[0107] In some embodiments, Figure 2 is a schematic diagram of a structure for generating a query statement according to an exemplary embodiment. Figure 2 As shown, after detecting the user's input statement (query), the query statement (eg, SQL statement) can be generated by the NL2SQL generation method, or by the pipeline method.

[0108] In some embodiments, in order to improve the accuracy of the NL2SQL model, a basic module BERT (Bidirectional Encoder Representations from Transformers) can be added to the NL2SQL model. BERT is a pre-trained language model that can learn general language representations through large-scale unlabeled text training, and then fine-tune it on specific tasks to improve the effect of the task. The BERT-based NL2SQL model realizes the conversion of natural language to SQL statements by combining the BERT model with the SQL parser.

[0109] Specifically: The BERT-based NL2SQL model is mainly divided into two stages. In the first stage, the model first uses the BERT model to encode the input sentence to obtain a natural language representation. Then, the natural language representation is input into an intermediate representation generator to generate an intermediate representation. The intermediate representation generator usually consists of multiple layers, each of which contains a self-attention mechanism and a feedforward neural network. The self-attention mechanism is used to learn the contextual information in the natural language, and the feedforward neural network is used to learn the semantic information in the intermediate representation. In the second stage, the model converts the intermediate representation into a SQL query statement. To achieve this goal, the model needs to learn how to map the intermediate representation to various parts of the SQL statement, including: SELECT, FROM, and WHERE. In addition, the model usually uses a decoder, which consists of multiple layers, each of which contains a self-attention mechanism, a feedforward neural network, and an output layer. The self-attention mechanism and the feedforward neural network are used to learn the mapping relationship between the intermediate representation and the SQL statement, and the output layer is used to generate the SQL statement.

[0110] In the disclosed embodiment, slot filling processing is performed on an input statement to obtain slot information in each slot corresponding to the input statement; the slot information is matched with entry information in each preset data table in a data table set to obtain a matching result; based on the matching result, a target data table is determined from the data table set, thereby improving the accuracy of locating the target data table; based on the target data table and the slot information, a query statement is generated, thereby improving the accuracy of the generated query statement, thereby solving the problem in the prior art of inaccurate query statement generated due to inaccurate data table positioning.

[0111] In some embodiments, the matching of the slot information with the entry information in each preset data table in the data table set to obtain a matching result includes:

[0112] Compare each of the slot information with the corresponding each of the entry information in the preset data table, and determine the entry information that is the same as the slot information from the preset data table; wherein the entry name of each of the entry information in the preset data table corresponds to each of the slots;

[0113] Determining a target data table from the data table set according to the matching result includes:

[0114] The target data table is determined from the data table set based on the entry information in each of the preset data tables that is identical to the slot information.

[0115] It is understandable that in order to improve the accuracy of locating the target data table, the slot information should be compared with the corresponding entry information in the preset data table. After comparing the slot information with the corresponding entry information in the preset data table, the entry information that is the same as the slot information and the entry information that is different from the slot information can be determined. In order to determine the target data table corresponding to the user's needs, it is necessary to determine the entry information that is the same as the slot information from the preset data table.

[0116] It should be noted that the slot information is obtained by filling the slot, and the entry information is obtained by filling the entry name. Therefore, when the slot information and the entry information are consistent, the slot and the entry name are also corresponding.

[0117] Here, the information of each entry in the preset data table may be the same or different, and the embodiment of the present disclosure is not limited to this.

[0118] In some embodiments, taking the example that slot information includes: indicator information, dimension information and time information, the slot information is compared with the corresponding entry information in the preset data table, and the entry information that is the same as the slot information is determined from the preset data table, specifically: the indicator information is compared with all the entry information in the preset data table, and the entry information containing the indicator information is obtained from the preset data table; the dimension information is compared with all the entry information in the preset data table, and the entry information containing the dimension information is obtained from the preset data table; the time information is compared with all the entry information in the preset data table, and the entry information containing the time information is obtained from the preset data table.

[0119] It can be understood that in order to determine the target data table corresponding to the user's needs, the slot information should be compared with the corresponding entry information in the preset data table to obtain the corresponding comparison results, and from the comparison results, the entry information in each preset data table that is the same as the slot information is obtained, and then the target data table is selected from the data table set.

[0120] The disclosed embodiment compares the slot information with the corresponding entry information in the preset data table, and determines the entry information that is identical to the slot information from the preset data table; based on the entry information that is identical to the slot information in the preset data table, determines the target data table from the data table set, thereby facilitating locating the target data table from multiple preset data tables based on the slot information, thereby improving the accuracy of locating the target data table.

[0121] In some embodiments, determining the target data table from the data table set based on the entry information identical to the slot information in each of the preset data tables includes:

[0122] Determine respectively the number of the entry information in each of the preset data tables that is the same as each of the slot information;

[0123] Based on the number, determining a contribution value of the preset data table;

[0124] The target data table is determined from the data table set based on the contribution values ​​of the respective preset data tables.

[0125] It should be explained that the number of entry information identical to the slot information contained in multiple preset data tables is different. In order to improve the accuracy of determining the target data table, after determining the entry information identical to the slot information in each preset data table, it is necessary to determine the number of the entry information and summarize the number.

[0126] It can be understood that the number of entry information identical to the slot information in the preset data table can reflect the contribution value of the preset data table to the user demand, and the contribution value represents the contribution of the preset data table to the user demand.

[0127] Here, the number is positively correlated with the contribution value of the preset data table. The larger the number of entry information that is the same as the slot information is, the larger the contribution value in the preset data table is.

[0128] It should be noted that, if the slot information includes multiple information, after determining the number of entry information that is the same as the slot information, the obtained contribution value is composed of multiple numbers of the multiple entry information.

[0129] In some embodiments, if the slot information includes dimension information, time information and indicator information, when the slot information is compared with the entry information of a preset data table, the number of entry information that is identical to the dimension information, the number of entry information that is identical to the time information, and the number of entry information that is identical to the indicator information are determined; based on multiple numbers, the contribution value corresponding to the preset data table is obtained.

[0130] It should be noted that after the contribution values ​​in the respective preset data tables are determined, each preset data table corresponds to a contribution value, and based on the multiple contribution values, the target data table can be determined from the data set.

[0131] In some embodiments, in order to improve the efficiency of locating the target data table, the multiple contribution values ​​are partitioned to determine the maximum contribution value of each partition, and then based on the maximum contribution value of each partition, the target data table is determined from the data table set.

[0132] In the disclosed embodiment, the number of entry information that is identical to the slot information in each preset data table is determined respectively, and based on the number, the contribution value of the preset data table is determined, and finally based on the contribution value of each preset table, the target data table is determined, thereby improving the accuracy of determining the target data table from the data table set.

[0133] In some embodiments, determining the contribution value of the preset data table based on the number includes:

[0134] Determine the slot weight corresponding to each of the slot information respectively;

[0135] Performing weighted processing on the numbers corresponding to each piece of slot information based on the slot weight to obtain a weighted number corresponding to each piece of slot information;

[0136] Based on each of the weighted numbers, a contribution value of the preset data table is determined.

[0137] It is understandable that in order to improve the accuracy of the determined contribution value, the slot weights corresponding to each slot information may be determined respectively, and the contribution value of the preset data table may be obtained based on the slot weights and the numbers corresponding to the slot information.

[0138] Here, the size of the slot weight is set by the tester according to the requirements, and the embodiment of the present disclosure does not limit this.

[0139] At the same time, different slot information can be set with the same slot weight, or different slot weights, which is not limited in the embodiments of the present disclosure.

[0140] In some embodiments, the system extracts data table information from the data table set to be queried according to a preset data extraction instruction; obtains a historical query log of the data table set to be queried, and extracts historical query information of the data table set to be queried from the historical query log of the data table set to be queried. According to the historical query information, field information in the historical query information and the query frequency of the field information are obtained, so as to set a larger slot weight value of the slot information corresponding to the field.

[0141] In other embodiments, after analyzing the historical query information, the tester can determine that the field information in the historical query information is helpful for subsequent research and has a certain degree of authority, so the slot weight value of the slot information corresponding to the field can also be set to a larger value.

[0142] Exemplarily, if the slot information includes: time information, dimension information and indicator information, based on the user's historical query information, it is determined that "sales volume" is the field information with the highest query frequency in the historical query information, then the slot weight value of the indicator information corresponding to "sales volume" is set to W, and the slot weight value corresponding to the time information and the slot weight value corresponding to the indicator information can be set to 1, where W is greater than 1.

[0143] It should be noted that the contribution value in the preset data table is calculated by the number of entry information corresponding to the slot information and the corresponding slot weight. Therefore, the weighted number corresponding to each slot information should be obtained first, and then the contribution value corresponding to the preset data table should be obtained.

[0144] It can be understood that there are multiple entry information identical to the slot information in each preset data table. After obtaining the slot weight corresponding to the slot information, the number of each identical entry information is weighted with the slot weight to obtain the weighted number corresponding to each slot information.

[0145] Here, the weighted numbers corresponding to different slot information may be the same or different, and the embodiment of the present disclosure is not limited to this.

[0146] It should be explained that after the corresponding weighted numbers in the plurality of slot information are determined, the weighted numbers are added together to determine the corresponding contribution values ​​in the preset data table.

[0147] In the embodiment of the present disclosure, the slot weights corresponding to each slot information are obtained, and then the numbers corresponding to each slot information are weighted based on the slot weights to obtain the weighted numbers corresponding to each slot information; based on each weighted number, the contribution value of the preset data table is determined. In this way, compared with directly adding the numbers corresponding to each slot information to obtain the contribution value corresponding to the preset data table, the contribution value determined by the embodiment of the present disclosure based on the slot weights corresponding to the slot information is more accurate, and thus the target data table obtained is also more accurate.

[0148] In some embodiments, determining the target data table from the data table set based on the contribution values ​​of the respective preset data tables includes:

[0149] Sorting the contribution values ​​to obtain a sorting result;

[0150] Based on the sorting result, the target data table is determined from the data table set.

[0151] It is understandable that by calculating the contribution value of the preset data table in the data table set, multiple contribution value results can be determined. In order to improve the efficiency of determining the target data table, the multiple contribution values ​​can be sorted.

[0152] Here, the multiple contribution values ​​may be sorted in descending order or in ascending order, which is not limited in the embodiment of the present disclosure.

[0153] It should be noted that the greater the contribution value corresponding to the data table, the more entry information identical to the slot information contained in the data table, and the more the data table meets the needs of the user. Therefore, in the embodiment of the present disclosure, based on the sorting result, the preset data table with the largest contribution value is selected as the target data table.

[0154] In the disclosed embodiment, the calculated contribution values ​​are sorted to obtain a sorting result, and based on the sorting result, a target data table is determined from a data table set, thereby improving the efficiency of locating the target data table, which is beneficial to improving the efficiency of generating query statements.

[0155] In some embodiments, the method further comprises:

[0156] Execute the query statement for the target data table to obtain a query result;

[0157] Based on the query results, a target graph is generated.

[0158] It should be noted that in the data question and answer project, after the user uses the search box to input a natural language question, he expects to directly obtain the chart data corresponding to the natural language question, so that the target data can be analyzed intuitively. Therefore, in the embodiment of the present disclosure, after generating the query statement, it is necessary to perform data operations on the target data table, and then generate a target chart corresponding to the user's needs.

[0159] For example, Figure 3 is a schematic diagram of a chart according to an exemplary embodiment. Figure 3 As shown, in the data question and answer project, after the user's input statement is detected (i.e., the number of commodities in a certain county in the past week), a chart corresponding to the user's needs can be generated (i.e., a chart with time as the horizontal axis and the number of commodities as the vertical axis), so that the user can intuitively analyze the target data.

[0160] It is understandable that after the query statement is generated, the query statement can be used to perform operations such as querying, summarizing, writing, deleting, and modifying the target data table.

[0161] Here, data operation is an important function of SQL language, including data query and data update. Data query can realize basic operations such as adding, deleting, modifying and checking, and supports SQL command line and graphical query; data update operation can define related data model structures, such as external model, global model and internal model structure, in addition to basic operations such as adding, deleting, modifying and checking.

[0162] It should be explained that after executing the query statement for the target data table, the query result corresponding to the user's needs can be obtained. When the instruction to generate the target chart is detected, the chart template corresponding to the target chart can be obtained from the preset chart template, and the query result can be injected into the chart template, so as to generate the target chart corresponding to the user's needs.

[0163] In the disclosed embodiment, after a query statement is generated, the query statement is executed in a target data table to obtain a query result; based on the query result, a target chart is generated so that the user can obtain the required chart data after entering a natural language question, thereby helping to improve the user's operating experience.

[0164] In some embodiments, the method further comprises:

[0165] Get user statements;

[0166] Inputting the user sentence into a preprocessing model;

[0167] Based on the preprocessing model, the user sentence is expanded to obtain the input sentence.

[0168] It can be understood that the preprocessing model is a model for expanding the user sentence, and after expanding the user sentence, the input sentence can be obtained.

[0169] In some embodiments, the expansion process includes one or more of conversion process, splitting process, replacement process and extraction process. Among them, the conversion process is to convert the numbers in Chinese characters into numbers in Arabic numerals, and the conversion process also includes converting the numerals that match the numbers into numbers in Arabic numerals, for example, converting "two hundred and seventy yuan and fifty cents" into "280.7"; the splitting process is to split the information into multiple texts; the replacement process is to replace the identified abbreviation text or idiomatic words with the full name; the extraction process is to extract the column names corresponding to the preset threshold value of the text in the information and the column names in the preset list name dictionary, that is, to identify the column names with high relevance to the content in the information, and the extraction process also includes separating the column names proposed in the information with separators after the information for splicing, and the separators can be set according to needs, such as semicolons, colons, etc. For example: the information "Beijing population" is "Beijing population; province; number of people" after extraction.

[0170] In the embodiment of the present disclosure, the user statement is input into a preprocessing model, the user statement is expanded and processed to obtain the input statement. In this way, the data information of the user statement can be converted into a complete and easily recognizable input statement, which is conducive to improving the accuracy of subsequent conversion into a query statement.

[0171] Figure 4 A data processing method according to an exemplary embodiment is shown in FIG. Figure 2 ,like Figure 4 As shown, a query statement can be generated based on the target data table and the slot information. The method mainly includes the following steps:

[0172] In step 401, an input statement (query) is obtained.

[0173] In some embodiments, the input sentence may be text information input by a user.

[0174] In other embodiments, the input sentence may be voice information input by the user.

[0175] In step 402, slots are filled in the input sentence.

[0176] In some embodiments, the input sentence is segmented based on the slot filling method, and specific words are filled into the corresponding slots through semantic analysis and other methods to obtain the slot information in each slot corresponding to the input sentence.

[0177] In other embodiments, the data table set may be preprocessed before slot filling. For example, a data table set of N preset data tables may be obtained first, and the field names of each preset data table may be divided into three types, namely, indicators, dimensions, and time. Then, the entry information of the preset data table is named in Chinese to obtain the entry name of each entry information, so that it is convenient to obtain the corresponding matching result through the input statement in the actual project.

[0178] After the slots of the input sentence are filled, the slot information of each slot corresponding to the input sentence is obtained.

[0179] Exemplarily, as shown in Table 1, Table 1 is a correspondence table 1 between input sentences and slot information; when the user inputs "goods on the portrait platform in the past week", after filling the slot of the input sentence, the slot information with the time as "past week", the dimension as "portrait platform", and the indicator as "goods" can be obtained.

[0180] Another example, as shown in Table 2, which is a correspondence table between input statements and slot information, when the user inputs "yesterday's sales volume of electronic devices", after the slot is filled in the input statement, the slot information with the time being "yesterday", the dimension being "electronic device", and the indicator being "sales volume" can be obtained.

[0181] Table 1 Correspondence between input statements and slot information Table 2

[0182] Input Statement close one week painting picture flat tower of goods thing Slot Information B-time I-time I-time B-prod I-prod I-prod I-prod O B-ind I-ind

[0183] Table 2 Correspondence between input statements and slot information Table 2

[0184] Input Statement yesterday sky electricity son set up Preparation of pin quantity Slot Information B-time I-time B-phone I-phone I-phone I-phone O B-ind I-ind

[0185] In step 403, data table matching is performed.

[0186] Here, after obtaining the slot information, the slot information can be matched with the entry information in each preset data table in the data table set to obtain a matching result. After matching the slot information with the entry information in each preset data table in the data table set, a matching result can be obtained.

[0187] In some embodiments, each of the slot information is compared with the corresponding each of the entry information in the preset data table, and the entry information that is the same as the slot information is determined from the preset data table; wherein the entry name of each of the entry information in the preset data table corresponds to each of the slots.

[0188] For example, if the slot information includes: indicator information, dimension information and time information, the data set includes data table 00001, data table 00002 and data table 00003. The indicator information in the slot information is matched with multiple preset data tables in the data table set, specifically:

[0189] Compare the indicator information in the slot information with indicator 1: xxx, indicator 2: xxx, indicator 3: xxx in data table 00001, and then compare the indicator information in the slot information with indicator 1: xxx, indicator 2: xxx, indicator 3: xxx in data table 00002, and finally compare the indicator information in the slot information with indicator 1: xxx, indicator 2: xxx, indicator 3: xxx in data table 00003.

[0190] The dimension information in the slot information is matched with a plurality of preset data tables in a data table set, specifically:

[0191] The dimension information in the slot information is compared with the dimensions 1: xxx, 2: xxx, and 3: xxx in the data table 00001, and then the dimension information in the slot information is compared with the dimensions 1: xxx, 2: xxx, and 3: xxx in the data table 00002, and finally the dimension information in the slot information is compared with the dimensions 1: xxx, 2: xxx, and 3: xxx in the data table 00003.

[0192] The time information in the slot information is matched with a plurality of preset data tables in a data table set, specifically:

[0193] The time information in the slot information is compared with time 1: xxx, time 2: xxx, time 3: xxx in data table 00001, and then the time information in the slot information is compared with time 1: xxx, time 2: xxx, time 3: xxx in data table 00002, and finally the time information in the slot information is compared with time 1: xxx, time 2: xxx, time 3: xxx in data table 00003.

[0194] In other embodiments, based on the matching results between the slot information and each preset data table in the data table set, the number of entry information in each data table that is the same as the slot information can be obtained.

[0195] Exemplarily, the slot result (i.e. the slot information) is matched with the preset data table i in the data table set to obtain the corresponding dimension information D i,j(0≤j≤K) , where K is the number of entry information in data table i that is the same as the dimension information; get the corresponding indicator information I i,j(0≤j≤P) , where P is the number of entries in data table i that are identical to the indicator information; the corresponding time information T is obtained i,j(0≤j≤Q) , where Q is the number of entry information in data table i that is identical to the time information.

[0196] In step 404, the contribution value is calculated.

[0197] Here, the number of the entry information identical to the respective slot information in each of the preset data tables may be determined respectively; and based on the number, the contribution value of the preset data table may be determined.

[0198] For example, when obtaining the dimension information D i,j(0≤j≤K) 、Indicator Information I i,j(0≤j≤P) And time information T i,j(0≤j≤Q) In order to improve the accuracy of contribution value calculation, a corresponding slot threshold can be set for the slot information. The frequency of field information in the data table can be determined based on the user's historical query information, and the slot weight of the slot information corresponding to the field information with high frequency can be set as the high-frequency weight; the slot weight of the slot information corresponding to the field information that is helpful for subsequent research and has high authority can also be obtained and set as the authoritative weight.

[0199] Here, the indicator information can be divided into authoritative indicators and high-frequency indicators, wherein the slot weight value of the authoritative indicator is set to w, and the slot weight value of the high-frequency indicator is set to m, and both w and m are values ​​greater than 0.

[0200] Based on the above, after setting the slot weight of the authoritative indicator to w, the slot weight value of the high-frequency indicator to m, and the slot weight of the time information and the slot weight of the dimension information to 1, the calculation formula for the contribution value of the preset data table can be as follows:

[0201]

[0202] In formula (1), ScoreMatching i represents the contribution value of data table i, Indicates whether the jth column in data table i is the same entry information as the dimension information. If the jth column in data table i is the same entry information as the dimension information, then If the jth column in data table i is not the same as the dimension information, then Indicates whether the jth column in data table i is the same entry information as the indicator information. If the jth column in data table i is the same entry information as the indicator information, then If the jth column in data table i is not the same as the index information, then Indicates whether the jth column in data table i is the same entry information as the indicator information. If the jth column in data table i is the same entry information as the indicator information, then If the jth column in data table i is not the same as the index information, then w i,j *1 权威 Indicates whether the jth column in data table i is the same as the authoritative indicator information, w i,j Indicates the slot weight corresponding to the authoritative indicator information; m i,j *1 高频 Indicates whether the jth column in data table i is the same as the high-frequency indicator information, m i,j Indicates the slot weight corresponding to the high-frequency indicator information; Indicates whether the jth column in data table i is the same entry information as the time information. If the jth column in data table i is the same entry information as the time information, then If the jth column in data table i is not the same entry information as the time information, then 0≤i≤N, N is the number of data tables.

[0203] Here, the contribution value ScoreMatching i The method is to directly weight the number of item information obtained that is the same as the dimension information and the corresponding slot weight 1; weight the number of item information obtained that is the same as the indicator information and the corresponding weight 1. When data table i has item information that is the same as the authoritative indicator and item information that is the same as the high-frequency indicator, determine the number of item information that is the same as the authoritative indicator and the number of item information that is the same as the high-frequency indicator, and weight them with the corresponding weights w and m respectively; weight the number of item information obtained that is the same as the time information and the corresponding slot weight 1; finally, sum the three weighted results to obtain the contribution value corresponding to data table i.

[0204] In another exemplary embodiment, if the indicator information does not include the above-mentioned high-frequency indicators and authoritative indicators, and at the same time, the slot weight corresponding to the dimension information, the slot weight corresponding to the indicator information, and the slot weight corresponding to the time information are all set to 1, the calculation formula for the contribution value of the preset data table can be as follows:

[0205]

[0206] In formula (2), ScoreMatchingInitial i represents the contribution value of data table i, Indicates whether the jth column in data table i is the same entry information as the dimension information. If the jth column in data table i is the same entry information as the dimension information, then If the jth column in data table i is not the same as the dimension information, then Indicates whether the jth column in data table i is the same entry information as the indicator information. If the jth column in data table i is the same entry information as the indicator information, then If the jth column in data table i is not the same as the index information, then Indicates whether the jth column in data table i is the same entry information as the time information. If the jth column in data table i is the same entry information as the time information, then If the jth column in data table i is not the same entry information as the time information, then

[0207] Here, the contribution value ScoreMatchingInitial i It is to directly weight the number of item information obtained that is the same as the dimension information and the corresponding weight 1, weight the number of item information obtained that is the same as the indicator information and the corresponding weight 1, and weight the number of item information obtained that is the same as the time information and the corresponding weight 1; finally, sum the three accumulated results to obtain the contribution value corresponding to data table i.

[0208] After the contribution values ​​of the data table are obtained, the contribution values ​​may be sorted to obtain a sorting result.

[0209] In step 405, the target data table is located.

[0210] Here, after obtaining the sorting result, the target data table may be determined from the data table set based on the sorting result;

[0211] For example, as shown in Table 3, Table 3 is a ranking table of contribution values ​​corresponding to each data table, which lists the ScoreMatching values ​​corresponding to multiple preset data tables. i From large to small, the data table with the largest value is the target data table tabel_idbest. As shown in Table 3, the data table with id 1234 has the largest contribution value, so it can be determined that the data table with id 1234 is the target data table tabel_id best.

[0212] Table 3 Ranking table of contribution values ​​of each data table

[0213] Data table id Contribution 1234 20.32 12645 10.90 6546 7.35

[0214] In step 406, a query statement is generated.

[0215] Here, a query statement may be generated based on the target data table and the slot information.

[0216] In step 407, the query statement is executed.

[0217] Here, the query statement may be executed on the target data table to obtain a query result; and a target chart may be generated based on the query result.

[0218] In the disclosed embodiment, slot filling processing is performed on an input statement to obtain slot information in each slot corresponding to the input statement; the slot information is matched with entry information in each preset data table in a data table set to obtain a matching result; based on the matching result, a target data table is determined from the data table set, thereby improving the accuracy of locating the target data table; based on the target data table and the slot information, a query statement is generated, thereby improving the accuracy of the generated query statement, thereby solving the problem in the prior art of inaccurate query statement generated due to inaccurate data table positioning.

[0219] Figure 5 is a block diagram of a data processing device according to an exemplary embodiment. Figure 5 As shown, the data processing device 500 includes:

[0220] The first determination module 501 is configured to perform slot filling processing on the input sentence to obtain slot information in each slot corresponding to the input sentence;

[0221] A matching module 502 is configured to match the slot information with the entry information in each preset data table in the data table set to obtain a matching result;

[0222] A second determination module 503 is configured to determine a target data table from the data table set according to the matching result;

[0223] The first generating module 504 is configured to generate a query statement based on the target data table and the slot information.

[0224] In some embodiments, the matching module 502 is specifically configured to:

[0225] Compare each of the slot information with the corresponding each of the entry information in the preset data table, and determine the entry information that is the same as the slot information from the preset data table; wherein the entry name of each of the entry information in the preset data table corresponds to each of the slots;

[0226] The second determining module 503 is specifically configured to:

[0227] The target data table is determined from the data table set based on the entry information in each of the preset data tables that is identical to the slot information.

[0228] In some embodiments, the second determining module 503 further includes:

[0229] A first submodule is configured to respectively determine the number of entry information in each of the preset data tables that is the same as each of the slot information;

[0230] A second submodule is configured to determine a contribution value of the preset data table based on the number;

[0231] The third submodule is configured to determine the target data table from the data table set based on the contribution values ​​of each of the preset data tables.

[0232] In some embodiments, the second submodule further includes:

[0233] The first module is configured to respectively determine the slot weight corresponding to each of the slot information;

[0234] The second module is configured to perform weighted processing on the numbers corresponding to each slot information based on the slot weight to obtain a weighted number corresponding to each slot information;

[0235] The third module is configured to determine the contribution value of the preset data table based on each of the weighted numbers.

[0236] In some embodiments, the third submodule further includes:

[0237] A sorting module is configured to sort the contribution values ​​to obtain a sorting result;

[0238] The determination submodule is configured to determine the target data table from the data table set based on the sorting result.

[0239] In some embodiments, the data processing device 500 further includes:

[0240] A query module, configured to execute the query statement for the target data table to obtain a query result;

[0241] The second generating module is configured to generate a target graph based on the query result.

[0242] In some embodiments, the data processing device 500 further includes:

[0243] An acquisition module, configured to acquire user statements;

[0244] An input module, configured to input the user sentence into a preprocessing model;

[0245] The expansion module is configured to perform expansion processing on the user sentence based on the preprocessing model to obtain the input sentence.

[0246] 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.

[0247] Figure 6 A hardware structure frame of an electronic device according to an exemplary embodiment is shown Figure 1 For example, the apparatus 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0248] Reference Figure 6 , the device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .

[0249] The processing component 802 generally controls the overall operation of the device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.

[0250] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0251] The power supply component 806 provides power to the various components of the device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 800.

[0252] The multimedia component 808 includes a screen that provides an output interface between the device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0253] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the device 800 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.

[0254] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.

[0255] The sensor assembly 814 includes one or more sensors for providing various aspects of the status assessment of the device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the device 800, and the sensor assembly 814 can also detect the position change of the device 800 or a component of the device 800, the presence or absence of user contact with the device 800, the orientation or acceleration / deceleration of the device 800, and the temperature change of the device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0256] The communication component 816 is configured to facilitate wired or wireless communication between the device 800 and other devices. The device 800 can access a wireless network based on a communication standard, such as WiFi, 4G or 5G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0257] In an exemplary embodiment, the apparatus 800 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.

[0258] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by the processor 820 of the device 800 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0259] A non-transitory computer-readable storage medium, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to perform a data processing method, the method comprising:

[0260] Performing slot filling processing on the input sentence to obtain slot information in each slot corresponding to the input sentence;

[0261] Matching the slot information with the entry information in each preset data table in the data table set to obtain a matching result;

[0262] Determining a target data table from the data table set according to the matching result;

[0263] A query statement is generated based on the target data table and the slot information.

[0264] Figure 7 A hardware structure frame of an electronic device according to an exemplary embodiment is shown Figure 2 For example, the apparatus 1900 may be provided as a server. Figure 7 , the apparatus 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions executable by the processing component 1922, such as an application. The application stored in the memory 1932 may include one or more modules each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method:

[0265] Performing slot filling processing on the input sentence to obtain slot information in each slot corresponding to the input sentence;

[0266] Matching the slot information with the entry information in each preset data table in the data table set to obtain a matching result;

[0267] Determining a target data table from the data table set according to the matching result;

[0268] A query statement is generated based on the target data table and the slot information.

[0269] The device 1900 may also include a power supply component 1926 configured to perform power management of the device 1900, a wired or wireless network interface 1950 configured to connect the device 1900 to a network, and an input / output (I / O) interface 1958. The device 1900 may operate based on an operating system stored in the memory 1932, such as Windows Server™, MacOS X™, Unix™, Linux™, FreeBSD™, or the like.

[0270] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0271] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A data processing method, characterized in that: The method comprises: Performing slot filling processing on the input sentence to obtain slot information in each slot corresponding to the input sentence; Matching the slot information with the entry information in each preset data table in the data table set to obtain a matching result; Determining a target data table from the data table set according to the matching result; A query statement is generated based on the target data table and the slot information.

2. The method according to claim 1, characterized in that The step of matching the slot information with the entry information in each preset data table in the data table set to obtain a matching result includes: Compare each of the slot information with the corresponding each of the entry information in the preset data table, and determine the entry information that is the same as the slot information from the preset data table; wherein the entry name of each of the entry information in the preset data table corresponds to each of the slots; Determining a target data table from the data table set according to the matching result includes: The target data table is determined from the data table set based on the entry information in each of the preset data tables that is identical to the slot information.

3. The method according to claim 2, characterized in that The determining the target data table from the data table set based on the entry information identical to the slot information in each of the preset data tables comprises: Determine respectively the number of the entry information in each of the preset data tables that is the same as each of the slot information; Based on the number, determining a contribution value of the preset data table; The target data table is determined from the data table set based on the contribution values ​​of the respective preset data tables.

4. The method according to claim 3, characterized in that The determining, based on the number, a contribution value of the preset data table includes: Determine the slot weight corresponding to each of the slot information respectively; Performing weighted processing on the numbers corresponding to each piece of slot information based on the slot weight to obtain a weighted number corresponding to each piece of slot information; Based on each of the weighted numbers, a contribution value of the preset data table is determined.

5. The method according to claim 3, characterized in that: The step of determining the target data table from the data table set based on the contribution values ​​of the preset data tables includes: Sorting the contribution values ​​to obtain a sorting result; Based on the sorting result, the target data table is determined from the data table set.

6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: Execute the query statement for the target data table to obtain a query result; Based on the query results, a target graph is generated.

7. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: Get user statements; Inputting the user sentence into a preprocessing model; Based on the preprocessing model, the user sentence is expanded to obtain the input sentence.

8. A data processing device, characterized in that: The device comprises: A first determination module is configured to perform slot filling processing on the input sentence to obtain slot information in each slot corresponding to the input sentence; A matching module, configured to match the slot information with the entry information in each preset data table in the data table set to obtain a matching result; A second determination module is configured to determine a target data table from the data table set according to the matching result; The first generating module is configured to generate a query statement based on the target data table and the slot information.

9. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to: when executing the executable command, implement the steps in the data processing method according to any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device, the steps in the data processing method according to any one of claims 1 to 7 are implemented.