Method, device, electronic device and readable medium for sending query result information

By decoding and lexical analysis of structured data query requests, a query syntax tree is generated, which solves the adaptability and compatibility problems caused by the differences in query syntax of different databases, and efficient query and resource saving across databases is achieved.

CN118093964BActive Publication Date: 2025-04-01北京衡石科技有限公司
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410120658.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-29
Publication Date
2025-04-01
Estimated Expiration
2044-01-29

AI Technical Summary

Technical Problem

Different types of databases need to use different query syntax and logic to conduct data queries, resulting in poor adaptability and compatibility of data queries, and serious waste of computer storage resources and data query resources.

Method used

By decoding the structured data query request, a morpheme set of data information, filtering condition information, sorting method information and return quantity information is generated, a query syntax tree is constructed, and it is converted into a query statement for the target database to realize cross-database data query.

Benefits of technology

Improve the adaptability and compatibility of data queries, and reduce the waste of computer storage resources and data query resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118093964B_ABST
    Figure CN118093964B_ABST
Patent Text Reader

Abstract

The embodiments of the present disclosure disclose a method, device, electronic device and readable medium for sending query result information. A specific implementation of the method includes: decoding a structured data query statement; performing lexical analysis on data information to generate a data information morpheme set; performing lexical analysis on filter condition information to generate a filter condition information morpheme set; performing lexical analysis on sorting information to generate a sorting information morpheme set; performing lexical analysis on return quantity information to generate a return quantity information morpheme set; generating a query statement morpheme sequence; generating a query syntax tree based on the query statement morpheme sequence; parsing the query syntax tree to obtain a database query statement; executing the database query statement to obtain query result information; and sending the query result information to the client. This implementation reduces the waste of computer storage resources and data query resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to the field of computer technology, and in particular to a method, device, electronic device, and readable medium for sending query result information. Background Art

[0002] With the development of information technology, database systems have been widely used in various fields of people's work and life. Due to the different needs of different database objects (such as factories, enterprises, etc.), in actual applications, the databases used by the database objects are also different. However, different databases have different query syntax and query logic, and database users also need to learn the corresponding query syntax and query logic. At present, when using a database for data query operations, the commonly used method is: the user uses the query syntax and query logic corresponding to the target database to write a query statement, execute the written query statement to obtain the query result information, and send the query result information to the client that sent the query request.

[0003] However, when using the above method to perform data query operations using a database, the following technical problems often occur:

[0004] In the process of using a database to query data, different types of data sources (i.e., different types of databases) need to use data query languages ​​with different (different query syntax) syntax structures and different query logics to query data, resulting in a single data query and poor adaptability and compatibility. In particular, when data query needs to connect to different (multiple) data sources, it is necessary to install multiple query language libraries, resulting in a large amount of computer memory usage and a waste of computer storage resources; at the same time, it is necessary to write multiple types of query statements and query data, resulting in a waste of data query resources.

[0005] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure concept and therefore it may contain information that does not form the prior art that is already known in this country to a person of ordinary skill in the art. Summary of the invention

[0006] The content of this disclosure is used to introduce concepts in a brief form, which will be described in detail in the detailed implementation section below. The content of this disclosure is not intended to identify the key features or essential features of the technical solution claimed for protection, nor is it intended to limit the scope of the technical solution claimed for protection.

[0007] Some embodiments of the present disclosure propose a method, device, electronic device, and computer-readable medium for sending query result information to solve one or more of the technical problems mentioned in the above background technology section.

[0008] In a first aspect, some embodiments of the present disclosure provide a method for sending query result information, the method comprising: in response to receiving a structured data query request sent by a client, decoding the structured data query statement corresponding to the structured data query request, and obtaining the decoded structured data query statement as decoded query information, wherein the decoded query information comprises: data information, filter condition information, sorting method information and return quantity information; performing lexical analysis on the data information to generate a data information morpheme set; performing lexical analysis on the filter condition information to generate a filter condition information morpheme set; performing lexical analysis on the sorting method information Perform lexical analysis to generate a sorting information morpheme set; perform lexical analysis on the above-mentioned return quantity information to generate a return quantity information morpheme set; generate a query statement morpheme sequence based on the above-mentioned data information morpheme set, the above-mentioned filter condition information morpheme set, the above-mentioned sorting information morpheme set and the above-mentioned return quantity information morpheme set; generate a query syntax tree based on the above-mentioned query statement morpheme sequence; parse the above-mentioned query syntax tree to obtain a database query statement corresponding to the target database; execute the database query statement to obtain query result information corresponding to the above-mentioned target database; send the above-mentioned query result information to the above-mentioned client for display.

[0009] In a second aspect, some embodiments of the present disclosure provide a query result information sending device, the device comprising: a decoding unit, configured to, in response to receiving a structured data query request sent by a client, decode the structured data query statement corresponding to the structured data query request, and obtain the decoded structured data query statement as decoded query information, wherein the decoded query information comprises: data information, filter condition information, sorting method information and return quantity information; a first parsing unit, configured to perform lexical parsing on the data information to generate a data information morpheme set; a second parsing unit, configured to perform lexical parsing on the filter condition information to generate a filter condition information morpheme set; a third parsing unit, configured to perform lexical parsing on the sorting method information to generate a filter condition information morpheme set; Generate a sorting method information morpheme set; the fourth parsing unit is configured to perform lexical parsing on the above-mentioned return quantity information to generate a return quantity information morpheme set; the first generating unit is configured to generate a query statement morpheme sequence based on the above-mentioned data information morpheme set, the above-mentioned filter condition information morpheme set, the above-mentioned sorting method information morpheme set and the above-mentioned return quantity information morpheme set; the second generating unit is configured to generate a query syntax tree based on the above-mentioned query statement morpheme sequence; the fifth parsing unit is configured to parse the above-mentioned query syntax tree to obtain a database query statement corresponding to the target database; the execution unit is configured to execute the database query statement to obtain query result information corresponding to the above-mentioned target database; the sending unit is configured to send the above-mentioned query result information to the above-mentioned client for display.

