Queue resource adjustment method, device, electronic device and computer readable medium

By using the predicted timing model in the Hadoop cluster to predict memory usage and the number of tasks to be allocated, the target queue is automatically determined and resource adjustment is performed, which solves the problem of poor flexibility in queue resource adjustment and achieves faster and more efficient resource management.

CN112231100BActive Publication Date: 2025-04-11BEIJING XUEZHITU NETWORK TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011105767.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-15
Publication Date
2025-04-11
Estimated Expiration
2040-10-15

AI Technical Summary

Technical Problem

The flexibility of queue resource adjustment in existing Hadoop clusters is poor, especially when resources need to be adjusted quickly in emergencies, and the timeliness of manually modifying configuration files is low.

Method used

By entering the target prediction timing model of the current memory usage and the number of tasks to be allocated in the cluster, we predict the future memory usage and the number of tasks to be allocated, and when the prediction results meet certain conditions, we automatically determine the target task identity and target queue to make resource adjustments.

Benefits of technology

It realizes early warning and automated processing of queue resource adjustment, improves the flexibility of resource adjustment, and avoids resource congestion and delays in manual adjustment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112231100B_ABST
    Figure CN112231100B_ABST
Patent Text Reader

Abstract

The present application provides a queue resource adjustment method, device, electronic device and computer-readable medium, which belongs to the field of cluster technology. The method includes: inputting the current memory usage rate and the current number of tasks to be assigned in the cluster into the target prediction timing model, and obtaining the predicted memory usage rate and the predicted number of tasks to be assigned output by the target prediction timing model; when the predicted memory usage rate is not less than the target memory usage rate, and the predicted number of tasks to be assigned is not less than the target number of tasks to be assigned, determining all task identifiers in the cluster; when the emergency task database contains at least one task identifier, taking the task identifier in the cluster that exists in the emergency task database as the target task identifier; determining the target queue corresponding to the target task identifier, and adjusting the resources of the target queue. The present application improves the flexibility of resource adjustment and avoids resource congestion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cluster technology, and in particular to a queue resource adjustment method, device, electronic device and computer-readable medium. Background Art

[0002] The Hadoop cluster can allocate resources for multiple business queues. Each business queue has a priority, and the corresponding resource allocation is also different. Generally, business queues with high priorities are allocated more resources, and business queues with low priorities are allocated fewer resources.

[0003] Each queue has a corresponding configuration file. Currently, the queue resources in the cluster are adjusted by switching the configuration files at a scheduled time. If the queue resources need to be adjusted in an emergency, the configuration files need to be manually modified, which is slow in timeliness and has poor flexibility in adjusting the queue resources. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a queue resource adjustment method, device, electronic device and computer readable medium to solve the problem of poor resource adjustment flexibility. The specific technical solution is as follows:

[0005] In a first aspect, a queue resource adjustment method is provided, the method comprising:

[0006] Inputting the current memory usage rate in the cluster and the current number of tasks to be assigned into the target prediction time series model to obtain the predicted memory usage rate and the predicted number of tasks to be assigned output by the target prediction time series model;

[0007] When the predicted memory usage is not less than the target memory usage, and the predicted number of tasks to be assigned is not less than the target number of tasks to be assigned, determining all task identifiers in the cluster, wherein the cluster includes multiple tasks, and each task has a corresponding task identifier;

[0008] In the case where the emergency task database contains at least one of the task identifiers, taking the task identifier in the cluster that exists in the emergency task database as the target task identifier;

[0009] A target queue corresponding to the target task identifier is determined, and resources of the target queue are adjusted, wherein the cluster includes a plurality of queues.

[0010] Optionally, the cluster includes multiple parent queues, each of the parent queues includes multiple child queues, each of the child queues includes multiple tasks, and determining the target queue corresponding to the target task identifier and adjusting resources for the target queue includes:

[0011] Determine the target parent queue corresponding to the target task identifier;

[0012] When all the services of the target parent queue are urgent, the resources in the target parent queue are adjusted.

[0013] Optionally, the cluster includes multiple parent queues, each of the parent queues includes multiple child queues, each of the child queues includes multiple tasks, and determining the target queue corresponding to the target task identifier and adjusting resources for the target queue includes:

[0014] Determine the target parent queue corresponding to the target task identifier;

[0015] In the case where the business of the target parent queue is partially urgent, determining the target subqueue corresponding to the target task identifier;

[0016] The resources in the target subqueue are adjusted.

