Query task scheduler training method and related device

Through the query task scheduler training method, a query simulator is used to simulate database operations, execution log information is obtained, and the scheduling strategy is determined. A query task scheduler is trained that does not require intrusion into the database management system, which solves the problem of insufficient applicability in the existing technology and improves the query task processing efficiency.

CN120670094APending Publication Date: 2025-09-19HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410308892.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-18
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

The existing technology requires deploying a scheduling algorithm in the database management system, resulting in low applicability and requiring modification of the underlying kernel code, which affects the normal operation of the database management system.

Method used

Through the query task scheduler training method, a query simulator is used to simulate the query operation of the database management system, the execution log information is obtained, the scheduling strategy of the unexecuted query tasks is determined, and the strategy is adjusted through the reward function. A query task scheduler is trained that does not require intrusion into the database management system.

Benefits of technology

It realizes query task scheduling without modifying the internal code of the database management system. It is applicable to various databases, improves the efficiency of processing batch query tasks, reduces data reading time, and has strong applicability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120670094A_ABST
    Figure CN120670094A_ABST
Patent Text Reader

Abstract

The invention provides a query task scheduler training method and a related device, and relates to the field of databases, and the query task scheduler training method comprises the following steps: determining a query representation of a query task which is not executed according to execution log information of an executed query task; determining a scheduling strategy according to the query representation of the query task which is not executed; according to the scheduling strategy, scheduling the query tasks which are not executed to a query simulator, so that the query simulator determines the duration consumed by execution of each query task in the query tasks which are not executed; calculating a reward function according to the time consumed for executing each query task; and according to the reward function, adjusting a scheduling strategy until a trained task scheduler is obtained. According to the training method of the query task scheduler, the query task scheduler obtained through training is used for task scheduling without invading the interior of a database management system, and the method can be suitable for various databases and is high in applicability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of databases, and in particular to a query task scheduler training method and related devices. Background Art

[0002] For some large enterprises, extracting operational data from within the enterprise to analyze current operations and then formulate operational decisions based on these conditions is a key technical approach to improving operational management. This approach is achieved by periodically querying and analyzing large amounts of operational data. Specifically, the database server storing the operational data retrieves certain operational data that meets certain criteria, and then schedules and analyzes this data.

[0003] Currently, the scheduling and analysis of operational data are implemented in a database management system. The scheduling algorithm is deployed in the database management system. The database management system queries for operational data that meets the conditions based on user needs, and then schedules these operational data to multiple processes or multiple connections, and analyzes these operational data through multiple processes or multiple connections.

[0004] However, this method requires deploying the scheduling algorithm in the database management system and modifying the underlying kernel code of the database management system. For example, the operators in the database management system need to be redesigned to meet the query operations of the database management system. This method has limited applicability. Summary of the Invention

[0005] The present application provides a query task scheduler training method and related devices. The trained query task scheduler is used to schedule tasks without intruding into the database management system. It can be applied to various databases and has strong applicability.

[0006] In a first aspect, the present application provides a query task scheduler training method, wherein multiple connections are established between the query task scheduler and a query simulator, and the query simulator is used to simulate the process of executing query operations by a database management system, including:

[0007] Obtaining execution log information of executed query tasks in a batch query task in real time, the execution log information including one or more of the number of connections established on the query simulator, configuration parameters on each connection of the query simulator, on which connection of the query simulator each query task is executed, the execution time of each query task, and which query tasks are executed in parallel;

[0008] Determine the query representation of the unexecuted query task based on the execution log information of the executed query task obtained in real time;

[0009] determining a scheduling strategy for the unexecuted query task according to the query representation of the unexecuted query task;

[0010] According to the scheduling strategy, the unexecuted query tasks are scheduled to the query simulator, so that the query simulator determines the execution time of each query task in the unexecuted query tasks;

[0011] The reward function is calculated based on the execution time of each query task and the total execution time of each query task in the batch query task. The reward function is used to guide the scheduling direction.

[0012] According to the reward function, the scheduling strategy is adjusted until a trained task scheduler is obtained.

[0013] The present application provides a method for training a query task scheduler. The query task scheduler trained using the method provided by the present application does not need to invade the database management system, does not need to modify its internal underlying code, and does not affect the existing database management system. The query task scheduler trained by the present application can be independently deployed and is applicable to any form of database, with strong applicability. During the training process of the query task scheduler, a query simulator is used to predict the time consumed when each query task is executed, instead of using the database management system to execute the query task. Compared to using the database management system to execute the query task, the query simulator directly determines the time consumed when the query task is executed based on the query representation of each query task, reducing the time it takes to read data from the database disk to the memory, improving the efficiency of processing batch query tasks, and saving the time of batch query tasks.

[0014] Based on the first aspect, in a possible implementation method, the query representation of the query task that has not been executed is determined according to the execution log information of the query task that has been executed, including: performing feature extraction on the query task that has not been executed according to the query execution plan to obtain the feature vector of each query task in the query task that has not been executed; obtaining the query representation of each query task in the query task that has not been executed according to the execution log information of the query task that has been executed and the feature vector of each query task in the query task that has not been executed.

[0015] Each query task's query representation includes environmental information. The execution log information of executed query tasks can influence the query representations of unexecuted query tasks. The query task scheduler training device can learn some prior knowledge from the execution log information of executed query tasks and apply it to the query representations of unexecuted query tasks. Determining the query representations of unexecuted query tasks based on the execution log information of executed query tasks can improve the training efficiency of the query task scheduler.

[0016] Based on the first aspect, in a possible implementation, determining a scheduling strategy for the unexecuted query task according to the query representation of the unexecuted query task includes:

[0017] Determine the probability of scheduling each of the unexecuted query tasks to the query simulator based on the query representations of the unexecuted query tasks; and schedule the query task with the highest probability and the corresponding query representation to an idle connection of the query simulator;

[0018] When the next connection of the query simulator is idle, the probability of scheduling each of the unexecuted query tasks to the query simulator is determined again based on the query representation of the unexecuted query tasks; the query task with the highest probability and the corresponding query representation are scheduled to the next idle connection of the query simulator.

