Abnormal query task processing method and device, electronic equipment and storage medium

By monitoring and classifying the query task execution queue of the target cluster, abnormal query tasks are transferred to a degraded execution queue for processing, which solves the resource consumption problem caused by abnormal query tasks and improves data processing efficiency.

CN121880106APending Publication Date: 2026-04-17INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
INDUSTRIAL AND COMMERCIAL BANK OF CHINA
Filing Date
2025-12-04
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

In existing technologies, the methods for detecting and eliminating abnormal query tasks lead users to repeatedly submit the same query tasks, increasing resource consumption and reducing data processing efficiency.

Method used

By monitoring the query task execution queue of the target cluster, abnormal query tasks are identified, classified according to the exception type and task priority, and a degraded execution queue is configured for each category. Abnormal query tasks are transferred to the degraded execution queue for processing. The resource volume of the degraded execution queue is smaller than that of the original queue.

Benefits of technology

While ensuring the normal execution of query tasks, resource consumption is reduced, data processing efficiency is improved, and the problem of resource waste caused by abnormal query tasks is solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121880106A_ABST
    Figure CN121880106A_ABST
Patent Text Reader

Abstract

The invention discloses an abnormal query task processing method and device, electronic equipment and a storage medium, and relates to the technical field of big data or other related technical fields, and the method comprises the following steps: monitoring a query task execution queue of a target cluster, and identifying an abnormal query task; classifying the abnormal query tasks based on the abnormal types and the task priorities of the abnormal query tasks; configuring a degradation execution queue for each type of abnormal query task based on the cluster granularity of the target cluster; the abnormal query task is transferred from the query task execution queue to a degradation execution queue corresponding to the abnormal query task to be processed, and the cluster resource quantity of the degradation execution queue is smaller than the cluster resource quantity of the query task execution queue. According to the method and the device, the technical problems that in related technologies, a mode of searching and killing an abnormal query task causes a user to repeatedly submit the same query task, resource occupation is aggravated, and data processing efficiency is reduced are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of big data technology or other related technical fields. Specifically, it relates to a method, apparatus, electronic device, and storage medium for processing abnormal query tasks. Background Technology

[0002] In the current big data processing environment, some data warehouse tools enable distributed data querying within distributed data management clusters by constructing SQL-like query statements, greatly simplifying the querying and management of large-scale datasets. However, with the continuous growth of business needs, distributed data management clusters face increasingly complex queries. Some of these queries, due to their complexity or excessively large data access scope, result in exceptionally long execution times, consuming significant cluster resources and potentially causing a significant degrade in cluster performance, impacting normal business operations and user experience.

[0003] In related technologies, when a system detects an anomaly in a query task, system administrators or automated management mechanisms may choose to "kill" the task to protect the overall performance and stability of the system. While killing a query task can release resources immediately, it often leads to users repeatedly submitting the same query. This behavior exacerbates resource consumption and may even cause cluster instability. Furthermore, simple killing does not solve the fundamental problem; users may be frustrated by the inability to complete queries, affecting the continuity and efficiency of data processing.

[0004] There is currently no effective solution to the above problems. Summary of the Invention

[0005] This invention provides a method, apparatus, electronic device, and storage medium for processing abnormal query tasks, to at least solve the technical problem in related technologies where methods for detecting and eliminating abnormal query tasks lead to users repeatedly submitting the same query tasks, increasing resource consumption, and reducing data processing efficiency.

[0006] According to one aspect of the present invention, a method for processing abnormal query tasks is provided, comprising: monitoring a query task execution queue of a target cluster and identifying abnormal query tasks; classifying the abnormal query tasks based on their abnormality type and task priority; configuring a degraded execution queue for each category of abnormal query tasks based on the cluster granularity of the target cluster; and transferring the abnormal query tasks from the query task execution queue to the degraded execution queue corresponding to the abnormal query tasks for processing, wherein the cluster resource size of the degraded execution queue is smaller than the cluster resource size of the query task execution queue.

[0007] Further, the steps for identifying abnormal query tasks include: obtaining the execution duration of the query task in the query task execution queue; comparing the execution duration with a preset execution duration threshold to obtain an execution duration comparison result; and determining that the query task is abnormal when the execution duration comparison result indicates that the execution duration of the query task is greater than the execution duration threshold, thereby obtaining the abnormal query task.

[0008] Furthermore, the step of identifying abnormal query tasks also includes: obtaining the execution plan of the query task in the query task execution queue; determining the number of blocks to be read by the query task based on the execution plan; comparing the number of blocks to be read by the query task with a block number threshold to obtain a block number comparison result; and determining that the query task is abnormal if the block number comparison result indicates that the number of blocks to be read by the query task is greater than the block number threshold, thereby obtaining the abnormal query task.

[0009] Furthermore, the step of identifying abnormal query tasks also includes: obtaining the statement structure and query logic of the query statement corresponding to the query task in the query task execution queue; calculating the hash value of the query task based on the statement structure and query logic; matching the hash value of the query task with the hash value list; and if the hash value of the query task matches the hash value list successfully, determining that the query task is abnormal, and obtaining the abnormal query task.

[0010] Further, the step of classifying the abnormal query tasks based on the exception type and task priority includes: configuring a first weight value for the abnormal query task based on the exception type; configuring a second weight value for the abnormal query task based on the task priority; calculating the risk coefficient of the abnormal query task based on the first weight value and the second weight value; classifying the abnormal query task based on the risk coefficient to obtain a first priority abnormal task, a second priority abnormal task, and a third priority abnormal task, wherein the execution priority of the first priority abnormal task is greater than the execution priority of the second priority abnormal task, and the execution priority of the second priority abnormal task is greater than the execution priority of the third priority abnormal task.

