Big data resource processing method, device, terminal and storage medium

By predicting the amount of resources consumed by tasks and queue performance identification, the target queue is determined, which solves the problem of resource waste on the big data platform and improves task completion speed and resource utilization.

CN111198767BActive Publication Date: 2024-10-18PING AN TECH (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010015241.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-01-07
Publication Date
2024-10-18
Estimated Expiration
2040-01-07

AI Technical Summary

Technical Problem

There is a waste of resources in existing big data platform resource management. One queue is busy while other queues are idle, resulting in the problem that tasks cannot be completed in time.

Method used

By predicting the amount of resources consumed by tasks and combining the remaining resources and performance indicators of each queue, the target queue is determined for task allocation to ensure that tasks can be completed quickly.

Benefits of technology

It achieves reasonable allocation of resources, saves task running time, and improves the utilization of cluster resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111198767B_ABST
    Figure CN111198767B_ABST
Patent Text Reader

Abstract

A method for processing big data resources includes: initializing a multi-layer queue; determining the performance identifier of each layer of queues according to the initial resources of the queues; when receiving a task processing request output by a client, monitoring the remaining resources of each layer of queues in the multi-layer queues; using a task duration consumption model to predict the expected duration of task consumption; determining the expected amount of resources consumed by the task according to the expected duration of task consumption; determining the queues in the multi-layer queues whose remaining resources are greater than the expected amount of resources as queues to be selected; matching a target queue whose performance identifier is a first performance identifier from the queues to be selected; and assigning the task to the target queue. The present invention also provides a big data resource processing device, a terminal, and a computer-readable storage medium. The present invention predicts the amount of resources consumed by a task, and comprehensively determines the target queue in combination with the remaining resources of each layer of queues and the performance identifier of the queues, thereby saving the running time of the overall task and improving the utilization rate of cluster resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of resource allocation, and in particular to a big data resource processing method, a big data resource processing device, a terminal and a computer-readable storage medium. Background Art

[0002] With the explosive growth of data, the use of big data platforms is increasing, and the resources invested in big data platforms are also increasing. How to improve the computing power of big data platforms through effective resource management is a very important topic. At present, the resource management of big data platforms is large-scale resource management. It is often the case that one queue is very busy while other queues are very idle, and a large task will occupy all resources, resulting in the inability to submit subsequent tasks.

[0003] Therefore, it is necessary to propose a new resource scheduling management method to improve the computing power of big data platforms through effective resource management. Summary of the invention

[0004] In view of the above content, it is necessary to propose a big data resource processing method, a big data resource processing device, a terminal and a computer-readable storage medium, which can predict the amount of resources consumed by a task, and comprehensively determine the target queue based on the remaining resources of each layer of queues and the performance identifier of the queue. The determined target queue can not only complete the task, but also complete the task quickly.

[0005] A first aspect of an embodiment of the present invention provides a big data resource processing method, which is applied to a big data platform. The big data resource processing method includes:

[0006] Initialize the multi-layer queues corresponding to the big data resources in the big data platform to obtain the initial resources of the queues;

[0007] Determining a performance indicator of each layer of queues according to the initial resources of the queues;

[0008] When receiving a task processing request output by a client, calling a preset number of resource amount listeners to listen to the remaining resource amount of each layer of queues in the multi-layer queue;

[0009] Predicting the estimated duration of the task using a pre-trained task duration consumption model;

[0010] Determining an estimated amount of resources consumed by the task based on the estimated duration of the task;

[0011] Determine a queue in the multi-layer queue whose remaining resource amount is greater than the estimated resource amount as a queue to be selected;

[0012] Matching a target queue whose performance identifier is a first performance identifier from the queues to be selected, wherein the initial resource of the queue corresponding to the first performance identifier is greater than the initial resource of the queues corresponding to other performance identifiers;

[0013] Assign the task to the target queue.

[0014] Furthermore, in the above-mentioned big data resource processing method provided by the embodiment of the present invention, the step of determining the performance identifier of each layer of queue according to the initial resources of the queue includes:

[0015] Determine whether the initial resource of each layer of queue is between a preset first resource threshold and a preset second resource threshold, wherein the first resource threshold is greater than the second resource threshold;

[0016] When the initial resource is greater than the preset first resource threshold, determining that the performance identifier of the queue corresponding to the initial resource is a first performance identifier;

[0017] When the initial resource is less than the preset first resource threshold and greater than the preset second resource threshold, determining that the performance identifier of the queue corresponding to the initial resource is a second performance identifier;

[0018] When the initial resource is less than the preset second resource threshold, it is determined that the performance identifier of the queue corresponding to the initial resource is a third performance identifier.

[0019] Furthermore, in the above-mentioned big data resource processing method provided by the embodiment of the present invention, when receiving a task processing request output by the client, the method further includes:

[0020] Calling the task scheduler on the server to obtain the description file of the task;

[0021] Identify the task name of the task according to the description file;

[0022] Determine whether the task is submitted for the first time according to the task name;

[0023] When the task is submitted for the first time, a predetermined queue is selected to run the task;

[0024] When the task is not submitted for the first time, the historical duration consumed by historical tasks with the same attributes as the task is screened out from historical running records, and the estimated duration consumed by the task is predicted based on the historical duration using a pre-trained task duration consumption model.

[0025] Furthermore, in the above-mentioned big data resource processing method provided by the embodiment of the present invention, the step of judging whether the task is submitted for the first time according to the task name includes:

[0026] Traversing the resource scheduling library according to the task name;

[0027] Determine whether there is a task name identical to the task name in the resource scheduling library;

[0028] If the judgment result is that there is no task name identical to the task name, it is determined that the task is submitted for the first time;

[0029] If the judgment result is that there is a task name identical to the task name, it is determined that the task is not submitted for the first time.

[0030] Furthermore, in the above-mentioned big data resource processing method provided by the embodiment of the present invention, the step of filtering out the historical duration consumed by the historical tasks having the same attributes as the task from the historical operation records includes:

[0031] Obtain the historical duration of historical tasks with the same attributes as the task within a preset number of days;

[0032] Calculate the average running time based on the historical running time within the preset number of days;

[0033] Substituting the historical duration and the average running duration into a variance calculation formula to obtain a variance value of the historical duration consumed by historical tasks having the same attributes as the task;

[0034] The historical duration of the task is obtained according to the variance value of the historical duration.

[0035] Furthermore, in the above-mentioned big data resource processing method provided by the embodiment of the present invention, the method further includes:

[0036] Predict the number of task processing requests received by each layer of queue within a predetermined time period;

[0037] Determine queues whose number is less than or equal to a preset number threshold as idle queues;

[0038] When a task processing request is received within the predetermined time period, the task in the task processing request is assigned to the idle queue for processing;

[0039] The predicting of the number of task processing requests received by each layer of queue within a predetermined time period includes:

[0040] Acquire task running data within a historical predetermined time period, and separate the task volume data and queue task allocation data through preprocessing of the task running data;

[0041] Performing a stabilization analysis on the task volume data to obtain stabilization task volume data, and performing a cluster analysis on the queue task allocation data using a K-means algorithm to obtain cluster data;

[0042] Using the stabilization task data as a first training data set, using the clustered data as a second training data set, training the first training data set with a preset model to obtain a first model, and training the second training data set with the preset model to obtain a second model;

[0043] Mixing the first model with the second model to obtain a mixed model;

[0044] Inputting the specified queue and timestamp into the hybrid model;

[0045] The number of task processing requests output by the hybrid model and allocated to the specified queue is obtained.

[0046] Furthermore, in the above-mentioned big data resource processing method provided by the embodiment of the present invention, the training process of the task duration consumption model includes:

[0047] Collect multiple tasks and the historical consumption time of each task in multi-layer queues;

[0048] Take multiple tasks and their corresponding historical consumption time as sample data sets;

[0049] Dividing the sample data set into a training set and a test set;

[0050] Inputting the training set into a preset neural network for training to obtain a task duration consumption model;

[0051] Input the test set into the task duration consumption model for testing, and calculate the test pass rate;

[0052] If the test pass rate is greater than or equal to a preset pass rate threshold, it is determined that the task duration consumption model training is completed;

[0053] If the test pass rate is less than the preset pass rate threshold, the number of training sets is increased and the task duration consumption model is retrained based on the increased training sets.

[0054] A second aspect of an embodiment of the present invention further provides a big data resource processing device, which is applied to a big data platform. The big data resource processing device includes:

[0055] A queue initialization module, used to initialize the multi-layer queues corresponding to the big data resources in the big data platform, and obtain the initial resources of the queues;

[0056] A performance identifier determination module, used to determine the performance identifier of each layer of queue according to the initial resources of the queue;

[0057] The remaining resource amount monitoring module is used to call a preset number of resource amount monitors to monitor the remaining resource amount of each layer of queues in the multi-layer queue when receiving a task processing request output by the client;

[0058] A consumption time prediction module is used to predict the estimated time consumed by the task using a pre-trained task time consumption model;

[0059] A resource consumption estimation module is used to determine the estimated resource consumption of the task according to the estimated duration of the task;

[0060] A queue-to-be-selected determining module, configured to determine a queue in the multi-layer queue whose remaining resource amount is greater than the estimated resource amount as a queue-to-be-selected;

[0061] A target queue matching module, used to match a target queue whose performance identifier is a first performance identifier from the queues to be selected, wherein the initial resources of the queue corresponding to the first performance identifier are greater than the initial resources of the queues corresponding to other performance identifiers;

[0062] The task allocation module is used to allocate the task to the target queue.

[0063] A third aspect of an embodiment of the present invention further provides a terminal, the terminal comprising a processor, the processor being configured to implement any one of the above-mentioned big data resource processing methods when executing a computer program stored in a memory.

[0064] A fourth aspect of an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, any one of the above-mentioned big data resource processing methods is implemented.

[0065] The embodiment of the present invention provides a big data resource processing method, a big data resource processing device, a terminal and a computer-readable storage medium, which initialize the multi-layer queue corresponding to the big data resource in the big data platform to obtain the initial resources of the queue; determine the performance identifier of each layer of the queue according to the initial resources of the queue; when receiving the task processing request output by the client, call a preset number of resource amount listeners to listen to the remaining resource amount of each layer of the queue in the multi-layer queue; use the pre-trained task duration consumption model to predict the expected duration of the task consumption; determine the expected resource amount consumed by the task according to the expected duration of the task consumption; determine the queue with the remaining resource amount greater than the expected resource amount in the multi-layer queue as a queue to be selected; match the target queue with the performance identifier as the first performance identifier from the queue to be selected, wherein the initial resources of the queue corresponding to the first performance identifier are greater than the initial resources of the queues corresponding to other performance identifiers; and assign the task to the target queue. Through the embodiment of the present invention, the amount of resources consumed by the task is predicted, and the target queue is comprehensively determined in combination with the remaining resource amount of each layer of the queue and the performance identifier of the queue, so that resources can be reasonably allocated, the running time of the overall task is saved, and the utilization rate of cluster resources is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0067] Figure 1 It is a flowchart of a big data resource processing method provided by the first embodiment of the present invention.