[0019] Multiple connections are established on the query simulator, and query tasks on multiple connections can be executed in parallel, improving the processing efficiency of batch query tasks.

[0020] Based on the first aspect, in a possible implementation, the method further includes:

[0021] Clustering batch query tasks based on similarity to obtain multiple classes, each of which includes multiple query tasks;

[0022] The multiple query tasks included in each class are dispatched to the multiple connections of the query simulator, so that the multiple query tasks included in each class are executed in parallel on the multiple connections of the query simulator.

[0023] By clustering, query tasks are processed at the granularity of classes, significantly reducing the search space for scheduling policies. Without clustering, the search space for scheduling policies would require determining which query task to schedule to the query simulator for multiple query tasks. In the next round, the remaining query tasks would also need to be determined. This would require as many determinations as there are query tasks, making the search space required for scheduling policies very large. By clustering multiple query tasks into multiple classes, we only need to determine which class's query tasks to schedule to the query simulator first. After scheduling the query tasks within a particular class, we then schedule multiple query tasks within that class to the query simulator. After the query simulator executes the query tasks within that class, we schedule the query tasks within another class to the query simulator in the next round. Clustering significantly reduces the search space required for scheduling policies.

[0024] In a second aspect, the present application provides a query task scheduler training device, wherein multiple connections are established between the query task scheduler and a query simulator, and the query simulator is used to simulate the process of executing query operations of a database management system, including:

[0025] An acquisition module is used to obtain in real time the execution log information of the query tasks that have been executed in the batch query tasks, the execution log information including one or more of the number of connections established on the query simulator, the configuration parameters on each connection of the query simulator, on which connection of the query simulator each query task is executed, the time consumed by each query task to be executed, and which query tasks are executed in parallel;

[0026] A query representation module is used to determine the query representation of the query task that has not been executed based on the execution log information of the query task that has been executed and obtained in real time;

[0027] a policy module, configured to determine a scheduling policy for the unexecuted query task based on a query representation of the unexecuted query task;

[0028] A scheduling module, configured to schedule unexecuted query tasks to a query simulator according to a scheduling policy, so that the query simulator can determine the execution time of each of the unexecuted query tasks;

[0029] The guidance module is used to calculate the reward function based on the execution time of each query task and the total execution time of each query task in the batch query task. The reward function is used to guide the scheduling direction;

[0030] The policy module is also used to adjust the scheduling policy according to the reward function until a trained task scheduler is obtained.

[0031] Based on the second aspect, in a possible implementation, the query representation module is configured to:

[0032] According to the query execution plan, feature extraction is performed on the unexecuted query tasks to obtain feature vectors of each query task in the unexecuted query tasks;

[0033] The query representation of each query task among the unexecuted query tasks is obtained according to the execution log information of the executed query tasks and the feature vector of each query task among the unexecuted query tasks.

[0034] Based on the second aspect, in a possible implementation, the policy module is used to:

[0035] Determine the probability of scheduling each of the unexecuted query tasks to the query simulator based on the query representations of the unexecuted query tasks; and schedule the query task with the highest probability and the corresponding query representation to an idle connection of the query simulator;

[0036] When the next connection of the query simulator is idle, the probability of scheduling each of the unexecuted query tasks to the query simulator is determined again based on the query representation of the unexecuted query tasks; the query task with the highest probability and the corresponding query representation are scheduled to the next idle connection of the query simulator.

[0037] Based on the second aspect, in a possible implementation, the device also includes a clustering module, which is used to cluster batch query tasks according to similarity to obtain multiple classes, and each of the multiple classes includes multiple query tasks; the scheduling module is used to schedule the multiple query tasks included in each class to multiple connections of the query simulator, so that the multiple query tasks included in each class are executed in parallel on the multiple connections of the query simulator.

[0038] The functional modules of the second aspect are used to implement the method described in the first aspect and any possible implementation manner of the first aspect.

[0039] In a third aspect, the present application provides a computing device cluster comprising at least one computing device, wherein the at least one computing device comprises a memory and a processor, and the processor in the at least one computing device is used to execute the method described in the first aspect and any possible implementation of the first aspect.

[0040] In a fourth aspect, the present application provides a computer storage medium comprising program instructions. When the program instructions are executed on a computing device cluster, the computing device cluster executes the method described in the first aspect and any possible implementation of the first aspect.

[0041] In a fifth aspect, the present application provides a system including a query task scheduler and a query simulator, wherein the query task scheduler is used to implement the method described in the first aspect and any possible implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 A schematic diagram of the system architecture provided for this application;

[0043] Figure 2 A schematic diagram of the overall system architecture provided for this application;

[0044] Figure 3 A flowchart of a query task scheduler training method provided in this application;

[0045] Figure 4 A schematic diagram of a network structure for determining query representation of unexecuted query tasks provided by this application;

[0046] Figure 5 A schematic diagram of the system architecture provided for this application;

[0047] Figure 6 A schematic diagram of the structure of a computing device provided in this application;

[0048] Figure 7 A schematic diagram of the structure of a computing device cluster provided in this application;

[0049] Figure 8 This is a structural diagram of another computing device cluster provided in this application. DETAILED DESCRIPTION

[0050] This application provides a system architecture, see Figure 1 , Figure 1 This is a schematic diagram of a system architecture provided in this application, which includes a query task scheduler training device, a database management system and a query simulator.

[0051] A database management system is used to manage and organize data in a database. Specifically, it is responsible for handling operations such as access, storage, management, and query of data in the database. The data in the database can be, for example, report data, operational data, etc.

[0052] The query simulation device is used to simulate the process of the database management system performing query operations. It can be used to simulate the database management system to perform query tasks and obtain output results.