[0011] Further, the step of configuring degraded execution queues for each category of abnormal query tasks based on the cluster granularity of the target cluster includes: constructing the degraded execution queues for the first priority abnormal task, the second priority abnormal task, and the third priority abnormal task, respectively, to obtain a first degraded execution queue, a second degraded execution queue, and a third degraded execution queue; obtaining the total cluster resources based on the cluster granularity of the target cluster; configuring cluster resources for the first degraded execution queue, the second degraded execution queue, and the third degraded execution queue based on the total cluster resources, wherein the cluster resources of the first degraded execution queue are greater than the cluster resources of the second degraded execution queue, the cluster resources of the second degraded execution queue are greater than the cluster resources of the third degraded execution queue, and the cluster resources of the first degraded execution queue, the second degraded execution queue, and the third degraded execution queue are all less than the cluster resources of the query task execution queue.

[0012] Furthermore, after transferring the abnormal query task from the query task execution queue to the downgrade execution queue corresponding to the abnormal query task, the method further includes: recording the abnormal query task and transfer parameters that performed the transfer operation, generating log data; and storing the log data in the database.

[0013] According to another aspect of the present invention, an apparatus for processing abnormal query tasks is also provided, comprising: an identification unit for monitoring a query task execution queue of a target cluster and identifying abnormal query tasks; a classification unit for classifying the abnormal query tasks based on their abnormality type and task priority; a configuration unit for configuring a degraded execution queue for each category of abnormal query tasks based on the cluster granularity of the target cluster; and a transfer unit for transferring the abnormal query tasks from the query task execution queue to the degraded execution queue corresponding to the abnormal query tasks for processing, wherein the cluster resource size of the degraded execution queue is smaller than the cluster resource size of the query task execution queue.

[0014] Further, the identification unit includes: a first acquisition module, used to acquire the execution time of the query task in the query task execution queue; a first comparison module, used to compare the execution time with a preset execution time threshold to obtain an execution time comparison result; and a first determination module, used to determine that the query task is abnormal and obtain the abnormal query task when the execution time comparison result indicates that the execution time of the query task is greater than the execution time threshold.

[0015] Furthermore, the identification unit further includes: a second acquisition module, used to acquire the execution plan of the query task in the query task execution queue; a second determination module, used to determine the number of blocks to be read by the query task based on the execution plan; a second comparison module, used to compare the number of blocks to be read by the query task with a block number threshold to obtain a block number comparison result; and a third determination module, used to determine that the query task is abnormal and obtain the abnormal query task when the block number comparison result indicates that the number of blocks to be read by the query task is greater than the block number threshold.

[0016] Furthermore, the identification unit further includes: a third acquisition module, used to acquire the statement structure and query logic of the query statement corresponding to the query task in the query task execution queue; a first calculation module, used to calculate the hash value of the query task based on the statement structure and query logic; and a first matching module, used to match the hash value of the query task with a hash value list, and if the hash value of the query task matches the hash value list successfully, determine that the query task is abnormal and obtain the abnormal query task.

[0017] Further, the classification unit includes: a first configuration module, configured to configure a first weight value for the anomaly query task based on the anomaly type; a second configuration module, configured to configure a second weight value for the anomaly query task based on the task priority; a second calculation module, configured to calculate the risk coefficient of the anomaly query task based on the first weight value and the second weight value; and a first classification module, configured to classify the anomaly query task based on the risk coefficient to obtain a first priority anomaly task, a second priority anomaly task, and a third priority anomaly task, wherein the execution priority of the first priority anomaly task is greater than the execution priority of the second priority anomaly task, and the execution priority of the second priority anomaly task is greater than the execution priority of the third priority anomaly task.

[0018] Further, the configuration unit includes: a first construction module, used to construct the degraded execution queues for the first priority abnormal task, the second priority abnormal task, and the third priority abnormal task respectively, to obtain a first degraded execution queue, a second degraded execution queue, and a third degraded execution queue; a fourth acquisition module, used to acquire the total cluster resources based on the cluster granularity of the target cluster; and a third calculation module, used to configure cluster resources for the first degraded execution queue, the second degraded execution queue, and the third degraded execution queue based on the total cluster resources, wherein the cluster resources of the first degraded execution queue are greater than the cluster resources of the second degraded execution queue, the cluster resources of the second degraded execution queue are greater than the cluster resources of the third degraded execution queue, and the cluster resources of the first degraded execution queue, the second degraded execution queue, and the third degraded execution queue are all less than the cluster resources of the query task execution queue.

[0019] Furthermore, the processing device for the abnormal query task also includes: a first generation module, used to record the abnormal query task and transfer parameters for performing the transfer operation, and generate log data; and a first storage module, used to store the log data in a database.

[0020] According to another aspect of the present invention, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform any of the above-mentioned abnormal query tasks.

[0021] According to another aspect of the present invention, an electronic device is also provided, including one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement any of the above-described methods for processing abnormal query tasks.

[0022] According to another aspect of the present invention, a computer program product is also provided, the computer program product comprising a computer program, wherein the computer program, when executed by a processor, implements the processing method for any of the above-described abnormal query tasks.

[0023] In this application, the following steps are performed: monitoring the query task execution queue of the target cluster, identifying abnormal query tasks, classifying abnormal query tasks based on their exception type and task priority, configuring a degraded execution queue for each category of abnormal query tasks based on the cluster granularity of the target cluster, and finally transferring the abnormal query tasks from the query task execution queue to the degraded execution queue corresponding to the abnormal query tasks for processing, wherein the cluster resource size of the degraded execution queue is smaller than that of the query task execution queue.

[0024] In this application, abnormal query tasks are categorized, and a degraded execution queue is configured for each category of abnormal query tasks. The degraded execution queue is configured with a small amount of cluster resources. By transferring abnormal query tasks from the original queue to the degraded execution queue for degraded processing, some cluster resources can be released while ensuring the normal execution of query tasks, reducing resource consumption and improving data processing efficiency. This solves the technical problem in related technologies where the method of killing abnormal query tasks leads to users repeatedly submitting the same query tasks, exacerbating resource consumption and reducing data processing efficiency. Attached Figure Description

