Information query method, server, storage medium and program product
By encoding data and query conditions and using pre-trained query processing models and relationship graphs for graph representation learning, the problems of low accuracy and efficiency in traditional approximate query processing are solved, and efficient and accurate approximate query results are achieved.
Patent Information
- Application Number
- CN202410294837.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-14
- Publication Date
- 2025-09-16
AI Technical Summary
Traditional approximate query processing methods have low accuracy, especially for query results containing joins. They are also inefficient and time-consuming.
By encoding the query conditions of the data to be queried and the query information, a data state vector set and a connection coding vector are obtained. The data state vector set and the connection coding vector are encoded using a pre-trained query processing model. The relationship diagram between the query conditions and the aggregation function is combined for graph representation learning to determine the query results of each aggregation function.
Improves the accuracy and efficiency of approximate query processing, supports query information containing multiple aggregate functions and joins, and greatly improves the efficiency of query information containing joins.
Smart Images

Figure CN120653689A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to computer technology, and in particular to an information query method, server, storage medium and program product. Background Art
[0002] Approximate Query Processing (AQP) provides query results for Structured Query Language (SQL) aggregate queries. By relaxing the requirements for result accuracy in exchange for higher query processing speed, it plays a vital role in modern data analysis systems and database management systems.
[0003] Traditional approximate query processing methods use database middleware (such as VerdictDB) to sample the database to create a sampling table. The original query is then rewritten as a query on the sampling table. Finally, the query results on the sampling table are processed based on the sampling ratio to obtain the original query results. However, sampling-based approximate query methods have low accuracy and are still inefficient for queries involving joins. Summary of the Invention
[0004] The present application provides an information query method, server, storage medium and program product to solve the problems of low accuracy and efficiency in approximate query processing and improve the accuracy and efficiency of approximate query processing.
[0005] In a first aspect, the present application provides an information query method, comprising:
[0006] Obtaining query information to be processed, where the query information includes at least one aggregation function;
[0007] Encoding the data to be queried and the query conditions of the query information to obtain a data state vector set and a connection coding vector;
[0008] Encoding the data state vector set and the connection encoding vector through a query processing model to obtain a first eigenvector of the query information, and determining a second eigenvector of the at least one aggregation function based on a pre-constructed relationship graph between query conditions and aggregation functions and a graph representation learning of the query information;
[0009] The query result of each aggregation function is determined according to the first feature vector of the query information and the second feature vector of each aggregation function.
[0010] In a second aspect, the present application provides an information query method, comprising:
[0011] A data analysis request sent by a receiving end-side device, wherein the data analysis request includes an SQL query statement to be executed, and the SQL query statement includes at least one aggregate function;
[0012] Encode the data to be queried and the query conditions of the SQL query statement to obtain a data state vector set and a connection encoding vector;
[0013] Encoding the data state vector set and the connection encoding vector through a query processing model to obtain a first eigenvector of the SQL query statement, and performing graph representation learning based on a pre-constructed graph of relationships between query conditions and aggregate functions and the first eigenvector of the SQL query statement to determine a second eigenvector of the at least one aggregate function;
[0014] Determine, based on the first eigenvector of the query information and the second eigenvector of each aggregation function, a query result of each aggregation function included in the SQL query statement to obtain a data analysis result;
[0015] Output the data analysis result to the end-side device.
[0016] In a third aspect, the present application provides a server comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the server to perform a method as provided in any of the foregoing aspects.
[0017] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the method provided in any of the aforementioned aspects is implemented.
[0018] In a fifth aspect, the present application provides a computer program product, comprising a computer program, which, when executed by a processor, implements the method provided in any of the aforementioned aspects.
[0019] The information query method, server, storage medium and program product provided by the present application encode the query conditions of the data to be queried and the query information to obtain a data state vector set and a connection coding vector, encode the data state vector and the connection coding vector through a pre-trained query processing model to obtain a first eigenvector of the query information, and the first eigenvector integrates the information of the query conditions in the data to be queried and the query information in the database; by constructing and training a relationship graph between the query conditions and the aggregation function, the query conditions are decoupled from the aggregation function, and approximate query processing of query information containing multiple aggregation functions can be supported; based on the relationship graph between the query conditions and the aggregation function and the first eigenvector of the query information, the neighborhood information of the nodes corresponding to each aggregation function can be aggregated to the nodes corresponding to the aggregation function through graph representation learning, and the hidden layer relationship between different aggregation functions and between the aggregation function and the first eigenvector can be learned to obtain a high-quality second eigenvector of the aggregation function; further, based on the first eigenvector of the query information and the second eigenvector of each aggregation function, the query result of each aggregation function is determined, which can improve the accuracy and efficiency of approximate query processing, and support approximate query processing of query information containing multiple aggregation functions and containing connections. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0021] Figure 1 A schematic diagram of an exemplary system architecture applicable to this application;
[0022] Figure 2 A flow chart of an information query method provided for an exemplary embodiment of the present application;
[0023] Figure 3 An example diagram of query information including filter predicates and join predicates provided in an embodiment of the present application;
[0024] Figure 4 An example diagram of an architecture of a query processing model for approximate query processing provided in an embodiment of the present application;
[0025] Figure 5 A detailed architecture diagram of a query processing model provided by an exemplary embodiment of the present application;
[0026] Figure 6 A schematic diagram of an approximate query processing process based on a query processing model provided in an exemplary embodiment of the present application;
[0027] Figure 7 A flowchart of constructing a relationship diagram between query conditions and aggregate functions provided in an exemplary embodiment of the present application;
[0028] Figure 8 A schematic diagram of a relationship diagram between query conditions and aggregation functions provided in an exemplary embodiment of the present application;
[0029] Figure 9 A flowchart of training a query processing model and a relationship graph provided in an exemplary embodiment of the present application;
[0030] Figure 10 A schematic diagram of the data flow of a query processing model in the training phase provided by an exemplary embodiment of the present application;
[0031] Figure 11 A complete interactive flow chart of information query provided by an exemplary embodiment of the present application;
[0032] Figure 12 A flowchart of an information query method provided by another exemplary embodiment of the present application;
[0033] Figure 13 A schematic diagram of the structure of a server provided in an embodiment of the present application.
[0034] The above drawings illustrate specific embodiments of the present application, which will be described in more detail below. These drawings and the textual description are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION
[0035] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
[0036] It should be noted that the user information (including but not limited to user device information, user attribute information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0037] First, let’s explain the terms involved in this application:
[0038] Structured Query Language (SQL): a database language with multiple functions such as data manipulation and data definition.
[0039] Approximate Query Processing (AQP): Provides query results for SQL aggregation queries, relaxing the requirement for result accuracy in exchange for higher query processing speed.
[0040] Aggregate Function (AF): refers to the aggregate function in SQL query statements.
[0041] Attention Mechanism (AM): It is a commonly used weighted query technology in machine learning. The input of this mechanism consists of two parts: key-value pair features and a query set. For convenience, key-value pair features are often split into key sets and value sets for illustration.
[0042] Self-Attention Mechanism (SAM): It is a special attention mechanism whose input key set, value set and query set are all the same set.
[0043] Cross-Attention Mechanism (CAM): is a special attention mechanism whose input key set and query set are two disjoint sets.
[0044] Graph Neural Network (GNN): refers to the general term for algorithms that use neural networks to learn graph-structured data, extract and discover features and patterns in graph-structured data, and meet the needs of graph learning tasks such as clustering, classification, prediction, segmentation, and generation.
[0045] Traditional sampling-based approximate query methods have low accuracy, especially for query results containing connected query information. They are also time-consuming and inefficient.
[0046] The present application provides an information query method for implementing approximate query processing, which comprises obtaining query information to be processed, the query information including at least one aggregation function; encoding the data to be queried and the query conditions of the query information to obtain a data state vector set and a connection encoding vector; encoding the data state vector and the connection encoding vector through a pre-trained query processing model to obtain a first eigenvector of the query information, and performing graph representation learning based on a relationship graph between the query conditions and the aggregation function and the first eigenvector of the query information to determine a second eigenvector of at least one aggregation function; determining a query result of each aggregation function based on the first eigenvector of the query information and the second eigenvector of each aggregation function, thereby obtaining an approximate query result of the query information.
[0047] The method of the present application encodes the query conditions of the data to be queried and the query information to obtain a data state vector set and a connection encoding vector, and encodes the data state vector and the connection encoding vector through a pre-trained query processing model to obtain a first eigenvector of the query information, which integrates the information of the query conditions in the data to be queried and the query information in the database; by constructing and training a relationship graph between the query conditions and the aggregation function, the query conditions and the aggregation function can be decoupled, and approximate query processing of query information containing multiple aggregation functions can be supported; based on the first eigenvector of the query information and the relationship graph between the query conditions and the aggregation function, the information of the neighborhood nodes corresponding to the nodes of each aggregation function can be aggregated to the nodes corresponding to the aggregation function through graph representation learning, to obtain a high-quality second eigenvector of the aggregation function; further, based on the first eigenvector of the query information and the second eigenvector of each aggregation function, the query result of each aggregation function is determined, which can improve the accuracy and efficiency of the approximate query processing, and supports approximate query processing of query information containing multiple aggregation functions and containing connections, especially for query information containing connections, the efficiency of the approximate query processing can be greatly improved.
[0048] The method of the present application can be applied to database management systems, data analysis systems, etc. When using these systems, users send data query requests to the system. When the user's query information contains aggregate functions and / or join predicates, it takes a long time to execute the query in the database (possibly up to several hours or even days) and the efficiency is very low. In some scenarios, users do not need to obtain very accurate query results, but only want to obtain an approximate query result. In this case, the method of the present application can be used to perform approximate query processing to obtain query information query results.
[0049] For example, in a certain e-commerce platform, users need to classify and count the number of customers who meet complex conditions. At this time, the query information (SQL statement) may contain multiple aggregation functions for different classification statistics, and complex conditions may also involve connection queries. Directly executing SQL queries may take hours or even days, which is unacceptable to users. In cases where users only need to estimate the approximate number of customers, the method of this application can be used to perform approximate query processing on the query information to obtain approximate query processing results, which can improve the efficiency of the query. Compared with traditional sampling-based approximate query methods, the method of this application can improve the accuracy and efficiency of approximate queries.
[0050] Figure 1 This is a schematic diagram of an example system architecture applicable to this application. Figure 1 As shown, the system architecture includes a server and a terminal device. There is a communication link between the server and the terminal device, which can realize the communication connection between the server and the terminal device.
[0051] Among them, the server is a device with computing power deployed in the cloud or locally, such as a cloud cluster. The server is responsible for storing the query processing model for approximate query processing, as well as the relationship graph between query conditions and aggregation functions pre-built based on the database to be queried. The server is responsible for using the query processing model for approximate query processing and the pre-built relationship graph between query conditions and aggregation functions to implement approximate query processing of the query information of the database and obtain approximate query processing results. Among them, the query processing model for approximate query processing mainly implements the encoding of input data (that is, feature extraction), which can be implemented using existing information encoding models and graph neural networks.
[0052] End-side devices can be electronic devices running downstream systems such as database management systems and data analysis systems. Specifically, they can be hardware devices with network communication, computing, and information display capabilities, including but not limited to smartphones, tablets, desktop computers, local servers, and cloud servers. When an end-side device running a downstream system such as a database management system or data analysis system needs to perform an approximate query, it sends an approximate query request to the server. The approximate query request includes query information to be processed, and the query information includes at least one aggregation function.
[0053] The server receives query information to be processed, encodes the data to be queried and the query conditions of the query information, and obtains a data state vector set and a connection encoding vector; encodes the data state vector and the connection encoding vector through a pre-trained query processing model to obtain a first eigenvector of the query information, and performs graph representation learning based on the relationship graph between the first eigenvector of the query information and the query conditions and aggregation functions to determine the second eigenvector of at least one aggregation function; and determines the query results of each aggregation function based on the first eigenvector of the query information and the second eigenvectors of each aggregation function. It should be noted that the query results of the aggregation functions here are approximate query results of each aggregation function, and the query results of each aggregation function constitute the approximate query results of the query information.
[0054] Furthermore, the server sends the query results of each aggregation function contained in the query information (i.e., the approximate query results of the query information) to the end-side device. The end-side device receives the query results of each aggregation function contained in the query information sent by the server (i.e., the approximate query results of the query information), and executes the subsequent processing logic of the system based on the approximate query results of the query information.
[0055] The following specific embodiments describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0056] Figure 2 This is a flow chart of an information query method provided by an exemplary embodiment of the present application. The execution subject of this embodiment is the server in the aforementioned system architecture. Figure 2 As shown, the specific steps of this method are as follows:
[0057] Step S201: Obtain query information to be processed, where the query information includes at least one aggregation function.
[0058] The query information to be processed refers to the SQL statement to be executed generated based on the user's query request and input information. Specifically, it can be implemented by using the existing method of dynamically generating SQL statements based on conditions provided by the user, which is not specifically limited here.
[0059] For example, first obtain the conditions input by the user, which may include table name, field name, operator (such as equal to, greater than), value and other information; then use the string concatenation function or template engine in the structured query language to build the SQL statement.
[0060] The method of this embodiment can be applied to database management systems, data analysis systems, etc., to implement approximate query processing for complex query information containing one or more aggregate functions, and can also implement approximate query processing for queries containing join predicates.
[0061] It should be noted that the query information to be processed may include one or more query information. If multiple query information is obtained, the approximate query processing of steps S202-S204 is performed on each query information to obtain the approximate query results of each query information.
[0062] Step S202: Encode the data to be queried and the query conditions of the query information to obtain a data state vector set and a connection coding vector.
[0063] The data to be queried includes all or part of the data in the database to be queried. For example, using a database management system as an example, the data to be queried includes all data in the database of the dataset management system. The data to be queried can be configured and adjusted by system administrators based on the needs of actual application scenarios. By default, the data to be queried may include all data in the database, and this is not specifically limited here.
[0064] In this step, the server converts the data to be queried and the filter predicates in the query conditions into a set of data state vectors. This set of data state vectors contains information about the data to be queried in the database and the filter predicates in the query conditions. The server also converts the join predicates in the query conditions into join encoding vectors, which contain information about the join predicates in the query conditions. The dimensions of the data state vectors and the join encoding vectors in the set of data state vectors can be configured and adjusted based on the needs of actual application scenarios and empirical data, and are not specifically limited here.
[0065] For example, Figure 3 An example of query information (SQL statement) containing filter predicates and join predicates is provided, such as Figure 3The query conditions of the query information shown include the join predicate "c.cid=i.cid" and the filter predicate "i.price>100". The query information includes three aggregate functions: AVG(i.price), SUM(i.price), and MIN(c.salary). Among them, c is the alias of the "customer" table in the database, i is the alias of the "item" table in the database, c.cid is a field in the "customer" table, i.cid is a field in the "item" table, i.price is another field in the "item" table, and c.salary is another field in the "customer" table. AVG() is an aggregate function for finding the average, SUM() is an aggregate function for finding the sum, and MIN() is an aggregate function for finding the minimum value.
[0066] In an optional embodiment, the query condition for the query information does not include a filter predicate. In this step, the data of each field in the database to be queried is converted into a data state vector to obtain a data state vector for each field. The data state vectors of each field constitute a data state vector set.
[0067] Exemplarily, the data state vector of each field may be a histogram vector of the data of each field in the database to be queried. The number of data state vectors in the data state vector set is equal to the total number of fields in the database.
[0068] Specifically, for any field in a database, if the data in that field is not numeric, the field data can be mapped to numeric data, and the numerical range of the mapped numeric data for the field can be determined as the numerical range of the field. If the data in the field is numeric, the numerical range of the field can be determined directly. The numerical range of the field is evenly divided into a fixed number of intervals (also called buckets), and the number of data in the field that falls within each interval is counted to obtain a histogram for the field. The vector consisting of the number of data in the field that falls within each interval is the histogram vector of the field, which serves as the data state vector of the field.
[0069] The number of intervals divided into each field should be consistent. If a field is divided into fewer intervals, additional intervals can be added after the intervals are divided. These additional intervals will not be overwritten by the field data. The fixed number of intervals divided into each field can be configured and adjusted based on the actual needs of the scenario and experience. For example, the fixed number of intervals can be 20, 10, etc., and is not specifically limited here.
[0070] For example, take the "customer age" field in the database as an example. The data of this field is numeric. Assume that the value range of this field is (1, 100]. The value range is divided into the following 10 intervals: (0, 10], (10, 20], (20, 30], (30, 40], (40, 50], (50, 60], (60, 70], (70, 80], (80, 90], (90, 100]. After counting, the number of data in this field that fall into these 10 intervals are: a1, a2, a3, a4, a5, a6, a7, a8, a9, a100, a111, a12, a3, a4, a5, a6, a7, a8, a9, a100, a111 10 Then the data state vector of this field can be expressed as {a1,a2,a3,a4,a5,a6,a7,a8,a9,a 10}.
[0071] For example, let's take the "customer gender" field in the database. The data in this field is not numerical. The possible values of "customer gender" (male) and "female) can be mapped to 0 and 1 respectively. This field can be divided into two intervals (buckets): [0] and [1]. By padding, the following 10 intervals can be obtained: [0], [1], [2], [3], [4], [5], [6], [7], [8], [9]. All data in this field in the database falls into the first two intervals [0] and [1], and no data falls into the padded intervals. After counting, the number of data in this field that fall into these 10 intervals is: b1, b2, 0, 0, 0, 0, 0, 0, 0, 0. Then the data state vector of this field can be expressed as {b1, b2, 0, 0, 0, 0, 0, 0, 0}.
[0072] In an optional embodiment, the query conditions of the query information include a filtering predicate. In this step, based on the filtering predicate in the query conditions of the query information, the data of the corresponding field in the database is filtered to obtain relevant data for the corresponding field. The relevant data of the unfiltered field includes all data of the field. The relevant data of each field is converted into a data state vector to obtain a data state vector for each field. The data state vectors of each field constitute a data state vector set.
[0073] For example, the data state vector of each field may be a histogram vector of the data of each field in the database after being processed by a filter predicate. The number of data state vectors in the data state vector set is equal to the total number of fields in the database.
[0074] Specifically, for the data of any field in the database, if the data of the field is not numeric, the data of the field can be mapped to numeric data, and the numerical range of the mapped numeric data of the field can be determined as the numerical range of the field. If the data of the field is numeric, the numerical range of the field can be determined directly. The numerical range of the field is evenly divided into a fixed number of intervals (also called buckets), and the number of numeric data after the field is mapped that falls into each interval is counted to obtain a histogram of the field after the filter predicate is processed. The vector composed of the number of numeric data after the field is mapped that falls into each interval is the histogram vector of the field after the filter predicate is processed, which serves as the data state vector of the field.
[0075] The number of intervals divided into each field should be consistent. If a field is divided into fewer intervals, additional intervals can be added after the intervals are divided. These additional intervals will not be overwritten by the field data. The fixed number of intervals divided into each field can be configured and adjusted based on the actual needs of the scenario and experience. For example, the fixed number of intervals can be 20, 10, etc., and is not specifically limited here.
[0076] For example, take the "customer age" field in the database as an example. The data of this field is numeric. Assume that the value range of this field is (1, 100]. The value range is divided into the following 10 intervals: (0, 10], (10, 20], (20, 30], (30, 40], (40, 50], (50, 60], (60, 70], (70, 80], (80, 90], (90, 100]. Assume that the query condition contains the following filter predicate "customer age>45". After filtering this field with this filter predicate, the number of related data in this field that fall into these 10 intervals is: 0, 0, 0, 0, a′5, a6, a7, a8, a9, a 10 Then the data state vector of this field can be expressed as {0,0,0,0,a′5,a6,a7,a8,a9,a 10}.
[0077] In this step, when converting the connection predicates in the query condition into the connection encoding vector, the connection encoding vector can be obtained by encoding the connection predicates in the query condition.
[0078] The server can first determine all possible connection predicates. Encoding is performed based on all possible connection predicates, and different connection predicates are encoded with unique vectors. According to the dimension of the encoding vector of a connection predicate, an initial connection encoding vector is designed. The initial connection encoding vector is composed of all possible connection predicates arranged in a certain order. Assuming that there are D possible connection predicates and the dimension of a connection predicate is E, the dimension of the connection encoding vector is D*E. Where D and E are both positive integers. For any query information, according to the connection predicates contained in the query information, the encoding vector of the connection predicate contained in the query information in the initial connection encoding vector is retained, and the encoding vector of the connection predicate not contained in the query information is set to all 0, and the connection encoding vector corresponding to the query information can be obtained.
[0079] Optionally, the server determines all possible connection predicates based on the data table structure of the database to be queried. Optionally, the server can also analyze the connection predicates that have appeared in the historical query information of the database to be queried as all possible connection predicates.
[0080] Optionally, an encoding method for each connection predicate is as follows: the server can uniquely encode each table in the database and uniquely encode the fields in each table; the connection predicate is usually in the form of "table 1.field 1=table 2.field 2", and the encoding vector of the connection predicate can be the concatenation of the unique encoding of table 1, the unique encoding of field 1 in table 1, the unique encoding of table 2, and the unique encoding of field 2 in table 2.
[0081] For example, assuming the unique code of Table 1 is 01 and the unique code of Table 2 is 10, the code of Field 1 in Table 1 is 001, and the code of Field 2 in Table 2 is 010, then the encoding vector for the join predicate "Table 1. Field 1 = Table 2. Field 2" is: 01 001100 10. In this example, the encoding vector for a join predicate has a dimension of 10. Assuming there are 20 possible join predicates, the dimension of the join encoding vector is a 200-dimensional vector (10*20). It should be noted that encoding vectors do not contain spaces; spaces are added here only to separate the unique codes of different tables and fields for easier observation and understanding.
[0082] Optionally, for an encoding method of each connection predicate, a unique encoding vector may be directly configured for each connection predicate according to all possible types of connection predicates, so that different connection predicates have different encoding vectors.
[0083] For example, to facilitate understanding, assuming there are seven possible join predicates, a three-dimensional vector can be used to uniquely encode all possible join predicates. The encoding vectors for these seven join predicates are: 001, 101, 011, 100, 101, 110, 111. If a query contains two join predicates whose encoding vectors are "011" and "110," the following join encoding vector can be determined based on the query: 000 000 011 000 000 110 000.
[0084] In addition, the encoding method for the connection predicate may also be other lossless encoding methods, and is not limited to the encoding method described in the above examples. This embodiment does not make any specific limitations here.
[0085] Step S203: Encode the data state vector and the connection coding vector through the query processing model to obtain the first eigenvector of the query information, and perform graph representation learning based on the relationship graph between the query condition and the aggregation function and the first eigenvector of the query information to determine the second eigenvector of at least one aggregation function.
[0086] The query processing model refers to a pre-trained neural network model for approximate query processing. Figure 4 As shown, the query processing model includes an encoding module and a graph processing module. The encoding module is used to encode the data state vector set and the connection encoding vector to obtain the first eigenvector of the query information. The graph processing module is used to learn the graph representation of the nodes corresponding to each aggregation function contained in the query information based on the relationship graph between the query conditions and the aggregation function and the first eigenvector of the query information, to obtain the second eigenvector of each aggregation function.
[0087] Exemplarily, the encoding module can use a commonly used attention-based encoder, a multilayer perceptron (MLP), or an attention-based MLP implementation to further extract features from the data state vector and the connection encoding vector to obtain a higher quality embedding vector.
[0088] The graph processing module can be implemented using a graph neural network (GNN) or an encoder based on an attention mechanism. Graph representation learning is performed based on the first eigenvector of the query information and the relationship graph between the query condition and the aggregation function. The neighborhood information of the nodes corresponding to each aggregation function in the relationship graph can be aggregated to the node corresponding to the aggregation function to obtain a high-quality second eigenvector of the aggregation function.
[0089] Among them, the relationship graph between query conditions and aggregation functions includes query nodes and task nodes. One query node corresponds to a query condition, and one task node corresponds to a type of aggregation function. There is a connected edge between any two task nodes. There may or may not be an edge between the query node and the task node. The edge between the query node and the task node indicates that the query condition corresponding to the query node and the aggregation function corresponding to the task node have appeared in the same query information. The relationship graph between query conditions and aggregation functions is pre-constructed based on a large amount of relevant data of historical queries. The embedding vector of the query node is the first eigenvector determined based on the historical query information where the query condition corresponding to the query node is located. The embedding vector of the task node is continuously updated and determined during the training process. It is a high-quality embedding vector of the aggregation function determined by learning a large amount of historical query data.
[0090] In this embodiment, after determining the data state vector and the connection coding vector based on the query information and the data to be queried, the data state vector and the connection coding vector are encoded through the encoding module of the pre-trained query processing model for approximate query processing to obtain the first feature vector of the query information. The first feature vector simultaneously contains information about the data to be queried in the database and the query conditions in the query information, and is a higher quality and more intelligent expression of the data to be queried and the query conditions in the database.
[0091] Furthermore, through the graph processing module of the query processing model, graph representation learning is performed based on the first eigenvector of the query information and the relationship graph between the query condition and the aggregation function. The neighborhood information of the nodes corresponding to each aggregation function in the relationship graph can be aggregated to the nodes corresponding to the aggregation function to obtain a high-quality second eigenvector of the aggregation function.
[0092] In an optional embodiment, after obtaining the second eigenvector of each aggregation function contained in the query information, the embedding vector of the corresponding aggregation function in the relationship graph can also be updated based on the second eigenvector of the aggregation function, which can improve the quality of the embedding vector of the node corresponding to the aggregation function in the relationship graph.
[0093] In an optional embodiment, the server may insert a query node corresponding to the current query condition into the relationship graph, use the first feature vector as the embedding vector of the query node, and add an edge between the query node and the task node corresponding to the aggregation function contained in the query information.
[0094] Furthermore, the server can also update the embedding vector of the task node with the added edge through graph representation learning. For example, the embedding vectors of the neighboring nodes connected to the task node are aggregated into the embedding vector of the task node, or the embedding vectors of the task node's multi-hop neighboring nodes (such as one-hop neighbors and two-hop neighbors) are aggregated into the embedding vector of the task node.
[0095] Step S204: Determine the query result of each aggregation function according to the first eigenvector of the query information and the second eigenvector of each aggregation function.
[0096] After obtaining the first eigenvector of the query information and the second eigenvector of each aggregation function, in this step, the inner product of the first eigenvector of the query information and the second eigenvector of each aggregation function included in the query information is calculated, and the inner product is used as the query result of the aggregation function (i.e., the approximate query result of the aggregation function). In this way, the query result of each aggregation function included in the query information (i.e., the approximate query result of the aggregation function) can be obtained.
[0097] For example, using q i Indicates query information, using C i Indicates the query conditions for query information, using T j Indicates the aggregate function contained in the query information. If the query information contains an aggregate function T j , then the approximate query result of the query information contains the aggregation function T j The query results. i Represents the first eigenvector of the query information, t j ′ represents the aggregation function T j The second eigenvector of , then the aggregation function T j The query result can be expressed as: <x i ,t j ′>. Among them, <,> are inner product operators.
[0098] If the query information contains m aggregate functions: T j1 ,T j2 ,…,T jm , where m is a positive integer greater than 1. Then the approximate query result of the query information includes the query results of m aggregate functions of the aggregate function (here refers to the approximate query results of the aggregate function). i Represents the first eigenvector of the query information, t j ′1,t j ′2,…,t j ' m Represents m aggregation functions T j1 ,T j2 ,…,T jm The second eigenvector of , then calculate m aggregation functions T respectively j1 ,T j2 ,…,T jm Query results: <x i ,t j ′1>,…,<x i ,t j ' m>.
[0099] Furthermore, after obtaining the query results of each aggregation function included in the query information, the server may output the query results of each aggregation function.
[0100] Optionally, the server may output the query results of each aggregation function included in the query information through a front-end visual interface for the user to view and reference.
[0101] Optionally, the server may output the query results of each aggregation function included in the query information to the designated device in a pre-configured output manner, for example, returning the query results of each aggregation function included in the query information to the end-side device that sent the request.
[0102] The method of this embodiment encodes the query conditions of the data to be queried and the query information to obtain a data state vector set and a connection encoding vector, and encodes the data state vector and the connection encoding vector through a pre-trained query processing model to obtain a first eigenvector of the query information, which integrates the information of the query conditions in the data to be queried and the query information in the database; by constructing and training a relationship graph between the query conditions and the aggregation function, the query conditions can be decoupled from the aggregation function, and approximate query processing of query information containing multiple aggregation functions can be supported; based on the relationship graph between the query conditions and the aggregation function and the first eigenvector of the query information, the neighborhood information of the nodes corresponding to each aggregation function can be aggregated to the nodes corresponding to the aggregation function through graph representation learning, and a high-quality second eigenvector of the aggregation function can be obtained; further, based on the first eigenvector of the query information and the second eigenvector of each aggregation function, the query result of each aggregation function is determined, which can improve the accuracy and efficiency of approximate query processing, and supports approximate query processing of query information containing multiple aggregation functions and containing connections, especially for query information containing connections, which can greatly improve the efficiency of approximate query processing.
[0103] In an alternative embodiment, the architecture of the query processing model for approximate query processing is as follows: Figure 5 As shown, the query processing model includes an encoding module and a graph processing module.
[0104] The encoding module is used to encode the data state vector set and the connection encoding vector to obtain the first feature vector of the query information.
[0105] In this embodiment, Figure 5 As shown, the encoding module includes a self-attention mechanism submodule and a cross-attention mechanism submodule. Among them, the self-attention mechanism submodule is used to i Perform self-attention calculation to obtain the data encoding vector set (which can be expressed as Z iThe self-attention mechanism allows the data state vectors of different fields in the data state vector set to interact with each other, learning the latent relationship information between different fields. Therefore, the data encoding vector set learns the latent relationship information between the data state vectors of different fields, providing a better representation of the data state vector set.
[0106] For example, Figure 5 An example architecture of the self-attention mechanism submodule is provided in Figure 5 As shown, the self-attention mechanism submodule includes a self-attention mechanism neural network and a feedforward neural network (FNN). The self-attention mechanism neural network can be implemented using a commonly used neural network module based on the multi-headed self-attention (MHSA) mechanism or a neural network module based on the single-headed self-attention mechanism, without specific limitations here. In addition, the self-attention mechanism submodule can also be implemented using a structure similar to the encoder module in the Transformer, without specific limitations here.
[0107] The cross attention mechanism submodule is used to encode the data vector set (Z i ) as the input key set and value set, the concatenated encoding vector γ i As the input query set, cross attention calculation is performed to obtain the first eigenvector x of the query information i The first eigenvector of the query information learns the relationship between the data encoding vectors and the connection encoding vectors of each field in the data encoding vector set, and integrates the low-level data to be queried in the database and the query conditions in the query information. It is a higher-quality and more intelligent expression of the low-level data and query conditions in the database.
[0108] For example, Figure 5 An example architecture of the cross-attention mechanism submodule is provided in Figure 5 As shown, the cross-attention mechanism submodule includes a cross-attention mechanism neural network and a feedforward neural network (FNN). The cross-attention mechanism neural network can be implemented using a commonly used neural network module based on the cross-attention (CA) mechanism, such as the cross-attention layer in the Transformer or a similar cross-attention mechanism-based neural network, which is not specifically limited here.
[0109] In this embodiment, the graph processing module is used to perform graph representation learning on the nodes corresponding to each aggregation function contained in the query information based on the first feature vector of the query information and the relationship graph between the query condition and the aggregation function, and obtain the embedding vector of each aggregation function.
[0110] For example, Figure 5 An example architecture of the graph processing module is provided in Figure 5 As shown in FIG, the graph processing module includes an attention mechanism neural network and a feedforward neural network (FNN). The attention mechanism neural network can be implemented using a neural network layer based on the attention mechanism, which can be a neural network module based on the multi-headed attention (MHA) mechanism or a neural network module based on a single-headed attention mechanism, which is not specifically limited here. For any aggregation function, the query set of the attention mechanism neural network is the query set containing the aggregation function T j The second eigenvector t j The key set and value set contain the embedding vectors of all nodes connected to the task node corresponding to the aggregation function and the first eigenvector x of the query information. i Since all task nodes in the relationship graph are connected, the key set and value set here contain the embedding vectors of all task nodes, as well as the embedding vectors of the query nodes connected to the task node corresponding to the current aggregation function. Through the attention mechanism neural network, the graph representation learning of the task nodes corresponding to the aggregation function in the relationship graph can be performed. The hidden layer relationship between different aggregation functions and the hidden layer relationship between the aggregation function and the first eigenvector can be learned to obtain a high-quality second eigenvector t′ of the aggregation function. j .
[0111] Furthermore, the first eigenvector x of the query information is calculated i and the aggregate function T j The second eigenvector t′ j The inner product of j 's query results.
[0112] In another embodiment, the graph processing module can also be implemented using a graph neural network, which is not specifically limited here.
[0113] It should be noted that Figure 5 The three feedforward neural networks in the query processing model shown in FIG can use the same or different structures. Even if the three feedforward neural networks use the same structure, since the feedforward neural network contains learnable parameters, the three feedforward neural networks will have different parameters after training.
[0114] Figure 6 A schematic diagram of the approximate query processing process based on the query processing model provided in the embodiment of the present application. Figure 5 The query processing model shown in Figure 6As shown, in the aforementioned step S203, the data state vector set and the connection encoding vector are encoded by the pre-trained query processing model to obtain the first eigenvector of the query information, and a graph representation learning is performed based on the first eigenvector of the query information and the relationship graph between the query condition and the aggregation function to determine the second eigenvector of at least one aggregation function. Specifically, the following steps S2031-S2034 can be used to implement it:
[0115] Step S2031: Perform self-attention calculation on the data state vector set through the self-attention mechanism sub-module to obtain the data encoding vector set.
[0116] In this step, the data state vector set is used as the key set, value set and query set in the self-attention mechanism submodule for attention calculation to realize self-attention calculation of the data state vector set and obtain a new set called the data encoding vector set.
[0117] For example, Figure 5 An example architecture of the self-attention mechanism submodule is provided in Figure 5 As shown in the figure, the self-attention mechanism submodule includes a self-attention mechanism neural network and a feedforward neural network (FNN).
[0118] based on Figure 5 The architecture of the self-attention mechanism submodule is shown. In this step, the data state vector set is used as the key set, value set and query set, and is input into the self-attention mechanism neural network for self-attention calculation; the output result of the self-attention mechanism neural network is input into the feedforward neural network for processing, and the feedforward neural network outputs the data encoding vector set.
[0119] The data encoding vectors in the data encoding vector set correspond to the data state vectors in the data state vector set, are higher quality expressions of the data state vectors, and include implicit relationship information between different fields.
[0120] Step S2032: Through the cross-attention mechanism sub-module, the data encoding vector set is used as the input key set and value set, and the set containing the connection encoding vector is used as the input query set, and cross-attention calculation is performed to obtain the first feature vector of the query information.
[0121] In this step, a cross-attention calculation is performed using the data encoding vector set as the input key set and value set, and the set containing the connection encoding vector as the input query set, to obtain the first feature vector of the query information. The input query set is a set containing only the connection encoding vectors.
[0122] For example, Figure 5An example architecture of the cross-attention mechanism submodule is provided in Figure 5 As shown, the cross-attention mechanism submodule includes a cross-attention mechanism neural network and a feedforward neural network (FNN).
[0123] based on Figure 5 The architecture of the self-attention mechanism submodule is shown. In this step, the data encoding vector set is used as the input key set and value set, and the set containing the connection encoding vector is used as the input query set, which are input into the cross-attention mechanism neural network for cross-attention calculation; the output result of the cross-attention mechanism neural network is input into the feedforward neural network for processing, and the feedforward neural network outputs the first eigenvector of the query information.
[0124] Step S2033: Based on the pre-built relationship graph between the query conditions and the aggregation functions, determine the corresponding node of the aggregation function included in the query information in the relationship graph.
[0125] The pre-built relationship diagram between query conditions and aggregation functions includes query nodes corresponding to the query conditions and task nodes corresponding to the aggregation functions.
[0126] In this step, based on the aggregation functions included in the query information, the task nodes corresponding to each aggregation function in the relationship graph are determined. Furthermore, the neighboring nodes connected to the task nodes corresponding to the aggregation functions in the query information can be determined, thereby obtaining the embedding vectors of the task nodes and their neighboring nodes in the relationship graph.
[0127] Step S2034: Through the graph processing module, a key set and a value set are constructed based on the embedding vectors of the neighbor nodes connected to the corresponding node in the relationship graph and the first eigenvector of the query information, and the embedding vector of the corresponding node is used as the query set to perform attention calculation to obtain the second eigenvector of each aggregation function.
[0128] For example, Figure 5 An example architecture of the graph processing module is provided in Figure 5 As shown in Figure 3, the graph processing module includes an attention mechanism neural network and a feedforward neural network (FNN).
[0129] based on Figure 5 The architecture of the graph processing module shown in the figure, in this step, the set of embedding vectors of neighboring nodes connected to the corresponding node in the relationship graph and the first eigenvector of the query information is used as the key set and the value set, and the set of embedding vectors of the corresponding nodes is used as the query set, and input into the attention mechanism neural network in the graph processing module for attention calculation; the output result of the attention mechanism neural network is input into the feedforward neural network for processing, and the output of the feedforward neural network contains the second eigenvector of each aggregation function.
[0130] The method of this embodiment encodes the data state vector and the connection encoding vector through the encoding module of the pre-trained query processing model to obtain the first eigenvector of the query information, which integrates the information of the query conditions in the data to be queried and the query information in the database; by constructing and training the relationship graph between the query conditions and the aggregation function, the query conditions and the aggregation function can be decoupled, and approximate query processing of query information containing multiple aggregation functions can be supported; through the graph processing module of the pre-trained query processing model, graph representation learning is performed based on the first eigenvector of the query information and the relationship graph between the query conditions and the aggregation function, and the neighborhood information of the nodes corresponding to each aggregation function can be aggregated to the nodes corresponding to the aggregation function to obtain a high-quality second eigenvector of the aggregation function; further, based on the first eigenvector of the query information and the second eigenvector of each aggregation function, the query result of each aggregation function is determined, which can improve the accuracy and efficiency of approximate query processing, and support approximate query processing of query information containing multiple aggregation functions and containing connections, especially for query information containing connections, which can greatly improve the efficiency of approximate query processing.
[0131] Based on any of the aforementioned method embodiments, before performing an online approximate query, the server constructs a relationship graph between the query conditions and the aggregation function based on the historical query information of the database; based on the historical query information and historical query results of the database, as well as the relationship graph, the query processing model for approximate query processing is trained, and the embedding vector of the aggregation function in the relationship graph is updated.
[0132] Figure 7 This is a flowchart of the relationship diagram between query conditions and aggregate functions provided in the embodiment of the present application. Figure 7 As shown in the figure, the specific steps for constructing a relationship diagram between query conditions and aggregate functions based on the historical query information of the database are as follows:
[0133] Step S700: Obtain historical query information from the database.
[0134] In this embodiment, historical query information and historical query results based on the database of a downstream system (such as a database management system and a data analysis system) used for approximate query processing are obtained. Specifically, SQL statements executed in the database can be obtained and used as historical query information.
[0135] Optionally, SQL statements executed in the database may be obtained, and SQL statements containing at least one aggregate function may be screened out as historical query information.
[0136] In addition, you can also construct more SQL statements by building SQL statements containing aggregate functions and / or join predicates, or by transforming executed SQL statements. By executing the constructed SQL statements, you can obtain the execution results of the SQL statements. These constructed SQL statements and execution results can be used as historical query information to obtain richer historical data.
[0137] Step S701: Based on the historical query conditions in the historical query information, construct a query node corresponding to the historical query conditions, and initialize the embedding vector of the query node. One query node represents one historical query condition.
[0138] In this embodiment, in order to distinguish the query conditions of the online query information from the query conditions of the online query information, the query conditions included in the historical query information are referred to as historical query conditions.
[0139] Based on a large amount of historical query information, a query node is constructed for each historical query condition in the historical query information. Different query conditions correspond to different query nodes. The embedding vector of this query node can be randomly initialized. In the subsequent training phase, the embedding vector of this query node is updated to the first eigenvector of the historical query information.
[0140] For example, assuming Figure 3 The query information shown is a historical query information, constructed with Figure 3 The query node corresponding to the query condition in .
[0141] Step S702: construct task nodes corresponding to various types of aggregation functions and initialize the embedding vectors of the task nodes. One task node represents one type of aggregation function.
[0142] In this embodiment, all types of aggregation functions supported by the database are obtained, and corresponding task nodes are constructed for each type of aggregation function. The embedding vectors of the task nodes corresponding to the aggregation functions can be randomly initialized. The embedding vectors of the task nodes corresponding to the aggregation functions are trainable parameters.
[0143] The construction of the nodes in the relationship graph can be completed through steps S701 and S702. Steps S701 and S702 can be performed in parallel or in sequence in any order, which is not specifically limited here.
[0144] Step S703: Establish an edge between any two different task nodes, and establish an edge between the query node corresponding to the query condition contained in any historical query information and the task node corresponding to the aggregation function contained in the same historical query information to obtain a relationship diagram between the query condition and the aggregation function.
[0145] An edge is established between any two different task nodes, so that any two different task nodes in the relationship graph are connected by an edge, and the task nodes form a fully connected subgraph.
[0146] For the query node corresponding to the query condition of any historical query information, an edge is established between the query node and the task node corresponding to the aggregation function contained in the same historical query information, so that the query condition and the nodes corresponding to the aggregation function contained in the same historical query information are connected by an edge.
[0147] For example, for any historical query information Q i , if Q i Contains query condition C i and the aggregate function T j , then in the query condition C i Corresponding query node and aggregation function T j Establish edges between corresponding task nodes. i Contains query condition C i and m aggregate functions: T j1 ,T j2 ,…,T jm , where m is a positive integer greater than 1. Then, in the query condition C i The corresponding query node and T j1 ,T j2 ,…,T jm Edges are established between corresponding task nodes.
[0148] In this way, the query conditions of the query information and each aggregation function are decoupled, and approximate query processing of query information containing multiple aggregation functions can be achieved based on the constructed relationship graph.
[0149] Figure 8 Schematic diagram of the relationship between the query conditions and the aggregation function provided in this embodiment. Assume that there are B historical query information: Q1, Q2, ..., Q B , assuming that the database supports M types of aggregate functions: T1, T2, ..., T M Where B and M are both positive integers. Figure 8 As shown, the relationship graph contains query nodes corresponding to the query conditions contained in B historical query information (a total of B query nodes), and the relationship graph contains task nodes corresponding to M types of aggregation functions. The embedding vector of each task node can be randomly initialized to t1, t2, ..., t M .
[0150] S1 and γ1 represent the data state vector set and connection encoding vector determined based on the historical query information Q1, respectively. By encoding S1 and γ1 through the encoding module of the graph neural network, the first eigenvector x1 of the historical query information Q1 can be obtained. The first eigenvector x1 of the historical query information Q1 serves as the embedding vector of the query node corresponding to the query condition C1 of Q1.
[0151] S2 and γ2 represent the data state vector set and connection encoding vector determined based on the historical query information Q2, respectively. By encoding S2 and γ2 through the encoding module of the graph neural network, the first eigenvector x2 of the historical query information Q2 can be obtained. This first eigenvector x2 of the historical query information Q2 serves as the embedding vector of the query node corresponding to the query condition C2 of Q2.
[0152] Similarly, S B and γ B The table is based on historical query information Q B Determine the data state vector set and connection encoding vector. Through the encoding module of the graph neural network, S B and γ B By encoding, historical query information Q can be obtained B The first eigenvector x B . Historical query information Q B The first eigenvector x B As Q B Query condition C B Embedding vector corresponding to the query node.
[0153] like Figure 8 As shown, any two task nodes are connected by an edge.
[0154] like Figure 8 As shown, assume that the historical query information Q1 contains aggregation functions T1 and T M , then the query condition C1 of Q1 corresponds to the query node (embedding vector is x1) and the aggregation functions T1 and T M The corresponding task nodes (embedded vectors are t1 and t M ) are established between them.
[0155] Assuming that the historical query information Q2 contains aggregation functions T1 and T2, edges are established between the query node corresponding to the query condition C2 of Q2 (the embedding vector is x2) and the task nodes corresponding to the aggregation functions T1 and T2 (the embedding vectors are t1 and t2 respectively).
[0156] Assume that the historical query information Q B Contains aggregate functions T2 and T M , then in Q B Query condition C BCorresponding query node (embedding vector is x B ) with aggregate functions T2 and T M The corresponding task nodes (embedded vectors are t2 and t M ) are established between them.
[0157] Figure 9 A flowchart of training a query processing model and a relationship graph is provided for an exemplary embodiment of the present application. Figure 9 As shown in the figure, based on the historical query information and historical query results of the database and the relationship graph, the query processing model for approximate query processing is trained, and the embedding vector of the aggregation function in the relationship graph is updated. The specific implementation steps are as follows:
[0158] Step S901: Acquire historical query information and historical query results of the historical query information from a database.
[0159] In this embodiment, historical query information and historical query results based on the database of a downstream system (such as a database management system and a data analysis system) used for approximate query processing are obtained. Specifically, SQL statements executed in the database and the query results of the SQL statements can be obtained. The executed SQL statements are used as historical query information, and the query results of the SQL statements are used as historical query results.
[0160] Optionally, SQL statements executed in the database may be obtained, and SQL statements containing at least one aggregate function may be screened out as historical query information, and query results of the SQL statements may be used as historical query results.
[0161] In addition, you can also construct more SQL statements by constructing SQL statements containing aggregate functions and / or join predicates, or by transforming executed SQL statements, and obtain the execution results of the SQL statements by executing the constructed SQL statements. These constructed SQL statements and execution results can be used as historical query information and historical query results to obtain richer historical data.
[0162] Step S902: Encode the data to be queried and the historical query conditions of the historical query information to obtain a data state vector set and a connection coding vector corresponding to the historical query information.
[0163] In this step, for each historical query information, the data in the query database and the query conditions of the historical query information are encoded to obtain the data state vector set and connection encoding vector corresponding to the historical query information. The specific implementation principle and technical effects are related to the above-mentioned step S202 and will not be repeated here.
[0164] Step S903: Encode the data state vector and connection coding vector corresponding to each historical query information through the query processing model to obtain the first eigenvector of the historical query information, perform graph representation learning based on the first eigenvector of the historical query information and the relationship graph, and determine the second eigenvector of the aggregation function contained in the historical query information.
[0165] The pre-trained query processing model refers to a pre-trained query processing model for approximate query processing. In this embodiment, the architecture of the query processing model refers to the relevant content in the above embodiment, which will not be repeated here.
[0166] In this step, the data state vector and connection coding vector corresponding to each historical query information are encoded through the query processing model to obtain the first eigenvector of the historical query information, and graph representation learning is performed based on the first eigenvector of the historical query information and the relationship graph to determine the second eigenvector of the aggregation function contained in the historical query information. This is the same as the implementation principle of encoding the data state vector and the connection coding vector through the pre-trained query processing model to obtain the first eigenvector of the query information, and graph representation learning is performed based on the first eigenvector of the query information and the relationship graph between the query condition and the aggregation function to determine the second eigenvector of at least one aggregation function in the aforementioned step S203. For the specific implementation principle and technical effects, please refer to the relevant content of the aforementioned step S203, which will not be repeated here.
[0167] Step S904: Update the embedding vector of the query node corresponding to the historical query condition in the historical query information according to the first eigenvector of the historical query information; and update the embedding vector of the node corresponding to each aggregation function in the relationship graph according to the second eigenvector of each aggregation function contained in the historical query information.
[0168] In this embodiment, after determining the first feature vector in the historical query information, the first feature vector in the historical query information is used to update the embedding vector of the corresponding query node in the relationship graph, so that the query node has a high-quality embedding vector.
[0169] After obtaining the second eigenvector of each aggregation function included in the historical query information, the embedding vector of the task node corresponding to the aggregation function in the relationship graph is updated according to the second eigenvector of each aggregation function included in the historical query information.
[0170] It should be noted that the embedding vector of a query node in the relationship graph is related to the corresponding historical query information and is updated once during training based on the first eigenvector of the corresponding historical query information. However, the aggregation function may be used for multiple different historical query information, so the embedding vector of the task node corresponding to the aggregation function will be updated multiple times during training.
[0171] Step S905 : Determine the query results of each aggregation function included in the historical query information based on the first eigenvector of the historical query information and the second eigenvector of each aggregation function included in the historical query information.
[0172] In this step, the query results of each aggregation function contained in the historical query information are determined based on the first eigenvector of the historical query information and the second eigenvector of each aggregation function contained in the historical query information. This is the same as the implementation principle of determining the query results of each aggregation function based on the first eigenvector of the query information and the second eigenvector of each aggregation function in the aforementioned step S204. For specific implementation principles and technical effects, please refer to the relevant content of the aforementioned embodiments and will not be repeated here.
[0173] Step S906: Train the parameters of the query processing model according to the query results of each aggregation function contained in the historical query information and the historical query results of the historical query information.
[0174] In this embodiment, a loss function value is calculated based on the query results of each aggregation function contained in the historical query information and the historical query results of the historical query information, and the parameters of the query processing model are updated through backpropagation based on the loss function value. The loss function used in training can be a cross-entropy loss function, which is calculated based on the difference between the approximate query combination of the same aggregation function contained in the same historical query information and the historical query results.
[0175] Figure 10 The data flow diagram of the query processing model in the training phase provided by this embodiment. Figure 10 As shown, based on Figure 5 The model architecture shown in the figure, in the query processing model, the data processing flow of the encoding module during the training phase is consistent with that during the online approximate query, and will not be repeated here. Figure 10 As shown, during the training phase, the query set input to the attention mechanism neural network in the graph processing module is a set containing the aggregation function T i The current embedding vector t of the corresponding node i The key set and value set contain the aggregate function T i Corresponding task node (current embedding vector is t i ) The embedding vectors of all neighbor nodes connected to it and the first eigenvector x of the historical query information i , the attention mechanism neural network performs attention calculation. The output of the attention mechanism neural network is input into the feedforward neural network for processing, and the output aggregation function of the feedforward neural network is T i The second eigenvector t′ i . Further, calculate the first eigenvector x of the historical query information i and the aggregate function T iThe second eigenvector t′ i The inner product of i Query results <x i ,t′ i >.
[0176] Furthermore, according to the first feature vector x of the historical query information i Update the embedding vector of the corresponding query node; according to the aggregation function T i The second eigenvector t′ i Update aggregate function T i The embedding vector of the corresponding task node, the updated aggregation function T i The embedding vector of the corresponding task node is t′ i .
[0177] use Indicates that the aggregation function T is completed after training i The embedding vector of the corresponding task node, when performing online approximate query, the query set input by the attention mechanism neural network in the graph processing module is the one containing the aggregation function T i The embedding vector of the corresponding node The key set and value set contain the aggregate function T i Corresponding task node (embedding vector is ) The embedded vectors (after training) of all neighbor nodes connected to it and the first eigenvector x of the historical query information i .
[0178] The method of this embodiment decouples the query conditions of the query information and each aggregation function by constructing a relationship graph between the query conditions and the aggregation function; based on a large amount of historical query information and historical query results in the database, the historical query conditions of the data to be queried and the historical query information are encoded to obtain a set of data state vectors and connection coding vectors corresponding to the historical query information; through the query processing model, the data state vectors and connection coding vectors corresponding to each historical query information are encoded to obtain the first feature vector of the historical query information, which integrates the information of the query conditions in the data to be queried and the historical query information in the database. The first feature vector of the historical query information is used as the embedding vector of the corresponding query node, which can improve the quality of the embedding vector of the query node; further, graph representation learning is performed based on the first feature vector of the historical query information and the relationship graph. Through graph representation learning, the neighborhood information of the nodes corresponding to each aggregation function can be aggregated into the aggregation node. At the node corresponding to the aggregation function, a high-quality second eigenvector of the aggregation function is obtained, and the second eigenvector of the aggregation function contained in the historical query information is obtained. According to the second eigenvector of each aggregation function contained in the historical query information, the embedding vector of the node corresponding to each aggregation function in the relationship graph is updated, which can improve the quality of the embedding vector of the node corresponding to the aggregation function; further, according to the first eigenvector of the historical query information and the second eigenvector of each aggregation function contained in the historical query information, the query results of each aggregation function contained in the historical query information are determined, and according to the query results of each aggregation function contained in the historical query information and the historical query results of the historical query information, the parameters of the query processing model are trained, which can improve the accuracy and efficiency of the query processing model for approximate query processing, and support approximate query processing of query information containing multiple aggregation functions and containing connections, especially for query information containing connections, the efficiency of approximate query processing can be greatly improved.
[0179] The approximate query processing method provided in this application effectively utilizes both the underlying data and the SQL query in the database, achieving both data-driven and query-driven performance. By introducing an attention mechanism into the encoding module and graph processing module used for approximate query processing, it can discover the intrinsic connections between the SQL query and the underlying data in the database, as well as the intrinsic connections between aggregation functions and between aggregation functions and the underlying data, enabling more accurate approximate query processing. Furthermore, by constructing a relationship graph between query conditions and aggregation functions, the query conditions of the SQL query and each aggregation function are decoupled, supporting approximate query processing for SQL queries containing multiple aggregation functions.
[0180] Figure 11 This is a complete interactive flow chart of information query provided by an exemplary embodiment of this application. Figure 11 As shown, the specific steps of this method are as follows:
[0181] Step S1101: The client device sends an approximate query request to the server. The approximate query request includes query information for a given database, and the query information includes at least one aggregation function.
[0182] In this embodiment, the end-side device may be an electronic device running a downstream system such as a database management system or a data analysis system. When an approximate query is required, the end-side device sends an approximate query request to the server. The approximate query request includes query information to be processed, and the query information includes at least one aggregation function.
[0183] The query information to be processed refers to the SQL statement to be executed generated based on the user's query request and input information. Specifically, it can be implemented by using the existing method of dynamically generating SQL statements based on conditions provided by the user, which is not specifically limited here.
[0184] Step S1102: The server receives the approximate query request sent by the terminal device and obtains query information to be processed.
[0185] The server receives the approximate query request sent by the terminal-side device and extracts query information to be processed from the approximate query request.
[0186] Step S1103: The server encodes the data to be queried and the query conditions of the query information to obtain a data state vector set and a connection encoding vector.
[0187] The specific implementation principle and technical effects of this step can be found in the relevant content of the aforementioned step S202, which will not be repeated here.
[0188] Step S1104: The server encodes the data state vector set and the connection coding vector through a pre-trained query processing model to obtain the first eigenvector of the query information, and performs graph representation learning based on the first eigenvector of the query information and the relationship graph between the query condition and the aggregation function to determine the second eigenvector of at least one aggregation function.
[0189] The specific implementation principle and technical effects of this step can be found in the relevant content of the aforementioned step S203, which will not be repeated here.
[0190] Step S1105: The server determines the query result of each aggregation function based on the first eigenvector of the query information and the second eigenvector of each aggregation function.
[0191] The specific implementation principle and technical effects of this step can be found in the relevant content of the aforementioned step S204, which will not be repeated here.
[0192] Step S1106: The server sends the query results of each aggregation function included in the query information to the end-side device.
[0193] After obtaining the query results of each aggregation function included in the query information, the server may send the query results of each aggregation function included in the query information to the end-side device.
[0194] Step S1107: The terminal device receives the query results of each aggregation function contained in the query information sent by the server.
[0195] After receiving the query results of each aggregation function contained in the query information sent by the server, the terminal-side device can output the query results of each aggregation function contained in the query information to the user.
[0196] Optionally, the terminal-side device may output the query results of each aggregation function included in the query information through a front-end visualization interface for user viewing and reference.
[0197] Optionally, the end-side device may output the query results of each aggregation function included in the query information to the designated device in a pre-configured output manner. For example, the query results of each aggregation function included in the query information may be returned to the designated user device.
[0198] The specific implementation principle and technical effects of this embodiment can be found in the above embodiments and will not be repeated here.
[0199] Figure 12 This is a flow chart of an information query method provided by an exemplary embodiment of the present application. Figure 12 As shown, the specific steps of this method are as follows:
[0200] Step S1201: A data analysis request sent by a receiving device, where the data analysis request includes an SQL query statement to be executed, and the SQL query statement includes at least one aggregate function.
[0201] In this embodiment, the end-side device may be an electronic device running a downstream system such as a database management system or a data analysis system. When the end-side device runs a downstream system such as a database management system or a data analysis system and needs to perform approximate query processing during data analysis, it sends a data analysis request to the server. The data analysis request includes an SQL query statement to be executed, and the SQL query statement includes at least one aggregate function.
[0202] It should be noted that a data analysis request may include one or more SQL query statements to be executed, and the server performs subsequent processing on each SQL query statement and obtains approximate query results for each SQL query statement, specifically including the query results of each aggregate function contained in the SQL query statement.
[0203] The server receives the data analysis request sent by the end-side device and extracts the SQL query statement to be executed from the data analysis request.
[0204] Step S1202: Encode the data to be queried and the query conditions of the SQL query statement to obtain a data state vector set and a connection encoding vector.
[0205] In this embodiment, the SQL query statement is the query information to be processed. The specific implementation principle and technical effect of this step can be found in the relevant content of the aforementioned step S202, which will not be repeated here.
[0206] Step S1203: Encode the data state vector set and the connection encoding vector through the query processing model to obtain the first eigenvector of the SQL query statement, and perform graph representation learning based on the pre-constructed relationship graph between the query condition and the aggregation function and the first eigenvector of the SQL query statement to determine the second eigenvector of at least one aggregation function.
[0207] The specific implementation principle and technical effects of this step can be found in the relevant content of the aforementioned step S203, which will not be repeated here.
[0208] Step S1204: Determine the query results of each aggregation function included in the SQL query statement based on the first eigenvector of the SQL query statement and the second eigenvector of each aggregation function, and obtain a data analysis result.
[0209] The specific implementation principle and technical effects of this step can be found in the relevant content of the aforementioned step S204, which will not be repeated here.
[0210] Step S1205: Output the data analysis results to the end-side device.
[0211] After obtaining the data analysis results, the server can send the data analysis results to the end-side device. The data analysis results include the approximate query results of the SQL query statement to be executed, that is, the approximate query results of each aggregation function included in the SQL query statement.
[0212] After receiving the data analysis results sent by the server, the terminal device can output the data analysis results to the user.
[0213] Optionally, the end-side device can output data analysis results through a front-end visualization interface for user viewing and reference.
[0214] Optionally, the end-side device may output the data analysis result to a designated device in a pre-configured output manner, for example, returning the data analysis result to a designated user device.
[0215] The specific implementation principle and technical effects of this embodiment can be found in the above embodiments and will not be repeated here.
[0216] Figure 13 This is a schematic diagram of the structure of a server provided in an embodiment of the present application. Figure 13 As shown, the server includes: memory 1301 and processor 1302. Memory 1301 is used to store computer-executable instructions and can be configured to store various other data to support operations on the server. Processor 1302 is communicatively connected to memory 1301 and is used to execute the computer-executable instructions stored in memory 1301 to implement the technical solutions provided by any of the above-mentioned method embodiments. The specific functions and technical effects achieved are similar and will not be further described here.
[0217] Optional, such as Figure 13 As shown, the server also includes: a firewall 1303, a load balancer 1304, a communication component 1305, a power supply component 1306 and other components. Figure 13 Only some components are shown schematically, which does not mean that the server only includes Figure 13 Components shown. Figure 13 The server is only taken as a cloud server deployed in the cloud as an example for exemplary description. The server can also be deployed locally, and this embodiment is not specifically limited here.
[0218] An embodiment of the present application also provides a computer-readable storage medium, which stores computer-executable instructions. When a processor executes the computer-executable instructions, the method of any of the aforementioned embodiments is implemented. The specific functions and technical effects that can be achieved are not repeated here.
[0219] The present application also provides a computer program product, including a computer program. When executed by a processor, the computer program implements the method of any of the aforementioned embodiments. The computer program is stored in a readable storage medium. At least one processor of a server can read the computer program from the readable storage medium. The at least one processor executes the computer program, causing the server to perform the technical solution provided by any of the aforementioned method embodiments. The specific functions and technical effects achieved are not further described here.
[0220] The present application provides a chip comprising: a processing module and a communication interface. The processing module is capable of executing the technical solution of the server in the aforementioned method embodiments. Optionally, the chip further comprises a storage module (e.g., a memory) configured to store instructions, and the processing module configured to execute the instructions stored in the storage module. Execution of the instructions stored in the storage module causes the processing module to execute the technical solution provided by any of the aforementioned method embodiments.
[0221] The above-mentioned integrated module implemented in the form of a software functional module can be stored in a computer-readable storage medium. The above-mentioned software functional module is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform some steps of the methods of various embodiments of the present application.
[0222] It should be understood that the above-mentioned processor can be a processing unit (Central Processing Unit, referred to as CPU), or it can be other general-purpose processors, digital signal processors (Digital Signal Processor, referred to as DSP), application specific integrated circuits (Application Specific Integrated Circuit, referred to as ASIC), etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the application can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor. The memory may include high-speed random access memory (Random Access Memory, referred to as RAM), and may also include non-volatile storage, such as at least one disk storage, and can also be a USB flash drive, a mobile hard disk, a read-only memory, a disk or an optical disk, etc.
[0223] The above storage may be an object storage service (OSS).
[0224] The above-mentioned memory can be implemented by any type of volatile or non-volatile memory 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.
[0225] The above-mentioned communication component is configured to facilitate wired or wireless communication between the device where the communication component is located and other devices. The device where the communication component is located can access a wireless network based on a communication standard, such as a mobile hotspot (WiFi), a second-generation mobile communication system (2G), a third-generation mobile communication system (3G), a fourth-generation mobile communication system (4G) / Long Term Evolution (LTE), a fifth-generation mobile communication system (5G) and other mobile communication networks, or a combination thereof. In an exemplary embodiment, the communication component 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 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 technology, ultra-wide band (UWB) technology, Bluetooth technology and other technologies.
[0226] The power supply assembly provides power to various components of the device in which the power supply assembly is located. The power supply assembly may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device in which the power supply assembly is located.
[0227] The storage medium may be implemented by any type of volatile or non-volatile memory 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 storage, flash memory, magnetic disk, or optical disk. The storage medium may be any available medium that can be accessed by a general-purpose or special-purpose computer.
[0228] An exemplary storage medium is coupled to a processor, such that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be an integral part of the processor. The processor and storage medium can be located in an application-specific integrated circuit. Of course, the processor and storage medium can also exist as discrete components in an electronic device or a host control device.
[0229] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.
[0230] The order of the above-mentioned embodiments of the present application is for description only and does not represent the advantages and disadvantages of the embodiments. In addition, in some of the processes described in the above-mentioned embodiments and the accompanying drawings, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or in parallel. They are only used to distinguish between different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., do not represent the order of precedence, and do not limit "first" and "second" to different types. The meaning of "multiple" is more than two, unless otherwise clearly and specifically defined.
[0231] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods of each embodiment of the present application.
[0232] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present invention that follow the general principles of this application and include common knowledge or customary techniques in the art that are not disclosed herein.
[0233] The above are only preferred embodiments of the present application and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. An information query method, characterized in that: include: Obtaining query information to be processed, where the query information includes at least one aggregation function; Encoding the data to be queried and the query conditions of the query information to obtain a data state vector set and a connection coding vector; Encoding the data state vector set and the connection encoding vector through a query processing model to obtain a first eigenvector of the query information, and performing graph representation learning based on a pre-constructed graph of the relationship between query conditions and aggregation functions and the first eigenvector of the query information to determine a second eigenvector of the at least one aggregation function; The query result of each aggregation function is determined according to the first feature vector of the query information and the second feature vector of each aggregation function.
2. The method according to claim 1, characterized in that The data to be queried and the query conditions of the query information are encoded to obtain a data state vector set and a connection encoding vector, including: Based on the filter predicate in the query condition of the query information, the data of the corresponding field in the database to be queried is filtered to obtain relevant data of the corresponding field, and the relevant data of the field not filtered includes all data of the corresponding field; Convert the relevant data of each field in the database into a data state vector, and the obtained data state vectors of each field constitute a data state vector set; The join predicates in the query condition are encoded into a join encoding vector.
3. The method according to claim 1, characterized in that The query processing model includes an encoding module and a graph processing module. The query processing model encodes the data state vector set and the connection encoding vector to obtain a first feature vector of the query information, and performs graph representation learning based on a pre-constructed relationship graph between query conditions and aggregation functions and the first feature vector of the query information to determine a second feature vector of the at least one aggregation function, including: Encoding the data state vector set and the connection encoding vector by the encoding module to obtain a first feature vector of the query information; Through the graph processing module, based on the first feature vector of the query information and the relationship graph between the query condition and the aggregation function, graph representation learning is performed on the nodes corresponding to each aggregation function contained in the query information to obtain the embedded vector of each aggregation function.
4. The method according to claim 3, characterized in that The encoding module includes a self-attention mechanism submodule and a cross-attention mechanism submodule. The encoding module encodes the data state vector set and the connection encoding vector to obtain the first feature vector of the query information, including: Performing self-attention calculation on the data state vector set through the self-attention mechanism submodule to obtain a data encoding vector set; Through the cross-attention mechanism sub-module, the data encoding vector set is used as the input key set and value set, and the set containing the connection encoding vector is used as the input query set, and cross-attention calculation is performed to obtain the first feature vector of the query information.
5. The method according to claim 3, characterized in that The graph processing module performs graph representation learning on nodes corresponding to each aggregation function included in the query information according to the first feature vector of the query information and the relationship graph between the query condition and the aggregation function to obtain an embedding vector of each aggregation function, including: Based on a pre-built relationship graph between query conditions and aggregation functions, determining a corresponding node of the aggregation function included in the query information in the relationship graph; Through the graph processing module, a key set and a value set are constructed based on the embedding vectors of the neighboring nodes connected to the corresponding node in the relationship graph and the first eigenvector of the query information, and the set containing the embedding vectors of the corresponding nodes is used as the query set to perform attention calculation to obtain the second eigenvector of each aggregation function.
6. The method according to claim 1, characterized in that Determining the query result of each aggregation function according to the first feature vector of the query information and the second feature vector of each aggregation function includes: The inner product of the first eigenvector of the query information and the second eigenvector of each of the aggregation functions is calculated to obtain the query result of each of the aggregation functions.
7. The method according to claim 1, characterized in that Also includes: Based on the historical query information of the database to be queried, a relationship diagram between query conditions and aggregate functions is constructed; Based on the historical query information and historical query results of the database and the relationship graph, a query processing model for approximate query processing is trained, and an embedding vector of an aggregation function in the relationship graph is updated.
8. The method according to claim 7, characterized in that The step of constructing a relationship diagram between query conditions and aggregate functions based on historical query information of the database includes: Based on the historical query conditions in the historical query information, construct a query node corresponding to the historical query condition and initialize an embedding vector of the query node, where one query node represents one historical query condition; Construct task nodes corresponding to various aggregation functions and initialize the embedding vectors of task nodes. One task node represents one type of aggregation function. An edge is established between any two different task nodes, and an edge is established between a query node corresponding to a query condition contained in any historical query information and a task node corresponding to an aggregation function contained in the same historical query information, to obtain a relationship graph between the query condition and the aggregation function.
9. The method according to claim 7, characterized in that The step of training a query processing model for approximate query processing based on historical query information and historical query results of the database and the relationship graph, and updating an embedding vector of an aggregation function in the relationship graph, includes: Encode the data to be queried and the historical query conditions of the historical query information to obtain a data state vector set and a connection encoding vector corresponding to the historical query information; Encoding the data state vector and the connection encoding vector corresponding to each historical query information using the query processing model to obtain a first eigenvector of the historical query information; performing graph representation learning based on the first eigenvector of the historical query information and the relationship graph to determine a second eigenvector of the aggregation function contained in the historical query information; Updating the embedding vector of the corresponding query node in the relationship graph according to the first eigenvector of the historical query information, and updating the embedding vector of the task node corresponding to each aggregation function in the relationship graph according to the second eigenvector of each aggregation function included in the historical query information; Determining query results of each aggregation function included in the historical query information according to the first feature vector of the historical query information and the second feature vector of each aggregation function included in the historical query information; The parameters of the query processing model are adjusted according to the query results of each aggregation function contained in the historical query information and the historical query results of the historical query information.
10. The method according to any one of claims 1 to 9, characterized in that The obtaining of query information to be processed includes: The approximate query request sent by the receiving end-side device includes query information.
11. The method according to claim 10, characterized in that After determining the query result of each aggregation function according to the first feature vector of the query information and the second feature vector of each aggregation function, the method further includes: Send the query results of each of the aggregation functions to the end-side device.
12. An information query method, characterized in that: include: A data analysis request sent by a receiving end-side device, wherein the data analysis request includes an SQL query statement to be executed, and the SQL query statement includes at least one aggregate function; Encode the data to be queried and the query conditions of the SQL query statement to obtain a data state vector set and a connection encoding vector; Encoding the data state vector set and the connection encoding vector through a query processing model to obtain a first eigenvector of the SQL query statement, and performing graph representation learning based on a pre-constructed graph of relationships between query conditions and aggregate functions and the first eigenvector of the SQL query statement to determine a second eigenvector of the at least one aggregate function; Determine the query results of each of the aggregation functions included in the SQL query statement according to the first feature vector of the SQL query statement and the second feature vector of each of the aggregation functions, and obtain a data analysis result; Output the data analysis result to the end-side device.
13. The method according to claim 12, characterized in that The query processing model includes an encoding module and a graph processing module. The query processing model encodes the data state vector set and the connection encoding vector to obtain a first feature vector of the SQL query statement, and performs graph representation learning based on a pre-constructed relationship graph between query conditions and aggregate functions and the first feature vector of the SQL query statement to determine a second feature vector of the at least one aggregate function, including: Encoding the data state vector set and the connection encoding vector by the encoding module to obtain a first feature vector of the SQL query statement; Through the graph processing module, based on the first feature vector of the SQL query statement and the relationship graph between the query condition and the aggregation function, graph representation learning is performed on the nodes corresponding to each aggregation function contained in the SQL query statement to obtain the embedded vector of each aggregation function.
14. A server, characterized in that: include: at least one processor; as well as a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the server to execute the method according to any one of claims 1 to 13.
15. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, and when a processor executes the computer-executable instructions, the method according to any one of claims 1 to 13 is implemented.
16. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 13 is implemented.