[0053] A query task scheduler training device is used to train a query task scheduler. Specifically, the query task scheduler training device is used to receive a batch of query tasks, each of which includes multiple query tasks, process each query task in the batch, obtain a scheduling policy, and schedule each query task in the batch to a simulated query device or a database management system based on the scheduling policy. The simulated query device simulates the process of the database management system performing query operations on each query task, or the database management system performs query operations on each query task, obtains output results, and feeds the output results back to the query task scheduler training device. The query task scheduler training device adjusts the scheduling policy based on the output results and schedules each query task to the simulated query device or database management system based on the adjusted scheduling policy. The simulated query device again simulates the process of the database management system performing query operations on each query task, or the database management system performs query operations on each query task, obtains output results, and feeds the output results back to the query task scheduler training device. The query task scheduler training device adjusts the scheduling policy based on the output results. This cycle is repeated multiple times until a trained query task scheduler is obtained. The trained query task scheduler can be used to schedule batch query tasks.

[0054] Based on the above system architecture, this application provides a query task scheduler training method, which can be applied to a query task scheduler training device. Figure 2 and Figure 3 , Figure 2 A schematic diagram of the overall system architecture provided for this application. Figure 3 A flowchart of a query task scheduler training method provided in this application is shown below in conjunction with Figure 2 The schematic diagram describes the query task scheduler training method provided by this application, which includes but is not limited to the description below.

[0055] S101: Obtain batch query tasks.

[0056] The query task scheduler training device obtains batch query tasks, which include multiple query tasks. Each query task can be composed of select and where statements. For example, a query task can be to query the sum of "order quantity" and "order amount" in a table titled "Report 1" in the database. For another example, a query task can be to query the data with "id=113" and "id=2" in a table titled "Table 1" in the database. For another example, a query task can be to query all data with "year after 2000" in a table titled "Operational Data Table" in the database, and so on. Users can set batch query tasks according to actual needs.

[0057] S102 : performing feature extraction on each query task in the batch query task according to the query execution plan to obtain a feature vector of each query task.

[0058] A query execution plan is a detailed description of the sequence of instructions or algorithm generated by the database management system to execute a given query. The query execution plan shows how the database management system accesses and processes data to respond to the query and provides information about the various steps, operations, and access paths required to execute the query. In short, the query execution plan indicates how the database management system executes the query operation.

[0059] A query execution plan may include one or more of the following: operators, access methods, join types, filter conditions, sorting methods, data reading order, index usage, and execution order. Operators describe the various operations used by the database management system to execute a query, such as table scans, index lookups, joins, aggregations, and sorts. Access methods specify how the database management system accesses data, such as sequential scans, index scans, and hash joins. Join types describe how the database management system performs join operations, such as inner joins, outer joins, and cross joins. Filter conditions specify the filter conditions that the database management system needs to apply when executing a query to reduce the size of the result set. Sorting methods specify the algorithm and order used by the database management system when performing sorting operations. Index usage indicates whether the database management system uses indexes to speed up query execution and specifies the index types used. Execution order specifies the order in which the database management system executes the various steps of a query, as well as the dependencies between each step.

[0060] The query execution plan is obtained from the database management system by the query task scheduler training device.

[0061] The query task scheduler training device can also use the database management system to obtain data statistical information from the database server. The data statistical information includes the table data involved in each query task in the batch query task, which may include the table title, table size, number of rows and columns in the table, which fields in the table and other statistical information.

[0062] The query task scheduler training device extracts features of each query task in the batch query task according to the query execution plan and data statistical information, and obtains the feature vector of each query task.

[0063] This step can be done by Figure 2The query task scheduler training device executes the transformer network, which can be, for example, a transformer. In one example, the query task scheduler training device first generates a tree structure for each query task based on the query execution plan and data statistics, and encodes each node in the tree structure for each query task as a feature vector. The transformer network model is then used to aggregate the feature vectors of each node in each query execution plan to obtain a feature vector for each query task.

[0064] S103 : Obtain a query representation of each query task among the unexecuted query tasks according to the execution log information of the executed query tasks and the feature vector of each query task among the unexecuted query tasks.

[0065] The query simulator processes the query tasks scheduled by the query task scheduler training device to obtain execution log information. The execution log information of the executed query tasks is obtained by the query task scheduler training device from the query simulator or the database management system.

[0066] It should be noted that, at the initial stage, the query task scheduler training device has not yet executed the scheduling strategy, the query simulator has not yet received the query task, the query task that has been executed is empty, and the execution log information of the query task that has been executed is also empty. Therefore, at the initial stage, the query task scheduler training device directly processes the feature vector of each query task in the batch query task obtained in S102 to obtain the query representation of each query task. Compared with the feature vector of each query task in S102, the query representation of each query task includes the environmental information of the query task. The environmental information refers to the factors that affect the execution of the query task. The factors that affect the execution of the query task include, for example, execution parameters. When the environmental information (such as execution parameters) is different, the query representation of the query task is different, and the scheduling strategy determined later based on the query representation is different. For example, when the query representation of a query task includes environmental information 1 (for example, execution parameter 1), the query task is subsequently determined to be scheduled to the first connection of the query simulator based on the query representation. If the query representation of the query task includes environmental information 2 (for example, execution parameter 2), the query task is subsequently determined to be scheduled to the second connection of the query simulator based on the query representation. The second connection and the first connection are two different connections.

[0067] After the query task scheduler training device executes the scheduling strategy, the query simulator receives the query task. During the query simulator's execution of the query task, the query task scheduler training device can obtain the execution log information of the query task that has been executed from the query simulator. In one implementation, the query task scheduler training device processes batch query tasks in batches. For a batch of batch query tasks, the query task scheduler training device needs to undergo multiple rounds of reinforcement learning with the query simulator. After the query simulator completes a round of processing of a batch of batch query tasks, the query task scheduler training device obtains the execution log information of the query task of the batch in the round of reinforcement learning. Therefore, in this implementation, the query tasks that have been executed include a batch of batch query tasks, and the execution log information of the query tasks that have been executed includes the execution log information of each query task in the batch of batch query tasks in one round.

[0068] In another implementation, each time the query simulator completes a query task, the query task scheduler training device acquires execution log information, i.e., acquires execution log information for each query task in real time. In this implementation, the execution log information for executed query tasks includes the execution log information for completed query tasks within the batch of query tasks. The query task scheduler training device may also acquire execution log information in other ways, which are not limited in this application.