[0025] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:

[0026] Figure 1 A hardware structure block diagram of a computer terminal (or mobile device) for implementing a method for handling abnormal query tasks is shown.

[0027] Figure 2 This is a flowchart of an optional method for processing an abnormal query task according to an embodiment of the present invention;

[0028] Figure 3 This is a schematic diagram of an optional exception query task processing flow according to an embodiment of the present invention;

[0029] Figure 4 This is a schematic diagram of an optional exception query task processing device according to an embodiment of the present invention;

[0030] Figure 5 This is a hardware structure block diagram of an electronic device (or mobile device) according to an optional method for processing an exception query task according to an embodiment of the present invention. Detailed Implementation

[0031] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0032] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0033] To facilitate understanding of the present invention by those skilled in the art, some terms or nouns involved in the various embodiments of the present invention are explained below:

[0034] Structured Query Language (SQL) is used to access and manipulate data in relational database management systems.

[0035] It should be noted that the method and apparatus for processing abnormal query tasks in this application can be used in the field of big data technology to process abnormal query tasks based on a degraded execution queue, and can also be used in any field other than big data technology to process abnormal query tasks based on a degraded execution queue. This application does not limit the application field of the method and apparatus for processing abnormal query tasks.

[0036] It should be noted that the information collected in this application (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) are information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of this data all comply with relevant laws, regulations, and standards, necessary confidentiality measures have been taken, and they do not violate public order and good morals. Corresponding access points are provided for users to choose to authorize or refuse. For example, interfaces are set up between this system and relevant users or organizations, providing users with corresponding access points to choose to agree to or refuse automated decision-making results; if the user chooses to refuse, the process proceeds to the expert decision-making stage.

[0037] The following embodiments of the present invention can be applied to various systems / applications / devices for processing abnormal query tasks. The present invention identifies and finely classifies abnormal query tasks, allocates appropriate cluster resources for them, and performs degradation processing, ensuring uninterrupted task execution while reducing the resource consumption of abnormal query tasks and improving the overall execution efficiency of cluster operations.

[0038] The present invention will now be described in detail with reference to various embodiments.

[0039] Example 1

[0040] According to an embodiment of the present invention, an embodiment of a method for processing an abnormal query task is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0041] The method embodiment provided in Embodiment 1 of this application can be executed on a mobile terminal, computer terminal, or similar computing device. Figure 1 A hardware block diagram of a computer terminal (or mobile device) for implementing a method for handling exception query tasks is shown. Figure 1 As shown, the computer terminal 10 (or mobile device) may include one or more processors 102 (shown as 102a, 102b, ..., 102n in the figure) 102 (processor 102 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 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 a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0042] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10 (or mobile device). As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).

[0043] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the abnormal query task processing method in this embodiment. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby realizing the above-mentioned abnormal query task processing method. The memory 104 may include high-speed random access memory, and may also include 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 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0044] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.

[0045] The display may be, for example, a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer terminal 10 (or mobile device).

[0046] Under the aforementioned operating environment, this application provides the following: Figure 2The method for handling abnormal query tasks shown is implemented by the abnormal query task handling system.

[0047] Figure 2 This is a flowchart of an optional method for processing an exception query task according to an embodiment of the present invention, such as... Figure 2 As shown, the method includes the following steps:

[0048] Step S201: Monitor the query task execution queue of the target cluster and identify abnormal query tasks.

[0049] In a distributed cluster management system, managing abnormal query tasks is a crucial aspect of ensuring overall system performance and stability. Especially during large-scale data processing, some query tasks, due to their complexity or wide data access scope, may experience excessively long execution times and resource consumption, thus impacting the normal execution of other business processes; these are referred to as abnormal query tasks.

[0050] In step S201 above, the query task execution queue of the target cluster is monitored to identify abnormal query tasks, so as to ensure that in the distributed data processing environment, abnormal query tasks that may have a negative impact on cluster performance can be detected and identified in a timely manner, thereby providing accurate information for subsequent resource management measures.

[0051] First, a monitoring mechanism needs to be implemented in the target cluster. This mechanism should be able to continuously monitor the execution queue of query tasks, collecting real-time status data for each query task, including but not limited to task start time, execution time, resource consumption (such as CPU and memory usage), and the execution plan of the query task. The monitoring mechanism should be designed to be highly efficient and non-intrusive, avoiding any additional burden on ongoing query tasks or the overall performance of the cluster.

[0052] Next, for the monitored tasks and their related information, abnormal query tasks are identified. Each query task is judged as abnormal based on preset judgment criteria. These criteria are typically based on predefined thresholds, which may include execution time thresholds, resource consumption thresholds, and the number of partitions read analyzed from the execution plan. When one or more of these metrics exceed these thresholds, the system determines it as an abnormal query task. The judgment criteria should be adjusted based on the target cluster's performance, business needs, and historical data to ensure accuracy and effectiveness.

[0053] Furthermore, the steps for identifying abnormal query tasks include: obtaining the execution duration of query tasks in the query task execution queue; comparing the execution duration with a preset execution duration threshold to obtain the execution duration comparison result; and determining that the query task is abnormal and obtaining the abnormal query task if the execution duration comparison result indicates that the execution duration of the query task is greater than the execution duration threshold.

[0054] Specifically, the steps for identifying abnormal query tasks are detailed as follows, aiming to accurately filter out query tasks with abnormal execution times: First, the monitoring mechanism will obtain the execution time of each query task in real time from the query task execution queue. The execution time directly reflects the performance of the query task. The execution time of each query task is compared with a preset execution time threshold. The execution time threshold is a time limit set based on historical data analysis, business needs, and cluster performance, used to determine whether a query task is abnormal. If the execution time of a query task exceeds this threshold, the comparison result will indicate that the query task is abnormal, thus identifying the abnormal query task.