[0010] In a third aspect, some embodiments of the present disclosure provide an electronic device comprising: one or more processors; a storage device on which one or more programs are stored, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation manner of the above-mentioned first aspect.

[0011] In a fourth aspect, some embodiments of the present disclosure provide a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method described in any implementation manner of the above-mentioned first aspect is implemented.

[0012] The above-mentioned embodiments of the present disclosure have the following beneficial effects: through the query result information sending method of some embodiments of the present disclosure, the waste of computer storage resources and the waste of data query resources can be reduced. Specifically, the reason for the waste of computer storage resources and data query resources is that in the process of using the database to query data, different types of data sources (i.e., different types of databases) need to use different (different query syntax) grammatical structures and different query logic data query languages ​​to query data, resulting in the data query being single, and the adaptability and compatibility of the data query being poor. In particular, when the data query needs to connect to different (multiple) data sources, it is necessary to install a variety of query language libraries, resulting in a large amount of computer memory occupation and a waste of computer storage resources; at the same time, it is necessary to write a variety of query statements and query the data, resulting in a waste of data query resources. Based on this, the query result information sending method of some embodiments of the present disclosure, first, in response to receiving a structured data query request sent by a client, the structured data query statement corresponding to the structured data query request is decoded and processed, and the decoded structured data query statement is obtained as decoded query information. Wherein, the decoded query information includes: data information, filtering condition information, sorting method information and return quantity information. Thus, the decoded query information can be obtained, which can be used to parse the query statement. Then, the data information is subjected to lexical analysis to generate a data information morpheme set. Thus, a data information morpheme set representing each single character corresponding to the data information can be obtained. Afterwards, the filtering condition information is subjected to lexical analysis to generate a filtering condition information morpheme set. Thus, a filtering condition information morpheme set representing each single character corresponding to the filtering condition information can be obtained. Subsequently, the sorting mode information is subjected to lexical analysis to generate a sorting mode information morpheme set. Thus, a sorting mode information morpheme set representing each single character corresponding to the sorting mode information can be obtained. Secondly, the return quantity information is subjected to lexical analysis to generate a return quantity information morpheme set. Thus, a return quantity information morpheme set representing each single character corresponding to the return quantity information can be obtained. Then, a query statement morpheme sequence is generated according to the data information morpheme set, the filtering condition information morpheme set, the sorting mode information morpheme set and the return quantity information morpheme set. Thus, a query statement morpheme sequence corresponding to each character of the structured data query statement can be obtained. Afterwards, a query syntax tree is generated according to the query statement morpheme sequence. Thus, a query syntax tree can be obtained, which can be used to perform query language conversion processing on the structured data query statement. Subsequently, the query syntax tree is parsed to obtain a database query statement corresponding to the target database. Thus, by performing query language conversion on the structured query statement, database query statements corresponding to different data sources can be obtained.Thus, cross-database data query can be realized. Then, the database query statement is executed to obtain the query result information corresponding to the above-mentioned target database. Thus, the cross-database data query result can be obtained. Finally, the above-mentioned query result information is sent to the above-mentioned client for display. Thus, the obtained query result information can be sent to the above-mentioned client for the user of the client to view the data. Also because the structured data query statement can be converted into a query syntax tree, and the query syntax tree can be converted into a data query statement corresponding to different data sources, the cross-database data query of the same query language can be realized, that is, a data query language can be connected to databases of different data sources, thereby improving the adaptability and compatibility of data query. Reduce the waste of computer storage resources (for example, when connecting to different data sources, it is necessary to install multiple query language libraries, resulting in more computer memory occupation) and the waste of data query resources (for example, it is necessary to write multiple types of query statements and query data). BRIEF DESCRIPTION OF THE DRAWINGS

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

[0014] Figure 1 is a flow chart of some embodiments of the method for sending query result information according to the present disclosure;

[0015] Figure 2 is a schematic diagram of the structure of some embodiments of the query result information sending device according to the present disclosure;

[0016] Figure 3 It is a schematic diagram of the structure of an electronic device suitable for implementing some embodiments of the present disclosure. DETAILED DESCRIPTION

[0017] 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 set forth herein. On the contrary, these embodiments are provided to provide 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.

[0018] It should also be noted that, for ease of description, only the parts related to the invention are shown in the drawings. In the absence of conflict, the embodiments and features in the embodiments of the present disclosure can be combined with each other.

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

[0020] 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".

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

[0022] The present disclosure will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

[0023] Figure 1 The process 100 of some embodiments of the method for sending query result information according to the present disclosure is shown. The method for sending query result information includes the following steps:

[0024] Step 101, in response to receiving a structured data query request sent by a client, decoding a structured data query statement corresponding to the structured data query request to obtain a decoded structured data query statement as decoded query information.