[0069] How the query task scheduler training device executes the scheduling strategy is not described in detail in this step. Please refer to the description of the relevant content of step S104.

[0070] In the present application, multiple connections are established between the query task scheduler training device and the query simulator, each connection can be used to receive a query request or process a query task, and multiple connections can be used to execute multiple query tasks in parallel. During actual operation, the query task scheduler training device can schedule multiple query tasks to multiple connections. For example, the query task scheduler training device obtains multiple query tasks (the number is greater than 20), and 20 connections are established between the query task scheduler training device and the query simulator. Initially, the query task scheduler training device schedules the 20 query tasks to the 20 connections, so that each connection processes one query task, wherein the 20 connections of the query simulator process these 20 query tasks in parallel. When the query task on one of the connections of the query simulator is processed, the query task scheduler training device selects another query task to schedule to this connection of the query simulator, and this connection processes a new query task; when the query task on another connection of the query simulator is processed, the query task scheduler training device selects another query task to schedule to this connection of the query simulator, and this connection processes a new query task... and so on.

[0071] One or more processes can run on a connection of the query simulator, and the one or more processes on this connection jointly process the query tasks on this connection.

[0072] The execution log information of the query tasks that have been executed includes one or more of the following: the number of connections established on the query simulator, the configuration parameters on each connection of the query simulator, on which connection of the query simulator each query task is executed, the time consumed by each query task to be executed, and which query tasks are executed in parallel. Among them, the configuration parameters on each connection of the query simulator include, for example, the number of processes running on each connection of the query simulator. Optionally, the configuration parameters on each connection may also include the size of computing power resources and memory resources allocated to each connection by the computing device where the query simulator is located. The computing power resources may include, for example, central processing unit resources and / or graphics card resources. The time consumed by each query task to be executed can be directly calculated by the query simulator based on the query representation of each query task, or the query simulator can calculate the time when the query task is completed based on the query representation, and calculate the time consumed by the query task to be executed based on the time when the execution is completed and the time when the execution starts. The query tasks being executed in parallel refer to multiple query tasks being executed on multiple connections of the query simulator at the same time, for example, 20 query tasks being executed on 20 connections at the same time.

[0073] After the query simulator executes the query task, the query task scheduler training device obtains the query representation of each query task in the unexecuted query task based on the execution log information of the executed query task and the feature vector of each query task in the unexecuted query task. In one implementation, the executed query task includes a batch of batch query tasks, and the execution log information of the executed query task includes the execution log information of each query task in the batch query task in one round. Then, the unexecuted query task also includes the batch query tasks of this batch, that is, based on the execution log information of each query task in the batch query task in the previous round and the feature vector of each query task, the query representation of each query task in the batch is determined. In another implementation, the executed query task includes the query task in the batch query task that has been completed. Then, the unexecuted query task includes the remaining query tasks in the batch query task except the query task that has been executed.

[0074] It is understood that the query representation includes environmental information, and the content of the execution log information of the executed query task can affect the query representation of the query task. For example, the execution log information such as which connection query task 1 was executed on in the previous round, the duration of execution on this connection, and the number of processes running on this connection can affect the query representation of query task 1 in the next round. If the parameters representing the environmental information in the query representation change, the subsequent scheduling strategy determined based on the query representation will be different. For example, if query task 1 and query task 2 are query tasks of the same or similar type, for example, query task 1 is "total order volume in 2000" and query task 2 is "total order volume in 2001", the query representation of the unexecuted query task 2 can be determined based on the execution log information of the executed query task 1. That is, when determining the query representation of query task 2, the execution log information of query task 1 can be referenced, such as the duration of execution of query task 1 and the number of processes running on the connection where query task 1 is located.

[0075] This step can be done by Figure 2In this paper, an attention-based state representation network is implemented. The attention-based state representation network determines the query representations of unexecuted query tasks based on the execution logs of executed query tasks. The attention-based state representation network includes multiple multilayer perceptrons (MLPs) and a multi-head attention mechanism network. An MLP consists of multiple layers, each containing multiple neurons, each connected to all neurons in the previous layer. By performing nonlinear transformations at different layers, the MLP can capture the complex relationships between executed query tasks and unexecuted query tasks, as well as between unexecuted query tasks. The multiple feature sequences output by the MLP are input into the multi-head attention mechanism network. The attention mechanism emphasizes different parts of the input feature sequence to achieve better representation. The multi-head attention mechanism extends the attention mechanism by introducing multiple attention heads, each representing multiple sets of weight parameters, to concurrently learn different focus points within multiple feature sequences, thereby more comprehensively capturing the information of multiple feature sequences. Based on the execution log information of the executed query tasks, the query representation of each unexecuted query task is determined through a combination of a multi-layer perceptron and a multi-head attention mechanism network. The query representation can be regarded as an abstract, high-dimensional representation of the query task, capturing the key features of each query task.

[0076] See also Figure 4 , Figure 4 A schematic diagram of a network structure for determining query representation of unexecuted query tasks provided by this application. Figure 4 In the

[15] , multiple query tasks are input into the transformer network, which extracts features from each query task and obtains a feature vector for each query task. The feature vectors of each query task are then input into the attention-based state representation network to obtain the query representation for each query task. The attention-based state representation network is shown in the dashed box. The feature vectors of each query task are first combined with the execution log information of the executed query task, then passed through a multi-layer perceptron. Finally, they are input into the multi-head attention mechanism network together with the global vector of the batch query task, resulting in an intermediate representation for each query task and an intermediate representation for the global vector. The intermediate representation of each query task is then combined with the intermediate representation of the global vector and the execution log information of the executed query task, and then passed through a multi-layer perceptron to obtain the query representation for each query task. The global vector of the batch query task represents the overall execution state information of the batch query task and can be calculated using the average pooling layer.

[0077] S104: Determine a scheduling strategy for the unexecuted query task according to the query representation of the unexecuted query task.

[0078] S105 . According to the scheduling policy, the unexecuted query tasks are scheduled to the query simulator, so that the query simulator determines the execution time of each of the unexecuted query tasks.