[0017] Optionally, the services of the target parent queue are all urgent and include:

[0018] Determine the target service identifier of the target parent queue, and obtain the emergency service identifier in the emergency service database;

[0019] In a case where the emergency service database contains an emergency service identifier that matches the target service identifier, it is determined that all services in the target parent queue are urgent.

[0020] Optionally, after the emergency task database includes at least one of the task identifiers, the method further includes:

[0021] Send a warning message to the target terminal so that the target terminal knows that the cluster needs to adjust resources.

[0022] Optionally, after inputting the current memory usage rate and the current number of tasks to be assigned into a target prediction time series model to obtain a predicted memory usage rate and a predicted number of tasks to be assigned output by the target prediction time series model, the method further includes:

[0023] When the predicted memory usage is less than the target memory usage, or the predicted number of tasks to be assigned is less than the target number of tasks to be assigned, the memory usage and the number of tasks to be assigned of the cluster continue to be acquired after a preset time.

[0024] Optionally, before inputting the current memory usage rate and the current number of tasks to be assigned into a target prediction time series model to obtain a predicted memory usage rate and a predicted number of tasks to be assigned output by the target prediction time series model, the method further includes:

[0025] Obtaining a sample memory usage rate, a sample number of tasks to be assigned, a first memory usage rate corresponding to the sample memory usage rate, and a first number of tasks to be assigned corresponding to the sample number of tasks to be assigned;

[0026] Inputting the sample memory usage rate and the sample number of tasks to be assigned into an initial prediction time series model to obtain a second memory usage rate and a second number of tasks to be assigned output by the initial prediction time series model;

[0027] When the first memory usage rate is different from the second memory usage rate, or the first number of tasks to be assigned is different from the second number of tasks to be assigned, the model parameters of the initial prediction timing model are adjusted to obtain the target prediction timing model, wherein the second memory usage rate output by the target prediction timing model is consistent with the first memory usage rate, and the second number of tasks to be assigned output by the target prediction timing model is consistent with the first number of tasks to be assigned.

[0028] In a second aspect, a queue resource adjustment device is provided, the device comprising:

[0029] An input-output module, used for inputting the current memory usage rate in the cluster and the current number of tasks to be assigned into a target prediction time series model, and obtaining a predicted memory usage rate and a predicted number of tasks to be assigned output by the target prediction time series model;

[0030] A determination module, configured to determine all task identifiers in the cluster when the predicted memory usage is not less than the target memory usage and the predicted number of tasks to be assigned is not less than the target number of tasks to be assigned, wherein the cluster includes a plurality of tasks and each task has a corresponding task identifier;

[0031] as a module, for, when the emergency task database contains at least one of the task identifiers, using the task identifier in the cluster that exists in the emergency task database as the target task identifier;

[0032] The adjustment module is used to determine the target queue corresponding to the target task identifier and adjust the resources of the target queue, wherein the cluster includes multiple queues.

[0033] In a third aspect, an electronic device is provided, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0034] Memory, used to store computer programs;

[0035] The processor is used to implement any of the method steps described above when executing a program stored in the memory.

[0036] In a fourth aspect, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, any of the method steps described above is implemented.

[0037] Beneficial effects of the embodiments of the present application:

[0038] The embodiment of the present application provides a queue resource adjustment method, the method comprising: inputting the current memory usage rate and the current number of tasks to be assigned in the cluster into the target prediction timing model, obtaining the predicted memory usage rate and the predicted number of tasks to be assigned output by the target prediction timing model, when the predicted memory usage rate is not less than the target memory usage rate, and the predicted number of tasks to be assigned is not less than the target number of tasks to be assigned, the server determines all task identifiers in the cluster, and when the emergency task database contains at least one task identifier, the task identifier in the cluster that exists in the emergency task database is used as the target task identifier, the target queue corresponding to the target task identifier is determined, and the target queue is adjusted for resources. The present application adjusts the resources of the queue in advance through the predicted memory usage rate and the number of tasks to be assigned, achieves early warning processing, improves the flexibility of resource adjustment, and avoids resource congestion.

[0039] Of course, implementing any product or method of the present application does not necessarily require achieving all of the above advantages at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the embodiments of the present application 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, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0041] Figure 1 A flow chart of a method for adjusting queue resources provided in an embodiment of the present application;

[0042] Figure 2 A flow chart of a method for adjusting resources in a cluster provided in an embodiment of the present application;