[0068] Figure 2 It is a schematic diagram of the structure of a terminal according to an embodiment of the present invention.

[0069] Figure 3 yes Figure 2 An exemplary functional module diagram of the terminal is shown.

[0070] The following specific implementation manner will further illustrate the present invention in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION

[0071] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0072] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. The embodiments described are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0073] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.

[0074] Figure 1 FIG. 1 is a flowchart of a big data resource processing method according to a first embodiment of the present invention, and the big data resource processing method can be applied to a big data platform. Figure 1 As shown, the big data resource processing method may include the following steps:

[0075] S11. Initialize a multi-layer queue corresponding to the big data resources in the big data platform to obtain initial resources of the queue.

[0076] A server is used as a working node to execute various tasks in each client. The server is connected to the client corresponding to the server, so that the client can obtain resources such as CPU resources and memory resources from the server connected to it.

[0077] In at least one embodiment of the present invention, the big data resource processing method is applied to a big data platform, in which a multi-layer queue is pre-set for the big data resources, and the multi-layer queue corresponding to the big data resources is initialized, so as to obtain the initial resources of each layer of queues. Among them, the number of multi-layer queues can be comprehensively analyzed based on the total amount of resources, the amount of historical tasks and the amount of resource consumption. Specifically, the total amount of resources, the amount of historical tasks and the amount of resource consumption are input into a pre-trained queue setting model to obtain a queue setting result, which includes the number of queues to be set and the initial resources corresponding to each queue. The queue is dynamically set by the queue setting model, and the corresponding queue setting results can be obtained for different historical task amounts and resource consumptions in different periods, thereby avoiding fixed queue settings and increasing the applicability of queue settings.