[0079] Initially, the query task scheduler training device has not yet determined a scheduling strategy and has not yet scheduled any query tasks to the query simulator. Therefore, no query tasks are currently being executed on the query simulator. The query task scheduler training device then schedules multiple query tasks in the batch query task to multiple connections of the query simulator based on the query representations of the individual queries in the batch query task. There is a one-to-one correspondence between the multiple query tasks and the multiple connections of the query simulator. For example, if there are 20 connections on the query simulator, the 20 query tasks in the batch query task are scheduled to the 20 connections, so that each connection processes one query task.

[0080] Subsequently, whenever the query task processing on a connection of the query simulator is completed, the query task scheduler training device again calculates the probability of scheduling each query task to the query simulator based on the query representation of each query task in the unexecuted query tasks, and then schedules the query task with the highest probability and the query representation of the query task to the idle connection of the query simulator, so that the query simulator processes the query task according to the query representation; when the query task processing on another connection of the query simulator is completed, the query task scheduler training device again calculates the probability of scheduling each query task to the query simulator based on the query representation of each query task in the remaining unexecuted query tasks, and then schedules the query task with the highest probability and the query representation of the query task to the idle connection of the query simulator, so that the query simulator processes the query task according to the query representation. Among them, the query representation of the unexecuted query task is determined by S103, that is, it is determined based on the execution log information of the executed query task. When the executed query task changes, the execution log information of the executed query task changes, and the query representation of the unexecuted query task may change. For details, please refer to the description of the relevant content in the above S103.

[0081] After receiving a query task, the query simulator simulates the database management system's query execution process and processes the query task. Specifically, based on the query task's query representation, the query simulator can predict / calculate which query task among multiple concurrent queries will complete first and when, and output the result. Alternatively, the query simulator can predict / calculate the duration of the query task that completes first and output the result.

[0082] Step S104 can be performed by Figure 2 Policy network execution in .

[0083] S106. Calculate a reward function based on the execution time of each query task and the total execution time of each query task in the batch query task. The reward function is used to guide the scheduling direction.

[0084] The query simulator processes each query task and can predict / calculate the end time of each query task. Based on the start and end times of each query task, the execution time of each query task can be determined. Alternatively, the query simulator can directly predict and output the execution time of each query task. After each query task in a batch of query tasks has been processed for one round, the query task scheduler training device obtains the execution time of each query task in that round and the total execution time of all query tasks in the batch.

[0085] The query task scheduler training device calculates a reward function based on the time consumed for all query tasks in the batch query task to complete a round of execution and the time consumed for each query task to be executed. The reward function is used to guide the query task scheduler training device to strengthen learning, that is, to guide the scheduling direction and influence the scheduling strategy.

[0086] The query task scheduler training device is equipped with a local reward function and a global reward function. The local reward function is the weighted sum of the relative execution time of all currently executed query tasks, where the relative execution time of the query task = the average execution time of the query task in the historical round of queries / the time consumed by the current round of execution. The local reward function is used to tend to reduce the time consumed by large query tasks. The global reward function is formulated based on the overall execution time of the batch query tasks in this round, and is corrected by the benchmark value to avoid excessive punishment of the scheduling action at the end. The local reward function and the global reward function are designed as follows:

[0087]

[0088] The upper part of the above formula is the local reward function, and the lower part is the global reward function. Among them, C is the scaling factor of the local reward function. The value of C can be set by the user based on experience, usually 0.01. t represents the deadline, n is the number of query tasks executed at the deadline t, and m is the number of query task executions in the historical execution record. Indicates the execution time of query task i in this round of scheduling, Indicates the execution time of query task i in the jth round of scheduling, It represents the average time consumed by query task i in m historical execution records, t t Indicates the total time consumed by all query tasks in the batch query task. Indicates the baseline value of the total duration consumed by all query tasks in the set batch query task. This baseline value is used to correct the global reward function.

[0089] This step can be done by Figure 2 The guided network in is executed, and the reward function is set in the guided network.

[0090] S107. Adjust the scheduling strategy according to the reward function until a trained task scheduler is obtained.

[0091] After a round of batch query tasks completes, the execution log information for each query task in that round is obtained. In the next round of reinforcement learning, the query task scheduler training device uses the execution log information of each query task obtained in the previous round to re-represent each query task in the batch query task. Based on the new query representation and reward function, the probability of scheduling each query task to an idle connection of the query simulator is recalculated. The query task with the highest probability and its corresponding query representation are then scheduled to the query simulator, which then processes the query task.

[0092] Steps S101 to S107 above describe the processing of a batch of query tasks. Multiple rounds of batch query tasks are performed on a batch of query tasks, for example, until the total duration of the batch query reaches a threshold, or until a threshold number of iterative training rounds is reached. During actual training, multiple batches of query tasks need to be processed. Any batch from these multiple batches is processed according to the method described in steps S101 to S107, ultimately obtaining a trained task scheduler.

[0093] The trained task scheduler can be used to schedule batch query tasks, and the batch query tasks are dispatched to a database management system, and the database management system executes query operations on the query tasks.

[0094] Optionally, the execution log information of the executed query tasks can be analyzed to obtain the configuration parameters that lead to low query task execution efficiency, such as the number of parallel query tasks, etc. By modifying the configuration parameters, the efficiency of reinforcement learning can be improved.

[0095] Optionally, when a batch query task contains a particularly large number of query tasks, the batch query tasks can be clustered. For example, clustering can be performed based on the similarity between the query tasks in the batch query task, with multiple query tasks with high similarity grouped together. The higher the similarity between the multiple query tasks, the higher the similarity when executing the query tasks, which means higher efficiency when executing concurrently. Multiple query tasks with high similarity are clustered together into a class, and the multiple query tasks in a class are executed in parallel across multiple connections of the query simulator.

[0096] It is understandable that when multiple query tasks are executed in parallel on multiple connections of the query simulator, the multiple query tasks will affect each other. Clustering is performed based on the similarity between the query tasks. The higher the similarity, the more helpful it is for shortening the total execution time of the batch query tasks.

[0097] The following formula is a method provided by this application to calculate the similarity between two query tasks:

[0098]