[0055] Furthermore, the steps for identifying abnormal query tasks also include: obtaining the execution plan of the query tasks in the query task execution queue; determining the number of blocks to be read by the query task based on the execution plan; comparing the number of blocks to be read by the query task with the block number threshold to obtain the block number comparison result; and determining that the query task is abnormal and obtaining the abnormal query task if the block number comparison result indicates that the number of blocks to be read by the query task is greater than the block number threshold.

[0056] Besides judging query task anomalies by execution time, the number of blocks planned to be read can also be used to determine if a query task is abnormal. Specifically, the execution plan for each task is extracted from the query task execution queue. An execution plan is an internal data structure generated by data warehouse software when executing SQL queries, detailing the steps and sequence of data reading, processing, and computation. Through the execution plan, the system can understand the specific data access patterns and operational details of the query task, which is a key data source for subsequent analysis. The system then analyzes the query execution plan to calculate the number of distributed cluster blocks to be read during the query process. Since query tasks often involve reading large-scale datasets stored in a distributed cluster, the more blocks read, the longer the potential execution time and the greater the resource consumption. Therefore, the number of blocks can also serve as an important indicator of query task execution efficiency.

[0057] After obtaining the number of blocks to be read by the query task, it is compared with a pre-set block count threshold. This threshold is a standard set based on cluster resource conditions, historical data, and business needs, used to determine whether the query task's read range is reasonable. If the number of blocks to be read exceeds the threshold, the query task's read operations are too extensive, leading to low execution efficiency or excessive resource consumption, thus causing execution anomalies. Finally, query tasks with more blocks than the threshold are marked as abnormal query tasks.

[0058] Furthermore, the steps for identifying abnormal query tasks also include: obtaining the statement structure and query logic of the query statement corresponding to the query task in the query task execution queue; calculating the hash value of the query task based on the statement structure and query logic; matching the hash value of the query task with the hash value list; and determining that the query task is abnormal if the hash value of the query task matches the hash value list successfully, thus obtaining the abnormal query task.

[0059] The identification of abnormal query tasks can also be based on matching a pre-defined hash value list. Abnormal query tasks identified within a historical time period are recorded, and a hash value list is constructed based on the key information hash values ​​of these historical abnormal query tasks. When it is necessary to identify abnormal query tasks, the complete query statement corresponding to each query task is extracted from the query task execution queue. The query statement contains all the logical and structural information of the executed query, including the name of the data table, the fields involved, the functions used, filtering conditions, join operations, and sorting. By deeply analyzing these statements, the system can understand the specific logical and structural characteristics of the query. Based on the extracted statement structure and query logic, the hash value of the query task is calculated. When calculating the hash value, the system excludes common variables such as date partitions. This ensures that similar query logic and structures will produce the same hash value even if executed at different times, thus effectively identifying duplicate or similar abnormal query tasks.

[0060] The calculated hash value of the query task is matched against a pre-established list of hash values. If the hash value of the query task matches an entry in the list, it indicates that the query task has the same or similar logic and structure as a known anomalous query task, and can be quickly identified as an anomalous query task.

[0061] Step S202: Classify the abnormal query tasks based on their abnormality type and task priority.

[0062] In step S202 above, for the identified abnormal query tasks, risk levels are classified according to the abnormality type and task priority of the query tasks. The abnormality type may include, but is not limited to, excessive execution time, excessive resource consumption, excessive number of blocks read, etc. The task priority is pre-configured according to the actual business situation. By classifying, abnormal query tasks caused by different reasons can be distinguished, providing a basis for subsequent differentiated processing.

[0063] Furthermore, the steps for classifying abnormal query tasks based on exception type and task priority include: configuring a first weight value for the abnormal query task based on the exception type; configuring a second weight value for the abnormal query task based on the task priority; calculating the risk coefficient of the abnormal query task based on the first weight value and the second weight value; and classifying the abnormal query task based on the risk coefficient to obtain first-priority abnormal tasks, second-priority abnormal tasks, and third-priority abnormal tasks, wherein the execution priority of the first-priority abnormal task is greater than the execution priority of the second-priority abnormal task, and the execution priority of the second-priority abnormal task is greater than the execution priority of the third-priority abnormal task.

[0064] Specifically, for each abnormal query task, a first weight value is assigned based on the specific exception type. This weight value reflects the severity of the impact of different types of task exceptions on cluster performance and resources. For example, a task whose execution time exceeds a threshold may receive a higher first weight value, while a task whose number of blocks read exceeds a threshold may receive a lower first weight value. The setting of the first weight value, based on the exception type and its corresponding severity, can directly measure the impact of abnormal query tasks on system performance and resources.

[0065] Secondly, a second weight value is configured for each abnormal query task based on its priority. The task priority is related to the urgency and importance of business needs; urgent and critical tasks may be assigned a higher second weight value, while routine or non-critical tasks will have a relatively lower second weight value. By configuring the second weight value, the system can comprehensively consider the business impact of abnormal queries, ensuring that important tasks receive appropriate attention and processing even in abnormal situations.

[0066] Based on the first and second weight values, a risk coefficient is calculated for each abnormal query task. The risk coefficient is a comprehensive evaluation index that integrates the impact of the anomaly type on the system and the task's priority, effectively measuring the risk level of the abnormal query task. The purpose of calculating the risk coefficient is to quantify the processing priority of abnormal query tasks and ensure the rational allocation of resources.

[0067] Finally, the abnormal query tasks are finely divided using a risk coefficient, resulting in three different priority categories: first-priority abnormal tasks, second-priority abnormal tasks, and third-priority abnormal tasks. This classification follows the order of increasing risk coefficient, meaning that first-priority abnormal tasks have a higher execution priority than second-priority abnormal tasks, and second-priority abnormal tasks have a higher execution priority than third-priority abnormal tasks. This hierarchical processing mechanism ensures that, with limited resources, the highest-risk and most impactful abnormal queries are prioritized, while tasks that are abnormal but have a smaller impact on business operations are not overlooked.