[0078] Exemplarily, according to the queue setting model, the server is provided with three layers of queues, namely Queue 1, Queue 2 and Queue 3. The initial resource corresponding to Queue 1 is 1000C; the initial resource corresponding to Queue 2 is 800C; and the initial resource corresponding to Queue 3 is 500C.

[0079] In at least one embodiment of the present invention, before the step of initializing the multi-layer queue corresponding to the big data resource in the big data platform, the method further includes: pre-training the task duration consumption model. The step of pre-training the task duration consumption model includes: collecting multiple tasks and the historical consumption time of each task in the multi-layer queue; using multiple tasks and the corresponding historical consumption time as a sample data set; dividing the sample data set into a training set and a test set; inputting the training set into a preset neural network for training to obtain a task duration consumption model; inputting the test set into the task duration consumption model for testing, and calculating the test pass rate; if the test pass rate is greater than or equal to the preset pass rate threshold, it is determined that the task duration consumption model training is completed; if the test pass rate is less than the preset pass rate threshold, the number of training sets is increased and the task duration consumption model is retrained based on the increased training set. The preset neural network may include, but is not limited to, a convolutional neural network, a recurrent neural network, etc. The preset pass rate threshold is preset by the user, for example, the preset pass rate threshold is 95%.

[0080] S12. Determine a performance identifier of each layer of queues according to the initial resources of the queues.

[0081] In at least one embodiment of the present invention, the step of determining the performance identifier of each layer of queues based on the initial resources of the queues includes: judging whether the initial resources of each layer of queues are between a preset first resource threshold and a preset second resource threshold, wherein the first resource threshold is greater than the second resource threshold; when the initial resources are greater than the preset first resource threshold, determining the performance identifier of the queue corresponding to the initial resources to be the first performance identifier; when the initial resources are less than the preset first resource threshold and greater than the preset second resource threshold, determining the performance identifier of the queue corresponding to the initial resources to be the second performance identifier; when the initial resources are less than the preset second resource threshold, determining the performance identifier of the queue corresponding to the initial resources to be the third performance identifier. The preset first resource threshold, the preset second resource threshold, and the preset third resource threshold are preset by the user.