[0099] Among them, sim ij Indicates the similarity between query task i and query task j, sim ji ov represents the similarity between query task j and query task i, which are the same. E represents the expectation. The similarity between query task i and query task j is obtained by averaging the approximation of all concurrent executions. ij It represents the time overlap between query task i and query task j when they are executed in parallel on the query simulator. represents the execution time of query task j when query task i and query task j are executed in parallel on the query simulator (under the influence of query task i), o ij It represents the ratio of the overlapping duration to the execution duration of query task j when query task i and query task j are executed in parallel. is the average execution time of query task j in the historical execution log information, a ij is the execution time of query task j when query task i and query task j are executed in parallel, compared with The execution time of query task i and query task j can be obtained from the historical execution log information.

[0100] When clustering batch query tasks, a hierarchical clustering method can be used. After multiple rounds of iteration, each query task in the batch query task is finally clustered into multiple clusters. Other clustering methods can also be used, which are not limited in this application.

[0101] After clustering the batch query tasks into multiple classes, the query tasks of multiple classes are input into the query task scheduler training device, and feature extraction is performed at the class granularity to obtain the query representation of each class. The probability of scheduling the query task of each class to the query simulator is calculated based on the query representation of each class, and multiple query tasks in the class with the largest probability are scheduled to multiple connections of the query simulator, so that multiple query tasks within the class are executed in parallel on multiple connections of the query simulator, and the query simulator calculates / predicts the time consumed for the execution of multiple query tasks in this class; then, multiple query tasks in the class with the second largest probability are scheduled to multiple connections of the query simulator, and the query simulator calculates / predicts the time consumed for the execution of multiple query tasks in this class; ... This cycle is similar to the above steps S101 to S107. After multiple rounds of reinforcement learning, the query task scheduler training device learns the scheduling strategy of each class (which class is executed first and which class is executed later). For the scheduling strategy within the class, a large query priority strategy or a random processing strategy can be adopted.

[0102] The query simulator in this application is trained. The training process includes obtaining historical logs. The historical logs are obtained when historical query tasks are executed on the database management system. The historical logs include information such as the number of connections established on the database management system, the configuration parameters of each connection (for example, the number of processes included in each connection), the nature of each query task, and the start and end execution times of each query task. The query simulator is predicted based on the historical logs to obtain a trained query simulator.

[0103] Therefore, 1) during the training of the query task scheduler through the trained query simulator, the query simulator can also be trained again using the execution log information of the query tasks that have been executed in this application, so that the performance of the query simulator is better. During the training of the query scheduler, based on the query execution log information of the query tasks that have been executed, the transformer network and the attention-based state representation network are used to perform query representation for the query tasks that have not been executed, wherein the attention-based state representation network includes multiple multi-layer perceptrons and multi-head attention mechanism networks, which can capture the complex relationship between each unexecuted query task, as well as the complex relationship between each unexecuted query task and the executed query task, so that the query representation of the unexecuted query task is more accurate, which helps to improve the processing efficiency of batch query tasks and improve the training efficiency of the query scheduler. 2) By clustering batch query tasks, the search space required for the scheduling strategy can be greatly reduced. 3) During the training of the query task scheduler, a query simulator is used to predict the time consumed when each query task is executed, instead of using a database management system to execute the query task. Compared with using a database management system to execute the query task, the query simulator directly determines the time consumed when the query task is executed based on the query representation of each query task, which reduces the time it takes to read data from the database disk to the memory, improves the efficiency of processing batch query tasks, and saves the time of batch query tasks. 4) The query task scheduler trained using the method provided by this application does not need to invade the database management system, does not need to modify its internal underlying code, and does not affect the existing database management system. The query task scheduler trained by this application can be deployed independently and is applicable to any form of database, with strong applicability.

[0104] The above are method embodiments provided in this application. The following introduces device embodiments corresponding to the method embodiments.

[0105] See also Figure 5 , Figure 5 This is a schematic diagram of a system architecture provided by this application. The system includes a query task scheduler training device 500 and a server 400. The server 400 is deployed with Figure 1 or Figure 2 The database management system or query simulator in .

[0106] The query task scheduler training device 500 is introduced in detail below.

[0107] The query task scheduler training device 500 includes:

[0108] An acquisition module 510 is configured to acquire, in real time, execution log information of query tasks that have been executed in a batch query task, the execution log information including one or more of the number of connections established on the query simulator, configuration parameters on each connection of the query simulator, on which connection of the query simulator each query task is executed, the time consumed by each query task to be executed, and which query tasks are executed in parallel;

[0109] The query representation module 520 is configured to determine the query representation of the unexecuted query task based on the execution log information of the executed query task obtained in real time;

[0110] a policy module 530 for determining a scheduling policy for the unexecuted query task based on the query representation of the unexecuted query task;

[0111] The scheduling module 540 is configured to schedule the unexecuted query tasks to the query simulator according to the scheduling policy, so that the query simulator can determine the execution time of each of the unexecuted query tasks.

[0112] A guidance module 550 is configured to calculate a reward function based on the execution time of each query task and the total execution time of each query task in the batch query task, and the reward function is used to guide the scheduling direction;

[0113] The policy module 530 is further configured to adjust the scheduling policy according to the reward function until a trained task scheduler is obtained.

[0114] In a possible implementation, the query representation module 520 is configured to:

[0115] According to the query execution plan, feature extraction is performed on the unexecuted query tasks to obtain feature vectors of each query task in the unexecuted query tasks;

[0116] The query representation of each query task among the unexecuted query tasks is obtained according to the execution log information of the executed query tasks and the feature vector of each query task among the unexecuted query tasks.

[0117] In a possible implementation, the policy module 530 is used to:

[0118] Determine the probability of scheduling each of the unexecuted query tasks to the query simulator based on the query representations of the unexecuted query tasks; and schedule the query task with the highest probability and the corresponding query representation to an idle connection of the query simulator;

[0119] When the next connection of the query simulator is idle, the probability of scheduling each of the unexecuted query tasks to the query simulator is determined again based on the query representation of the unexecuted query tasks; the query task with the highest probability and the corresponding query representation are scheduled to the next idle connection of the query simulator.