[0025] In some embodiments, in response to receiving a structured data query request sent by a client, the execution subject may decode the structured data query statement corresponding to the structured data query request to obtain the decoded structured data query statement as decoded query information. The decoded query information may include: data information, filtering condition information, sorting method information, and return quantity information. The client may be a client with data viewing permission and sends a data query request. The structured data query statement may be a data query statement in a dictionary format. The structured data query statement may be in text form. The data information may be information representing the dimension of the data query. For example, the data information may be "axes":[{"dataset":1,"uid":"product","kind":"formula","op":"{product}"},{"dataset":1,"uid":"revenue","kind":"formula","op":"sum({revenue})"},{"dataset":1,"uid":"quantity","kind":"formula","op":"avg({quantity})"}]. The above-mentioned filtering condition information can represent the information of the filtering condition of the query. For example, the above-mentioned filtering condition information can be "where":[{"kind":"function","op":">=","args":["{date}","2022-01-01"]},{"kind":"function","op":"=","args":["{product}","Laptop"]}]. The above-mentioned sorting method information can represent the information of the sorting method of the query results. For example, the above-mentioned sorting method information can be "sort":[{"kind":"reference","op":"revenue","direction":"desc"}],. The above-mentioned return quantity information can represent the information of the number of return results of the query. For example, the above-mentioned return quantity information can be "limit":10. In practice, in response to receiving a structured data query request sent by a client, the above-mentioned execution subject can use a preset format parser to decode the structured data query statement corresponding to the structured data query request, and obtain the decoded structured data query statement as the decoded query information. Among them, the above-mentioned preset format parser can be a preset format parser. For example, the preset format parser may be a Json format parser.Therefore, in the process of using different query languages ​​to query data, by adopting the query statement in dictionary format (the grammatical structure of the query statement is relatively simple), and dividing the query content of the query statement into four parts: data information, filter condition information, sorting method information and return quantity information (the query logic is relatively simple), the number of times users enter incorrect query statements is reduced, thereby improving query efficiency, shortening query time, and reducing the waste of query resources.

[0026] Optionally, the above method further includes:

[0027] The first step is to parse the structured data query statement corresponding to the structured data query request to obtain a parsed object. In practice, the execution subject can use a preset parsing function to parse the structured data query statement corresponding to the structured data query request to obtain the parsed structured data query statement as the parsed object. The preset parsing function can be a pre-set parsing function. For example, the preset parsing function can be the JSON.parse() function of JavaScript. It can also be the load() function in the json module of Python.

[0028] The second step is to perform data preprocessing on the above-mentioned parsing object to obtain the preprocessed parsing object as the preprocessed parsing object. Here, the data preprocessing may include but is not limited to: data cleaning processing and data type conversion processing. For example, the data type conversion processing may be normalization processing and logarithmic conversion processing.

[0029] The third step is to determine the visualization database. In practice, the execution entity may use a preset visualization database as the visualization database. The preset visualization database may be a preset visualization database where the execution entity is located. For example, the preset visualization database may include but is not limited to: Tableau, Power BI, QlikView, Spotfire.

[0030] In the fourth step, based on the visualization database, the preprocessed parsed object is format-converted to obtain the preprocessed parsed object after format conversion as a conversion data object. In practice, the execution subject may perform format conversion on the preprocessed parsed object using a preset format conversion function to obtain the preprocessed parsed object after format conversion as a conversion data object. The preset format conversion function may be a prepackaged method. For example, the preset format conversion function may be a logarithmic function. The execution subject may use a logarithmic conversion function to convert nonlinear data into linear data for visualization.

[0031] In the fifth step, the converted data object is rendered to obtain the converted data object after rendering as a rendering visualization result. In practice, the execution subject can render the converted data object by calling a visualization function to obtain the converted data object after rendering as a rendering visualization result. The visualization function can be a visualization function in a visualization database. The visualization function can include but is not limited to: a chart generation function, a map drawing function, and a time series visualization function.

[0032] In the sixth step, the rendered visualization result is sent to the client for visualization. Thus, by reverse parsing the structured data query statement corresponding to the structured data query request and returning it to the client in a visualized implementation form, the user can understand the structure and parameters of the query, and it is convenient for the user to view, modify or further understand the query statement, thereby improving the user's operational convenience and understanding ability.

[0033] Optionally, before decoding the structured data query statement corresponding to the structured data query request to obtain the decoded structured data query statement as the decoded query information, the execution subject may further perform the following steps:

[0034] The first step is to determine whether the request information meets the preset connection condition in response to receiving the request information for establishing a network connection sent by the client. The request information may be a request information for establishing a connection verification sent by the client. For example, the request information may be a request information for verifying a user name and a user password. The preset connection condition may be that the user password is the same as the pre-stored user password corresponding to the user name.

[0035] The second step is to send connection confirmation information corresponding to the request information to the client in response to determining that the request information satisfies the preset connection condition, wherein the connection confirmation information may be information for verifying that the user name and user password sent by the client are correct.

[0036] Step 102: Perform lexical analysis on the data information to generate a data information morpheme set.

[0037] In some embodiments, the execution subject may perform lexical analysis on the data information to generate a set of data information morphemes. In practice, the execution subject may perform lexical analysis on the data information using a preset lexical analyzer to generate a set of data information morphemes. The preset lexical analyzer may be a pre-set lexical analyzer. For example, the preset lexical analyzer may be a Flex lexical analyzer. It can be understood as a process of converting a character sequence corresponding to the data information into a word (data information morpheme) sequence through a preset lexical analyzer.

[0038] Step 103: perform lexical analysis on the filtering condition information to generate a set of filtering condition information morphemes.

[0039] In some embodiments, the execution subject may perform lexical analysis on the filtering condition information to generate a set of morphemes of the filtering condition information. In practice, the execution subject may perform lexical analysis on the filtering condition information through a preset lexical analyzer to generate a set of morphemes of the filtering condition information. This can be understood as a process of converting a character sequence corresponding to the filtering condition information into a word (data information morpheme) sequence through a preset lexical analyzer.

[0040] Step 104, performing lexical analysis on the sorting information to generate a sorting information morpheme set.