[0043] Figure 3 A processing flow chart of queue resource adjustment provided in an embodiment of the present application;

[0044] Figure 4 A schematic diagram of the structure of a queue resource adjustment device provided in an embodiment of the present application;

[0045] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0046] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not 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.

[0047] An embodiment of the present application provides a queue resource adjustment method, which can be applied to a server to adjust queue resources in a cluster.

[0048] The following will describe in detail a queue resource adjustment method provided by an embodiment of the present application in combination with a specific implementation method. Figure 1 As shown, the specific steps are as follows:

[0049] Step 101: input the current memory usage rate and the current number of tasks to be assigned in the cluster into the target prediction time series model to obtain the predicted memory usage rate and the predicted number of tasks to be assigned output by the target prediction time series model.

[0050] In the embodiment of the present application, the Hadoop cluster is a distributed system infrastructure. Hadoop implements a distributed file system that provides high throughput to access application data. It is suitable for applications with very large data sets. The cluster contains multiple queues, and the resources in the Hadoop cluster are divided into queues for use. Each queue corresponds to a business group. Generally, queue resources are not evenly distributed. Different resources are allocated to each business queue according to the priority of the business. Businesses with low priority are allocated fewer queue resources, and businesses with high priority are allocated more queue resources. Among them, the queue mainly provides the reception and transmission of messages to achieve message synchronization between microservices.

[0051] There are multiple tasks to be assigned in the cluster, and the cluster assigns tasks to queues based on business priorities. Each queue contains multiple tasks, and the urgency of different tasks can be different, and the cluster memory occupied by each task is also different. When there are too many urgent tasks in the cluster, the resources in the cluster need to be adjusted to make effective use of cluster resources.

[0052] The server periodically obtains the current memory usage rate and the current number of tasks to be assigned of the cluster. The obtained current memory usage rate and the current number of tasks to be assigned are input into the target prediction time series model to obtain the predicted memory usage rate and the predicted number of tasks to be assigned output by the target prediction time series model.

[0053] Since the server obtains the current memory usage and the current number of tasks to be assigned regularly, the predicted memory usage output by the target prediction time series model is the memory usage after the target duration, and the predicted number of tasks to be assigned output by the target prediction time series model is the number of tasks to be assigned after the target duration. The target duration is the duration of the scheduled time interval, and the target prediction time series model can be a TreNet deep learning network.

[0054] As an optional implementation, before inputting the current memory usage rate and the current number of tasks to be allocated into the target prediction timing model to obtain the predicted memory usage rate and the predicted number of tasks to be allocated output by the target prediction timing model, the method also includes: obtaining the sample memory usage rate, the sample number of tasks to be allocated, the first memory usage rate corresponding to the sample memory usage rate, and the first number of tasks to be allocated corresponding to the sample number of tasks to be allocated; inputting the sample memory usage rate and the sample number of tasks to be allocated into the initial prediction timing model to obtain the second memory usage rate and the second number of tasks to be allocated output by the initial prediction timing model; when the first memory usage rate is different from the second memory usage rate, or the first number of tasks to be allocated is different from the second number of tasks to be allocated, adjusting the model parameters of the initial prediction timing model to obtain the target prediction timing model, wherein the second memory usage rate output by the target prediction timing model is consistent with the first memory usage rate, and the second number of tasks to be allocated output by the target prediction timing model is consistent with the first number of tasks to be allocated.

[0055] In an embodiment of the present application, the server obtains the sample memory usage rate, the sample number of tasks to be allocated, the first memory usage rate corresponding to the sample memory usage rate, and the first number of tasks to be allocated corresponding to the sample number of tasks to be allocated. The server inputs the sample memory usage rate and the sample number of tasks to be allocated into the initial prediction timing model to obtain the second memory usage rate and the second number of tasks to be allocated output by the initial prediction timing model. If the server determines that the first memory usage rate is different from the second memory usage rate, or the first number of tasks to be allocated is different from the second number of tasks to be allocated, the model parameters of the initial prediction timing model are adjusted until the second memory usage rate output by the target prediction timing model is consistent with the first memory usage rate, and the second number of tasks to be allocated output by the target prediction timing model is consistent with the first number of tasks to be allocated, thereby obtaining the target prediction timing model.

[0056] Step 102: when the predicted memory usage is not less than the target memory usage and the predicted number of tasks to be assigned is not less than the target number of tasks to be assigned, determine all task identifiers in the cluster.