[0120] In a possible implementation, the device 500 also includes a clustering module 560, which is used to cluster batch query tasks according to similarity to obtain multiple classes, each of the multiple classes including multiple query tasks; the scheduling module 540 is used to schedule the multiple query tasks included in each class to multiple connections of the query simulator, so that the multiple query tasks included in each class are executed in parallel on the multiple connections of the query simulator.

[0121] Among them, the acquisition module 510, query representation module 520, policy module 530, scheduling module 540, guidance module 550, and clustering module 560 can all be implemented by software or hardware. For example, the implementation of the query representation module 520 will be described below using the query representation module 520 as an example. Similarly, the implementation of the acquisition module 510, policy module 530, scheduling module 540, guidance module 550, and clustering module 560 can refer to the implementation of the query representation module 520.

[0122] As an example of a software functional unit, the query representation module 520 may include code running on a computing device. The computing device may be a computing device in a cloud service, wherein the computing device may be, for example, a server, a virtual machine, a container, etc. Further, the computing device may be one or more. For example, the query representation module 520 may include code running on multiple computing devices. It should be noted that the multiple computing devices used to run the code may be distributed in the same region or in different regions. Furthermore, the multiple computing devices used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one data center or multiple geographically close data centers. Generally, a region may include multiple availability zones AZ.

[0123] Similarly, the multiple computing devices used to run the code can be distributed within the same virtual private cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Cross-region communication between two VPCs within the same region, or between VPCs in different regions, requires a communication gateway within each VPC to interconnect the VPCs.

[0124] As an example of a hardware functional unit, the query representation module 520 may include at least one computing device. Alternatively, the query representation module 520 may be implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0125] The multiple computing devices included in the query representation module 520 can be distributed in the same region or in different regions. The multiple computing devices included in the query representation module 520 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the query representation module 520 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.

[0126] It should be noted that, in other embodiments, the query representation module 520 can be used to execute any step in a query task scheduler training method, and the acquisition module 510, policy module 530, scheduling module 540, guidance module 550 and clustering module 560 can all be used to execute any step in a query task scheduler training method. The steps that the acquisition module 510, policy module 530, scheduling module 540, guidance module 550 and clustering module 560 are responsible for implementing can be specified as needed. By respectively implementing different steps in a query task scheduler training method through the acquisition module 510, query representation module 520, policy module 530, scheduling module 540, guidance module 550 and clustering module 560, all functions of generating a query task scheduler training device 500 are realized.

[0127] See also Figure 6 , Figure 6 This is a schematic diagram of the structure of a computing device provided in this application. Computing device 600 can be, for example, a server, a virtual machine, a container, etc. Computing device 600 includes: bus 602, processor 604, memory 606, and communication interface 608. Processor 604, memory 606, and communication interface 608 communicate with each other via bus 602. It should be understood that this application does not limit the number of processors and memories in computing device 600.

[0128] The bus 602 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 The bus 602 may include a path for transmitting information between various components of the computing device 600 (eg, memory 606, processor 604, and communication interface 608).

[0129] The processor 604 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0130] The memory 606 may include volatile memory, such as random access memory (RAM). The processor 604 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).

[0131] Memory 606 stores executable program code. Processor 604 executes the executable program code to implement the functions of the aforementioned acquisition module 510, query representation module 520, policy module 530, scheduling module 540, guidance module 550, and clustering module 560, thereby implementing a query task scheduler training method. In other words, memory 606 stores instructions for executing a query task scheduler training method.

[0132] The communication interface 608 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 600 and other devices or a communication network.

[0133] The present application also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, a virtual machine, or a container, such as a central server, an edge server, or a sidecar container.

[0134] like Figure 7 As shown, Figure 7 This is a structural diagram of a computing device cluster provided in the present application, wherein the computing device cluster includes at least one computing device 600, and the memory 606 in one or more computing devices 600 in the computing device cluster may store the same instructions for executing a query task scheduler training method.

[0135] In some possible implementations, the memory 606 of one or more computing devices 600 in the computing device cluster may also store partial instructions for executing a query task scheduler training method. In other words, the combination of one or more computing devices 600 can be used to jointly execute instructions for a query task scheduler training method.

[0136] When at least one computing device in a computing device cluster is configured as the query task scheduler training apparatus 500, the memories 606 in different computing devices 600 in the computing device cluster may store different instructions, each for executing a portion of the functions of the query task scheduler training apparatus 500. In other words, the instructions stored in the memories 606 in different computing devices 600 may implement the functions of one or more of the acquisition module 510, the query representation module 520, the policy module 530, the scheduling module 540, the guidance module 550, and the clustering module 560.

[0137] In some possible implementations, one or more computing devices in a computing device cluster may be connected via a network, which may be a wide area network or a local area network. Figure 8 A schematic diagram of the structure of another computing device cluster is shown. Figure 8 As shown, two computing devices 600A and 600B are connected via a network. Specifically, the connection to the network is achieved through the communication interface in each computing device. In this type of possible implementation, the memory 606 in the computing device 600A stores instructions for the functions of the acquisition module 510, the query representation module 520, the strategy module 530, the scheduling module 540, and the guidance module 550. The computing device 600A is used to learn the scheduling strategy for batch query tasks through multiple rounds of reinforcement learning. The memory 606 in the computing device 600B stores instructions for executing the functions of the clustering module 560. The computing device 600B is used to cluster the query tasks in the batch query task to obtain multiple classes. The computing device 600A is also used to learn the scheduling strategy between classes through multiple rounds of reinforcement learning.

[0138] It should be understood that Figure 8 The functions of computing device 600A shown in FIG2 may also be performed by multiple computing devices 600, or a computing device cluster may include multiple computing devices having the same functions as computing device 600A. Similarly, the functions of computing device 600B may also be performed by multiple computing devices 600, or a computing device cluster may include multiple computing devices having the same functions as computing device 600B.