[0041] In some embodiments, the execution subject may perform lexical analysis on the sorting information to generate a set of morphemes of the sorting information. In practice, the execution subject may perform lexical analysis on the sorting information through a preset lexical analyzer to generate a set of morphemes of the sorting information. This can be understood as a process of converting a character sequence corresponding to the sorting information into a word (data information morpheme) sequence through a preset lexical analyzer.

[0042] Step 105: perform lexical analysis on the returned quantity information to generate a morpheme set of the returned quantity information.

[0043] In some embodiments, the execution subject may perform lexical analysis on the returned quantity information to generate a set of returned quantity information morphemes. In practice, the execution subject may perform lexical analysis on the returned quantity information through a preset lexical analyzer to generate a set of returned quantity information morphemes. This may be understood as a process of converting a character sequence corresponding to the returned quantity information into a sequence of words (returned quantity information morphemes) through a preset lexical analyzer.

[0044] Step 106: Generate a query statement morpheme sequence according to the data information morpheme set, the filter condition information morpheme set, the sorting method information morpheme set and the return quantity information morpheme set.

[0045] In some embodiments, based on the above-mentioned data information morpheme set, the above-mentioned filter condition information morpheme set, the above-mentioned sorting method information morpheme set and the above-mentioned return quantity information morpheme set, the above-mentioned execution subject can generate a query statement morpheme sequence. In practice, the above-mentioned execution subject can combine the data information morpheme set, the filter condition information morpheme set, the sorting method information morpheme set and the return quantity information morpheme set to generate a query statement morpheme sequence. Here, the combination processing method can be splicing. The above-mentioned splicing method includes but is not limited to splicing through space characters. The order of combination can be: data information morpheme set, filter condition information morpheme set, sorting method information morpheme set and return quantity information morpheme set.

[0046] Step 107: Generate a query syntax tree according to the query statement morpheme sequence.

[0047] In some embodiments, according to the query statement morpheme sequence, the execution subject can generate a query syntax tree. In practice, the execution subject can use a preset syntax parser to recursively construct the query statement morphemes included in the query statement morpheme sequence into a query syntax tree. Among them, the preset syntax parser can be a preset syntax parser. For example, the preset syntax parser can be a pre-packaged method that can recursively construct each morpheme using the syntax information (grammar rules) corresponding to the structured data query statement to generate a syntax tree.

[0048] Step 108: parse the query syntax tree to obtain a database query statement corresponding to the target database.

[0049] In some embodiments, the execution subject may parse the query syntax tree to obtain a database query statement corresponding to the target database. The target database may be the database where the query result corresponding to the query statement is located. In practice, first, the execution subject may traverse the query syntax tree to obtain a query node information sequence corresponding to the query syntax tree. Then, for each query node information in the query node information sequence, the execution subject may use the preset mapping syntax information to convert the query node information into the database query node information corresponding to the target database. Finally, the converted database query node information is combined to obtain a database query statement. The traversal method may include but is not limited to: pre-order traversal, in-order traversal and subsequent traversal. Here, the traversal method may be pre-order traversal. The preset mapping syntax information may be a pre-set code for converting the query node information into the query information corresponding to the target database syntax. The combination processing here may be splicing processing through line breaks.

[0050] Step 109, execute the database query statement to obtain the query result information corresponding to the target database.

[0051] In some embodiments, the execution subject may execute a database query statement to obtain query result information corresponding to the target database. The query result information may be information of the query result corresponding to the database query statement.

[0052] In some optional implementations of some embodiments, the execution subject may execute a database query statement through the following steps to obtain query result information corresponding to the target database:

[0053] In the first step, in response to determining that the target database is a local database, a database query statement is executed to obtain query result information corresponding to the target database. The local database may be a database where the execution subject is located. The local database may include but is not limited to: a relational database and a non-relational database.

[0054] The second step is to send a query request corresponding to the database query statement to a server corresponding to the target database in response to determining that the target database is an external database, so as to obtain query result information. The external database may be a database associated with the execution subject and connected via an API interface.

[0055] The third step is to receive the query result information sent by the server corresponding to the above target database.

[0056] Furthermore, in the process of adopting technical solutions to solve the technical problems mentioned in the background technology, it is found that users have high requirements for the efficiency of data query. The conventional technical solution to meet the efficiency requirements of users for data query is to generate a query plan by performing lexical analysis and grammatical analysis on the query statement, and execute the data query according to the generated query plan. However, this method has a large query loss (large query cost). Therefore, considering the requirements of users for data query efficiency and reducing query loss, combined with the advantages of deep learning technology, it is decided to use the idea of ​​dynamic programming and generate a query plan set corresponding to the query statement through a query plan generator, and predict the query loss of all query plans corresponding to the query statement through a pre-trained query loss prediction model to obtain a query plan with the minimum query loss value. Finally, the query plan with the minimum query loss is executed to obtain a solution for query result information. In order to meet the efficiency requirements of users for data query and reduce query loss.

[0057] In some optional implementations of some embodiments, the execution subject may execute a database query statement through the following steps to obtain query result information corresponding to the target database:

[0058] The first step is to generate a query plan set corresponding to the above database query statement based on the above database query statement. In practice, the above execution subject can generate a query plan for the above database query statement through a preset query plan generator to obtain a query plan set. Here, the structure of the query plan in the query plan set is a tree structure. The above database query statement can be a query statement in the format of the database corresponding to the data source. Specifically, the above database query statement can be a query code. For example, the above query code can be a MySQL instruction. The above data source can be a data source connected to the above execution subject. The above query plan can represent the process of the database executing the database query statement. The goal of the query plan is to efficiently retrieve data and minimize data retrieval losses, including I / O operations, CPU usage, etc.