[0068] Step S203: Configure a degraded execution queue for each category of anomaly query tasks based on the cluster granularity of the target cluster.

[0069] In step S203 above, after constructing multiple priority exception query tasks, specific degraded execution queues are configured for different types of tasks. This allows for the reasonable allocation of cluster resources based on the exception level and priority of the tasks, ensuring that critical business operations are not affected. At the same time, it reduces the negative impact of exception query tasks on system performance, reduces the occupation of cluster resources by exception query tasks, and does not affect the normal execution of exception query tasks.

[0070] The purpose of a degraded execution queue is to configure fewer cluster resources for the queue, so as to reduce the excessive consumption of cluster resources by these abnormal query tasks and ensure the execution of other normal query tasks. Cluster resources can include: cluster resources, memory resources, disk resources, network resources, etc.

[0071] Furthermore, the steps of configuring degraded execution queues for each category of abnormal query tasks based on the cluster granularity of the target cluster include: constructing degraded execution queues for first-priority abnormal tasks, second-priority abnormal tasks, and third-priority abnormal tasks respectively, resulting in a first degraded execution queue, a second degraded execution queue, and a third degraded execution queue; obtaining the total cluster resources based on the cluster granularity of the target cluster; and configuring cluster resources for the first degraded execution queue, the second degraded execution queue, and the third degraded execution queue based on the total cluster resources, wherein the cluster resources of the first degraded execution queue are greater than those of the second degraded execution queue, the cluster resources of the second degraded execution queue are greater than those of the third degraded execution queue, and the cluster resources of the first degraded execution queue, the second degraded execution queue, and the third degraded execution queue are all less than the cluster resources of the query task execution queue.

[0072] Specifically, based on the classification results of the anomaly query tasks, degraded execution queues are constructed for first-priority, second-priority, and third-priority anomaly tasks, respectively. These are designated as the first degraded execution queue, the second degraded execution queue, and the third degraded execution queue. Each queue will receive different levels of cluster resource allocation based on its priority. This hierarchical queue construction mechanism ensures that resources are prioritized for the anomaly query tasks with the highest risk and most urgent business needs.

[0073] The total resources of the cluster are obtained based on the cluster granularity of the target cluster. Cluster granularity refers to the scale and complexity of the cluster. Obtaining the total cluster resources is the basis for subsequent resource allocation, ensuring that resource allocation is neither excessive nor insufficient, and maintaining the stable operation of the cluster. Based on the total cluster resources, cluster resources are configured for the first, second, and third degraded execution queues. This configuration process follows a descending priority principle: the first degraded execution queue has the highest execution priority and receives more cluster resources than the second degraded execution queue, which in turn receives more resources than the third degraded execution queue. Simultaneously, the resource amounts of all degraded execution queues are less than the resource amounts of the query task execution queue to ensure the normal operation of the cluster and efficient business processing.

[0074] In this embodiment of the invention, fine-grained resource management is implemented. This mechanism ensures that when handling abnormal query tasks, high-risk tasks can be responded to promptly, reducing their impact on cluster performance, while also conserving resources and avoiding excessive resource allocation to low-priority query tasks, thereby maintaining cluster stability and efficiency. Simultaneously, by controlling the resource limit of the degradation queue, abnormal query tasks can be effectively managed without affecting normal business queries, preventing excessive resource consumption and cluster instability.

[0075] Step S204: Transfer the abnormal query task from the query task execution queue to the corresponding degraded execution queue for processing.

[0076] Finally, the abnormal query tasks are transferred from the initial query task queue to the corresponding degraded execution queue for further processing. The cluster resources in the degraded execution queue are less than those in the query task execution queue. By degrading the abnormal query tasks, the stability and response speed of the cluster are improved, providing users with more reliable data processing services, while reducing resource waste and operation and maintenance costs caused by abnormal queries.

[0077] Furthermore, after transferring the abnormal query task from the query task execution queue to the corresponding degraded execution queue, the process also includes: recording the abnormal query task and transfer parameters that performed the transfer operation, generating log data, and storing the log data in the database.

[0078] The system automatically records all exception query tasks that have undergone migration operations, along with their specific migration parameters, including but not limited to task ID, original execution queue, post-migration degraded execution queue, migration time, exception type, and resource configuration at the time of migration. The collected migration information will be organized into a structured log data format and stored in the corresponding database. The log data is designed for ease of retrieval and analysis, typically including field titles and data type definitions to ensure data accuracy and completeness. This method allows for quick location of the migration history of specific tasks and evaluation of the effectiveness of resource degradation strategies.

[0079] Through the above steps, the query task execution queue of the target cluster is monitored to identify abnormal query tasks. Abnormal query tasks are then classified based on their exception type and task priority. Next, a degraded execution queue is configured for each category of abnormal query tasks based on the cluster granularity of the target cluster. Finally, the abnormal query tasks are transferred from the query task execution queue to the corresponding degraded execution queue for processing. The cluster resource size of the degraded execution queue is smaller than that of the query task execution queue.

[0080] In this embodiment, abnormal query tasks are classified, and a degraded execution queue is configured for each category of abnormal query tasks. The degraded execution queue is configured with a small amount of cluster resources. By transferring abnormal query tasks from the original queue to the degraded execution queue for degraded processing, some cluster resources can be released while ensuring the normal execution of query tasks, reducing resource consumption and improving data processing efficiency. This solves the technical problem in related technologies where the method of killing abnormal query tasks leads to users repeatedly submitting the same query tasks, exacerbating resource consumption and reducing data processing efficiency.

[0081] The following describes in detail another optional implementation method.

[0082] Figure 3 This is a schematic diagram of an optional exception query task processing flow according to an embodiment of the present invention, such as... Figure 3 As shown, the processing flow for anomaly query tasks includes:

[0083] Step 1, Begin;

[0084] Step 2: Set up rules for identifying slow SQL queries (corresponding to the abnormal query tasks mentioned above);