[0139] The present application embodiment also provides another computing device cluster. The connection relationship between the computing devices in the computing device cluster can be similarly referred to as Figure 7 and Figure 8The connection method of the computing device cluster. Differently, the memory 606 of one or more computing devices 600 in the computing device cluster may store different instructions for executing a query task scheduler training method. In some possible implementations, the memory 606 of one or more computing devices 600 in the computing device cluster may also respectively store partial instructions for executing a query task scheduler training method. In other words, the combination of one or more computing devices 600 can jointly execute instructions for executing a query task scheduler training method.

[0140] The present application also provides a computer program product comprising instructions. The computer program product may be software or a program product comprising instructions that can be executed on a computing device or stored in any available medium. When the computer program product is executed on at least one computing device, the at least one computing device executes a query task scheduler training method.

[0141] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive). The computer-readable storage medium includes instructions that instruct a computing device or a computing device cluster to execute a query task scheduler training method.

[0142] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the protection scope of the technical solutions of the embodiments of the present invention.

Claims

1. A query task scheduler training method, characterized in that: A plurality of connections are established between the query task scheduler and the query simulator, and the query simulator is used to simulate the process of executing query operations by the database management system, including: Obtaining execution log information of query tasks that have been executed in the batch query task, the execution log information including one or more of the number of connections established on the query simulator, configuration parameters on each connection of the query simulator, on which connection of the query simulator each query task is executed, the time consumed by each query task to be executed, and which query tasks are executed in parallel; Determining a query representation of an unexecuted query task based on the acquired execution log information of the executed query task; Determining a scheduling strategy for the unexecuted query task according to the query representation of the unexecuted query task; According to the scheduling strategy, the unexecuted query tasks are scheduled to the query simulator, so that the query simulator determines the execution time of each of the unexecuted query tasks; Calculating a reward function based on the execution time of each query task and the total execution time of each query task in the batch query task, wherein the reward function is used to guide the scheduling direction; According to the reward function, the scheduling strategy is adjusted until a trained task scheduler is obtained.

2. The method according to claim 1, characterized in that The determining, based on the execution log information of the executed query task, the query representation of the unexecuted query task includes: performing feature extraction on the unexecuted query tasks according to the query execution plan to obtain a feature vector of each query task in the unexecuted query tasks; A query representation of each query task among the unexecuted query tasks is obtained according to the execution log information of the executed query task and the feature vector of each query task among the unexecuted query tasks.

3. The method according to claim 1 or 2, characterized in that The determining, based on the query representation of the unexecuted query task, a scheduling strategy for the unexecuted query task includes: Determining the probability of scheduling each of the unexecuted query tasks to the query simulator based on the query representations of the unexecuted query tasks; scheduling the query task with the highest probability and the corresponding query representation to an idle connection of the query simulator; When the next connection of the query simulator is idle, the probability of scheduling each of the unexecuted query tasks to the query simulator is determined again based on the query representation of the unexecuted query task; the query task with the highest probability and the corresponding query representation are scheduled to the next idle connection of the query simulator.

4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: Clustering the batch query tasks according to similarity to obtain multiple classes, each of the multiple classes including multiple query tasks; The multiple query tasks included in each class are scheduled to the multiple connections of the query simulator, so that the multiple query tasks included in each class are executed in parallel on the multiple connections of the query simulator.

5. A query task scheduler training device, characterized in that: A plurality of connections are established between the query task scheduler and the query simulator, and the query simulator is used to simulate the process of executing query operations by the database management system, including: an acquisition module, configured to acquire execution log information of query tasks that have been executed in a batch query task, wherein the execution log information includes one or more of the number of connections established on the query simulator, configuration parameters on each connection of the query simulator, on which connection of the query simulator each query task is executed, the time consumed by the execution of each query task, and which query tasks are executed in parallel; A query representation module, configured to determine a query representation of an unexecuted query task based on the acquired execution log information of the executed query task; a policy module, configured to determine a scheduling policy for the unexecuted query task according to the query representation of the unexecuted query task; a scheduling module, configured to schedule the unexecuted query tasks to the query simulator according to the scheduling policy, so that the query simulator can respectively determine the duration consumed by executing each of the unexecuted query tasks; A guidance module, configured to calculate a reward function based on the execution time of each query task and the total execution time of each query task in the batch query task, wherein the reward function is used to guide the scheduling direction; The strategy module is further configured to adjust the scheduling strategy according to the reward function until a trained task scheduler is obtained.

6. The device according to claim 5, characterized in that The query representation module is used to: performing feature extraction on the unexecuted query tasks according to the query execution plan to obtain a feature vector of each query task in the unexecuted query tasks; A query representation of each query task among the unexecuted query tasks is obtained according to the execution log information of the executed query task and the feature vector of each query task among the unexecuted query tasks.

7. The device according to claim 5 or 6, characterized in that The policy module is used to: Determining the probability of scheduling each of the unexecuted query tasks to the query simulator based on the query representations of the unexecuted query tasks; scheduling the query task with the highest probability and the corresponding query representation to an idle connection of the query simulator; When the next connection of the query simulator is idle, the probability of scheduling each of the unexecuted query tasks to the query simulator is determined again based on the query representation of the unexecuted query task; the query task with the highest probability and the corresponding query representation are scheduled to the next idle connection of the query simulator.

8. The device according to any one of claims 5 to 7, characterized in that The device also includes a clustering module, The clustering module is used to cluster the batch query tasks according to similarity to obtain multiple classes, each of the multiple classes including multiple query tasks; The scheduling module is used to schedule the multiple query tasks included in each class to the multiple connections of the query simulator, so that the multiple query tasks included in each class are executed in parallel on the multiple connections of the query simulator.

9. A computing device cluster, characterized in that: The method comprises at least one computing device, wherein the at least one computing device comprises a memory and a processor, and the processor in the at least one computing device is configured to execute instructions stored in the memory in the at least one computing device to implement the method according to any one of claims 1 to 4.

10. A computer storage medium, characterized in that The method comprises program instructions, and when the program instructions are executed on a computing device cluster, the computing device cluster executes the method according to any one of claims 1 to 4.

11. A system, characterized in that: The method comprises a query task scheduler and a query simulator, wherein the query task scheduler is used to implement the method according to any one of claims 1 to 4.