[0082] Exemplarily, the first resource threshold is 900C, the second resource threshold is 400C, the initial resource number corresponding to Queue1 is 1000C; the resource number corresponding to Queue2 is 800C; and the resource number corresponding to Queue3 is 500C. Since the initial resources of Queue1 are greater than the first resource threshold 900C, the performance identifier of Queue1 is determined to be the first performance identifier, and the priority channel corresponding to Queue1 is set to the fast channel; since the initial resources of Queue2 are less than the first resource threshold 900C and greater than the second resource threshold 400C, the performance identifier of Queue2 is determined to be the second performance identifier, and the priority channel corresponding to Queue2 is set to the medium channel; since the initial resources of Queue3 are less than the second resource threshold 400C, the performance identifier of Queue3 is determined to be the third performance identifier, and the priority channel corresponding to Queue3 is set to the slow channel.

[0083] Preferably, a corresponding label can be set for each queue, and a plurality of different task queues can be distinguished by labels to facilitate task management.

[0084] S13. When a task processing request output by the client is received, a preset number of resource amount listeners are called to monitor the remaining resource amount of each layer of queues in the multi-layer queues.

[0085] In at least one embodiment of the present invention, before the client obtains resources such as CPU resources and memory resources from the server, it needs to output a task processing request to the server. The server allocates relevant resources to the client based on the received task processing request for executing the current task.

[0086] When the user submits a task processing request on the client, the user needs to inform the user interface program corresponding to the client of the task description information (including but not limited to the task name, command parameters, resource requirements, etc.), and the user interface program will pass the task description information to the task scheduler on the server to implement the submission process of the task processing request. Among them, the user interface program is a web application program, and the user needs to operate the user interface program through a web browser; the task scheduler is used to analyze and schedule the tasks submitted by the client.

[0087] The task processing request includes a task description file, which refers to a file that complies with the server-side resource scheduling specification and is used to express the task request. The task description file is determined based on the task description file template pre-set by the user, and the task description file template is a template file used to define the common information organization structure in the task description file. The task description file template can be written in a dedicated programming language, such as the Jinja programming language, or it can be a simple text file with replaceable fields, etc., which is not specifically limited here. The task description file includes at least one of the following information: task name (job_name, which is a string field) and task resource requirements (attribute_description, which is a key-value pair field), etc. Among them, the task name is the identifier of resource scheduling, and one task corresponds to a unique task name; the task resource requirements are used to determine the resources that need to be occupied during resource scheduling.

[0088] When receiving a task processing request output by a client, a preset number of resource amount listeners are called to listen to the remaining resource amount of each layer of the multi-layer queue. The preset number is preset by the user, for example, the preset number can be one or the number corresponding to the queue. The resource amount listener can be used to listen to the resource amount in the queue.

[0089] When a task processing request output by a client is received, the method further includes: calling a task scheduler on the server side to obtain a description file of the task; identifying a task name of the task according to the description file; judging whether the task is submitted for the first time according to the task name; when the task is submitted for the first time, selecting a predetermined queue to run the task; when the task is not submitted for the first time, filtering out the historical duration consumed by historical tasks with the same attributes as the task from historical running records, and predicting the estimated duration consumed by the task according to the historical duration using a pre-trained task duration consumption model, wherein the same attributes may include having the same task name.

[0090] Among them, the first submission indicates that the client has not output the same task processing request to the server before, and the server has not allocated relevant resources to the current task. Therefore, the server cannot obtain the historical running time of the current task and cannot determine which queue the current task should be assigned to for execution. The step of judging whether the task is submitted for the first time according to the task name includes: traversing the resource scheduling library according to the task name; judging whether there is a task name identical to the task name in the resource scheduling library; if the judgment result is that there is no task name identical to the task name, then determining that the task is submitted for the first time; if the judgment result is that there is a task name identical to the task name, then determining that the task is not submitted for the first time. Among them, the resource scheduling library stores historical resource scheduling records, and the historical resource scheduling records contain task names corresponding to resource scheduling.

[0091] When it is determined that the task is not submitted for the first time, the step of selecting the historical duration consumed by historical tasks with the same attributes as the task from the historical running records includes: obtaining the historical duration of historical tasks with the same attributes as the task within a preset number of days, recorded as x1, x2...x n ; Calculate the average running time based on the historical time within the preset number of days, and record it as Substituting the historical duration and the average running duration into a variance calculation formula, the variance value of the historical duration consumed by historical tasks having the same attributes as the task is obtained; and the historical duration of the task is obtained according to the variance value of the historical duration.

[0092] After the step of obtaining the historical duration of the task according to the variance value of the historical duration, the method further includes: judging whether the historical duration of the task exceeds a preset duration threshold; if the judgment result is that the historical duration of the task exceeds the preset duration threshold, the task is assigned to Queue3 for execution. The preset duration threshold is pre-set by the user. For example, the preset duration threshold can be 30 minutes. For tasks whose estimated duration exceeds 30 minutes, the tasks are refused to be submitted to Queue1 or Queue2 for execution, so as to avoid occupying resources for a long time and reduce resource utilization and timeliness. If the judgment result is that the historical running time of the task does not exceed the preset duration threshold, the pre-trained task duration consumption model is used to predict the estimated duration of the task.

[0093] Wherein, the variance calculation formula is: S 2 is the sample variance, x is the historical running time, is the average running time, and n is the preset number of days. The historical tasks with the same attributes as the task are the historical tasks with the same task name, the same time period as the task processing request output, etc. It can be understood that the variance is a quantity indicating the degree of data deviation. By calculating the variance value of the historical running time of the current task within the preset number of days, the historical running time value with a large deviation can be discarded, thereby improving the accuracy of the historical running time of the current task.