[0085] The rules for identifying slow SQL queries include:

[0086] 1. The SQL execution time exceeds the preset time threshold;

[0087] 2. The SQL execution used more resources than the preset resource threshold;

[0088] 3. The number of blocks read during the SQL execution calculation exceeds the preset block count threshold.

[0089] Step 3: Identify slow SQL queries based on slow SQL identification rules;

[0090] All SQL queries in the execution queue are monitored to obtain the execution time of each SQL query. The execution time is then compared with a preset execution time threshold. If the execution time exceeds the preset execution time threshold, the SQL query is identified as a slow SQL query.

[0091] Based on the execution calculation of the SQL, the number of blocks read is obtained. If the number of blocks is greater than the preset block number threshold, the SQL query is determined to be a slow SQL.

[0092] If the hash value of the remaining content of an SQL statement, after removing common variables such as date partitions, is consistent with the hash value of the content of a previously executed SQL statement that was also identified as a slow SQL statement, then the SQL query is determined to be a slow SQL statement.

[0093] Step 4: Create a degrade execution queue;

[0094] Slow SQL queries are further categorized based on their exception type and task priority, resulting in multiple priority levels. Degraded execution queues with varying cluster resources are then created for each priority level, with each queue receiving fewer cluster resources.

[0095] Step 5: Transfer slow SQL queries from the original queue to the degraded execution queue;

[0096] If a SQL statement is identified as slow during execution, it is removed from the original execution queue and transferred to the global slow SQL queue (corresponding to the aforementioned degraded execution queue) to continue execution. This reduces the resource consumption of slow SQL statements without interrupting execution.

[0097] Step six, end.

[0098] In this embodiment of the invention, abnormal query tasks are identified and finely segmented, and appropriate cluster resources are allocated to them for degradation processing. This ensures that the tasks are not interrupted while reducing the resource consumption of abnormal query tasks and improving the overall execution efficiency of cluster operations.

[0099] The following is a detailed description with reference to another embodiment.

[0100] Example 2

[0101] The abnormal query task processing device provided in this embodiment includes multiple implementation units, each of which corresponds to the implementation steps in the above embodiment one. Its specific implementation method and beneficial effects can be referred to the foregoing method embodiment, and will not be repeated here.

[0102] Figure 4 This is a schematic diagram of an optional exception query task processing apparatus according to an embodiment of the present invention, such as... Figure 4 As shown, the processing device for this anomaly query task may include: an identification unit 41, a classification unit 42, a configuration unit 43, and a transfer unit 44, wherein,

[0103] The identification unit 41 is used to monitor the query task execution queue of the target cluster and identify abnormal query tasks.

[0104] Classification unit 42 is used to classify abnormal query tasks based on the abnormality type and task priority of the abnormal query task;

[0105] Configuration unit 43 is used to configure a degraded execution queue for each category of abnormal query tasks based on the cluster granularity of the target cluster.

[0106] The transfer unit 44 is used to transfer abnormal query tasks from the query task execution queue to the corresponding degraded execution queue for processing, wherein the cluster resource size of the degraded execution queue is smaller than that of the query task execution queue.

[0107] The aforementioned abnormal query task processing device monitors the query task execution queue of the target cluster through the identification unit 41 to identify abnormal query tasks; classifies abnormal query tasks based on the abnormality type and task priority through the classification unit 42; configures a degraded execution queue for each category of abnormal query tasks based on the cluster granularity of the target cluster through the configuration unit 43; and transfers abnormal query tasks from the query task execution queue to the degraded execution queue corresponding to the abnormal query task for processing through the transfer unit 44, wherein the cluster resource volume of the degraded execution queue is less than the cluster resource volume of the query task execution queue.

[0108] In this embodiment, abnormal query tasks are classified, and a degraded execution queue is configured for each category of abnormal query tasks. The degraded execution queue is configured with a small amount of cluster resources. By transferring abnormal query tasks from the original queue to the degraded execution queue for degraded processing, some cluster resources can be released while ensuring the normal execution of query tasks, reducing resource consumption and improving data processing efficiency. This solves the technical problem in related technologies where the method of killing abnormal query tasks leads to users repeatedly submitting the same query tasks, exacerbating resource consumption and reducing data processing efficiency.

[0109] Furthermore, the identification unit includes: a first acquisition module, used to acquire the execution duration of query tasks in the query task execution queue; a first comparison module, used to compare the execution duration with a preset execution duration threshold to obtain an execution duration comparison result; and a first determination module, used to determine that the query task is abnormal and obtain the abnormal query task when the execution duration comparison result indicates that the execution duration of the query task is greater than the execution duration threshold.

[0110] Furthermore, the identification unit also includes: a second acquisition module, used to acquire the execution plan of the query task in the query task execution queue; a second determination module, used to determine the number of blocks to be read by the query task based on the execution plan; a second comparison module, used to compare the number of blocks to be read by the query task with a block number threshold to obtain a block number comparison result; and a third determination module, used to determine that the query task is abnormal and obtain an abnormal query task when the block number comparison result indicates that the number of blocks to be read by the query task is greater than the block number threshold.

[0111] Furthermore, the identification unit also includes: a third acquisition module, used to acquire the statement structure and query logic of the query statement corresponding to the query task in the query task execution queue; a first calculation module, used to calculate the hash value of the query task based on the statement structure and query logic; and a first matching module, used to match the hash value of the query task with the hash value list, and if the hash value of the query task matches the hash value list successfully, determine that the query task is abnormal and obtain the abnormal query task.

[0112] Furthermore, the classification unit includes: a first configuration module, used to configure a first weight value for the abnormal query task based on the abnormality type; a second configuration module, used to configure a second weight value for the abnormal query task based on the task priority; a second calculation module, used to calculate the risk coefficient of the abnormal query task based on the first weight value and the second weight value; and a first classification module, used to classify the abnormal query task based on the risk coefficient to obtain a first priority abnormal task, a second priority abnormal task, and a third priority abnormal task, wherein the execution priority of the first priority abnormal task is greater than the execution priority of the second priority abnormal task, and the execution priority of the second priority abnormal task is greater than the execution priority of the third priority abnormal task.

