A unified scheduling method and system for enterprise-level data warehouse tasks
By collecting resource and task status information in the enterprise-level data warehouse, and dynamically adjusting the number of concurrent tasks and priorities, the problem of low task scheduling efficiency in the existing technology is solved, and intelligent utilization of resources and automated management of tasks are realized.
Patent Information
- Application Number
- CN202410997424.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-24
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2044-07-24
AI Technical Summary
The existing technology lacks task scheduling design for enterprise-level data warehouses and fails to effectively consider task classification issues, resulting in insufficient resource utilization and low task scheduling efficiency.
By collecting resource status and task status information in the data warehouse, dynamically adjusting the maximum number of task concurrency and core task priority, combined with CPU occupancy, IO resource occupancy, task queuing and task delay, we can realize ODS, DW, CUBE Intelligent task scheduling for databases.
It improves resource utilization, reduces task delays, realizes intelligent and automated task scheduling, and solves the problems of idle resource waste and resource tight task blocking.
Smart Images

Figure CN118550672B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data warehouses, and more specifically, to a unified scheduling method and system for enterprise-level data warehouse tasks. Background Art
[0002] A data warehouse is a subject-oriented, integrated, non-volatile database system used to support management decision making. Scheduling refers to the coordination and arrangement of application or system tasks according to a predetermined plan to complete a specific operation or task. In a data warehouse, scheduling is used to perform tasks such as ETL (extraction, transformation, and loading) tasks, data refresh, data backup, and data replication.
[0003] Azure Data Factory is a cloud-based ETL and data integration service that makes it easy to create data-driven workflows to orchestrate data movement and transform data at scale. Azure Data Factory allows you to create and schedule data-driven workflows (called pipelines) to ingest data from different data stores. You can build complex ETL processes to visually transform data through data flows or using compute services such as Azure HDInsight Hadoop, Azure Databricks, and AzureSynapse Analytics.
[0004] The enterprise data warehouse carries large-scale operations of large enterprise data warehouses and is responsible for scheduling and running large and complex operation pipelines in an orderly manner every day. The core modules of the unified scheduling mechanism mainly include task generation module, task polling module, task search module, job distribution module, and job execution module. The enterprise data warehouse includes the operational data storage database ODS, the data warehouse DW, and the data cube CUBE; among them, ODS is an operation-oriented database, which is usually used to integrate data from multiple production systems and provide real-time or near real-time data support for enterprise operations. The characteristics of ODS are that it can capture, integrate and store current and latest operation data, but not necessarily retain historical data. DW is a central repository for storing various types of business data of the enterprise, mainly used to support business decision-making. The data warehouse integrates, cleans and transforms data from different business systems to achieve a unified data view. CUBE is a multidimensional data model database that performs fast and complex queries and analysis through data in multidimensional tables. Therefore, when executing a task, the task data is received by ODS, processed by DW, and sent to CUBE for execution.
[0005] After an in-depth analysis of the mechanism principle, it was found that there are variable factors such as the maximum number of concurrent tasks and task priority in the job search process. The scheduling and operation trajectory of the job has a very limited impact on a single variable factor, but is closely related to the combined impact of the maximum number of concurrent tasks and task priority variable factors.
[0006] The original intention of designing the maximum number of concurrent tasks is to avoid resource competition bottlenecks and ensure job execution efficiency. However, from the analysis of historical batch runs, it is found that there are periods of idle resources and no jobs are being executed, that is, resources are not fully utilized. This situation is related to the two variable factors of the maximum number of concurrent tasks and task dependencies. It may be that the number of running tasks has reached the maximum number of concurrent tasks, or the pre-dependencies of the tasks are not met.
[0007] The original intention of designing task priority is to ensure that core key jobs can be prioritized in the job distribution queue under any circumstances. However, the priority of tasks is a complex game. In addition to the importance of business application scenarios, it can also depend on many factors, such as the execution time of the task itself, the maximum number of concurrent tasks, etc.
[0008] There is a task scheduling method, device and electronic device, which includes: after receiving a task request for a first task, scheduling the first task to a fifth task block to wait for scheduling, continuously detecting whether the number of tasks being executed in a second task block is less than a preset maximum concurrency, and if so, calling the second task from other task blocks to the second task block and executing the second task, thereby first storing the received task in the fifth task block for queuing, and when the number of tasks being executed in the second task block is less than the preset maximum concurrency, calling the task from other task blocks.
[0009] However, the existing technology is still not suitable for data warehouses, lacks task scheduling design for each database, and does not consider the problem of task classification. Therefore, how to invent a unified scheduling method and system for enterprise-level data warehouse tasks is a technical problem that urgently needs to be solved in this technical field. Summary of the invention
[0010] In order to solve the problem that the prior art is not suitable for data warehouses, lacks task scheduling design for each database, and does not consider task classification, the present invention provides a unified scheduling method and system for enterprise-level data warehouse tasks, which has the characteristics of intelligent and automatic operation.
[0011] In order to achieve the above-mentioned purpose of the present invention, the technical scheme adopted is as follows:
[0012] A unified scheduling method for enterprise-level data warehouse tasks, wherein the enterprise-level data warehouse includes ODS, DW, and CUBE databases, and the method includes the following specific steps:
[0013] When the data warehouse performs the job search process, it collects resource status information and task status information from the ODS database;
[0014] Determine whether the resource status of ODS is tight. If so, reduce the maximum number of concurrent tasks. If not, further determine whether the current task queue is too long and whether there is a core task delay. If the queue is too long, increase the maximum number of concurrent tasks. If there is a core task delay, increase the priority of the core task.
[0015] After the ODS data is extracted and loaded into the DW, the resource status information and task status information of the DW database are collected;
[0016] Determine whether the DW resource status is tight. If so, reduce the maximum number of concurrent tasks. If not, further determine whether the current task queue is too long and whether there is a core task delay. If the queue is too long, increase the maximum number of concurrent tasks. If there is a core task delay, increase the priority of the core task.
[0017] After the DW data is extracted and loaded into CUBE, the resource status information and task status information of the CUBE database are collected;
[0018] Determine whether the resource status of CUBE is tight. If so, reduce the maximum number of concurrent tasks. If not, further determine whether the current task queue is too long. If not, increase the maximum number of concurrent tasks.
[0019] Preferably, for ODS and DW databases, the resource status information specifically refers to the server CPU occupancy rate and IO resource occupancy rate; for CUBE database, the resource status information specifically refers to memory occupancy; for ODS and DW databases, the task status information includes the maximum concurrent task number, task queuing status, and task delay status; for CUBE database, the task status information includes the maximum concurrent task number and task queuing status.
[0020] Furthermore, after collecting the task status information of ODS or DW, the resource status information and task status information are classified and graded to obtain the core tasks and task priorities. The specific steps are as follows:
[0021] For ODS tasks:
[0022] Query the core key business report. If the task in it corresponds to the task of ODS, then the task is regarded as the core task.
[0023] Design an ODS evaluation standard that takes into account the importance of application scenarios, average table processing time, table data volume, data sensitivity, and task creation time, and assign weights to each evaluation item in the ODS evaluation standard based on needs;
[0024] Scoring the tasks in the core task queue and the non-core task queue of the ODS according to the ODS evaluation criteria; prioritizing the tasks in the core task queue and the non-core task queue of the ODS according to the scores;
[0025] For DW's tasks:
[0026] Query the core key business report. If the task in it corresponds to the task in DW, then the task is regarded as the core task.
[0027] Design DW evaluation criteria that take into account the importance of application scenarios, average table processing time, table reference depth or breadth, data sensitivity, and task creation time, and assign weights to each evaluation item in the DW evaluation criteria based on needs;
[0028] Scoring the tasks in the core task queue and the non-core task queue of the DW according to the DW evaluation criteria; and prioritizing the tasks in the core task queue and the non-core task queue of the DW according to the scores.
[0029] Furthermore, it is determined whether the resource status of the ODS is tight. If so, the maximum number of concurrent tasks is reduced; if not, it is further determined whether the current task queue is too long and whether there is a core task delay. If the queue is too long, the maximum number of concurrent tasks is increased. If there is a core task delay, the priority of the core task is increased. The specific steps are as follows:
[0030] Set the CPU usage, IO resource usage, current task queue threshold, task priority threshold, and task delay threshold of ODS;
[0031] If the current CPU usage or IO resource usage of the ODS is greater than the set threshold, the ODS resource status is considered to be tight, and the maximum concurrent task number is reduced by the set amount;
[0032] If the current CPU occupancy rate and IO resource occupancy rate of ODS are both lower than the set threshold, it is determined that the resource status of ODS is not tight, and it is further determined whether the current task queue is greater than the current task queue threshold. If so, the maximum concurrent number of tasks is increased by the set amount, and the newly added concurrent tasks are reclassified; if not, it is further determined whether there are any high-priority tasks in the task queue that are higher than the task priority threshold and have not been processed. If so, the maximum concurrent number of tasks is increased by the set amount, and the newly added concurrent tasks are reclassified; if not, it is further determined whether there is a core task processing time greater than the task delay threshold. If so, the priority of the core task is increased by the set amount, the maximum concurrent number of tasks is increased by the set amount, and the newly added concurrent tasks are reclassified.
[0033] Furthermore, set the CPU usage threshold, IO resource usage threshold, and current task queue threshold of DW; determine whether the resource status of DW is tight, if so, reduce the maximum number of concurrent tasks; if not, further determine whether the current task queue is too long, if so, increase the maximum number of concurrent tasks. The specific steps are as follows:
[0034] Set the CPU usage, IO resource usage, current task queue threshold, task priority threshold, task delay threshold, and abnormal situation threshold of DW;
[0035] If the current CPU usage or IO resource usage of the DW is greater than the set threshold, the DW resource status is judged to be tight, and the maximum concurrent task number is reduced by the set amount;
[0036] If the current CPU occupancy rate and IO resource occupancy rate of DW are all less than the set threshold, it is determined that the resource status of DW is not tight, and it is further determined whether the current task queue is greater than the current task queue threshold. If so, the maximum task concurrency number is increased by the set amount, and the newly added concurrent tasks are reclassified; if not, it is further determined whether there are high-priority tasks in the task queue that are higher than the task priority threshold that have not been processed. If so, the maximum task concurrency number is increased by the set amount, and the newly added concurrent tasks are reclassified; if not, it is further determined whether there is a situation where the core task processing time is greater than the task delay threshold. If so, it is further determined whether the core task delay is greater than the abnormal situation threshold. If not, the priority of the core task is increased by the set amount, the maximum task concurrency number is increased by the set amount, and the newly added concurrent tasks are reclassified; if so, it is determined that there is a task dependency problem, and the core task is analyzed by link to find the strong dependency tasks that are not satisfied in its predecessor dependency tasks, adjust the task to weak dependency, and increase the priority of the core task by the set amount.
[0037] Furthermore, the core task is analyzed for links, unsatisfied dependencies are found in its pre-dependencies, and the task is adjusted to a weak dependency. The specific steps are as follows:
[0038] Extract all the predecessor and successor tasks with strong dependency marks of the core task from the task dependency table;
[0039] Detect the predecessor and successor tasks marked with strong dependencies to find out whether there are any tasks with abnormal situations including task delay or non-execution. If so, adjust the task to a weak dependency. If not, use the pre-trained machine learning model to predict the tasks that may not be satisfied in the predecessor and successor tasks marked with strong dependencies; adjust the tasks that may not be satisfied to weak dependencies.
[0040] Furthermore, it is determined whether the resource status of CUBE is tight. If so, the maximum number of concurrent tasks is reduced; if not, it is further determined whether the current task queue is too long. If not, the maximum number of concurrent tasks is increased. The specific steps are as follows:
[0041] Set the memory usage threshold of CUBE;
[0042] If the memory usage of CUBE is greater than the set threshold, the ODS resource status is judged to be tight, and the maximum number of concurrent tasks is reduced by the set amount;
[0043] If the memory usage of CUBE is not greater than the set threshold, it is determined that the resource status of CUBE is not tight, then the maximum concurrent number of tasks is increased by the set amount, and the newly added concurrent tasks are reclassified.
[0044] Furthermore, the task delay threshold includes a task start time delay threshold and a task execution time threshold; when judging whether there is a core task delay in ODS or DW, if the start time or execution time of any core task exceeds the threshold, it is judged that there is a core task processing time greater than the task delay threshold.
[0045] Furthermore, after the scheduling is completed, the enterprise data warehouse tasks are also monitored in real time. The specific steps are as follows:
[0046] The task execution status is detected in real time. If a task delay is found, the database to which the delayed task belongs is located, the corresponding resource status information and task status information are obtained, and the task is scheduled through the steps of the corresponding task scheduling method.
[0047] A unified scheduling system for enterprise-level data warehouse tasks, used in an enterprise-level data warehouse, wherein the enterprise-level data warehouse includes ODS, DW, and CUBE databases, and the system includes a data collection module and an intelligent scheduling module;
[0048] The data collection module is used for:
[0049] When performing job search process in the data warehouse, collect resource status information and task status information of the ODS database;
[0050] After the ODS data is extracted and loaded into the DW, the resource status information and task status information of the DW database are collected;
[0051] After the DW data is extracted and loaded into CUBE, the resource status information and task status information of the CUBE database are collected;
[0052] The intelligent scheduling module is used for:
[0053] Determine whether the resource status of ODS is tight. If so, reduce the maximum number of concurrent tasks. If not, further determine whether the current task queue is too long and whether there is a core task delay. If the queue is too long, increase the maximum number of concurrent tasks. If there is a core task delay, increase the priority of the core task.
[0054] Determine whether the DW resource status is tight. If so, reduce the maximum number of concurrent tasks. If not, further determine whether the current task queue is too long and whether there is a core task delay. If the queue is too long, increase the maximum number of concurrent tasks. If there is a core task delay, increase the priority of the core task.
[0055] Determine whether the resource status of CUBE is tight. If so, reduce the maximum number of concurrent tasks. If not, further determine whether the current task queue is too long. If not, increase the maximum number of concurrent tasks.
[0056] The beneficial effects of the present invention are as follows:
[0057] The present invention discloses a unified scheduling method for enterprise-level data warehouse tasks, which fully considers the database structure and task flow of the data warehouse, and schedules tasks for ODS, DW, and CUBE databases in turn by adjusting the maximum number of concurrent tasks and the priority of core tasks, thereby solving the problems in the prior art that the method is not suitable for data warehouses, lacks task scheduling design for each database, and does not consider task classification, and has the characteristics of intelligent and automatic operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 It is a flow chart of a unified scheduling method for enterprise-level data warehouse tasks according to the present invention.
[0059] Figure 2 The present invention is a task scheduling diagram of an ODS database of a unified scheduling method for enterprise-level data warehouse tasks.
[0060] Figure 3The present invention is a task scheduling diagram of a DW database of a unified scheduling method for enterprise-level data warehouse tasks.
[0061] Figure 4 It is a task scheduling diagram of a CUBE database of a unified scheduling method for enterprise-level data warehouse tasks of the present invention. DETAILED DESCRIPTION
[0062] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0063] Example 1
[0064] like Figure 1 As shown, a unified scheduling method for enterprise-level data warehouse tasks, the enterprise-level data warehouse includes ODS, DW, CUBE databases, and the method includes the following specific steps:
[0065] When the data warehouse performs the job search process, it collects resource status information and task status information from the ODS database;
[0066] Determine whether the resource status of ODS is tight. If so, reduce the maximum number of concurrent tasks. If not, further determine whether the current task queue is too long and whether there is a core task delay. If the queue is too long, increase the maximum number of concurrent tasks. If there is a core task delay, increase the priority of the core task.
[0067] After the ODS data is extracted and loaded into the DW, the resource status information and task status information of the DW database are collected;
[0068] Determine whether the DW resource status is tight. If so, reduce the maximum number of concurrent tasks. If not, further determine whether the current task queue is too long and whether there is a core task delay. If the queue is too long, increase the maximum number of concurrent tasks. If there is a core task delay, increase the priority of the core task.
[0069] After the DW data is extracted and loaded into CUBE, the resource status information and task status information of the CUBE database are collected;
[0070] Determine whether the resource status of CUBE is tight. If so, reduce the maximum number of concurrent tasks. If not, further determine whether the current task queue is too long. If not, increase the maximum number of concurrent tasks.
[0071] Example 2
[0072] More specifically, in a specific embodiment, for ODS and DW databases, the resource status information specifically refers to the server CPU occupancy rate and IO resource occupancy rate; for CUBE database, the resource status information specifically refers to memory occupancy; for ODS and DW databases, the task status information includes the maximum concurrent task number, task queuing status, and task delay status; for CUBE database, the task status information includes the maximum concurrent task number and task queuing status.
[0073] In this embodiment, the collected resource status information and task status information are also recorded in the resource status table.
[0074] In a specific embodiment, after collecting the task status information of the ODS or DW, the resource status information and the task status information are classified and graded to obtain the core tasks and task priorities. The specific steps are as follows:
[0075] For ODS tasks:
[0076] Query the core key business report. If the task in it corresponds to the task of ODS, then the task is regarded as the core task.
[0077] Design an ODS evaluation standard that takes into account the importance of application scenarios, average table processing time, table data volume, data sensitivity, and task creation time, and assign weights to each evaluation item in the ODS evaluation standard based on needs;
[0078] Scoring the tasks in the core task queue and the non-core task queue of the ODS according to the ODS evaluation criteria; prioritizing the tasks in the core task queue and the non-core task queue of the ODS according to the scores;
[0079] For DW's tasks:
[0080] Query the core key business report. If the task in it corresponds to the task in DW, then the task is regarded as the core task.
[0081] Design DW evaluation criteria that take into account the importance of application scenarios, average table processing time, table reference depth or breadth, data sensitivity, and task creation time, and assign weights to each evaluation item in the DW evaluation criteria based on needs;
[0082] Scoring the tasks in the core task queue and the non-core task queue of the DW according to the DW evaluation criteria; and prioritizing the tasks in the core task queue and the non-core task queue of the DW according to the scores.
[0083] In this embodiment, after classification and grading, in task polling, core tasks are processed first, and non-core tasks are processed later, and high priority tasks are processed first, and low priority tasks are processed later.
[0084] In a specific embodiment, Figure 2 As shown, determine whether the resource status of ODS is tight. If so, reduce the maximum number of concurrent tasks. If not, further determine whether the current task queue is too long and whether there is a core task delay. If the queue is too long, increase the maximum number of concurrent tasks. If there is a core task delay, increase the priority of the core task. The specific steps are:
[0085] Set the CPU usage, IO resource usage, current task queue threshold, task priority threshold, and task delay threshold of ODS;
[0086] In this embodiment, the CPU occupancy rate threshold is 80%, the IO resource occupancy rate is 80%, the current task queue threshold is 40, the task priority threshold is level 8, and the task delay threshold is the startup time delay of 15 minutes.
[0087] If the current CPU usage or IO resource usage of the ODS is greater than the set threshold, the ODS resource status is considered to be tight, and the maximum concurrent task number is reduced by the set amount;
[0088] In this embodiment, the set amount is 5.
[0089] If the current CPU occupancy rate and IO resource occupancy rate of ODS are both lower than the set threshold, it is determined that the resource status of ODS is not tight, and it is further determined whether the current task queue is greater than the current task queue threshold. If so, the maximum concurrent number of tasks is increased by the set amount, and the newly added concurrent tasks are reclassified; if not, it is further determined whether there are any high-priority tasks in the task queue that are higher than the task priority threshold and have not been processed. If so, the maximum concurrent number of tasks is increased by the set amount, and the newly added concurrent tasks are reclassified; if not, it is further determined whether there is a core task processing time greater than the task delay threshold. If so, the priority of the core task is increased by the set amount, the maximum concurrent number of tasks is increased by the set amount, and the newly added concurrent tasks are reclassified.
[0090] In this embodiment, the maximum number of concurrent tasks is fixed by the system to 40.
[0091] In this embodiment, the maximum number of concurrent tasks is increased. Specifically, the maximum number of concurrent tasks is increased to 40+X, and X is distributed according to the task type distribution counted above.
[0092] In this embodiment, raising the task priority specifically means increasing the task priority by one level.
[0093] In a specific embodiment, Figure 3 As shown, set the CPU usage threshold, IO resource usage threshold, and current task queue threshold of DW; determine whether the resource status of DW is tight, if so, reduce the maximum number of concurrent tasks; if not, further determine whether the current task queue is too long, if so, increase the maximum number of concurrent tasks. The specific steps are as follows:
[0094] Set the CPU usage, IO resource usage, current task queue threshold, task priority threshold, task delay threshold, and abnormal situation threshold of DW;
[0095] In this embodiment, the CPU occupancy rate threshold is 80%, the IO resource occupancy rate is 80%, the current task queue threshold is 35, the task priority threshold is level 9, the task delay threshold is greater than the average startup time of the past 7 days by 15 minutes or greater than the average execution time of the past 7 days by 30 minutes, and the abnormal situation threshold is greater than the average startup time of the past 7 days by 30 minutes or greater than the average execution time of the past 7 days by 45 minutes.
[0096] If the current CPU usage or IO resource usage of DW is greater than the set threshold, the resource status of DW is judged to be tight, and the maximum concurrent task number is reduced by the set amount;
[0097] In this embodiment, the set amount is 5.
[0098] If the current CPU occupancy rate and IO resource occupancy rate of DW are all less than the set threshold, it is determined that the resource status of DW is not tight, and it is further determined whether the current task queue is greater than the current task queue threshold. If so, the maximum task concurrency number is increased by the set amount, and the newly added concurrent tasks are reclassified; if not, it is further determined whether there are high-priority tasks in the task queue that are higher than the task priority threshold that have not been processed. If so, the maximum task concurrency number is increased by the set amount, and the newly added concurrent tasks are reclassified; if not, it is further determined whether there is a situation where the core task processing time is greater than the task delay threshold. If so, it is further determined whether the core task delay is greater than the abnormal situation threshold. If not, the priority of the core task is increased by the set amount, the maximum task concurrency number is increased by the set amount, and the newly added concurrent tasks are reclassified; if so, it is determined that there is a task dependency problem, and the core task is analyzed by link to find the strong dependency tasks that are not satisfied in its predecessor dependency tasks, adjust the task to weak dependency, and increase the priority of the core task by the set amount.
[0099] In this embodiment, the maximum number of concurrent tasks is fixed by the system to 35.
[0100] In this embodiment, the maximum number of concurrent tasks is increased. Specifically, the maximum number of concurrent tasks is increased to 35+Y, and Y is distributed according to the task type distribution counted above.
[0101] In this embodiment, raising the task priority specifically means increasing the task priority by one level.
[0102] In a specific embodiment, link analysis is performed on the core task to find unsatisfied dependencies in its pre-dependencies, and the task is adjusted to a weak dependency. The specific steps are:
[0103] Extract all the predecessor and successor tasks with strong dependency marks of the core task from the task dependency table;
[0104] Detect the predecessor and successor tasks marked with strong dependencies to find out whether there are any tasks with abnormal situations including task delay or non-execution. If so, adjust the task to a weak dependency. If not, use the pre-trained machine learning model to predict the tasks that may not be satisfied in the predecessor and successor tasks marked with strong dependencies; adjust the tasks that may not be satisfied to weak dependencies.
[0105] In a specific embodiment, Figure 4 As shown, determine whether the resource status of CUBE is tight. If so, reduce the maximum number of concurrent tasks; if not, further determine whether the current task queue is too long. If not, increase the maximum number of concurrent tasks. The specific steps are:
[0106] Set the memory usage threshold of CUBE;
[0107] In this embodiment, the memory usage threshold of CUBE is 160G.
[0108] If the memory usage of CUBE is greater than the set threshold, the ODS resource status is judged to be tight, and the maximum number of concurrent tasks is reduced by the set amount;
[0109] In this embodiment, the set amount is 2.
[0110] If the memory usage of CUBE is not greater than the set threshold, it is determined that the resource status of CUBE is not tight, then the maximum concurrent number of tasks is increased by the set amount, and the newly added concurrent tasks are reclassified.
[0111] In this embodiment, the maximum number of concurrent tasks is fixed by the system to 10.
[0112] In this embodiment, the maximum number of concurrent tasks is increased. Specifically, the maximum number of concurrent tasks is increased to 10+Z, and Y is allocated according to the task type distribution counted above.
[0113] In a specific embodiment, the task delay threshold includes a task start time delay threshold and a task execution time threshold; when judging whether there is a core task delay in ODS or DW, if the start time or execution time of any core task exceeds the threshold, it is judged that the core task processing time is greater than the task delay threshold.
[0114] In a specific embodiment, after the scheduling is completed, the enterprise-level data warehouse task is also monitored in real time, and the specific steps are as follows:
[0115] The task execution status is detected in real time. If a task delay is found, the database to which the delayed task belongs is located, the corresponding resource status information and task status information are obtained, and the task is scheduled through the steps of the corresponding task scheduling method.
[0116] Therefore, the present invention realizes intelligent task concurrency by designing the task scheduling process for each database in the data warehouse, solves the problem of idle resource waste and resource-constrained task blocking; the present invention obtains core tasks and task priorities by classifying and grading resource status information and task status information, and ensures the progress of task advancement; the present invention considers the task dependency problem of the DW database, designs intelligent strong and weak dependency adjustment, and the task anomalies with negligible impact can be automatically operated and maintained through changes in dependencies. The present invention fully considers the maximum number of concurrent tasks, task priorities, and task dependencies, and combines the above three variable factors to upgrade the unified scheduling mechanism to a new generation of intelligent production scheduling system, solving the problem that the traditional task scheduling method cannot automatically adjust the task concurrency parameters according to the current resource situation, cannot automatically adjust the task polling order according to the hierarchical response level, and cannot automatically adjust the task dependency according to the downstream impact.
[0117] Example 3
[0118] A unified scheduling system for enterprise-level data warehouse tasks, used in an enterprise-level data warehouse, wherein the enterprise-level data warehouse includes ODS, DW, and CUBE databases, and the system includes a data collection module and an intelligent scheduling module;
[0119] The data collection module is used for:
[0120] When performing job search process in the data warehouse, collect resource status information and task status information of the ODS database;
[0121] After the ODS data is extracted and loaded into the DW, the resource status information and task status information of the DW database are collected;
[0122] After the DW data is extracted and loaded into CUBE, the resource status information and task status information of the CUBE database are collected;
[0123] The intelligent scheduling module is used for:
[0124] Determine whether the resource status of ODS is tight. If so, reduce the maximum number of concurrent tasks. If not, further determine whether the current task queue is too long and whether there is a core task delay. If the queue is too long, increase the maximum number of concurrent tasks. If there is a core task delay, increase the priority of the core task.
[0125] Determine whether the DW resource status is tight. If so, reduce the maximum number of concurrent tasks. If not, further determine whether the current task queue is too long and whether there is a core task delay. If the queue is too long, increase the maximum number of concurrent tasks. If there is a core task delay, increase the priority of the core task.
[0126] Determine whether the resource status of CUBE is tight. If so, reduce the maximum number of concurrent tasks. If not, further determine whether the current task queue is too long. If not, increase the maximum number of concurrent tasks.
[0127] Obviously, the above embodiments of the present invention are only examples for clearly explaining the present invention, and are not intended to limit the implementation methods of the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention shall be included in the protection scope of the claims of the present invention.
Claims
1. A unified scheduling method for enterprise-level data warehouse tasks, Features: The enterprise-level data warehouse includes ODS, DW, and CUBE databases, and the method includes the following specific steps: When the data warehouse performs the job search process, it collects resource status information and task status information from the ODS database; After collecting the task status information of ODS or DW, the resource status information and task status information are classified and graded to obtain the core tasks and task priorities. The specific steps are as follows: For ODS tasks: Query the core key business report. If the task in it corresponds to the task of ODS, then the task is regarded as the core task; Design an ODS evaluation standard that takes into account the importance of application scenarios, average table processing time, table data volume, data sensitivity, and task creation time, and assign weights to each evaluation item in the ODS evaluation standard based on needs; Scoring the tasks in the ODS core task queue and non-core task queue according to the ODS evaluation criteria; Prioritize the tasks in the ODS core task queue and non-core task queue according to the scores; For DW's tasks: Query the core key business report. If the task in it corresponds to the task in DW, then the task is regarded as the core task. Design DW evaluation criteria that take into account the importance of application scenarios, average table processing time, table reference depth or breadth, data sensitivity, and task creation time, and assign weights to each evaluation item in the DW evaluation criteria based on needs; Score the tasks in the DW core task queue and non-core task queue according to the DW evaluation criteria; Prioritize tasks in the DW core task queue and non-core task queue according to the scores; Determine whether the resource status of ODS is tight. If so, reduce the maximum number of concurrent tasks. If not, further determine whether the current task queue is too long and whether there is a core task delay. If the queue is too long, increase the maximum number of concurrent tasks. If there is a core task delay, increase the priority of the core task. After the ODS data is extracted and loaded into the DW, the resource status information and task status information of the DW database are collected; Determine whether the DW resource status is tight. If so, reduce the maximum number of concurrent tasks. If not, further determine whether the current task queue is too long and whether there is a core task delay. If the queue is too long, increase the maximum number of concurrent tasks. If there is a core task delay, increase the priority of the core task. After the DW data is extracted and loaded into CUBE, the resource status information and task status information of the CUBE database are collected; Determine whether the resource status of CUBE is tight. If so, reduce the maximum number of concurrent tasks. If not, further determine whether the current task queue is too long. If not, increase the maximum number of concurrent tasks.
2. The unified scheduling method for enterprise-level data warehouse tasks according to claim 1, Features: For ODS and DW databases, the resource status information specifically refers to the server CPU occupancy rate and IO resource occupancy rate; for CUBE database, the resource status information specifically refers to the memory occupancy rate; for ODS and DW databases, the task status information includes the maximum concurrent task number, task queuing status, and task delay status; for CUBE database, the task status information includes the maximum concurrent task number and task queuing status.
3. The unified scheduling method for enterprise-level data warehouse tasks according to claim 2, Features: Determine whether the resource status of ODS is tight. If so, reduce the maximum number of concurrent tasks. If not, further determine whether the current task queue is too long and whether there is a core task delay. If the queue is too long, increase the maximum number of concurrent tasks. If there is a core task delay, increase the priority of the core task. The specific steps are as follows: Set the CPU usage, IO resource usage, current task queue threshold, task priority threshold, and task delay threshold of ODS; If the current CPU usage or IO resource usage of the ODS is greater than the set threshold, the ODS resource status is considered to be tight, and the maximum concurrent task number is reduced by the set amount; If the current CPU occupancy rate and IO resource occupancy rate of ODS are both lower than the set threshold, it is determined that the resource status of ODS is not tight, and it is further determined whether the current task queue is greater than the current task queue threshold. If so, the maximum concurrent number of tasks is increased by the set amount, and the newly added concurrent tasks are reclassified; if not, it is further determined whether there are any high-priority tasks in the task queue that are higher than the task priority threshold and have not been processed. If so, the maximum concurrent number of tasks is increased by the set amount, and the newly added concurrent tasks are reclassified; if not, it is further determined whether there is a core task processing time greater than the task delay threshold. If so, the priority of the core task is increased by the set amount, the maximum concurrent number of tasks is increased by the set amount, and the newly added concurrent tasks are reclassified.
4. The unified scheduling method for enterprise-level data warehouse tasks according to claim 3, Features: Set the CPU usage threshold, IO resource usage threshold, and current task queue threshold of DW; determine whether the resource status of DW is tight, if so, reduce the maximum number of concurrent tasks; if not, further determine whether the current task queue is too long, if so, increase the maximum number of concurrent tasks. The specific steps are as follows: Set the CPU usage, IO resource usage, current task queue threshold, task priority threshold, task delay threshold, and abnormal situation threshold of DW; If the current CPU usage or IO resource usage of the DW is greater than the set threshold, the DW resource status is judged to be tight, and the maximum concurrent task number is reduced by the set amount; If the current CPU occupancy rate and IO resource occupancy rate of DW are all less than the set threshold, it is determined that the resource status of DW is not tight, and it is further determined whether the current task queue is greater than the current task queue threshold. If so, the maximum task concurrency number is increased by the set amount, and the newly added concurrent tasks are reclassified; if not, it is further determined whether there are high-priority tasks in the task queue that are higher than the task priority threshold that have not been processed. If so, the maximum task concurrency number is increased by the set amount, and the newly added concurrent tasks are reclassified; if not, it is further determined whether there is a situation where the core task processing time is greater than the task delay threshold. If so, it is further determined whether the core task delay is greater than the abnormal situation threshold. If not, the priority of the core task is increased by the set amount, the maximum task concurrency number is increased by the set amount, and the newly added concurrent tasks are reclassified; If so, it is determined that there is a task dependency problem, and a link analysis is performed on the core task to find the strong dependency tasks that are not satisfied in its predecessor dependency tasks, adjust the task to a weak dependency, and increase the priority of the core task by the set amount.
5. The unified scheduling method for enterprise-level data warehouse tasks according to claim 4, Features: Perform link analysis on the core task, find out the unsatisfied dependencies in its pre-dependencies, and adjust the task to a weak dependency. The specific steps are as follows: Extract all the predecessor and successor tasks with strong dependency marks of the core task from the task dependency table; Detect the predecessor and successor tasks marked with strong dependencies to find out whether there are any tasks with abnormal situations including task delay or non-execution. If so, adjust the task to a weak dependency. If not, use the pre-trained machine learning model to predict the tasks that may not be satisfied in the predecessor and successor tasks marked with strong dependencies; adjust the tasks that may not be satisfied to weak dependencies.
6. The unified scheduling method for enterprise-level data warehouse tasks according to claim 5, Features: Determine whether the resource status of CUBE is tight. If so, reduce the maximum number of concurrent tasks. If not, further determine whether the current task queue is too long. If not, increase the maximum number of concurrent tasks. The specific steps are: Set the memory usage threshold of CUBE; If the memory usage of CUBE is greater than the set threshold, the ODS resource status is judged to be tight, and the maximum number of concurrent tasks is reduced by the set amount; If the memory usage of CUBE is not greater than the set threshold, it is determined that the resource status of CUBE is not tight, then the maximum concurrent number of tasks is increased by the set amount, and the newly added concurrent tasks are reclassified.
7. The unified scheduling method for enterprise-level data warehouse tasks according to claim 6, Features: The task delay threshold includes a task start time delay threshold and a task execution time threshold; when judging whether there is a core task delay in ODS or DW, if the start time or execution time of any core task exceeds the threshold, it is judged that the core task processing time is greater than the task delay threshold.
8. The unified scheduling method for enterprise-level data warehouse tasks according to claim 7, Features: After the scheduling is completed, the enterprise-level data warehouse tasks are also monitored in real time. The specific steps are as follows: The task execution status is detected in real time. If a task delay is found, the database to which the delayed task belongs is located, the corresponding resource status information and task status information are obtained, and the task is scheduled through the steps of the corresponding task scheduling method.
9. A unified scheduling system for enterprise-level data warehouse tasks, Features: Used in an enterprise-level data warehouse, the enterprise-level data warehouse includes ODS, DW, CUBE databases, and the system includes a data collection module and an intelligent scheduling module; The data collection module is used for: When performing job search process in the data warehouse, collect resource status information and task status information of the ODS database; After the ODS data is extracted and loaded into the DW, the resource status information and task status information of the DW database are collected; After the DW data is extracted and loaded into CUBE, the resource status information and task status information of the CUBE database are collected; After collecting the task status information of ODS or DW, the resource status information and task status information are classified and graded to obtain the core tasks and task priorities. The specific steps are as follows: For ODS tasks: Query the core key business report. If the task in it corresponds to the task of ODS, then the task is regarded as the core task; Design an ODS evaluation standard that takes into account the importance of application scenarios, average table processing time, table data volume, data sensitivity, and task creation time, and assign weights to each evaluation item in the ODS evaluation standard based on needs; Scoring the tasks in the ODS core task queue and non-core task queue according to the ODS evaluation criteria; Prioritize the tasks in the ODS core task queue and non-core task queue according to the scores; For DW's tasks: Query the core key business report. If the task in it corresponds to the task in DW, then the task is regarded as the core task. Design DW evaluation criteria that take into account the importance of application scenarios, average table processing time, table reference depth or breadth, data sensitivity, and task creation time, and assign weights to each evaluation item in the DW evaluation criteria based on needs; Score the tasks in the DW core task queue and non-core task queue according to the DW evaluation criteria; Prioritize tasks in the DW core task queue and non-core task queue according to the scores; The intelligent scheduling module is used for: Determine whether the resource status of ODS is tight. If so, reduce the maximum number of concurrent tasks. If not, further determine whether the current task queue is too long and whether there is a core task delay. If the queue is too long, increase the maximum number of concurrent tasks. If there is a core task delay, increase the priority of the core task. Determine whether the DW resource status is tight. If so, reduce the maximum number of concurrent tasks. If not, further determine whether the current task queue is too long and whether there is a core task delay. If the queue is too long, increase the maximum number of concurrent tasks. If there is a core task delay, increase the priority of the core task. Determine whether the resource status of CUBE is tight. If so, reduce the maximum number of concurrent tasks. If not, further determine whether the current task queue is too long. If not, increase the maximum number of concurrent tasks.