[0094] When it is determined that the task is submitted for the first time, the method further includes: selecting a predetermined queue to run the current task. The predetermined queue may be any one of Queue1, Queue2 and Queue3. In this embodiment, the predetermined queue may be Queue2.

[0095] In at least one embodiment of the present invention, the number of task processing requests received from the client may be one or more. When the number of task processing requests received from the client is more than one, each task may be uniformly scheduled and managed according to a scan file of a uniformly standardized task defined for each task.

[0096] S14: Use a pre-trained task duration consumption model to predict the estimated duration of the task.

[0097] In at least one embodiment of the present invention, the step of using a pre-trained task duration consumption model to predict the estimated duration of the task consumption includes: inputting the historical consumption duration of the current task and the current resource consumption of the multi-layer queue into the pre-trained task duration consumption model; and calculating the duration required for the current task to be assigned to the corresponding queue through the task duration consumption model.

[0098] S15. Determine the estimated amount of resources consumed by the task according to the estimated duration of the task.

[0099] In at least one embodiment of the present invention, the longer the estimated duration of the task consumption, the greater the estimated amount of resources consumed by the task. A duration-resource consumption correspondence table is set, in which the correspondence between the duration of the task consumption and the amount of resources consumed by the task is listed. When the performance and operating environment of the system remain unchanged, it can be considered that the correspondence between the duration of the task consumption and the amount of resources consumed by the task is stable. The correspondence between the duration of the task consumption and the amount of resources consumed by the task can be obtained through multiple experiments.

[0100] The step of determining the estimated amount of resources consumed by the task based on the estimated duration of the task includes: traversing the duration-resource consumption correspondence table based on the estimated duration of the task; and matching the corresponding estimated amount of resources consumed by the task in the duration-resource consumption correspondence table.

[0101] S16: Determine the queues in the multi-layer queues whose remaining resource amount is greater than the estimated resource amount as queues to be selected.

[0102] In at least one embodiment of the present invention, the remaining resource amount of the multi-layer queue is determined, and it is determined whether there is a multi-layer queue with the remaining resource amount greater than the expected resource amount. If the judgment result is that there is a multi-layer queue with the remaining resource amount greater than the expected resource amount, the multi-layer queue with the remaining resource amount greater than the expected resource amount is obtained and determined as the queue to be selected.

[0103] S17: Match a target queue whose performance identifier is a first performance identifier from the queues to be selected, wherein the initial resources of the queue corresponding to the first performance identifier are greater than the initial resources of the queues corresponding to other performance identifiers.

[0104] In at least one embodiment of the present invention, when the number of multi-layer queues with resources greater than the expected amount exceeds one, a target queue with a performance identifier of the first performance identifier is matched from the queues to be selected, wherein the initial resources of the queue corresponding to the first performance identifier are greater than the initial resources of the queues corresponding to other performance identifiers. For example, when the queues with resources greater than the expected amount are Queue 1 and Queue 2, since the performance identifier of Queue 1 is the first performance identifier, Queue 1 is selected as the target queue.

[0105] In at least one embodiment of the present invention, the method further includes: predicting the number of task processing requests received by each layer of queues within a predetermined time period; determining a queue whose number is less than or equal to a preset number threshold as an idle queue; when a task processing request is received within the predetermined time period, assigning the task in the task processing request to the idle queue for processing;

[0106] By predicting the number of task processing requests received by a designated queue within a predetermined time period in the future and allocating some tasks to the idle queue for processing, queue resource utilization is maximized.

[0107] Wherein, the prediction of the number of task processing requests received by each layer of queue within a predetermined time period includes: obtaining the task running data within the historical predetermined time period, and preprocessing the task running data to separate the task volume data and the queue task allocation data; performing a stabilization analysis on the task volume data to obtain the stabilization task volume data, and using the K-means algorithm to perform a cluster analysis on the queue task allocation data to obtain cluster data; using the stabilization task data as the first training data set and the cluster data as the second training data set, training the first training data set through a preset model to obtain a first model, and training the second training data set through the preset model to obtain a second model; mixing the first model with the second model to obtain a hybrid model; inputting the specified queue and timestamp into the hybrid model; and obtaining the number of task processing requests assigned to the specified queue output by the hybrid model. Wherein, the preset model is a model pre-set by the user according to specific needs, and is not limited here.

[0108] Specifically, the task volume data includes the task quantity and the timestamp. The task volume data is converted into matrix data and stored in a designated database. For example, the matrix data of the task volume data can be x i , t i , where x i represents the number of tasks, t i The queue task allocation data includes the task name, the allocated queue and the timestamp. The queue task allocation data is converted into matrix data and stored in a specified database. For example, the matrix data of the queue task allocation data can be n i , d i , t i , where n i Indicates the task name, d i represents the allocated queue, t i Represents a timestamp. In one embodiment, the task operation data can be preprocessed by data ETL separation technology, and the data format extracted from the source data can be converted into a target data format that is easy to process. By performing a stabilization analysis on the task volume data and removing non-periodic data, it is shown that the difference between historical task volume data and future task volume data is small, and future task volume data can be predicted by historical task volume data. The step of using the K-means algorithm to perform cluster analysis on the queue task allocation data to obtain clustered data may include: obtaining the queue task allocation data in matrix form; determining the initial cluster center of the queue task allocation data based on a density-based method; using the initial cluster center as the initial center point, clustering the queue task allocation data using the distance-based clustering algorithm K-means to obtain clustered data.