[0113] Furthermore, the configuration unit includes: a first construction module, used to construct degraded execution queues for the first priority abnormal task, the second priority abnormal task, and the third priority abnormal task respectively, to obtain a first degraded execution queue, a second degraded execution queue, and a third degraded execution queue; a fourth acquisition module, used to acquire the total cluster resources based on the cluster granularity of the target cluster; and a third calculation module, used to configure cluster resources for the first degraded execution queue, the second degraded execution queue, and the third degraded execution queue based on the total cluster resources, wherein the cluster resources of the first degraded execution queue are greater than the cluster resources of the second degraded execution queue, the cluster resources of the second degraded execution queue are greater than the cluster resources of the third degraded execution queue, and the cluster resources of the first degraded execution queue, the second degraded execution queue, and the third degraded execution queue are all less than the cluster resources of the query task execution queue.

[0114] Furthermore, the processing device for the abnormal query task also includes: a first generation module, used to record the abnormal query task and transfer parameters for performing the transfer operation, and generate log data; and a first storage module, used to store the log data in the database.

[0115] It should be noted that the identification unit 41, classification unit 42, configuration unit 43, and transfer unit 44 mentioned above correspond to steps S201 to S204 in Embodiment 1. The instances and application scenarios implemented by the above units and corresponding steps are the same, but are not limited to the content disclosed in Embodiment 1. It should be noted that the above modules or units can be hardware or software components stored in memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n). The above modules or units can also be part of a device and run in the computer terminal 10 provided in Embodiment 1.

[0116] The invention will now be described in conjunction with another alternative embodiment.

[0117] Example 3

[0118] The present invention can also provide an electronic device. Figure 5 This is a hardware structure block diagram of an electronic device (or mobile device) according to an optional method for processing an exception query task based on an embodiment of the present invention, such as... Figure 5 As shown, the electronic device may include: one or more ( Figure 5 (Only one is shown) processor 502, memory 504, memory controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.

[0119] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the methods and apparatus in the embodiments of this application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby implementing the above-described methods. The memory may include high-speed random access memory, and may also include 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 memory remotely located relative to the processor, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0120] The processor can access information and applications stored in memory via a transmission device to perform the following steps: monitor the query task execution queue of the target cluster and identify abnormal query tasks; classify abnormal query tasks based on their exception type and task priority; configure degraded execution queues for each category of abnormal query tasks based on the cluster granularity of the target cluster; and transfer abnormal query tasks from the query task execution queue to the corresponding degraded execution queue for processing, wherein the cluster resource size of the degraded execution queue is smaller than that of the query task execution queue.

[0121] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: obtain the execution time of the query task in the query task execution queue; compare the execution time with the preset execution time threshold to obtain the execution time comparison result; if the execution time comparison result indicates that the execution time of the query task is greater than the execution time threshold, determine that the query task is abnormal and obtain the abnormal query task.

[0122] The processor can access information and applications stored in memory via a transmission device to perform the following steps: obtain the execution plan of the query task in the query task execution queue; determine the number of blocks to be read by the query task based on the execution plan; compare the number of blocks to be read by the query task with a block count threshold to obtain a block count comparison result; if the block count comparison result indicates that the number of blocks to be read by the query task is greater than the block count threshold, determine that the query task is abnormal and obtain an abnormal query task.

[0123] The processor can invoke information and applications stored in the memory through the transmission device to perform the following steps: obtain the statement structure and query logic of the query statement corresponding to the query task in the query task execution queue; calculate the hash value of the query task based on the statement structure and query logic; match the hash value of the query task with the hash value list; if the hash value of the query task matches the hash value list successfully, determine that the query task is abnormal and obtain the abnormal query task.

[0124] The processor can access information and applications stored in memory via a transmission device to perform the following steps: configuring a first weight value for an exception query task based on the exception type; configuring a second weight value for the exception query task based on the task priority; calculating the danger coefficient of the exception query task based on the first and second weight values; classifying the exception query task based on the danger coefficient to obtain a first-priority exception task, a second-priority exception task, and a third-priority exception task, wherein the execution priority of the first-priority exception task is greater than the execution priority of the second-priority exception task, and the execution priority of the second-priority exception task is greater than the execution priority of the third-priority exception task.

[0125] The processor can invoke information and applications stored in memory via a transmission device to execute the following steps: constructing degraded execution queues for the first-priority exception task, the second-priority exception task, and the third-priority exception task, respectively, to obtain the first degraded execution queue, the second degraded execution queue, and the third degraded execution queue; obtaining the total cluster resources based on the cluster granularity of the target cluster; configuring cluster resources for the first degraded execution queue, the second degraded execution queue, and the third degraded execution queue based on the total cluster resources, wherein the cluster resources of the first degraded execution queue are greater than those of the second degraded execution queue, the cluster resources of the second degraded execution queue are greater than those of the third degraded execution queue, and the cluster resources of the first degraded execution queue, the second degraded execution queue, and the third degraded execution queue are all less than the cluster resources of the query task execution queue.

[0126] The processor can access information and applications stored in memory via a transmission device to perform the following steps: record the exception query task and transfer parameters for the transfer operation, generate log data, and store the log data in a database.

[0127] This invention provides a solution for handling abnormal query tasks. Abnormal query tasks are categorized, and a degraded execution queue is configured for each category. The degraded execution queue is allocated a small amount of cluster resources. By transferring abnormal query tasks from the original queue to the degraded execution queue for degraded processing, some cluster resources can be released while ensuring the normal execution of query tasks, reducing resource consumption and improving data processing efficiency. This solves the technical problem in related technologies where methods of killing abnormal query tasks lead to users repeatedly submitting the same query tasks, exacerbating resource consumption and reducing data processing efficiency.