[0059] The second step is to determine a query data group set based on the database query statement and the query plan set. In practice, first, for each query plan in the query plan set, the execution entity may combine the database query statement and the query plan to generate a query data group. Then, the generated query data groups may be determined as a query data group set.

[0060] The third step is to generate a query loss information set based on the query data set and the pre-trained query loss prediction model. The query loss prediction model can be a neural network model that takes the query data set as input and the query loss information as output. The query loss information in the query loss information set can be information about various resources in the database system that are consumed to execute the query plan. The various resources can include but are not limited to: CPU, memory, disk I / O and query time.

[0061] In the fourth step, the query loss information with the smallest loss value in the above query loss information set is determined as the minimum query loss information.

[0062] The fifth step is to determine the query data group corresponding to the minimum query loss information in the query data group set as the target query data group.

[0063] Step 6: execute the query plan corresponding to the target query data set to obtain query result information corresponding to the target database. Here, the query plan corresponding to the target query data set can be the query plan that minimizes the query loss of the database query statement in the query plan set.

[0064] In some optional implementations of some embodiments, based on the query data set and the pre-trained query loss prediction model, the execution subject may generate a query loss information set by following the steps below:

[0065] In the first step, for each query data group in the above query data group set, perform the following steps:

[0066] The first sub-step is to encode the database query statement included in the query data group to obtain the encoded database query statement as a query statement encoding vector. The query data group in the query data group set includes: a database query statement and a query plan. Here, the encoding process can be a one-hot encoding process. The structure of the query statement encoding vector is a tree vector structure.

[0067] The second sub-step is to perform full connection processing on the above query statement encoding vector to generate a query statement full connection vector.

[0068] The third sub-step is to encode the query plan included in the query data group to generate a query plan encoding vector. In practice, the execution subject may perform one-hot encoding on the query plan included in the query data group to generate a query plan encoding vector. The structure of the query plan encoding vector is a tree vector structure.

[0069] The fourth sub-step is to fuse the query statement fully connected vector and the query plan encoding vector to generate a fused feature vector. Here, the fusion processing method is vector concatenation.

[0070] The fifth sub-step is to perform tree convolution processing on the above-mentioned fused feature vector, and obtain the fused feature vector after the tree convolution processing as the first tree convolution feature vector. In practice, the above-mentioned execution subject can use a tree convolution kernel to perform tree convolution processing on the above-mentioned fused feature vector, and obtain the fused feature vector after the tree convolution processing as the first tree convolution feature vector. Among them, the convolution kernel of the tree convolution processing is a tree structure. The tree structure includes: a root node, a left node and a right node. In the process of tree convolution processing, the root node is used to perform an inner product operation with a specific node. The left node is used to multiply the left subtree. The right node is used to multiply the right subtree.

[0071] The sixth sub-step is to perform tree convolution processing on the first tree convolution feature vector, and obtain the first tree convolution feature vector after the tree convolution processing as the second tree convolution feature vector. In practice, the execution subject can perform tree convolution processing on the first tree convolution feature vector using a tree convolution kernel, and obtain the first tree convolution feature vector after the tree convolution processing as the second tree convolution feature vector.

[0072] In the seventh sub-step, the second tree convolution feature vector is subjected to tree convolution processing to obtain the second tree convolution feature vector after the tree convolution processing as the third tree convolution feature vector. In practice, the execution subject may perform tree convolution processing on the second tree convolution feature vector using a tree convolution kernel to obtain the second tree convolution feature vector after the tree convolution processing as the third tree convolution feature vector.

[0073] In an eighth sub-step, a full connection process is performed on the third tree-shaped convolutional feature vector to obtain a tree-shaped fully connected feature vector.

[0074] The ninth sub-step is to classify the tree-shaped fully connected feature vector to obtain query loss information. In practice, the execution subject may classify the tree-shaped fully connected feature vector through a Softmax multi-classification function to obtain query loss information. The query loss information may be information about resources consumed by executing the query plan corresponding to the query statement. Specifically, the query loss information may be time information. The query loss information may be 0.1s.

[0075] In the second step, the obtained query loss information is determined as a query loss information set.

[0076] The above-mentioned first to sixth steps, first to second steps and their related contents serve as an inventive point of an embodiment of the present disclosure, which solves the technical problem that "in the process of using a database to query data, a query plan is generated by performing lexical analysis and grammatical analysis on the query statement, and data query is executed according to the generated query plan, resulting in more query loss and failing to better meet the user's efficiency requirements for data query." The factors that lead to more query loss and fail to better meet the user's efficiency requirements for data query are often as follows: in the process of using a database to query data, a query plan is generated by performing lexical analysis and grammatical analysis on the query statement, and data query is executed according to the generated query plan, resulting in more query loss and failing to better meet the user's efficiency requirements for data query. If the above-mentioned factors are solved, the effect of meeting the user's efficiency requirements for data query and reducing query loss can be achieved. In order to achieve this effect, the present disclosure utilizes the idea of ​​dynamic programming and generates a query plan set corresponding to a query statement through a query plan generator, and predicts the query loss of all query plans corresponding to the query statement through a pre-trained query loss prediction model, obtains a query plan with the minimum query loss value, and finally executes the query plan with the minimum query loss to obtain a solution for query result information, so as to meet the user's demand for data query efficiency and reduced query loss.

[0077] Step 110, sending the query result information to the client for display.

[0078] In some embodiments, the execution entity may send the query result information to the client for display.

[0079] Optionally, before sending the query result information to the client for display, the execution subject may further perform the following steps:

[0080] The first step is to perform format conversion processing on the query result information, and obtain the query result information after format conversion as the format conversion query result information. In practice, the execution entity can perform format conversion processing on the query result information through a preset conversion function, and obtain the query result information after format conversion as the format conversion query result information. Among them, the preset conversion function can be a pre-packaged method for converting the query result information into a corresponding display requirement format. For example, the preset conversion function can be a method for converting the value "2022-12-12" of the date column in the database into "December 2022".

[0081] The second step is to determine the format-converted query result information as the query result information, so as to update the query result information.

[0082] Optionally, the above method further includes:

[0083] In the first step, in response to determining that the data type corresponding to the query result information is a classification type, a first visualization chart is generated according to the query result information, and the first visualization chart is sent to the client, wherein the chart type of the first visualization chart is a pie chart type. In practice, the execution entity can use a visualization database to generate the first visualization chart from the query result information.

[0084] In the second step, in response to determining that the data type corresponding to the query result information is a time series type, a second visualization chart is generated according to the query result information, and the second visualization chart is sent to the client. The chart type of the second visualization chart is a line chart type. In practice, the execution entity can use the visualization database to generate the second visualization chart from the query result information.

[0085] The above-mentioned embodiments of the present disclosure have the following beneficial effects: through the query result information sending method of some embodiments of the present disclosure, the waste of computer storage resources and the waste of data query resources can be reduced. Specifically, the reason for the waste of computer storage resources and data query resources is that in the process of using the database to query data, different types of data sources (i.e., different types of databases) need to use different (different query syntax) grammatical structures and different query logic data query languages ​​to query data, resulting in the data query being single, and the adaptability and compatibility of the data query being poor. In particular, when the data query needs to connect to different (multiple) data sources, it is necessary to install a variety of query language libraries, resulting in a large amount of computer memory occupation and a waste of computer storage resources; at the same time, it is necessary to write a variety of query statements and query the data, resulting in a waste of data query resources. Based on this, the query result information sending method of some embodiments of the present disclosure, first, in response to receiving a structured data query request sent by a client, the structured data query statement corresponding to the structured data query request is decoded and processed, and the decoded structured data query statement is obtained as decoded query information. Wherein, the decoded query information includes: data information, filtering condition information, sorting method information and return quantity information. Thus, the decoded query information can be obtained, which can be used to parse the query statement. Then, the data information is subjected to lexical analysis to generate a data information morpheme set. Thus, a data information morpheme set representing each single character corresponding to the data information can be obtained. Afterwards, the filtering condition information is subjected to lexical analysis to generate a filtering condition information morpheme set. Thus, a filtering condition information morpheme set representing each single character corresponding to the filtering condition information can be obtained. Subsequently, the sorting mode information is subjected to lexical analysis to generate a sorting mode information morpheme set. Thus, a sorting mode information morpheme set representing each single character corresponding to the sorting mode information can be obtained. Secondly, the return quantity information is subjected to lexical analysis to generate a return quantity information morpheme set. Thus, a return quantity information morpheme set representing each single character corresponding to the return quantity information can be obtained. Then, a query statement morpheme sequence is generated according to the data information morpheme set, the filtering condition information morpheme set, the sorting mode information morpheme set and the return quantity information morpheme set. Thus, a query statement morpheme sequence corresponding to each character of the structured data query statement can be obtained. Afterwards, a query syntax tree is generated according to the query statement morpheme sequence. Thus, a query syntax tree can be obtained, which can be used to perform query language conversion processing on the structured data query statement. Subsequently, the query syntax tree is parsed to obtain a database query statement corresponding to the target database. Thus, by performing query language conversion on the structured query statement, database query statements corresponding to different data sources can be obtained.Thus, cross-database data query can be realized. Then, the database query statement is executed to obtain the query result information corresponding to the above-mentioned target database. Thus, the cross-database data query result can be obtained. Finally, the above-mentioned query result information is sent to the above-mentioned client for display. Thus, the obtained query result information can be sent to the above-mentioned client for the user of the client to view the data. Also because the structured data query statement can be converted into a query syntax tree, and the query syntax tree can be converted into a data query statement corresponding to different data sources, the cross-database data query of the same query language can be realized, that is, a data query language can be connected to databases of different data sources, thereby improving the adaptability and compatibility of data query. Reduce the waste of computer storage resources (for example, when connecting to different data sources, it is necessary to install multiple query language libraries, resulting in more computer memory occupation) and the waste of data query resources (for example, it is necessary to write multiple types of query statements and query data).

[0086] Further references Figure 2 As an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a query result information sending device. These device embodiments are similar to Figure 1 Corresponding to the method embodiments shown, the device can be specifically applied to various electronic devices.

[0087] like Figure 2As shown, the query result information sending device 200 of some embodiments includes: a decoding unit 201, a first parsing unit 202, a second parsing unit 203, a third parsing unit 204, a fourth parsing unit 205, a first generating unit 206, a second generating unit 207, a fifth parsing unit 208, an executing unit 209 and a sending unit 210. The decoding unit 201 is configured to decode the structured data query statement corresponding to the structured data query request in response to receiving the structured data query request sent by the client, and obtain the decoded structured data query statement as the decoded query information, wherein the decoded query information includes: data information, filtering condition information, sorting method information and return quantity information; the first parsing unit 202 is configured to perform lexical parsing on the data information to generate a data information morpheme set; the second parsing unit 203 is configured to perform lexical parsing on the filtering condition information to generate a filtering condition information morpheme set; the third parsing unit 204 is configured to perform lexical parsing on the sorting method information to generate a sorting method information morpheme set; the fourth parsing unit The unit 205 is configured to perform lexical analysis on the above-mentioned return quantity information to generate a set of return quantity information morphemes; the first generation unit 206 is configured to generate a query statement morpheme sequence based on the above-mentioned data information morpheme set, the above-mentioned filter condition information morpheme set, the above-mentioned sorting method information morpheme set and the above-mentioned return quantity information morpheme set; the second generation unit 207 is configured to generate a query syntax tree based on the above-mentioned query statement morpheme sequence; the fifth parsing unit 208 is configured to parse the above-mentioned query syntax tree to obtain a database query statement corresponding to the target database; the execution unit 209 is configured to execute the database query statement to obtain query result information corresponding to the above-mentioned target database; the sending unit 210 is configured to send the above-mentioned query result information to the above-mentioned client for display.