[0109] S18. Allocate the task to the target queue.

[0110] In at least one embodiment of the present invention, after the step of assigning the task to the target queue, the method further includes: identifying the ID (identification identifier) ​​of the client corresponding to the current task; obtaining the running status of the current task and feeding back the running status to the client corresponding to the client ID. The running status of the task may include the status of task completion, task failure, etc.

[0111] The embodiment of the present invention provides a method for processing big data resources, which initializes the multi-layer queues corresponding to the big data resources in the big data platform to obtain the initial resources of the queues; determines the performance identifier of each layer of queues according to the initial resources of the queues; when receiving the task processing request output by the client, calls a preset number of resource amount listeners to listen to the remaining resource amount of each layer of queues in the multi-layer queues; uses a pre-trained task duration consumption model to predict the expected duration of the task consumption; determines the expected resource amount consumed by the task according to the expected duration of the task consumption; determines the queue whose remaining resource amount in the multi-layer queue is greater than the expected resource amount as a queue to be selected; matches the target queue whose performance identifier is the first performance identifier from the queue to be selected, wherein the initial resources of the queue corresponding to the first performance identifier are greater than the initial resources of the queues corresponding to other performance identifiers; and assigns the task to the target queue. Through the embodiment of the present invention, the amount of resources consumed by the task is predicted, and the target queue is comprehensively determined in combination with the remaining resource amount of each layer of queues and the performance identifier of the queue, so that resources can be reasonably allocated, the running time of the overall task is saved, and the utilization rate of cluster resources is improved. The above is a detailed description of the method provided by the embodiment of the present invention. According to different requirements, the execution order of the blocks in the flowchart shown can be changed, and some blocks can be omitted. The terminal 1 provided in the embodiment of the present invention is described below.

[0112] An embodiment of the present invention also provides a terminal 1, comprising a memory 10, a processor 30, and a computer program stored in the memory 10 and executable on the processor 30, wherein the processor 30 implements the steps of the big data resource processing method described in any of the above-mentioned embodiments when executing the program.

[0113] Figure 2 is a schematic diagram of the structure of a terminal according to an embodiment of the present invention, such as Figure 2As shown, the terminal 1 includes a memory 10, in which a big data resource processing device 100 is stored. The terminal 1 can be an electronic device such as a computer, a tablet computer, a personal digital assistant, etc., which has functions such as data processing, analysis, program execution and display, wherein the terminal can also be used as a server and a client. The big data resource processing device 100 can initialize the multi-layer queue corresponding to the big data resources in the big data platform to obtain the initial resources of the queue; determine the performance identifier of each layer of the queue according to the initial resources of the queue; when receiving the task processing request output by the client, call a preset number of resource amount listeners to listen to the remaining resource amount of each layer of the queue in the multi-layer queue; use the pre-trained task duration consumption model to predict the expected duration of the task consumption; determine the expected resource amount consumed by the task according to the expected duration of the task consumption; determine the queue with the remaining resource amount greater than the expected resource amount in the multi-layer queue as the queue to be selected; match the target queue with the performance identifier as the first performance identifier from the queue to be selected, wherein the initial resource of the queue corresponding to the first performance identifier is greater than the initial resource of the queue corresponding to other performance identifiers; and assign the task to the target queue. Through the embodiments of the present invention, the amount of resources consumed by the task is predicted, and the target queue is comprehensively determined in combination with the remaining amount of resources of each layer of queues and the performance identifier of the queue, so that resources can be reasonably allocated, the running time of the overall task is saved, and the utilization rate of cluster resources is improved.

[0114] In this embodiment, the terminal 1 may further include a display screen 20 and a processor 30. The memory 10 and the display screen 20 may be electrically connected to the processor 30 respectively.

[0115] The memory 10 can be different types of storage devices for storing various types of data. For example, it can be the memory or internal memory of the terminal 1, or it can be a memory card that can be externally connected to the terminal 1, such as a flash memory, a SM card (Smart Media Card), an SD card (Secure Digital Card), etc. In addition, the memory 10 may include a non-volatile memory, such as a hard disk, an internal memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. The memory 10 is used to store various types of data, for example, various types of applications installed in the terminal 1, and information such as data set and obtained by applying the above-mentioned big data resource processing method.

[0116] The display screen 20 is installed on the terminal 1 and is used to display information.

[0117] The processor 30 is used to execute the big data resource processing method and various software installed in the terminal 1, such as an operating system and application display software. The processor 30 includes but is not limited to a processor (Central Processing Unit, CPU), a microcontroller unit (Micro Controller Unit, MCU) and other devices used to interpret the computer and process data in the computer software.