[0128] Those skilled in the art will understand that Figure 5 The structure shown is for illustrative purposes only. Electronic devices can also be smartphones, tablets, handheld computers, mobile internet devices (MIDs), PADs, and other terminal devices. Figure 5 This does not limit the structure of the aforementioned electronic device. For example, electronic devices may also include components that are more... Figure 5 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 5 The different configurations shown.

[0129] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0130] The invention will now be described in conjunction with another alternative embodiment.

[0131] Example 4

[0132] This invention also provides a computer-readable storage medium. Optionally, in this invention, the computer-readable storage medium can be used to store the program code executed by the method for handling the abnormal query task provided in Embodiment 1.

[0133] Optionally, in this embodiment of the invention, the storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.

[0134] This invention also provides a computer program product, which, when executed on a data processing device, is suitable for performing the following steps of a method for processing abnormal query tasks: monitoring the query task execution queue of the target cluster and identifying abnormal query tasks; classifying abnormal query tasks based on their exception type and task priority; configuring degraded execution queues for each category of abnormal query tasks based on the cluster granularity of the target cluster; and transferring the abnormal query tasks from the query task execution queue to the degraded execution queue corresponding to the abnormal query tasks for processing, wherein the cluster resource size of the degraded execution queue is smaller than that of the query task execution queue.

[0135] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0136] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0137] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

[0138] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0139] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0140] If the integrated unit is implemented as 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. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0141] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method for handling abnormal query tasks, characterized in that, include: Monitor the query task execution queue of the target cluster and identify abnormal query tasks; The abnormal query tasks are classified based on their abnormality type and task priority. Based on the cluster granularity of the target cluster, a degraded execution queue is configured for each category of the abnormal query task; The abnormal query task is transferred from the query task execution queue to the corresponding degraded execution queue for processing, wherein the cluster resource size of the degraded execution queue is smaller than that of the query task execution queue.

2. The method according to claim 1, characterized in that, The steps for identifying abnormal query tasks include: Obtain the execution time of the query task in the query task execution queue; The execution time is compared with a preset execution time threshold to obtain the execution time comparison result; If the execution time comparison result indicates that the execution time of the query task is greater than the execution time threshold, it is determined that the query task is abnormal, and the abnormal query task is obtained.

3. The method according to claim 1, characterized in that, The steps for identifying abnormal query tasks also include: Obtain the execution plan of the query task in the query task execution queue; The number of blocks to be read by the query task is determined based on the execution plan; The number of blocks to be read in the query task is compared with the block number threshold to obtain the block number comparison result; If the block count comparison result indicates that the number of blocks to be read by the query task is greater than the block count threshold, it is determined that the query task is abnormal, and the abnormal query task is obtained.

4. The method according to claim 1, characterized in that, The steps for identifying abnormal query tasks also include: Obtain the statement structure and query logic of the query statement corresponding to the query task in the query task execution queue; The hash value of the query task is calculated based on the statement structure and query logic. The hash value of the query task is matched with the hash value list. If the hash value of the query task matches the hash value list successfully, it is determined that the query task is abnormal, and the abnormal query task is obtained.

5. The method according to claim 1, characterized in that, The steps for classifying the anomaly query tasks based on anomaly type and task priority include: Configure a first weight value for the exception query task based on the exception type; Configure a second weight value for the abnormal query task based on the task priority; The risk coefficient of the abnormal query task is calculated based on the first weight value and the second weight value; The abnormal query tasks are classified based on the risk coefficient to obtain a first priority abnormal task, a second priority abnormal task, and a third priority abnormal task. The execution priority of the first priority abnormal task is higher than that of the second priority abnormal task, and the execution priority of the second priority abnormal task is higher than that of the third priority abnormal task.

6. The method according to claim 5, characterized in that, The steps for configuring a degradation execution queue for each category of the abnormal query task based on the cluster granularity of the target cluster include: The degraded execution queues are constructed for the first priority abnormal task, the second priority abnormal task, and the third priority abnormal task, respectively, to obtain the first degraded execution queue, the second degraded execution queue, and the third degraded execution queue; The total amount of cluster resources is obtained based on the cluster granularity of the target cluster; Based on the total cluster resources, cluster resources are configured for the first degraded execution queue, the second degraded execution queue, and the third degraded execution queue, respectively. The cluster resources of the first degraded execution queue are greater than those of the second degraded execution queue, the cluster resources of the second degraded execution queue are greater than those of the third degraded execution queue, and the cluster resources of the first degraded execution queue, the second degraded execution queue, and the third degraded execution queue are all less than those of the query task execution queue.

7. The method according to claim 1, characterized in that, After transferring the abnormal query task from the query task execution queue to the corresponding degraded execution queue, the process further includes: Record abnormal query tasks and transfer parameters during the execution of transfer operations, and generate log data; The log data is stored in a database.

8. A processing device for anomaly query tasks, characterized in that, include: The identification unit is used to monitor the query task execution queue of the target cluster and identify abnormal query tasks. A classification unit is used to classify the abnormal query task based on the abnormality type and task priority of the abnormal query task; A configuration unit is used to configure a degraded execution queue for each category of the abnormal query task based on the cluster granularity of the target cluster. A transfer unit is used to transfer the abnormal query task from the query task execution queue to the degraded execution queue corresponding to the abnormal query task for processing, wherein the cluster resource size of the degraded execution queue is smaller than the cluster resource size of the query task execution queue.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device containing the computer-readable storage medium to perform the processing method for the abnormal query task as described in any one of claims 1 to 7.

10. An electronic device, characterized in that, It includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the method for processing an anomaly query task as described in any one of claims 1 to 7.

11. A computer program product, characterized in that, The computer program product includes a computer program, wherein when the computer program is executed by a processor, it implements the method for processing the abnormal query task as described in any one of claims 1 to 7.