Priority-based SQL task execution method, device and computer program product
By predicting the execution time of SQL tasks and the SQL throughput during idle periods, the priority of SQL tasks is adjusted for priority execution, which solves the problem of external application SQL tasks and internal application SQL tasks competing for database resources, and improves execution efficiency and database resource utilization. Utilization.
Patent Information
- Application Number
- CN202410981020.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-07-22
AI Technical Summary
现有技术中外部应用的SQL任务与内部应用的SQL任务在使用内部数据库资源时存在冲突,导致外部应用SQL任务执行效率低,并影响内部业务的运行效率和稳定性。
Predict the execution time of SQL tasks through the execution time prediction model, determine the SQL flux during idle periods through the flux prediction model, adjust the priority of SQL tasks based on the SQL flux, and execute SQL tasks in order of priority.
Improved the efficiency of the free time during the free time, solved the problem of external application SQL tasks and internal applications SQL tasks to compete for database resources, and improved the efficiency of external applications for internal databases.
Smart Images

Figure CN118860602B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a priority-based SQL task execution method, device and computer program product. Background Art
[0002] In the field of big data and data governance, there are a large number of data collection, data quality inspection, metadata collection and data analysis activities such as connecting to business databases and batch data processing. Since these data activities are connected to internal databases as external applications, they put a certain amount of pressure on the resources of the internal database. However, these external activities have to be carried out, which leads to the problem of external applications competing with internal businesses for database resources, and sometimes even affects the performance and stability of internal business processing. For example, for SQL tasks of external applications, the traditional practice is to agree to execute them during a fixed period when the pressure on database data resources is relatively small, such as at night. However, when the task volume is large, not all queued SQL tasks can be processed during this period.
[0003] In addition, the internal database needs to execute internal SQL tasks during the day, and there will be some idle periods during the execution of the internal SQL tasks. Therefore, the idle periods during the day can be used to execute SQL tasks of external applications.
[0004] However, the execution time of SQL tasks of external applications is not fixed, and the idle period of the internal database is also not fixed. Therefore, the execution time of SQL tasks of external applications may be longer than that of the idle period of the internal database, and thus they cannot be completed during the idle period of the internal database, resulting in competition with internal SQL tasks for data resources, thereby affecting the efficiency of internal business activities. Alternatively, the execution time of SQL tasks of external applications is relatively short, resulting in the inability to fully and completely utilize the idle period of the internal database, thus causing the problem of low efficiency in the use of database resources.
[0005] Currently, no effective solution has been proposed to the technical problems in the above-mentioned prior art, that is, external application SQL competes with internal application SQL for internal database resources, resulting in low execution efficiency of external application SQL tasks and impacting the operating efficiency and stability of internal business due to external applications competing for internal database resources. Summary of the invention
[0006] The embodiments of the present application provide a priority-based SQL task execution method, device and computer program product to solve the conflict problem between the SQL of external applications and internal applications in the use of internal database resources in the prior art, and better balance the use of internal database resources by external applications and internal applications, without affecting the normal execution of internal applications, while improving the efficiency of external applications in using the internal database.
[0007] According to one aspect of an embodiment of the present application, a priority-based SQL task execution method is provided, including: determining the corresponding execution times of multiple first SQL tasks according to SQL information of multiple first SQL tasks through an execution time prediction model; determining the SQL flux of the idle period according to the execution times of the multiple first SQL tasks and the idle period through a flux prediction model, wherein the SQL flux of the idle period is used to indicate the number of SQL tasks of various execution times that can be executed in the idle period; determining the priorities of the multiple first SQL tasks according to the SQL flux; and executing the multiple first SQL tasks in sequence according to the priorities of the multiple first SQL tasks.
[0008] According to another aspect of the embodiments of the present application, a computer program product is also provided, including a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0009] According to another aspect of the embodiment of the present application, a priority-based SQL task execution device is also provided, including: a first determination module, used to determine the corresponding execution times of multiple first SQL tasks according to the SQL information of multiple first SQL tasks through an execution time prediction model; a second determination module, used to determine the SQL flux of the idle period according to the execution times of multiple first SQL tasks and the idle period through a flux prediction model, wherein the SQL flux of the idle period is used to indicate the number of SQL tasks of various execution times that can be executed in the idle period; a third determination module, used to determine the priorities of multiple first SQL tasks according to the SQL flux; and a task execution module, used to execute the multiple first SQL tasks in sequence according to the priorities of the multiple first SQL tasks.
[0010] According to another aspect of an embodiment of the present application, a priority-based SQL task execution device is also provided, including: a processor; and a memory, connected to the processor, for providing the processor with instructions for processing the following processing steps: determining the corresponding execution times of multiple first SQL tasks according to SQL information of multiple first SQL tasks through an execution time prediction model; determining the SQL flux of the idle period according to the execution times and idle periods of multiple first SQL tasks through a flux prediction model, wherein the SQL flux of the idle period is used to indicate the number of SQL tasks of various execution times that can be executed in the idle period; determining the priorities of multiple first SQL tasks according to the SQL flux; and executing the multiple first SQL tasks in sequence according to the priorities of the multiple first SQL tasks.
[0011] In an embodiment of the present application, the SQL task control module predicts the execution time of each SQL task of an external application through an execution time prediction model, and then determines the number of SQL tasks that can be executed in the idle period (i.e., SQL flux) through a flux prediction model. Then, the execution time of the SQL task and the SQL flux are matched to determine the SQL tasks that can be executed in the idle period, so that multiple SQL tasks are assigned to the idle period in the above manner, so as to fully and completely utilize the idle period to execute as many SQL tasks as possible. By adjusting the priority of the SQL task, the technical solution can execute SQL tasks in order of priority, thereby improving the execution efficiency of the idle period. This solves the technical problems existing in the prior art that the external application SQL competes with the internal application SQL for internal database resources, resulting in low execution efficiency of the external application SQL tasks and the impact on the operating efficiency and stability of the internal business due to the external application competing for internal database resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0013] Figure 1 is a hardware structure block diagram of a computing device for implementing the method according to Embodiment 1 of the present application;
[0014] Figure 2 is a schematic diagram of the SQL control system according to Example 1 of the present application;
[0015] Figure 3 It is a flowchart of the priority-based SQL task execution method according to the first aspect of Example 1 of the present application;
[0016] Figure 4 is another schematic diagram of the SQL control system according to Example 1 of the present application;
[0017] Figure 5 is another schematic diagram of the SQL control system according to Example 1 of the present application;
[0018] Figure 6 is another flowchart of the priority-based SQL task execution method according to Example 1 of the present application;
[0019] Figure 7 is a schematic diagram of a priority-based SQL task execution device according to Embodiment 2 of the present application; and
[0020] Figure 8It is a schematic diagram of the priority-based SQL task execution device described in Example 3 of the present application. DETAILED DESCRIPTION
[0021] In order to enable those skilled in the art to better understand the technical solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only embodiments of a part of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work should fall within the scope of protection of the present application.
[0022] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0023] Example 1
[0024] According to this embodiment, a method embodiment of a priority-based SQL task execution method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0025] The method embodiment provided in this embodiment can be executed in a mobile terminal, a computer terminal, a server or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computing device for implementing a priority-based SQL task execution method. Figure 1As shown, the computing device may include one or more processors (the processor may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory for storing data, and a transmission device for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0026] It should be noted that the one or more processors and / or other data processing circuits described above may generally be referred to herein as "data processing circuitry". The data processing circuitry may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuitry may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computing device. As described in the embodiments of the present application, the data processing circuitry serves as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0027] The memory can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the priority-based SQL task execution method in the embodiment of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, the priority-based SQL task execution method of the above-mentioned application is realized. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the computing device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0028] The transmission device is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computing device. In one example, the transmission device includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device can be a radio frequency (Radio Frequency, RF) module, which is used to communicate with the Internet wirelessly.
[0029] The display may be, for example, a touch screen liquid crystal display (LCD) that may enable a user to interact with a user interface of the computing device.
[0030] It should be noted that, in some optional embodiments, the above Figure 1 The computing device shown may include hardware elements (including circuits), software elements (including computer code stored on a computer-readable medium), or a combination of both hardware elements and software elements. Figure 1 This is merely one example of a particular embodiment and is intended to illustrate the types of components that may be present in the computing devices described above.
[0031] Figure 2 Schematic diagram of the SQL control system 200 according to this embodiment. Figure 2 As shown, the system includes: a SQL task acquisition module 210, a SQL task control module 220 and a SQL task execution module 230.
[0032] The SQL control system 200 is connected to the external application 100 and the database 300 respectively.
[0033] The SQL task acquisition module 210 is used to receive a SQL task sent by the external application 100 and send the SQL task to the SQL task control module 220 .
[0034] The SQL task control module 220 is used to determine the priority of the SQL task sent by the SQL task acquisition module.
[0035] The SQL task execution module 230 is used to send the SQL task to the database 300 according to the priority order, and the database 300 executes the SQL task.
[0036] It should be noted that the SQL control system 200 is applicable to the hardware structure described above.
[0037] In the above operating environment, according to the first aspect of this embodiment, a priority-based SQL task execution method is provided. The method comprises: Figure 2The SQL control system 200 shown in FIG. Figure 3 A schematic diagram showing the process of the method is shown in FIG. Figure 3 As shown, the method includes:
[0038] S302: Determine the corresponding execution times of the plurality of first SQL tasks according to the SQL information of the plurality of first SQL tasks by using an execution time prediction model;
[0039] S304: determining the SQL flux of the idle period according to the execution durations of the plurality of first SQL tasks and the idle period by means of a flux prediction model, wherein the SQL flux of the idle period is used to indicate the number of SQL tasks of various execution durations that can be executed in the idle period;
[0040] S306: Determine priorities of multiple first SQL tasks according to SQL flux; and
[0041] S308: Execute the multiple first SQL tasks in sequence according to their priorities.
[0042] Specifically, the external application 100 sends a plurality of SQL tasks (i.e., the first SQL task) that need to be executed by the database 300 to the SQL control system 200. The SQL task acquisition module 210 of the SQL control system 200 receives the first SQL task sent by the external application 100, and then the SQL task acquisition module 210 sends the first SQL task to the SQL task control module 220.
[0043] The SQL task control module 220 inputs the received first SQL task into the preset execution time prediction model. Then, the SQL task control module 220 parses the first SQL task through the execution time prediction model to determine the SQL information corresponding to the first SQL task. The SQL information includes information such as the main table, associated table, data scale, aggregate calculation and conditional calculation corresponding to the SQL task. Then, the SQL task control module 220 predicts the execution time of the first SQL task according to the SQL information of the first SQL task through the execution time prediction model, thereby determining the execution time of the first SQL task. The execution time prediction model is trained based on the historical data in the SQL execution log as a sample. The historical data includes the main table, associated table, data scale, aggregate calculation, conditional calculation, and time used corresponding to the historical SQL task. And the time used is the data after labeling, such as (0, 15 minutes], (15 minutes, 30 minutes], (30 minutes, 60 minutes], etc.
[0044] Furthermore, the SQL task control module 220 is connected to the database resource monitoring system, and obtains a monitoring log for recording the usage of the corresponding database resources from the database resource monitoring system. The SQL task control module 220 then inputs the monitoring information related to the database in the monitoring log into a preset idle period prediction model, and determines the idle period of the database 300 closest to the current moment according to the monitoring information through the idle period prediction model, and then inputs the idle period and the execution duration of the first SQL task output by the execution duration prediction model into the preset flux prediction model.
[0045] Afterwards, the SQL task control module 220 determines the SQL flux of the idle period according to the idle period and the execution time of the first SQL task through the flux prediction model. The SQL flux of the idle period is used to indicate the number of SQL tasks of various execution times that can be executed in the idle period. For example, the idle period is 2 hours, the execution time of SQL task 1 is 1 hour, the execution time of SQL task 2 is 2 and a half hours, and the execution time of SQL task 3 is 1 hour. Then the SQL flux of the idle period is that 2 SQL tasks with an execution time of 1 hour can be executed in the idle period (i.e., 2 hours), namely SQL task 1 and SQL task 3.
[0046] Furthermore, the SQL task control module 220 uses the execution time of the first SQL task and the order in which the SQL task acquisition module 210 acquires the first SQL tasks to sequentially screen the first SQL tasks that match the SQL flux, thereby adjusting the priority of the first SQL task.
[0047] Furthermore, the SQL task execution module 230 first obtains the first SQL task with a high priority according to the priority of the first SQL task, and sends the first SQL task to the database 300 in sequence, and the database 300 executes the first SQL task in an idle period.
[0048] Further, after the idle period ends, the SQL task control module 220 obtains the monitoring log of the database 300 up to now from the database resource monitoring system again, and then determines the next idle period again according to the monitoring log through the idle period prediction model, and determines the corresponding SQL flux through the flux prediction model, and adjusts the priority of other SQL tasks that have not been executed according to the SQL flux. Then, the SQL task execution module 230 sends the SQL task to the database 300 for execution according to the new priority order.
[0049] As described in the background technology, in the field of big data and data governance, there are a large number of data collection, data quality inspection, metadata collection and data analysis, etc., which are used to connect to business databases and process batch data. Since these data activities are used as external applications to connect to internal databases, they put a certain amount of pressure on the resources of the internal database, but these external activities have to be carried out. This creates a contradiction between the business data itself and the external business in the use of the database. For example, for SQL tasks of external applications, the traditional practice is to agree to execute them in a fixed period when the pressure on the data resources of the database is relatively small, such as at night. However, when the task volume is large, not all queued SQL tasks can be processed within this period. In addition, the internal database needs to execute internal SQL tasks during the day, and there will be some idle periods during the execution of internal SQL tasks, so the idle periods during the day can be used to execute SQL tasks of external applications. However, the execution time of SQL tasks of external applications is not fixed, and the idle period of the internal database is also not fixed. Therefore, it is possible that the execution time of SQL tasks of external applications is longer than the duration of the idle period of the internal database, so that they cannot be completed during the idle period of the internal database, resulting in competition with internal SQL tasks for data resources, thereby affecting the efficiency of internal business activities. Or the execution time of the SQL task of the external application is short, resulting in that the idle period of the internal database cannot be fully and completely utilized, thus causing the problem of low efficiency in the use of database resources.
[0050] In view of the technical problems described above, through the technical solutions of the embodiments of the present application, the SQL task control module predicts the execution time of the SQL tasks of each external application through the execution time prediction model, and then determines the number of SQL tasks that can be executed in the idle period (i.e., SQL flux) through the flux prediction model. Then, the execution time of the SQL task and the SQL flux are matched to determine the SQL tasks that can be executed in the idle period, so that multiple SQL tasks are allocated to the idle period in the above manner, so as to fully and completely utilize the idle period to execute as many SQL tasks as possible. By adjusting the priority of the SQL task, this technical solution can execute SQL tasks in order of priority, thereby improving the execution efficiency of the idle period. This solves the technical problems existing in the prior art that the external application SQL competes with the internal application SQL for internal database resources, resulting in low execution efficiency of the external application SQL tasks and the impact on the operating efficiency and stability of the internal business due to the external application competing for internal database resources.
[0051] Optionally, the operation of determining the corresponding execution times of multiple first SQL tasks based on the SQL information of multiple first SQL tasks through an execution time prediction model includes: receiving multiple second SQL tasks sent by an external application; dividing the multiple second SQL tasks into corresponding SQL queues according to pre-specified databases corresponding to the multiple second SQL tasks; and determining the corresponding execution times of multiple first SQL tasks based on the SQL information of multiple first SQL tasks corresponding to each SQL queue through an execution time prediction model.
[0052] Specifically, refer to Figure 4 As shown, the external application 100 includes external applications 1 to m, and the database 300 includes databases 1 to n, wherein m represents the number of external applications, and n represents the number of databases.
[0053] The external applications 1-m send SQL tasks (i.e., second SQL tasks) to the SQL control system 200. The SQL task acquisition module 210 of the SQL control system 200 sequentially acquires the second SQL tasks, and determines the initial priority for each second SQL task according to the database tag carried by the second SQL task and the acquisition order. The second SQL task is used to indicate all SQL tasks sent by the external applications 1-m to the SQL control system 200.
[0054] For example, if the database tag carried by a second SQL task is database 1, it means that the second SQL task is executed by database 1. And for example, if the second SQL task is the first SQL task corresponding to database 1 acquired by the SQL task acquisition module 210, the SQL task acquisition module 210 determines the initial priority of the second SQL task as 1. Thus, the SQL task acquisition module 210 determines the initial priority for each second SQL task according to the above method for determining the initial priority.
[0055] Then, the SQL task acquisition module 210 divides the second SQL tasks with determined initial priorities into corresponding SQL queues according to the database tags of each second SQL task, and determines the SQL tasks (i.e., first SQL tasks) in each SQL queue. There are n SQL queues, corresponding to databases 1 to n respectively.
[0056] Furthermore, the SQL task control module 220 inputs the first SQL task corresponding to each SQL queue into the execution time prediction model, and determines the execution time corresponding to the first SQL tasks according to the SQL information of the first SQL tasks corresponding to each SQL queue through the execution time prediction model. The SQL information includes the main table, associated table, data scale, aggregate calculation and conditional calculation of the database corresponding to the SQL task.
[0057] Therefore, the technical solution divides SQL queues for each SQL task in advance through a database corresponding to the SQL task, so that the priority of the SQL task in each queue can be determined separately, the execution order can be clarified, and the execution efficiency can be improved.
[0058] Optionally, the method also includes: classifying multiple first SQL tasks according to their execution time, and determining the SQL type of each first SQL task, wherein the SQL type includes heavy SQL and light SQL, wherein heavy SQL is used to indicate the SQL type of SQL tasks whose execution time is greater than or equal to a preset threshold, and light SQL is used to indicate the SQL type of SQL tasks whose execution time is less than a preset threshold.
[0059] Specifically, after determining the execution time of each first SQL task through the execution time prediction model, the SQL task control module 220 classifies each first SQL task according to the execution time of the first SQL task, and determines whether the SQL type of each first SQL task is heavy SQL or light SQL. Heavy SQL is used to indicate the SQL type of SQL tasks whose execution time is greater than or equal to a preset threshold, and light SQL is used to indicate the SQL type of SQL tasks whose execution time is less than a preset threshold.
[0060] Since different databases have different performances, the standards for determining heavy SQL and light SQL (ie, preset thresholds) are also different.
[0061] For example, if the preset threshold of database 1 is 1 hour, then if the execution time of the first SQL task in the SQL queue corresponding to database 1 is greater than or equal to 1 hour, the SQL task control module 220 determines that its SQL type is heavy SQL. If the execution time of the first SQL task in the SQL queue corresponding to database 1 is less than 1 hour, its SQL type is determined to be light SQL.
[0062] Therefore, this technical solution determines the standard for judging heavy SQL and light SQL according to the performance of the database, so that after determining the priority of the SQL task according to the SQL type, the database can evenly execute various types of SQL tasks, ensuring the adaptability and stability of the database.
[0063] Optionally, the operation of determining the SQL flux of the idle period according to the execution duration of multiple first SQL tasks and the idle period through a flux prediction model includes: determining the idle period according to the resource monitoring log through the idle period prediction model; and determining the SQL flux of the idle period according to the execution duration of multiple first SQL tasks, SQL type and idle period through the flux prediction model.
[0064] Specifically, the SQL task control module 220 is connected to the database resource monitoring system, and obtains a monitoring log for recording the usage of the corresponding database resources from the database resource monitoring system. The SQL task control module 220 inputs the monitoring information related to the database in the monitoring log into the idle period prediction model, so as to predict the idle period corresponding to the database according to the monitoring information through the idle period prediction model. The idle period includes a time point and a duration. Afterwards, the SQL task control module 220 determines whether the idle period is a disabled period. The disabled period is a period during which the database does not allow the execution of SQL tasks of external applications.
[0065] When the idle period is not a disabled period, the SQL task control module 220 inputs the execution duration of multiple first SQL tasks corresponding to each database, the SQL type and the corresponding idle period into the flux prediction model. The SQL task control module 220 determines the SQL flux of the idle period based on the execution duration of multiple first SQL tasks, the SQL type and the idle period through the flux prediction model.
[0066] Therefore, this technical solution predicts the idle period through the idle period prediction model, so that the time point and duration of the idle period can be clearly determined, so that the SQL tasks executed in the idle period can be accurately determined, and the idle period can be used to maximize the execution of SQL tasks and improve execution efficiency.
[0067] Optionally, the operation of determining the SQL flux of the idle period according to the execution duration, SQL type and idle period of multiple first SQL tasks through a flux prediction model includes: filtering a third SQL task whose SQL type is heavy SQL from multiple first SQL tasks through a flux prediction model; matching the execution duration of the third SQL task with the idle period through the flux prediction model; and determining the SQL flux of the idle period based on the matching result.
[0068] Specifically, the SQL task control module 220 uses the flux prediction model to filter out a third SQL task whose SQL type is heavy SQL from the multiple first SQL tasks according to the input multiple first SQL tasks and the corresponding SQL types. Then, the SQL task control module 220 uses the flux prediction model to match the execution duration of the third SQL task with the idle time period in sequence to obtain a matching result.
[0069] When the matching result is that the idle period matches the execution durations of the plurality of third SQL tasks, it means that the plurality of third SQL tasks can be executed in the idle period.
[0070] For example, the duration of the idle period is 2 hours and 15 minutes. The third SQL task includes: 2 SQL tasks with an execution duration of 1 hour and 1 SQL task with an execution duration of 3 hours. Therefore, the matching result is that 2 SQL tasks with an execution duration of 1 hour can be executed in the idle period.
[0071] After that, the SQL task control module 220 determines through the flux prediction model whether there are any remaining unmatched time periods in the idle period, such as 15 minutes, after matching multiple SQL types of heavy SQL. In the case that there are any remaining unmatched time periods in the idle period, the SQL task control module 220 matches the unmatched time periods with SQL tasks of the SQL type of light SQL through the flux prediction model, thereby determining the number of SQL tasks of light SQL that match the unmatched time periods in the idle period.
[0072] Therefore, the SQL task control module 220 determines the SQL flux through the flux prediction model as: the number of SQL tasks of heavy SQL with a predetermined execution time that can be executed and the number of SQL tasks of light SQL with a predetermined execution time that can be executed.
[0073] For example, the SQL throughput is: 2 SQL tasks with an execution time of 1 hour and 3 SQL tasks with an execution time of 5 minutes.
[0074] Therefore, when matching SQL tasks with SQL flux, this technical solution matches heavy SQL first and then matches light SQL, so that heavy SQL that is not easy to match to a suitable idle period can be matched first, the execution time of the heavy SQL can be determined, and execution efficiency can be ensured.
[0075] Optionally, the operation of determining the SQL flux of the idle period according to the obtained matching result includes: when the matching result is that the third SQL task does not match the idle period, determining the SQL flux of the idle period according to the execution duration of the fourth SQL task whose SQL type is lightweight SQL and the idle period.
[0076] Specifically, after the SQL task control module 220 obtains the matching result about the heavy SQL through the flux prediction model, if the matching result is that the third SQL task whose SQL type is heavy SQL does not match the idle period, the SQL task whose SQL type is light SQL (i.e., the fourth SQL task) is directly screened. The case where the third SQL task does not match the idle period may be, for example, that the execution time of the third SQL task is longer than the duration of the idle period.
[0077] Further, the SQL task control module 220 matches the execution duration of the fourth SQL task with the idle period through the flux prediction model, thereby determining the SQL flux of the idle period. Wherein, in the case where the matching result only includes the fourth SQL task whose SQL type is light SQL, the corresponding SQL flux is used to indicate how many fourth SQL tasks with different execution durations there are, for example, 5 SQL tasks of 5 minutes and 10 SQL tasks of 1 minute.
[0078] Therefore, this technical solution effectively processes SQL tasks whose SQL type is lightweight SQL and ensures execution efficiency by matching the execution duration of the SQL tasks whose SQL type is lightweight SQL with the idle period.
[0079] Optionally, the operation of determining the priorities of multiple first SQL tasks according to SQL flux includes: comparing the SQL flux with the execution duration of the multiple first SQL tasks to determine a fifth SQL task matching the SQL flux; and adjusting the priority of the fifth SQL task.
[0080] Specifically, after the SQL task control module 220 outputs the SQL flux through the flux prediction model, the SQL type and execution duration of the multiple first SQL tasks are determined in turn according to the initial priority order of the multiple first SQL tasks, and the SQL type and execution duration are compared and matched with the SQL flux.
[0081] When the first SQL task matches the SQL flux, the adjustment priority of the first SQL task is determined to be a high priority corresponding to the SQL flux. Table 1 shows an initial information table of the first SQL task in a certain SQL queue.
[0082] Table 1
[0083] SQL Tasks Execution time Initial Priority Adjust priorities SQL Type SQL_1 <![CDATA[t1]]> 1 -- Light SQL SQL_2 <![CDATA[t2]]> 2 -- Heavy SQL … … … … … SQL_k <![CDATA[t k ]]> k -- Light SQL
[0084] The first SQL task in the SQL queue includes, in order of initial priority, SQL_1, SQL_2, ..., SQL_k.
[0085] For example, the SQL flux is a heavy SQL with an execution time of Ta and b light SQL with an execution time of Tb. Thus, starting from SQL_1 with an initial priority of 1 to SQL_k with an initial priority of k, the SQL task control module 220 sequentially matches the SQL type and execution time of each SQL task with the SQL flux, thereby determining the SQL task (i.e., the fifth SQL task) that matches the SQL flux.
[0086] For example, the SQL task control module 220 matches the SQL type and execution time t1 corresponding to SQL_1 with the SQL flux. In the case where SQL_1 matches the SQL flux, the SQL task is used as the fifth SQL task that needs to determine the adjustment priority to a high priority. After that, the SQL task control module 220 matches the SQL type and execution time t2 of SQL_2 with an initial priority of 2 with the SQL flux, and so on, until the number of SQLs of the SQL flux is reached (i.e., a heavy SQL with an execution time of Ta, and b light SQL with an execution time of Tb).
[0087] Further, the SQL task control module 220 determines the adjustment priority of the fifth SQL task to be 1. For SQL tasks that do not match the SQL flux or SQL tasks that have not yet matched the SQL flux due to a low initial priority, the SQL task control module 220 arranges them in sequence after the adjustment priority of the fifth SQL task according to the order of the initial priority to determine their adjustment priorities. Table 2 shows an adjustment information table for determining the adjustment priority.
[0088] Table 2
[0089] SQL Tasks Execution time Initial Priority Adjust priorities SQL Type SQL_1 <![CDATA[t1]]> 1 1 Light SQL SQL_2 <![CDATA[t2]]> 2 2 Heavy SQL SQL_3 <![CDATA[t2]]> 3 1 Heavy SQL SQL_4 <![CDATA[t2]]> 4 1 Light SQL SQL_5 <![CDATA[t2]]> 5 3 Heavy SQL … … … … … SQL_k <![CDATA[t k ]]> k sk Light SQL
[0090] As shown in Table 2, for example, SQL_1, SQL_3 and SQL_4 are the fifth SQL task. Therefore, the SQL task control module 220 determines the adjustment priorities of SQL_1, SQL_3 and SQL_4 to be 1.
[0091] For other SQL tasks, SQL_2 has the highest initial priority, and the SQL task control module 220 determines the adjustment priority of SQL_2 to be 2, and then determines the adjustment priority of SQL_5, which has the second highest initial priority, to be 3, and so on, until the adjustment priority of SQL_k, which has the lowest initial priority, is determined. The adjustment priority of SQL_k is sk. At this point, the SQL task control module 220 has determined the adjustment priority of all SQL tasks. Therefore, the SQL task control module 220 can determine the adjustment priority of each SQL task according to the order of the initial priorities.
[0092] Further, refer to Figure 5 As shown, during the idle period, the SQL task execution module 230 obtains the number of idle connections in the database connection pool. The number of idle connections is used to indicate the number of SQLs that can be connected to the database at one time and executed by the database. Then, the SQL task execution module 230 obtains a corresponding number of SQL tasks with an adjusted priority of 1 (i.e., the fifth SQL task) from the SQL queue according to the number of idle connections.
[0093] When the number of idle connections is greater than or equal to the number of SQL tasks (i.e., the fifth SQL task) whose priority is adjusted to 1, it means that the database connection pool can connect all the fifth SQL tasks at one time and execute them by the database. Thus, the SQL task execution module 230 obtains all the fifth SQL tasks from the SQL queue, and sends the fifth SQL tasks to the corresponding database through the database connection pool, and the database executes them.
[0094] When the number of idle connections is less than the number of SQL tasks with an adjusted priority of 1 (i.e., the fifth SQL task), the SQL task execution module 230 obtains the same number of fifth SQL tasks as the number of idle connections, and sends the fifth SQL tasks to the corresponding database for execution by the database. For example, if the number of idle connection pools is 2 and the number of SQL tasks with an adjusted priority of 1 is 3, the SQL task execution module 230 obtains 2 SQL tasks with an adjusted priority of 1, and sends the 2 SQL tasks to the corresponding database through the database connection pool for execution by the database.
[0095] After that, the SQL task execution module 230 waits for the number of idle connections to appear again in the database connection pool. When the number of idle connections appears again in the database connection pool, the SQL task execution module 230 obtains the corresponding SQL task from the remaining fifth SQL task that has not been executed according to the number of idle connections, and sends the SQL task to the corresponding database through the database connection pool for execution by the database.
[0096] Afterwards, if there are still remaining unexecuted SQL tasks in the SQL queue, the SQL task execution module 230 continues to wait for the number of idle connections to appear in the database connection pool again, and obtains the corresponding fifth SQL task based on the number of idle connections to be executed by the database, so that the SQL task execution module 230 executes the fifth SQL task in the above manner until the fifth SQL task is executed during the idle period.
[0097] For example, there is one fifth SQL task remaining that has not been executed, and the number of idle connections is greater than or equal to one, so the SQL task execution module 230 obtains the fifth SQL task remaining that has not been executed from the SQL queue, and sends the SQL task to the corresponding database through the database connection pool, and the database executes it. At this point, the fifth SQL task is executed in the idle period.
[0098] In addition, when the SQL task execution module 230 waits for the number of idle connections in the database connection pool to appear again, if the SQL task control module 220 detects that the idle period has ended but the fifth SQL task has not been fully executed, the SQL task control module 220 sets the adjustment priority of the fifth SQL task that has not been executed and other SQL tasks to NULL. Thereafter, in the next idle period, the SQL task control module 220 re-determines the adjustment priority for the fifth SQL task that has not been executed last time and other SQL tasks, and executes them in sequence.
[0099] Therefore, the technical solution adjusts the priority of the matching SQL task according to the determined SQL flux, and adjusts the position of the SQL task in the SQL queue, so that the SQL tasks in the SQL queue can be executed in sequence, thereby improving the execution efficiency.
[0100] In summary, reference Figure 6 As shown, the sequence of steps to adjust the priority of the SQL task and execute it is as follows:
[0101] S601: the external application 100 sends a second SQL task to the SQL control system 200;
[0102] S602: The SQL task receiving module 210 of the SQL control system 200 receives the second SQL task, and then determines the initial priority of the second SQL task according to the order in which the second SQL tasks are received, and then divides the SQL queues for each second SQL;
[0103] S603: The SQL task control module 220 of the SQL control system 200 inputs the corresponding first SQL task in each SQL queue into the execution time prediction model to determine the corresponding execution times of the plurality of first SQL tasks;
[0104] S604: The SQL task control module 220 classifies each first SQL task according to the execution time of the first SQL task, and determines the SQL type of the first SQL task;
[0105] S605: The SQL task control module 220 predicts the idle period according to the monitoring information using the idle period prediction model;
[0106] S606: The SQL task control module 220 determines the SQL flux in the idle period according to the execution duration, SQL type and idle period of the plurality of first SQL tasks through the flux prediction model;
[0107] S607: The SQL task control module 220 determines the priorities of the plurality of first SQL tasks according to the SQL flux;
[0108] S608: The SQL task execution module 230 of the SQL control system 200 sends the first SQL task to the database 300 for execution according to the priorities of the plurality of first SQL tasks.
[0109] In addition, according to a second aspect of this embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0110] Therefore, according to this embodiment, the SQL task control module predicts the execution time of each SQL task of the external application through the execution time prediction model, and then determines the number of SQL tasks that can be executed in the idle period (i.e., SQL flux) through the flux prediction model. Then, the execution time of the SQL task and the SQL flux are matched to determine the SQL tasks that can be executed in the idle period, so that multiple SQL tasks are allocated to the idle period in the above manner, so as to fully and completely utilize the idle period to execute as many SQL tasks as possible. By adjusting the priority of the SQL task, the technical solution can execute SQL tasks in order of priority, thereby improving the execution efficiency of the idle period. This solves the technical problems existing in the prior art that the external application SQL competes with the internal application SQL for the internal database resources, resulting in low execution efficiency of the external application SQL tasks and the impact on the operating efficiency and stability of the internal business due to the external application competing for the internal database resources.
[0111] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0112] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a 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 such an understanding, the technical solution of the present invention, 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, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0113] Example 2
[0114] Figure 7 FIG. 7 shows a priority-based SQL task execution device 700 according to the first aspect of this embodiment, and the device 700 corresponds to the method according to the first aspect of embodiment 1. Figure 7 As shown, the device 700 includes: a first determination module 710, used to determine the corresponding execution times of multiple first SQL tasks according to the SQL information of multiple first SQL tasks through an execution time prediction model; a second determination module 720, used to determine the SQL flux of the idle period according to the execution times of multiple first SQL tasks and the idle period through a flux prediction model, wherein the SQL flux of the idle period is used to indicate the number of SQL tasks of various execution times that can be executed in the idle period; a third determination module 730, used to determine the priorities of multiple first SQL tasks according to the SQL flux; and a task execution module 740, used to execute the multiple first SQL tasks in sequence according to the priorities of the multiple first SQL tasks.
[0115] Optionally, the first determination module 710 includes: a task receiving sub-module, used to receive multiple second SQL tasks sent by an external application; a task division sub-module, used to divide the multiple second SQL tasks into corresponding SQL queues according to a pre-specified database corresponding to the multiple second SQL tasks; and a duration determination sub-module, used to determine the corresponding execution durations of the multiple first SQL tasks according to the SQL information of the multiple first SQL tasks corresponding to each SQL queue through an execution duration prediction model.
[0116] Optionally, the device 700 also includes: a fourth determination module, used to classify multiple first SQL tasks according to the execution time of the multiple first SQL tasks, and determine the SQL type of each first SQL task, wherein the SQL type includes heavy SQL and light SQL, wherein the heavy SQL is used to indicate the SQL type of the SQL task whose execution time is greater than or equal to a preset threshold, and the light SQL is used to indicate the SQL type of the SQL task whose execution time is less than the preset threshold.
[0117] Optionally, the second determination module 720 includes: a first determination submodule, used to determine the idle period according to the resource monitoring log through the idle period prediction model; and a second determination submodule, used to determine the SQL flux of the idle period according to the execution time of multiple first SQL tasks, SQL type and idle period through the flux prediction model.
[0118] Optionally, the second determination submodule includes: a screening unit, used to screen a third SQL task whose SQL type is heavy SQL from multiple first SQL tasks through a flux prediction model; a matching unit, used to match the execution duration of the third SQL task with the idle period through the flux prediction model; and a flux determination unit, used to determine the SQL flux of the idle period based on the matching results obtained.
[0119] Optionally, the flux determination unit includes: when the matching result is that the third SQL task does not match the idle period, determining the SQL flux of the idle period according to the execution duration of the fourth SQL task whose SQL type is lightweight SQL and the idle period.
[0120] Optionally, the third determination module 730 includes: a third determination submodule, used to compare the SQL flux with the execution duration of multiple first SQL tasks to determine a fifth SQL task matching the SQL flux; and an adjustment submodule, used to adjust the priority of the fifth SQL task.
[0121] Therefore, according to this embodiment, the SQL task control module predicts the execution time of each SQL task of the external application through the execution time prediction model, and then determines the number of SQL tasks that can be executed in the idle period (i.e., SQL flux) through the flux prediction model. Then, the execution time of the SQL task and the SQL flux are matched to determine the SQL tasks that can be executed in the idle period, so that multiple SQL tasks are allocated to the idle period in the above manner, so as to fully and completely utilize the idle period to execute as many SQL tasks as possible. By adjusting the priority of the SQL task, the technical solution can execute SQL tasks in order of priority, thereby improving the execution efficiency of the idle period. This solves the technical problems existing in the prior art that the external application SQL competes with the internal application SQL for the internal database resources, resulting in low execution efficiency of the external application SQL tasks and the impact on the operating efficiency and stability of the internal business due to the external application competing for the internal database resources.
[0122] Example 3
[0123] Figure 8 FIG. 8 shows a priority-based SQL task execution device 800 according to this embodiment, which corresponds to the method described in the first aspect of Embodiment 1. Figure 8As shown, the device 800 includes: a processor 810; and a memory 820, which is connected to the processor 810 and is used to provide the processor 810 with instructions for processing the following processing steps: determining the corresponding execution times of multiple first SQL tasks according to the SQL information of multiple first SQL tasks through an execution time prediction model; determining the SQL flux of the idle period according to the execution times and idle periods of multiple first SQL tasks through a flux prediction model, wherein the SQL flux of the idle period is used to indicate the number of SQL tasks of various execution times that can be executed in the idle period; determining the priorities of multiple first SQL tasks according to the SQL flux; and executing the multiple first SQL tasks in sequence according to the priorities of the multiple first SQL tasks.
[0124] Optionally, the operation of determining the corresponding execution times of multiple first SQL tasks based on the SQL information of multiple first SQL tasks through an execution time prediction model includes: receiving multiple second SQL tasks sent by an external application; dividing the multiple second SQL tasks into corresponding SQL queues according to pre-specified databases corresponding to the multiple second SQL tasks; and determining the corresponding execution times of multiple first SQL tasks based on the SQL information of multiple first SQL tasks corresponding to each SQL queue through an execution time prediction model.
[0125] Optionally, the device 700 also includes: classifying multiple first SQL tasks according to their execution time, and determining the SQL type of each first SQL task, wherein the SQL type includes heavy SQL and light SQL, wherein heavy SQL is used to indicate the SQL type of SQL tasks whose execution time is greater than or equal to a preset threshold, and light SQL is used to indicate the SQL type of SQL tasks whose execution time is less than a preset threshold.
[0126] Optionally, the operation of determining the SQL flux of the idle period according to the execution duration of multiple first SQL tasks and the idle period through a flux prediction model includes: determining the idle period according to the resource monitoring log through the idle period prediction model; and determining the SQL flux of the idle period according to the execution duration of multiple first SQL tasks, SQL type and idle period through the flux prediction model.
[0127] Optionally, the operation of determining the SQL flux of the idle period according to the execution duration, SQL type and idle period of multiple first SQL tasks through a flux prediction model includes: filtering a third SQL task whose SQL type is heavy SQL from multiple first SQL tasks through a flux prediction model; matching the execution duration of the third SQL task with the idle period through the flux prediction model; and determining the SQL flux of the idle period based on the matching result.
[0128] Optionally, the operation of determining the SQL flux of the idle period according to the obtained matching result includes: when the matching result is that the third SQL task does not match the idle period, determining the SQL flux of the idle period according to the execution duration of the fourth SQL task whose SQL type is lightweight SQL and the idle period.
[0129] Optionally, the operation of determining the priorities of multiple first SQL tasks according to SQL flux includes: comparing the SQL flux with the execution duration of the multiple first SQL tasks to determine a fifth SQL task matching the SQL flux; and adjusting the priority of the fifth SQL task.
[0130] Therefore, according to this embodiment, the SQL task control module predicts the execution time of each SQL task of the external application through the execution time prediction model, and then determines the number of SQL tasks that can be executed in the idle period (i.e., SQL flux) through the flux prediction model. Then, the execution time of the SQL task and the SQL flux are matched to determine the SQL tasks that can be executed in the idle period, so that multiple SQL tasks are allocated to the idle period in the above manner, so as to fully and completely utilize the idle period to execute as many SQL tasks as possible. By adjusting the priority of the SQL task, the technical solution can execute SQL tasks in order of priority, thereby improving the execution efficiency of the idle period. This solves the technical problems existing in the prior art that the external application SQL competes with the internal application SQL for the internal database resources, resulting in low execution efficiency of the external application SQL tasks and the impact on the operating efficiency and stability of the internal business due to the external application competing for the internal database resources.
[0131] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0132] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0133] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0134] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0135] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0136] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0137] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A priority-based SQL task execution method, characterized in that: include: Determining corresponding execution times of the plurality of first SQL tasks according to the SQL information of the plurality of first SQL tasks by using an execution time prediction model; Determine, by a flux prediction model, the SQL flux of the idle period of the internal database according to the execution durations of the plurality of first SQL tasks and the idle period of the internal database, wherein the SQL flux of the idle period of the internal database is used to indicate the number of SQL tasks of various execution durations that can be executed in the idle period of the internal database; Determining priorities of the plurality of first SQL tasks according to the SQL flux; as well as The multiple first SQL tasks are executed in sequence according to their priorities.
2. The method according to claim 1, characterized in that: The operation of determining the execution times of the plurality of first SQL tasks according to the SQL information of the plurality of first SQL tasks by using the execution time prediction model includes: receiving a plurality of second SQL tasks sent by an external application, wherein the second SQL tasks are used to indicate all SQL tasks sent by the external application to the SQL control system; dividing the plurality of second SQL tasks into corresponding SQL queues according to pre-specified databases corresponding to the plurality of second SQL tasks; and The execution duration prediction model is used to determine the corresponding execution durations of the multiple first SQL tasks according to the SQL information of the multiple first SQL tasks corresponding to each SQL queue.
3. The method according to claim 2, characterized in that Also includes: The multiple first SQL tasks are classified according to their execution durations, and the SQL type of each first SQL task is determined, wherein the SQL type includes heavy SQL and light SQL, wherein the heavy SQL is used to indicate the SQL type of the SQL task whose execution duration is greater than or equal to a preset threshold, and the light SQL is used to indicate the SQL type of the SQL task whose execution duration is less than the preset threshold.
4. The method according to claim 3, characterized in that The operation of determining the SQL flux in the idle period according to the execution durations and idle periods of the plurality of first SQL tasks through a flux prediction model includes: Determining the idle period according to the resource monitoring log using an idle period prediction model; and The SQL flux of the idle period is determined by the flux prediction model according to the execution durations of the multiple first SQL tasks, the SQL type, and the idle period.
5. The method according to claim 4, characterized in that The operation of determining the SQL flux of the idle period according to the execution duration of the plurality of first SQL tasks, the SQL type and the idle period by the flux prediction model includes: Filtering the third SQL task whose SQL type is heavy SQL from the plurality of first SQL tasks by using the flux prediction model; Matching the execution duration of the third SQL task with the idle period by using the flux prediction model; and The SQL flux of the idle period is determined according to the obtained matching result.
6. The method according to claim 5, characterized in that The operation of determining the SQL flux in the idle period according to the obtained matching result includes: When the matching result is that the third SQL task does not match the idle period, the SQL flux of the idle period is determined according to the execution duration of the fourth SQL task whose SQL type is lightweight SQL and the idle period.
7. The method according to claim 1, characterized in that The operation of determining the priorities of the plurality of first SQL tasks according to the SQL flux includes: Matching the SQL flux with the execution durations of the plurality of first SQL tasks, and determining a fifth SQL task matching the SQL flux; and The priority of the fifth SQL task is adjusted.
8. A priority-based SQL task execution device, characterized in that: include: A first determination module, configured to determine the corresponding execution durations of the plurality of first SQL tasks according to the SQL information of the plurality of first SQL tasks by using an execution duration prediction model; A second determination module is used to determine the SQL flux of the idle period of the internal database according to the execution durations of the multiple first SQL tasks and the idle period of the internal database through a flux prediction model, wherein the SQL flux of the idle period of the internal database is used to indicate the number of SQL tasks of various execution durations that can be executed in the idle period of the internal database; A third determination module, configured to determine the priorities of the plurality of first SQL tasks according to the SQL flux; as well as The task execution module is used to execute the multiple first SQL tasks in sequence according to the priorities of the multiple first SQL tasks.
9. A priority-based SQL task execution device, characterized in that: include: processor; as well as A memory, connected to the processor, configured to provide the processor with instructions for processing the following processing steps: Determining corresponding execution times of the plurality of first SQL tasks according to the SQL information of the plurality of first SQL tasks by using an execution time prediction model; Determine, by a flux prediction model, the SQL flux of the idle period of the internal database according to the execution durations of the plurality of first SQL tasks and the idle period of the internal database, wherein the SQL flux of the idle period of the internal database is used to indicate the number of SQL tasks of various execution durations that can be executed in the idle period of the internal database; Determining priorities of the plurality of first SQL tasks according to the SQL flux; as well as The multiple first SQL tasks are executed in sequence according to their priorities.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to claim 1 are implemented.
Citation Information
Patent Citations
Background task management method, system and device and storage medium
CN116009509A
Data backup method, device and system for cloud computing operation and maintenance platform
CN117472652A