[0118] The big data resource processing device 100 may include one or more modules, which are stored in the memory 10 of the terminal 1 and configured to be executed by one or more processors (a processor 30 in this embodiment) to implement the embodiment of the present invention. Figure 3 As shown, the terminal 1 may include a queue initialization module 101, a performance indicator determination module 102, a remaining resource monitoring module 103, a consumption time prediction module 104, a resource consumption estimation module 105, a candidate queue determination module 106, a target queue matching module 107 and a task allocation module 108. The module referred to in the embodiment of the present invention may be a program segment that completes a specific function, which is more suitable for describing the execution process of software in the processor 30 than a program.

[0119] It can be understood that, corresponding to each implementation of the above-mentioned big data resource processing method, the terminal 1 may include Figure 3 The functions of each module will be described in detail below. It should be noted that the same nouns and related nouns and their specific explanations in each implementation of the above big data resource processing method can also be applied to the following introduction to the functions of each module. In order to save space and avoid repetition, they will not be repeated here.

[0120] The queue initialization module 101 can be used to initialize the multi-layer queues corresponding to the big data resources in the big data platform to obtain the initial resources of the queues.

[0121] The performance indicator determination module 102 may be configured to determine the performance indicator of each layer of queues according to the initial resources of the queues.

[0122] The remaining resource amount monitoring module 103 can be used to call a preset number of resource amount monitors to monitor the remaining resource amount of each layer of queues in the multi-layer queues when receiving a task processing request output by the client.

[0123] The consumption time prediction module 104 may be used to predict the estimated consumption time of the task by using a pre-trained task consumption model.

[0124] The resource consumption estimation module 105 may be used to determine the estimated amount of resources consumed by the task according to the estimated duration of the task.

[0125] The queue-to-be-selected determining module 106 may be configured to determine a queue in the multi-layer queue whose remaining resource amount is greater than the estimated resource amount as a queue to be selected.

[0126] The target queue matching module 107 may be configured to match a target queue having a first performance identifier from the candidate queues, wherein the initial resources of the queue corresponding to the first performance identifier are greater than the initial resources of the queues corresponding to other performance identifiers.

[0127] The task allocation module 108 may be configured to allocate the task to the target queue.

[0128] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by the processor 30, the steps of the big data resource processing method in any of the above-mentioned embodiments are implemented.

[0129] If the big data resource processing device 100 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned implementation method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor 30, the steps of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form, etc. The computer-readable storage medium may include: any entity or device that can carry the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), etc.

[0130] The processor 30 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor 30 is the control center of the big data resource processing device 100 / terminal 1, and uses various interfaces and lines to connect various parts of the entire big data resource processing device 100 / terminal 1.

[0131] The memory 10 is used to store the computer programs and / or modules. The processor 30 implements various functions of the big data resource processing device 100 / terminal 1 by running or executing the computer programs and / or modules stored in the memory 10 and calling the data stored in the memory 10. The memory 10 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data (such as audio data) created according to the use of the terminal 1, etc.

[0132] In the several specific implementations provided by the present invention, it should be understood that the disclosed terminal and method can be implemented in other ways. For example, the system implementation described above is only illustrative, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.

[0133] It is obvious to those skilled in the art that the embodiments of the present invention are not limited to the details of the exemplary embodiments described above, and that the embodiments of the present invention can be implemented in other specific forms without departing from the spirit or essential features of the embodiments of the present invention. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive, and the scope of the embodiments of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the embodiments of the present invention. Any figure mark in the claims should not be regarded as limiting the claims involved. Multiple units, modules or devices stated in the system, device or terminal claims may also be implemented by the same unit, module or device through software or hardware.

[0134] The above implementation modes are only used to illustrate the technical solutions of the embodiments of the present invention and are not intended to limit the present invention. Although the embodiments of the present invention are described in detail with reference to the above preferred implementation modes, those skilled in the art should understand that the technical solutions of the embodiments of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A big data resource processing method, applied to a big data platform, characterized in that: The big data resource processing method comprises: Initializing the multi-layer queues corresponding to the big data resources in the big data platform to obtain the initial resources of the queues, wherein the total resources, the historical task volume and the resource consumption are input into a pre-trained queue setting model, and the queues are dynamically set through the queue setting model to obtain queue setting results, wherein the queue setting results include the number of set queues and the initial resources corresponding to each queue; Determining a performance indicator of each layer of queues according to the initial resources of the queues; When receiving a task processing request output by a client, calling a preset number of resource amount listeners to listen to the remaining resource amount of each layer of queues in the multi-layer queue; Using a pre-trained task duration consumption model to predict the estimated duration consumed by the task in the task processing request; Determining an estimated amount of resources consumed by the task based on the estimated duration of the task; Determine a queue in the multi-layer queue whose remaining resource amount is greater than the estimated resource amount as a queue to be selected; Matching a target queue whose performance identifier is a first performance identifier from the queues to be selected, wherein the initial resource of the queue corresponding to the first performance identifier is greater than the initial resource of the queues corresponding to other performance identifiers; Assigning the task to the target queue; Predict the number of task processing requests received by each layer of queue within a predetermined time period; Determine queues whose number is less than or equal to a preset number threshold as idle queues; When a task processing request is received within the predetermined time period, the task in the task processing request is assigned to the idle queue for processing; The predicting of the number of task processing requests received by each layer of queue within a predetermined time period includes: Acquire task running data within a historical predetermined time period, and separate the task volume data and queue task allocation data through preprocessing of the task running data; Performing a stabilization analysis on the task volume data to obtain stabilization task volume data, and performing a cluster analysis on the queue task allocation data using a K-means algorithm to obtain cluster data; Using the stabilized workload data as a first training data set, using the clustered data as a second training data set, training the first training data set using a preset model to obtain a first model, and training the second training data set using the preset model to obtain a second model; Mixing the first model with the second model to obtain a mixed model; Inputting the specified queue and timestamp into the hybrid model; The number of task processing requests output by the hybrid model and allocated to the specified queue is obtained.