[0057] The cluster contains multiple tasks, and each task has a corresponding task identifier.

[0058] In an embodiment of the present application, after obtaining the predicted memory usage and the predicted number of tasks to be assigned, the server determines whether the predicted memory usage is not less than the target memory usage and whether the predicted number of tasks to be assigned is not less than the target number of tasks to be assigned.

[0059] If the server determines that the predicted memory usage is less than the target memory usage, or the predicted number of tasks to be assigned is less than the target number of tasks to be assigned, it indicates that the current memory usage and number of tasks to be assigned of the cluster are not very high, and there is no need to readjust the cluster resources.

[0060] If the server determines that the predicted memory usage is not less than the target memory usage, and the predicted number of tasks to be assigned is not less than the target number of tasks to be assigned, it indicates that the current cluster's memory usage and the number of tasks to be assigned are too high, and it is necessary to determine whether the tasks in the cluster are urgent, and the server obtains the task identifier of each task. The task identifier can be the number corresponding to the task.

[0061] Step 103: When the emergency task database contains at least one task identifier, the task identifier in the cluster that exists in the emergency task database is used as the target task identifier.

[0062] In the present application, an emergency task database is provided, and the emergency task database contains task identifiers of emergency tasks. If the server determines that the emergency task database contains at least one task identifier in a cluster, indicating that the task corresponding to the task identifier in the emergency task database is an emergency task, the server uses the task identifier as the target task identifier. If the server determines that the emergency task database does not contain the task identifier in the cluster, indicating that no task in the cluster is an emergency task, there is no need to adjust the queue resources.

[0063] Step 104: Determine the target queue corresponding to the target task identifier, and adjust resources for the target queue.

[0064] The cluster includes multiple queues, and each queue corresponds to multiple tasks.

[0065] In an embodiment of the present application, a cluster includes multiple queues, each queue corresponds to multiple tasks, and each task has a corresponding task identifier. After the server determines the target task identifier, the server determines the target queue corresponding to the target task identifier and adjusts the resources of the target queue, which may specifically be to increase the weight of the target queue or increase the resource storage capacity of the target queue.

[0066] In this application, the server obtains the predicted memory usage and the predicted number of tasks to be assigned output by the target prediction timing model, and can predict the memory usage and the number of tasks to be assigned in the next stage. If it is determined that there is an urgent task, the resources of the queue corresponding to the task are adjusted. This application can predict the memory usage and the number of tasks to be assigned in the next stage of the queue, adjust the resources of the queue in advance, achieve early warning processing, improve the flexibility of resource adjustment, and avoid resource allocation delays. In addition, the automatic adjustment of resources improves operational efficiency compared to manual adjustment of resources.

[0067] As an optional implementation, the cluster includes multiple parent queues, each parent queue includes multiple child queues, each child queue includes multiple tasks, determining the target queue corresponding to the target task identifier, and adjusting the resources of the target queue include: determining the target parent queue corresponding to the target task identifier; when the business of the target parent queue is all urgent, adjusting the resources in the target parent queue.

[0068] In an embodiment of the present application, a cluster includes multiple parent queues, each parent queue corresponds to a business group, each parent queue includes multiple child queues, and each child queue includes multiple tasks. After the server determines the target task identifier, it determines the target parent queue corresponding to the target task identifier. If all the businesses in the business group corresponding to the target parent queue are emergency businesses, then the server adjusts the resources in the target parent queue, that is, adjusts the resources for all emergency businesses in the business group.

[0069] As an optional implementation, the services of the target parent queue are all urgent, including: determining the target service identifier of the target parent queue and obtaining the emergency service identifier in the emergency service database; when the emergency service database contains an emergency service identifier that matches the target service identifier, determining that the services of the target parent queue are all urgent.

[0070] In the embodiment of the present application, the emergency service database contains multiple emergency service identifiers, and the server obtains the target service identifier of the target parent queue. If the server determines that the target service identifier matches the emergency service identifier in the emergency service database, it indicates that the services in the target parent queue corresponding to the target service identifier are all emergency. If the server determines that the target service identifier does not match the emergency service identifier in the emergency service database, it indicates that the services in the target parent queue corresponding to the target service identifier are partially emergency.

[0071] As an optional implementation, Figure 2 As shown, the cluster includes multiple parent queues, each parent queue includes multiple child queues, each child queue includes multiple tasks, and adjusting the resources in the cluster includes:

[0072] Step 201: Determine the target parent queue corresponding to the task identifier.

[0073] In the embodiment of the present application, after determining the target task identifier, the server determines the target parent queue corresponding to the target task identifier.

[0074] Step 202: When the service of the target parent queue is partially urgent, determine the target child queue corresponding to the target task identifier.

[0075] In an embodiment of the present application, not all of the services in the service group corresponding to the target parent queue are urgent services, indicating that only some of the sub-queues in the target parent queue have urgent tasks. The server does not need to adjust all resources in the target parent queue, but only needs to determine the target sub-queue corresponding to the task identifier.

[0076] Step 203: Adjust the resources in the target sub-queue.

[0077] In the embodiment of the present application, the server adjusts the resources in the target sub-queue, which may specifically be to increase the weight of the target sub-queue or to increase the resource storage capacity of the target sub-queue.

[0078] In the present application, if the server determines that the services of the target parent queue are all urgent, the server adjusts the resources of the target parent queue. If the server determines that the services of the target parent queue are partially urgent, the server adjusts the resources of the target child queue. In this way, resource adjustments are only made to the queues corresponding to the urgent services.

[0079] As an optional implementation, after determining that the emergency task database has a task identifier, the method further includes: sending a warning message to a target terminal so that the target terminal is informed that the cluster needs to adjust resources.

[0080] In the embodiment of the present application, after the server determines that there is a task identifier in the emergency task database, it sends a warning message to the target terminal so that the target terminal knows that the cluster needs to adjust resources.

[0081] As an optional implementation, after inputting the current memory usage and the current number of tasks to be assigned into the target prediction timing model to obtain the predicted memory usage and the predicted number of tasks to be assigned output by the target prediction timing model, the method also includes: when the predicted memory usage is less than the target memory usage, or the predicted number of tasks to be assigned is less than the target number of tasks to be assigned, continuing to obtain the memory usage and the number of tasks to be assigned of the cluster after a preset time period.

[0082] In an embodiment of the present application, when the server predicts that the memory usage is less than the target memory usage, or predicts that the number of tasks to be assigned is less than the target number of tasks to be assigned, the server does not adjust the queue resources, and continues to obtain the memory usage and number of tasks to be assigned of the cluster after a preset period of time.

[0083] In this application, the server will adjust the resources of the queue only after identifying an urgent task. If the memory usage is too high or the number of tasks to be assigned is too large, the queue will not be adjusted to avoid the situation where urgent tasks occur but there are insufficient adjustable resources.

[0084] Optionally, the embodiment of the present application also provides a processing flow chart of queue resource adjustment, such as Figure 3 As shown, the specific steps are as follows.

[0085] Step 301: Obtain the current memory usage and the current number of tasks to be assigned in the cluster.

[0086] Step 302: input the current memory usage rate and the current number of tasks to be assigned in the cluster into the target prediction time series model to obtain the predicted memory usage rate and the predicted number of tasks to be assigned output by the target prediction time series model.

[0087] Step 303: determine whether the predicted memory usage is not less than the target memory usage. If so, execute step 304; if not, return to step 301 and continue to obtain the memory usage of the cluster and the number of tasks to be assigned after a preset time.

[0088] Step 304: Determine whether the predicted number of tasks to be assigned is not less than the target number of tasks to be assigned. If so, execute step 305; if not, return to step 301 and continue to obtain the memory usage rate and the number of tasks to be assigned of the cluster after a preset time.

[0089] Step 305: determine all task identifiers in the cluster, and determine whether the emergency task database contains at least one task identifier. If so, execute step 306; if not, return to step 301;

[0090] Step 306: Use the task identifier in the cluster that exists in the emergency task database as the target task identifier.

[0091] Step 307: determine the target parent queue corresponding to the target task identifier, and judge whether all services of the target parent queue are urgent. If so, execute step 308; if not, execute step 309.

[0092] Step 308: Adjust the resources in the target parent queue.

[0093] Step 309: Adjust the resources in the target sub-queue.

[0094] Based on the same technical concept, the embodiment of the present application also provides a queue resource adjustment device, such as Figure 4 As shown, the device comprises:

[0095] Input-output module 401, used for inputting the current memory usage rate and the current number of tasks to be assigned in the cluster into the target prediction time series model, and obtaining the predicted memory usage rate and the predicted number of tasks to be assigned output by the target prediction time series model;