[0088] It is understood that the units described in the device 200 are similar to those described in the reference Figure 1 Therefore, the operations, features and beneficial effects described above for the method are also applicable to the device 100 and the units included therein, and will not be described in detail here.

[0089] Reference below Figure 3 , which shows a structural schematic diagram of an electronic device (eg, a computing device) 300 suitable for implementing some embodiments of the present disclosure. Figure 3 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.

[0090] like Figure 3As shown, the electronic device 300 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 301, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a storage device 308 into a random access memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the electronic device 300 are also stored. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0091] Typically, the following devices may be connected to the I / O interface 305: input devices 306 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 308 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 309. The communication devices 309 may allow the electronic device 300 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 3 The electronic device 300 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. Figure 3 Each block shown in the figure may represent one device, or may represent multiple devices as required.

[0092] In particular, according to some embodiments of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, some embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In some such embodiments, the computer program can be downloaded and installed from the network through the communication device 309, or installed from the storage device 308, or installed from the ROM 302. When the computer program is executed by the processing device 301, the above-mentioned functions defined in the method of some embodiments of the present disclosure are executed.

[0093] It should be noted that the computer-readable medium recorded in some embodiments of 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 some embodiments of 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 some embodiments of 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 electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

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

[0095] The above-mentioned computer-readable medium may be included in the above-mentioned electronic device; or it may exist independently without being assembled into the electronic device. The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: in response to receiving a structured data query request sent by a client, decodes the structured data query statement corresponding to the above-mentioned structured data query request, and obtains the decoded structured data query statement as decoded query information, wherein the above-mentioned decoded query information includes: data information, filter condition information, sorting method information and return quantity information; performs lexical analysis on the above-mentioned data information to generate a data information morpheme set; performs lexical analysis on the above-mentioned filter condition information to generate a filter condition information morpheme set; The sorting method information is lexically parsed to generate a sorting method information morpheme set; the returned quantity information is lexically parsed to generate a returned quantity information morpheme set; a query statement morpheme sequence is generated according to the data information morpheme set, the filter condition information morpheme set, the sorting method information morpheme set and the returned quantity information morpheme set; a query syntax tree is generated according to the query statement morpheme sequence; the query syntax tree is parsed to obtain a database query statement corresponding to the target database; the database query statement is executed to obtain query result information corresponding to the target database; the query result information is sent to the client for display.

[0096] Computer program code for performing the operations of some embodiments of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via 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., via the Internet using an Internet service provider).

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

[0098] The units described in some embodiments of the present disclosure may be implemented by software or by hardware. The described units may also be arranged in a processor, for example, may be described as: a processor includes a decoding unit, a first parsing unit, a second parsing unit, a third parsing unit, a fourth parsing unit, a first generating unit, a second generating unit, a fifth parsing unit, an execution unit and a sending unit. The names of these units do not constitute limitations on the units themselves in certain cases, for example, the sending unit may also be described as "a unit that sends the above query result information to the above client for display".

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

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

Claims

1. A method for sending query result information, applied to a server, comprising: In response to receiving a structured data query request sent by a client, decoding a structured data query statement corresponding to the structured data query request to obtain a decoded structured data query statement as decoded query information, wherein the decoded query information includes: data information, filtering condition information, sorting method information, and return quantity information; Performing lexical analysis on the data information to generate a data information morpheme set; Performing lexical analysis on the filtering condition information to generate a filtering condition information morpheme set; Performing lexical analysis on the sorting information to generate a sorting information morpheme set; Performing lexical analysis on the returned quantity information to generate a returned quantity information morpheme set; Generate a query statement morpheme sequence according to the data information morpheme set, the filtering condition information morpheme set, the sorting mode information morpheme set and the return quantity information morpheme set; Generate a query syntax tree according to the query sentence morpheme sequence; Parsing the query syntax tree to obtain a database query statement corresponding to the target database; Execute a database query statement to obtain query result information corresponding to the target database; Sending the query result information to the client for display; The following steps are used to execute the database query statement to obtain the query result information corresponding to the target database: According to the database query statement, a query plan set corresponding to the database query statement is generated; Determine a query data set based on the database query statement and the query plan set; Generate a query loss information set according to the query data set and a pre-trained query loss prediction model; Determine the query loss information with the smallest loss value in the query loss information set as the minimum query loss information; Determine the query data group corresponding to the minimum query loss information in the query data group set as the target query data group; Execute the query plan corresponding to the target query data group to obtain query result information corresponding to the target database; According to the query data set and the pre-trained query loss prediction model, the execution subject generates a query loss information set through the following steps: For each query data group in the query data group set, the following steps are performed: Encoding the database query statement included in the query data group to obtain the encoded database query statement as a query statement encoding vector; Performing full-connection processing on the query statement encoding vector to generate a query statement full-connection vector; Encoding the query plan included in the query data group to generate a query plan encoding vector; Fusing the query statement full connection vector and the query plan encoding vector to generate a fused feature vector; Performing tree convolution processing on the fused feature vector to obtain the fused feature vector after the tree convolution processing as the first tree convolution feature vector; Performing tree convolution processing on the first tree convolution feature vector to obtain the first tree convolution feature vector after the tree convolution processing as the second tree convolution feature vector; Performing tree convolution processing on the second tree convolution feature vector to obtain the second tree convolution feature vector after the tree convolution processing as the third tree convolution feature vector; Performing full connection processing on the third tree-shaped convolutional feature vector to obtain a tree-shaped fully connected feature vector; Classify the tree-shaped fully connected feature vector to obtain query loss information; The obtained individual query loss information are determined as a query loss information set.