2. The method for processing big data resources according to claim 1, characterized in that: The step of determining the performance identifier of each layer of queue according to the initial resources of the queue includes: Determine whether the initial resource of each layer of queue is between a preset first resource threshold and a preset second resource threshold, wherein the first resource threshold is greater than the second resource threshold; When the initial resource is greater than the preset first resource threshold, determining that the performance identifier of the queue corresponding to the initial resource is a first performance identifier; When the initial resource is less than the preset first resource threshold and greater than the preset second resource threshold, determining that the performance identifier of the queue corresponding to the initial resource is a second performance identifier; When the initial resource is less than the preset second resource threshold, it is determined that the performance identifier of the queue corresponding to the initial resource is a third performance identifier.

3. The method for processing big data resources according to claim 1, characterized in that: When receiving a task processing request output by the client, the method further includes: Calling the task scheduler on the server to obtain the description file of the task; Identify the task name of the task according to the description file; Determine whether the task is submitted for the first time according to the task name; When the task is submitted for the first time, a predetermined queue is selected to run the task; When the task is not submitted for the first time, the historical duration consumed by historical tasks with the same attributes as the task is screened out from historical running records, and the estimated duration consumed by the task is predicted based on the historical duration using a pre-trained task duration consumption model.

4. The method for processing big data resources according to claim 3, characterized in that: The step of judging whether the task is submitted for the first time according to the task name includes: Traversing the resource scheduling library according to the task name; Determine whether there is a task name identical to the task name in the resource scheduling library; If the judgment result is that there is no task name identical to the task name, it is determined that the task is submitted for the first time; If the judgment result is that there is a task name identical to the task name, it is determined that the task is not submitted for the first time.

5. The method for processing big data resources according to claim 3, characterized in that: The step of filtering out the historical duration consumed by historical tasks having the same attributes as the task from the historical running records includes: Obtain the historical duration of historical tasks with the same attributes as the task within a preset number of days; Calculate the average running time based on the historical running time within the preset number of days; Substituting the historical duration and the average running duration into a variance calculation formula to obtain a variance value of the historical duration consumed by historical tasks having the same attributes as the task; The historical duration of the task is obtained according to the variance value of the historical duration.

6. The method for processing big data resources according to any one of claims 1 to 5, characterized in that: The training process of the task duration consumption model includes: Collect multiple tasks and the historical consumption time of each task in multi-layer queues; Take multiple tasks and their corresponding historical consumption time as sample data sets; Dividing the sample data set into a training set and a test set; Inputting the training set into a preset neural network for training to obtain a task duration consumption model; Input the test set into the task duration consumption model for testing, and calculate the test pass rate; If the test pass rate is greater than or equal to a preset pass rate threshold, it is determined that the task duration consumption model training is completed; If the test pass rate is less than the preset pass rate threshold, the number of training sets is increased and the task duration consumption model is retrained based on the increased training sets.

7. A big data resource processing device, applied to a big data platform, for implementing the big data resource processing method according to any one of claims 1 to 6, characterized in that: The big data resource processing device comprises: A queue initialization module, used to initialize the multi-layer queues corresponding to the big data resources in the big data platform, and obtain the initial resources of the queues; A performance identifier determination module, used to determine the performance identifier of each layer of queue according to the initial resources of the queue; The remaining resource amount monitoring module is used to call a preset number of resource amount monitors to monitor the remaining resource amount of each layer of queues in the multi-layer queue when receiving a task processing request output by the client; A consumption time prediction module is used to predict the estimated time consumed by the task using a pre-trained task time consumption model; A resource consumption estimation module is used to determine the estimated resource consumption of the task according to the estimated duration of the task; A queue-to-be-selected determining module, configured to determine a queue in the multi-layer queue whose remaining resource amount is greater than the estimated resource amount as a queue-to-be-selected; A target queue matching module, used to match a target queue whose performance identifier is a first performance identifier from the queues to be selected, wherein the initial resources of the queue corresponding to the first performance identifier are greater than the initial resources of the queues corresponding to other performance identifiers; The task allocation module is used to allocate the task to the target queue.

8. A terminal, characterized in that: The terminal includes a processor, and the processor is used to implement the big data resource processing method as described in any one of claims 1 to 6 when executing a computer program stored in a memory.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the big data resource processing method as described in any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Cluster resource scheduling method, device and equipment and computer readable storage medium

    CN109634748A

  • Intelligent scheduling method and device, computer equipment and storage medium

    CN110070260A