[0096] A determination module 402 is used to determine all task identifiers in the cluster when the predicted memory usage is not less than the target memory usage and the predicted number of tasks to be assigned is not less than the target number of tasks to be assigned, wherein the cluster includes multiple tasks and each task has a corresponding task identifier;

[0097] As module 403, when the emergency task database contains at least one task identifier, the task identifier in the cluster existing in the emergency task database is used as the target task identifier;

[0098] The first adjustment module 404 is used to determine the target queue corresponding to the target task identifier and adjust the resources of the target queue, wherein the cluster includes multiple queues.

[0099] Optionally, the cluster includes multiple parent queues, each parent queue includes multiple child queues, each child queue includes multiple tasks, and the first adjustment module 404 includes:

[0100] A first determining unit, used to determine a target parent queue corresponding to a target task identifier;

[0101] The first adjustment unit is configured to adjust resources in the target parent queue when all services in the target parent queue are urgent.

[0102] Optionally, the cluster includes multiple parent queues, each parent queue includes multiple child queues, each child queue includes multiple tasks, and the first adjustment module 404 includes:

[0103] A second determining unit, used to determine a target parent queue corresponding to the target task identifier;

[0104] A third determining unit is used to determine a target sub-queue corresponding to the target task identifier when the service of the target parent queue is partially urgent;

[0105] The second adjustment unit is used to adjust the resources in the target sub-queue.

[0106] Optionally, the first adjustment unit includes:

[0107] A first determination subunit is used to determine the target service identifier of the target parent queue and obtain the emergency service identifier in the emergency service database;

[0108] The second determining subunit is configured to determine that all services in the target parent queue are urgent when the emergency service database contains an emergency service identifier that matches the target service identifier.

[0109] Optionally, the device further comprises:

[0110] The sending module is used to send warning information to the target terminal so that the target terminal knows that the cluster needs to adjust resources.

[0111] Optionally, the device further comprises:

[0112] The first acquisition module is used to continue to acquire the memory usage and the number of tasks to be assigned of the cluster after a preset time period when the predicted memory usage is less than the target memory usage or the predicted number of tasks to be assigned is less than the target number of tasks to be assigned.

[0113] Optionally, the device further comprises:

[0114] The second acquisition module is used to obtain the sample memory usage rate, the number of sample tasks to be assigned, the first memory usage rate corresponding to the sample memory usage rate, and the first number of tasks to be assigned corresponding to the number of sample tasks to be assigned;

[0115] An input module, used for inputting the sample memory usage rate and the sample number of tasks to be assigned into the initial prediction time series model, and obtaining the second memory usage rate and the second number of tasks to be assigned output by the initial prediction time series model;

[0116] The second adjustment module is used to adjust the model parameters of the initial prediction timing model when the first memory usage rate is different from the second memory usage rate, or the first number of tasks to be assigned is different from the second number of tasks to be assigned, so as to obtain a target prediction timing model, wherein the second memory usage rate output by the target prediction timing model is consistent with the first memory usage rate, and the second number of tasks to be assigned output by the target prediction timing model is consistent with the first number of tasks to be assigned.

[0117] Based on the same technical concept, an embodiment of the present invention further provides an electronic device, such as Figure 5 As shown, it includes a processor 501, a communication interface 502, a memory 503 and a communication bus 504, wherein the processor 501, the communication interface 502, and the memory 503 communicate with each other through the communication bus 504.

[0118] Memory 503, used for storing computer programs;

[0119] The processor 501 is used to implement the above steps when executing the program stored in the memory 503.

[0120] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0121] The communication interface is used for communication between the above electronic device and other devices.

[0122] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0123] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0124] In another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above methods are implemented.

[0125] In another embodiment of the present invention, a computer program product including instructions is provided, which enables the computer to execute any one of the methods in the above embodiments when the computer program product is executed on the computer.

[0126] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.

[0127] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0128] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.

Claims