2. The method according to claim 1, wherein: Before sending the query result information to the client for display, the method further includes: Performing format conversion processing on the query result information to obtain query result information after format conversion processing as format conversion query result information; The format conversion query result information is determined as the query result information, so as to update the query result information.

3. The method according to claim 1, wherein: The method further comprises: Parsing the structured data query statement corresponding to the structured data query request to obtain a parsed object; Performing data preprocessing on the parsing object to obtain the parsing object after data preprocessing as the preprocessed parsing object; Determine the visualization database; Based on the visual database, the preprocessing parsed object is subjected to format conversion processing to obtain the preprocessing parsed object after format conversion processing as a conversion data object; Rendering the converted data object to obtain the converted data object after rendering as a rendering visualization result; The rendered visualization result is sent to the client for visualization display.

4. The method according to claim 1, wherein: The executing of the database query statement to obtain query result information corresponding to the target database includes: In response to determining that the target database is a local database, executing a database query statement to obtain query result information corresponding to the target database; In response to determining that the target database is an external database, sending a query request corresponding to the database query statement to a server corresponding to the target database to obtain query result information; Receive query result information sent by the server corresponding to the target database.

5. The method according to claim 1, wherein: Before decoding the structured data query statement corresponding to the structured data query request to obtain the decoded structured data query statement as decoded query information, the method further includes: In response to receiving a request message for establishing a network connection sent by the client, determining whether the request message meets a preset connection condition; In response to determining that the request information satisfies the preset connection condition, connection confirmation information corresponding to the request information is sent to the client.

6. The method according to claim 1, wherein: The method further comprises: In response to determining that the data type corresponding to the query result information is a classification type, generating a first visualization chart according to the query result information, and sending the first visualization chart to the client, wherein the chart type of the first visualization chart is a pie chart type; In response to determining that the data type corresponding to the query result information is a time series type, a second visualization chart is generated according to the query result information, and the second visualization chart is sent to the client, wherein the chart type of the second visualization chart is a line chart type.

7. A query result information sending device, comprising: The decoding unit is configured to, in response to receiving a structured data query request sent by a client, decode the structured data query statement corresponding to the structured data query request to obtain the decoded structured data query statement as decoded query information, wherein the decoded query information includes: data information, filtering condition information, sorting method information and return quantity information; A first parsing unit is configured to perform lexical parsing on the data information to generate a data information morpheme set; A second parsing unit is configured to perform lexical parsing on the filtering condition information to generate a filtering condition information morpheme set; A third parsing unit is configured to perform lexical parsing on the sorting information to generate a sorting information morpheme set; a fourth parsing unit, configured to perform lexical parsing on the returned quantity information to generate a returned quantity information morpheme set; A first generating unit is configured to generate a query statement morpheme sequence according to the data information morpheme set, the filtering condition information morpheme set, the sorting mode information morpheme set and the return quantity information morpheme set; A second generating unit is configured to generate a query syntax tree according to the query sentence morpheme sequence; a fifth parsing unit, configured to parse the query syntax tree to obtain a database query statement corresponding to a target database; An execution unit is configured to execute a database query statement to obtain query result information corresponding to the target database; a sending unit, configured to send the query result information to the client for display; The following steps are used to execute the database query statement to obtain the query result information corresponding to the target database: According to the database query statement, a query plan set corresponding to the database query statement is generated; Determine a query data set based on the database query statement and the query plan set; Generate a query loss information set according to the query data set and a pre-trained query loss prediction model; Determine the query loss information with the smallest loss value in the query loss information set as the minimum query loss information; Determine the query data group corresponding to the minimum query loss information in the query data group set as the target query data group; Execute the query plan corresponding to the target query data group to obtain query result information corresponding to the target database; According to the query data set and the pre-trained query loss prediction model, the execution subject generates a query loss information set through the following steps: For each query data group in the query data group set, the following steps are performed: Encoding the database query statement included in the query data group to obtain the encoded database query statement as a query statement encoding vector; Performing full-connection processing on the query statement encoding vector to generate a query statement full-connection vector; Encoding the query plan included in the query data group to generate a query plan encoding vector; Fusing the query statement full connection vector and the query plan encoding vector to generate a fused feature vector; Performing tree convolution processing on the fused feature vector to obtain the fused feature vector after the tree convolution processing as the first tree convolution feature vector; Performing tree convolution processing on the first tree convolution feature vector to obtain the first tree convolution feature vector after the tree convolution processing as the second tree convolution feature vector; Performing tree convolution processing on the second tree convolution feature vector to obtain the second tree convolution feature vector after the tree convolution processing as the third tree convolution feature vector; Performing full connection processing on the third tree-shaped convolutional feature vector to obtain a tree-shaped fully connected feature vector; Classify the tree-shaped fully connected feature vector to obtain query loss information; The obtained individual query loss information are determined as a query loss information set.

8. An electronic device comprising: one or more processors; a storage device having one or more programs stored thereon; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.

9. A computer readable medium having a computer program stored thereon, wherein: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Data processing method and device based on database engine, terminal and medium

    CN111522816A

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

    CN114385721A

  • Data query method, device and equipment based on search engine and medium

    CN115481145A