1. A queue resource adjustment method, characterized in that: The method comprises: Inputting the current memory usage rate and the current number of tasks to be assigned in the cluster into the target prediction time series model to obtain the predicted memory usage rate and the predicted number of tasks to be assigned output by the target prediction time series model; When the predicted memory usage is not less than the target memory usage, and the predicted number of tasks to be assigned is not less than the target number of tasks to be assigned, determining all task identifiers in the cluster, wherein the cluster includes multiple tasks, and each task has a corresponding task identifier; In the case where the emergency task database contains at least one of the task identifiers, taking the task identifier in the cluster that exists in the emergency task database as the target task identifier; Determine a target queue corresponding to the target task identifier, and adjust resources for the target queue, wherein the cluster includes multiple queues, and each queue corresponds to multiple tasks; The cluster includes multiple parent queues, each parent queue includes multiple child queues, each child queue includes multiple tasks, and determining the target queue corresponding to the target task identifier and adjusting resources for the target queue includes: Determine the target parent queue corresponding to the target task identifier; In the case where the business of the target parent queue is partially urgent, determining the target subqueue corresponding to the target task identifier; The resources in the target subqueue are adjusted.

2. The method according to claim 1, characterized in that The cluster includes a plurality of parent queues, each of the parent queues includes a plurality of child queues, each of the child queues includes a plurality of tasks, and the step of determining a target queue corresponding to the target task identifier and adjusting resources of the target queue includes: Determine the target parent queue corresponding to the target task identifier; When all the services of the target parent queue are urgent, the resources in the target parent queue are adjusted.

3. The method according to claim 2, characterized in that The target parent queue's services are all urgent and include: Determine the target service identifier of the target parent queue, and obtain the emergency service identifier in the emergency service database; In a case where the emergency service database contains an emergency service identifier that matches the target service identifier, it is determined that all services in the target parent queue are urgent.

4. The method according to claim 1, characterized in that: After determining that the emergency task database contains at least one of the task identifiers, the method further includes: Send a warning message to the target terminal so that the target terminal knows that the cluster needs to adjust resources.

5. The method according to claim 1, characterized in that After inputting the current memory usage rate and the current number of tasks to be assigned into a target prediction time series model to obtain a predicted memory usage rate and a predicted number of tasks to be assigned output by the target prediction time series model, the method further includes: When the predicted memory usage is less than the target memory usage, or the predicted number of tasks to be assigned is less than the target number of tasks to be assigned, the memory usage and the number of tasks to be assigned of the cluster continue to be acquired after a preset time.

6. The method according to claim 1, characterized in that Before inputting the current memory usage rate and the current number of tasks to be assigned into a target prediction time series model to obtain a predicted memory usage rate and a predicted number of tasks to be assigned output by the target prediction time series model, the method further includes: Obtaining a sample memory usage rate, a sample number of tasks to be assigned, a first memory usage rate corresponding to the sample memory usage rate, and a first number of tasks to be assigned corresponding to the sample number of tasks to be assigned; Inputting the sample memory usage rate and the sample number of tasks to be assigned into an initial prediction time series model to obtain a second memory usage rate and a second number of tasks to be assigned output by the initial prediction time series model; When the first memory usage rate is different from the second memory usage rate, or the first number of tasks to be assigned is different from the second number of tasks to be assigned, the model parameters of the initial prediction timing model are adjusted to obtain the target prediction timing model, wherein the second memory usage rate output by the target prediction timing model is consistent with the first memory usage rate, and the second number of tasks to be assigned output by the target prediction timing model is consistent with the first number of tasks to be assigned.

7. A queue resource adjustment device, characterized in that: The device comprises: An input-output module, used to input the current memory usage rate and the current number of tasks to be assigned in the cluster into a target prediction time series model, and obtain a predicted memory usage rate and a predicted number of tasks to be assigned output by the target prediction time series model; A determination module, configured to determine all task identifiers in the cluster when the predicted memory usage is not less than the target memory usage and the predicted number of tasks to be assigned is not less than the target number of tasks to be assigned, wherein the cluster includes a plurality of tasks and each task has a corresponding task identifier; as a module, for, when the emergency task database contains at least one of the task identifiers, using the task identifier in the cluster that exists in the emergency task database as the target task identifier; An adjustment module, used to determine a target queue corresponding to the target task identifier and perform resource adjustment on the target queue, wherein the cluster includes a plurality of queues; The cluster includes multiple parent queues, each parent queue includes multiple child queues, each child queue includes multiple tasks, and the adjustment module is used to: Determine the target parent queue corresponding to the target task identifier; In the case where the business of the target parent queue is partially urgent, determining the target subqueue corresponding to the target task identifier; The resources in the target subqueue are adjusted.

8. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method steps described in any one of claims 1 to 6 when executing a program stored in a memory.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Resource allocation method, device, computer equipment and storage medium

    CN108881495A

  • Resource management method and device based on Hadoop cluster, equipment and storage medium

    CN111651266A