CN116661957A - Cluster resource scheduling method, device, computer equipment and storage medium - Google Patents
Cluster resource scheduling method, device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN116661957A CN116661957A CN202210152693.0A CN202210152693A CN116661957A CN 116661957 A CN116661957 A CN 116661957A CN 202210152693 A CN202210152693 A CN 202210152693A CN 116661957 A CN116661957 A CN 116661957A
- Authority
- CN
- China
- Prior art keywords
- resource
- queue
- cluster
- value
- information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/4881—Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
本申请公开了一种集群资源调度方法、装置、计算机设备及存储介质,该集群资源调度方法包括:获取集群的历史任务执行信息,集群中包括用于执行任务的多个队列;根据历史任务执行信息确定集群中各队列的初始资源需求信息,初始资源需求信息包括各队列在预设第一时间段内每一时刻的初始资源值;获取各队列的实时资源需求信息,根据实时资源需求信息和初始资源需求信息确定各队列在下一时刻的资源修正值;根据初始资源需求信息和资源修正值,对各队列进行资源分配。本申请实施例中可以为各队列动态分配集群资源,提高了集群资源的利用率,能够以尽量少的资源数提高任务执行的效率,减少任务执行的时间。
The application discloses a cluster resource scheduling method, device, computer equipment, and storage medium. The cluster resource scheduling method includes: obtaining historical task execution information of the cluster, which includes multiple queues for executing tasks; The information determines the initial resource demand information of each queue in the cluster, and the initial resource demand information includes the initial resource value of each queue at each moment in the preset first time period; obtains the real-time resource demand information of each queue, according to the real-time resource demand information and The initial resource demand information determines the resource correction value of each queue at the next moment; according to the initial resource demand information and the resource correction value, resource allocation is performed on each queue. In the embodiment of the present application, cluster resources can be dynamically allocated to each queue, which improves the utilization rate of cluster resources, improves task execution efficiency with as few resources as possible, and reduces task execution time.
Description
技术领域technical field
本申请涉及资源调度技术领域,具体涉及一种集群资源调度方法、装置、计算机设备及存储介质。The present application relates to the technical field of resource scheduling, and in particular to a cluster resource scheduling method, device, computer equipment, and storage medium.
背景技术Background technique
随着科技的迅速发展,越来越多的数据产生,基于Hadoop集群等框架的各种大数据产品越来越受到用户的青睐。如何调度可用的集群资源节省成本、提高计算效率已经成为各大数据平台的重要研究方向。现有技术中,在对集群中的各队列进行资源分配时,是根据用户预先设定好的资源策略为各队列分配空闲资源,这种集群资源固定分配方式会导致资源分配不均。With the rapid development of science and technology, more and more data are generated, and various big data products based on frameworks such as Hadoop clusters are more and more favored by users. How to schedule available cluster resources to save costs and improve computing efficiency has become an important research direction for major data platforms. In the prior art, when resources are allocated to each queue in the cluster, idle resources are allocated to each queue according to a resource policy preset by the user. This fixed allocation of cluster resources will lead to uneven resource allocation.
发明内容Contents of the invention
本申请实施例提供一种集群资源调度方法、装置、计算机设备及存储介质,根据集群的历史任务执行信息和队列的实时资源需求信息为各队列动态分配集群资源,提高了集群资源的利用率,能够以尽量少的资源数提高任务执行的效率,减少任务执行的时间。The embodiment of the present application provides a cluster resource scheduling method, device, computer equipment, and storage medium, which dynamically allocate cluster resources to each queue according to the historical task execution information of the cluster and the real-time resource demand information of the queue, thereby improving the utilization rate of the cluster resources. It can improve the efficiency of task execution with as few resources as possible and reduce the time of task execution.
一方面,本申请提供一种集群资源调度方法,所述集群资源调度方法包括:On the one hand, the present application provides a cluster resource scheduling method, and the cluster resource scheduling method includes:
获取集群的历史任务执行信息,所述集群中包括用于执行任务的多个队列;Obtain historical task execution information of the cluster, where the cluster includes multiple queues for executing tasks;
根据所述历史任务执行信息确定所述集群中各队列的初始资源需求信息,所述初始资源需求信息包括所述各队列在预设第一时间段内每一时刻的初始资源值;determining initial resource requirement information of each queue in the cluster according to the historical task execution information, where the initial resource requirement information includes the initial resource value of each queue at each moment within a preset first time period;
获取所述各队列的实时资源需求信息,根据所述实时资源需求信息和所述初始资源需求信息确定所述各队列在下一时刻的资源修正值;Acquiring the real-time resource requirement information of each queue, and determining the resource correction value of each queue at the next moment according to the real-time resource requirement information and the initial resource requirement information;
根据所述初始资源需求信息和所述资源修正值,对所述各队列进行资源分配。Resource allocation is performed on each of the queues according to the initial resource requirement information and the resource correction value.
在本申请一些实施方案中,所述根据所述历史任务执行信息确定所述集群中各队列的初始资源需求信息,包括:In some implementations of the present application, the determining the initial resource requirement information of each queue in the cluster according to the historical task execution information includes:
根据所述历史任务执行信息,确定所述集群中各队列在预设第一时间段内每一时刻的历史资源需求值;According to the historical task execution information, determine the historical resource demand value of each queue in the cluster at each moment within the preset first time period;
根据所述历史资源需求值,确定所述集群中各队列的初始资源需求信息。Determine initial resource requirement information of each queue in the cluster according to the historical resource requirement value.
在本申请一些实施方案中,所述根据所述历史任务执行信息,确定所述集群中各队列在预设第一时间段内每一时刻的历史资源需求值,包括:In some implementations of the present application, the determining the historical resource demand value of each queue in the cluster at each moment within the preset first time period according to the historical task execution information includes:
根据所述历史任务执行信息,确定所述集群中各队列的任务时间序列及所述各队列中的任务在执行时间内的平均资源需求值;According to the historical task execution information, determine the task time sequence of each queue in the cluster and the average resource demand value of the tasks in each queue within the execution time;
根据所述任务时间序列及所述平均资源需求值,确定所述集群中各队列在预设第一时间段内每一时刻的历史资源需求值。According to the task time series and the average resource demand value, determine the historical resource demand value of each queue in the cluster at each moment within a preset first time period.
在本申请一些实施方案中,所述根据所述历史资源需求值,确定所述集群中各队列的初始资源需求信息,包括:In some implementations of the present application, the determining the initial resource requirement information of each queue in the cluster according to the historical resource requirement value includes:
根据所述历史资源需求值,确定所述各队列在所述第一时间段内每一时刻的初始资源值;determining the initial resource value of each queue at each moment within the first time period according to the historical resource demand value;
根据所述各队列在所述第一时间段内每一时刻的初始资源值,确定所述集群中各队列的初始资源需求信息。The initial resource requirement information of each queue in the cluster is determined according to the initial resource value of each queue at each moment in the first time period.
在本申请一些实施方案中,所述根据所述实时资源需求信息和所述初始资源需求信息确定所述各队列在下一时刻的资源修正值,包括:In some implementations of the present application, the determining the resource correction value of each queue at the next moment according to the real-time resource requirement information and the initial resource requirement information includes:
根据所述实时资源需求信息和所述初始资源需求信息,分别确定所述各队列在预设第二时间段内每一时刻的实时资源需求值和初始资源值,所述第二时间段包含于所述第一时间段内;According to the real-time resource demand information and the initial resource demand information, respectively determine the real-time resource demand value and the initial resource value of each queue at each moment within a preset second time period, the second time period being included in within said first period of time;
根据所述各队列在所述第二时间段内每一时刻的实时资源需求值和初始资源值,确定所述各队列在下一时刻的资源修正值。According to the real-time resource demand value and the initial resource value of each queue at each moment within the second time period, determine the resource correction value of each queue at a next moment.
在本申请一些实施方案中,所述根据所述各队列在所述第二时间段内每一时刻的实时资源需求值和初始资源值,确定所述各队列在下一时刻的资源修正值,包括:In some implementations of the present application, the determining the resource correction value of each queue at the next moment according to the real-time resource demand value and initial resource value of each queue at each moment within the second time period includes: :
根据所述各队列在所述第二时间段内每一时刻的实时资源需求值和初始资源值,确定所述各队列在所述第二时间段内每一时刻的资源差值;determining the resource difference of each queue at each moment in the second time period according to the real-time resource demand value and the initial resource value of the queues at each moment in the second time period;
根据所述资源差值,确定所述各队列在下一时刻的资源修正值。According to the resource difference value, the resource correction value of each queue at the next moment is determined.
在本申请一些实施方案中,所述根据所述初始资源需求信息和所述资源修正值,对所述各队列进行资源分配,包括:In some implementations of the present application, the resource allocation for each queue according to the initial resource requirement information and the resource correction value includes:
根据所述初始资源需求信息和所述资源修正值,确定所述各队列在下一时刻的目标资源需求值;determining the target resource demand value of each queue at the next moment according to the initial resource demand information and the resource correction value;
根据所述目标资源需求值,对所述各队列进行资源分配。Resource allocation is performed on each of the queues according to the target resource demand value.
在本申请一些实施方案中,所述根据所述初始资源需求信息和所述资源修正值,确定所述各队列在下一时刻的目标资源需求值,包括:In some implementations of the present application, the determining the target resource demand value of each queue at the next moment according to the initial resource demand information and the resource correction value includes:
根据所述初始资源需求信息,确定所述各队列在所述下一时刻的初始资源值;determining the initial resource value of each queue at the next moment according to the initial resource requirement information;
根据所述各队列在所述下一时刻的初始资源值和所述资源修正值,确定所述各队列在下一时刻的目标资源需求值。Determine the target resource demand value of each queue at the next moment according to the initial resource value of each queue at the next moment and the resource correction value.
另一方面,本申请提供一种集群资源调度装置,所述集群资源调度装置包括:In another aspect, the present application provides a cluster resource scheduling device, and the cluster resource scheduling device includes:
信息获取单元,用于获取集群的历史任务执行信息,所述集群中包括用于执行任务的多个队列;An information acquisition unit, configured to acquire historical task execution information of the cluster, where the cluster includes multiple queues for executing tasks;
信息确定单元,用于根据所述历史任务执行信息确定所述集群中各队列的初始资源需求信息,所述初始资源需求信息包括所述各队列在预设第一时间段内每一时刻的初始资源值;An information determining unit, configured to determine initial resource requirement information of each queue in the cluster according to the historical task execution information, where the initial resource requirement information includes the initial resource requirement information of each queue at each moment within a preset first time period. resource value;
修正值确定单元,用于获取所述各队列的实时资源需求信息,根据所述实时资源需求信息和所述初始资源需求信息确定所述各队列在下一时刻的资源修正值;A correction value determining unit, configured to acquire real-time resource demand information of each queue, and determine a resource correction value of each queue at a next moment according to the real-time resource demand information and the initial resource demand information;
资源调度单元,用于根据所述初始资源需求信息和所述资源修正值,对所述各队列进行资源分配。A resource scheduling unit, configured to allocate resources to each of the queues according to the initial resource requirement information and the resource correction value.
在本申请一些实施方案中,所述信息确定单元具体用于:In some embodiments of the present application, the information determination unit is specifically used for:
根据所述历史任务执行信息,确定所述集群中各队列在预设第一时间段内每一时刻的历史资源需求值;According to the historical task execution information, determine the historical resource demand value of each queue in the cluster at each moment within the preset first time period;
根据所述历史资源需求值,确定所述集群中各队列的初始资源需求信息。Determine initial resource requirement information of each queue in the cluster according to the historical resource requirement value.
在本申请一些实施方案中,所述信息确定单元具体还用于:In some embodiments of the present application, the information determination unit is specifically further configured to:
根据所述历史任务执行信息,确定所述集群中各队列的任务时间序列及所述各队列中的任务在执行时间内的平均资源需求值;According to the historical task execution information, determine the task time sequence of each queue in the cluster and the average resource demand value of the tasks in each queue within the execution time;
根据所述任务时间序列及所述平均资源需求值,确定所述集群中各队列在预设第一时间段内每一时刻的历史资源需求值。According to the task time series and the average resource demand value, determine the historical resource demand value of each queue in the cluster at each moment within a preset first time period.
在本申请一些实施方案中,所述信息确定单元具体还用于:In some embodiments of the present application, the information determination unit is specifically further configured to:
根据所述历史资源需求值,确定所述各队列在所述第一时间段内每一时刻的初始资源值;determining the initial resource value of each queue at each moment within the first time period according to the historical resource demand value;
根据所述各队列在所述第一时间段内每一时刻的初始资源值,确定所述集群中各队列的初始资源需求信息。The initial resource requirement information of each queue in the cluster is determined according to the initial resource value of each queue at each moment in the first time period.
在本申请一些实施方案中,所述修正值确定单元具体用于:In some embodiments of the present application, the correction value determination unit is specifically used for:
根据所述实时资源需求信息和所述初始资源需求信息,分别确定所述各队列在预设第二时间段内每一时刻的实时资源需求值和初始资源值,所述第二时间段包含于所述第一时间段内;According to the real-time resource demand information and the initial resource demand information, respectively determine the real-time resource demand value and the initial resource value of each queue at each moment within a preset second time period, the second time period being included in within said first period of time;
根据所述各队列在所述第二时间段内每一时刻的实时资源需求值和初始资源值,确定所述各队列在下一时刻的资源修正值。According to the real-time resource demand value and the initial resource value of each queue at each moment within the second time period, determine the resource correction value of each queue at a next moment.
在本申请一些实施方案中,所述修正值确定单元具体还用于:In some embodiments of the present application, the correction value determining unit is specifically further used for:
根据所述各队列在所述第二时间段内每一时刻的实时资源需求值和初始资源值,确定所述各队列在所述第二时间段内每一时刻的资源差值;determining the resource difference of each queue at each moment in the second time period according to the real-time resource demand value and the initial resource value of the queues at each moment in the second time period;
根据所述资源差值,确定所述各队列在下一时刻的资源修正值。According to the resource difference value, the resource correction value of each queue at the next moment is determined.
在本申请一些实施方案中,所述资源调度单元具体用于:In some implementations of the present application, the resource scheduling unit is specifically configured to:
根据所述初始资源需求信息和所述资源修正值,确定所述各队列在下一时刻的目标资源需求值;determining the target resource demand value of each queue at the next moment according to the initial resource demand information and the resource correction value;
根据所述目标资源需求值,对所述各队列进行资源分配。Resource allocation is performed on each of the queues according to the target resource demand value.
在本申请一些实施方案中,所述资源调度单元具体还用于:In some embodiments of the present application, the resource scheduling unit is further configured to:
根据所述初始资源需求信息,确定所述各队列在所述下一时刻的初始资源值;determining the initial resource value of each queue at the next moment according to the initial resource requirement information;
根据所述各队列在所述下一时刻的初始资源值和所述资源修正值,确定所述各队列在下一时刻的目标资源需求值。Determine the target resource demand value of each queue at the next moment according to the initial resource value of each queue at the next moment and the resource correction value.
另一方面,本申请还提供一种计算机设备,所述计算机设备包括:On the other hand, the present application also provides a kind of computer equipment, and described computer equipment comprises:
一个或多个处理器;one or more processors;
存储器;以及storage; and
一个或多个应用程序,其中所述一个或多个应用程序被存储于所述存储器中,并配置为由所述处理器执行以实现第一方面中任一项所述的集群资源调度方法。One or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to implement the cluster resource scheduling method described in any one of the first aspects.
第四方面,本申请还提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器进行加载,以执行第一方面任一项所述的集群资源调度方法中的步骤。In the fourth aspect, the present application also provides a computer-readable storage medium, on which a computer program is stored, and the computer program is loaded by a processor to execute the cluster resource scheduling method described in any one of the first aspect. step.
本申请根据集群的历史任务执行信息确定各队列的初始资源需求信息,根据各队列的初始资源需求信息和各队列的实时资源需求信息确定各队列在下一时刻的资源修正值,并根据初始资源需求信息和资源修正值对各队列进行资源分配,能够以尽量少的资源数提高任务执行的效率,提高了集群资源的利用率,减少了任务执行的时间。This application determines the initial resource demand information of each queue according to the historical task execution information of the cluster, determines the resource correction value of each queue at the next moment according to the initial resource demand information of each queue and the real-time resource demand information of each queue, and determines the resource correction value of each queue according to the initial resource demand Information and resource correction values allocate resources to each queue, which can improve the efficiency of task execution with as few resources as possible, improve the utilization rate of cluster resources, and reduce the time for task execution.
附图说明Description of drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings that need to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, other drawings can also be obtained based on these drawings without any creative effort.
图1是本申请实施例提供的集群资源调度系统的场景示意图;FIG. 1 is a schematic diagram of a scenario of a cluster resource scheduling system provided by an embodiment of the present application;
图2是本申请实施例中提供的集群资源调度方法的一个实施例流程示意图;FIG. 2 is a schematic flow chart of an embodiment of a cluster resource scheduling method provided in the embodiment of the present application;
图3是本申请实施例中提供的集群资源调度方法的具体实施例流程示意图;Fig. 3 is a schematic flow chart of a specific embodiment of the cluster resource scheduling method provided in the embodiment of the present application;
图4是本申请实施例中提供的集群资源调度装置的一个实施例结构示意图;FIG. 4 is a schematic structural diagram of an embodiment of a cluster resource scheduling device provided in an embodiment of the present application;
图5是本申请实施例中提供的计算机设备的一个实施例结构示意图。Fig. 5 is a schematic structural diagram of an embodiment of a computer device provided in an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the application with reference to the drawings in the embodiments of the application. Apparently, the described embodiments are only some of the embodiments of the application, not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts belong to the scope of protection of this application.
在本申请的描述中,需要理解的是,术语“中心”、“纵向”、“横向”、“长度”、“宽度”、“厚度”、“上”、“下”、“前”、“后”、“左”、“右”、“竖直”、“水平”、“顶”、“底”、“内”、“外”等指示的方位或位置关系为基于附图所示的方位或位置关系,仅是为了便于描述本申请和简化描述,而不是指示或暗示所指的装置或元件必须具有特定的方位、以特定的方位构造和操作,因此不能理解为对本申请的限制。此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个所述特征。在本申请的描述中,“多个”的含义是两个或两个以上,除非另有明确具体的限定。In the description of the present application, it should be understood that the terms "center", "longitudinal", "transverse", "length", "width", "thickness", "upper", "lower", "front", " The orientation or positional relationship indicated by "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. is based on the orientation shown in the drawings Or positional relationship is only for the convenience of describing the present application and simplifying the description, but does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the present application. In addition, the terms "first" and "second" are used for descriptive purposes only, and cannot be interpreted as indicating or implying relative importance or implicitly specifying the quantity of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of said features. In the description of the present application, "plurality" means two or more, unless otherwise specifically defined.
在本申请中,“示例性”一词用来表示“用作例子、例证或说明”。本申请中被描述为“示例性”的任何实施例不一定被解释为比其它实施例更优选或更具优势。为了使本领域任何技术人员能够实现和使用本申请,给出了以下描述。在以下描述中,为了解释的目的而列出了细节。应当明白的是,本领域普通技术人员可以认识到,在不使用这些特定细节的情况下也可以实现本申请。在其它实例中,不会对公知的结构和过程进行详细阐述,以避免不必要的细节使本申请的描述变得晦涩。因此,本申请并非旨在限于所示的实施例,而是与符合本申请所公开的原理和特征的最广范围相一致。In this application, the word "exemplary" is used to mean "serving as an example, illustration or illustration". Any embodiment described in this application as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments. The following description is given to enable any person skilled in the art to make and use the application. In the following description, details are set forth for purposes of explanation. It should be understood that one of ordinary skill in the art would recognize that the present application may be practiced without these specific details. In other instances, well-known structures and processes are not described in detail to avoid obscuring the description of the present application with unnecessary detail. Thus, the present application is not intended to be limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed in this application.
需要说明的是,本申请实施例方法由于是在计算机设备中执行,各计算机设备的处理对象均以数据或信息的形式存在,例如时间,实质为时间信息,可以理解的是,后续实施例中若提及尺寸、数量、位置等,均为对应的数据存在,以便计算机设备进行处理,具体此处不作赘述。It should be noted that since the methods in the embodiments of the present application are executed in computer equipment, the processing objects of each computer equipment exist in the form of data or information, such as time, which is essentially time information. It can be understood that in the subsequent embodiments If the size, quantity, location, etc. are mentioned, there are corresponding data for processing by computer equipment, and the details will not be repeated here.
本申请实施例提供一种集群资源调度方法、装置、计算机设备及存储介质,以下分别进行详细说明。Embodiments of the present application provide a cluster resource scheduling method, device, computer equipment, and storage medium, which will be described in detail below.
请参阅图1,图1为本申请实施例所提供的集群资源调度系统的场景示意图,该集群资源调度系统可以包括计算机设备100,计算机设备100中集成有集群资源调度装置,如图1中的计算机设备。Please refer to FIG. 1. FIG. 1 is a schematic diagram of a scenario of a cluster resource scheduling system provided by an embodiment of the present application. The cluster resource scheduling system may include a computer device 100, and a cluster resource scheduling device is integrated in the computer device 100, as shown in FIG. 1 computer equipment.
本申请实施例中计算机设备100主要用于获取集群的历史任务执行信息,所述集群中包括用于执行任务的多个队列;根据所述历史任务执行信息确定所述集群中各队列的初始资源需求信息,所述初始资源需求信息包括所述各队列在预设第一时间段内每一时刻的初始资源值;获取所述各队列的实时资源需求信息,根据所述实时资源需求信息和所述初始资源需求信息确定所述各队列在下一时刻的资源修正值;根据所述初始资源需求信息和所述资源修正值,对所述各队列进行资源分配,计算机设备100根据集群的历史任务执行信息和集群中各队列的实时资源需求信息为各队列动态分配集群资源,提高了集群资源的利用率,能够以尽量少的资源数提高任务执行的效率,减少任务执行的时间。In the embodiment of the present application, the computer device 100 is mainly used to obtain the historical task execution information of the cluster, which includes multiple queues for executing tasks; determine the initial resources of each queue in the cluster according to the historical task execution information demand information, the initial resource demand information includes the initial resource value of each queue at each moment within the preset first time period; obtain the real-time resource demand information of each queue, and according to the real-time resource demand information and the The initial resource demand information determines the resource correction value of each queue at the next moment; according to the initial resource demand information and the resource correction value, resource allocation is performed on each queue, and the computer device 100 executes according to the historical tasks of the cluster. Information and the real-time resource demand information of each queue in the cluster dynamically allocate cluster resources for each queue, which improves the utilization rate of cluster resources, improves the efficiency of task execution with as few resources as possible, and reduces the time for task execution.
本申请实施例中,该计算机设备100可以是独立的服务器,也可以是服务器组成的服务器网络或服务器集群,例如,本申请实施例中所描述的计算机设备100,其包括但不限于计算机、网络主机、单个网络服务器、多个网络服务器集或多个服务器构成的云服务器。其中,云服务器由基于云计算(Cloud Computing)的大量计算机或网络服务器构成。In the embodiment of the present application, the computer device 100 can be an independent server, or a server network or server cluster composed of servers, for example, the computer device 100 described in the embodiment of the present application, which includes but not limited to computers, network A host, a single web server, a collection of multiple web servers, or a cloud server composed of multiple servers. Wherein, the cloud server is composed of a large number of computers or network servers based on cloud computing (Cloud Computing).
可以理解的是,本申请实施例中所使用的计算机设备100可以是既包括接收和发射硬件的设备,即具有能够在双向通信链路上,执行双向通信的接收和发射硬件的设备。这种设备可以包括:蜂窝或其他通信设备,其具有单线路显示器或多线路显示器或没有多线路显示器的蜂窝或其他通信设备。具体的计算机设备100具体可以是台式终端或移动终端,计算机设备100具体还可以是手机、平板电脑、笔记本电脑等中的一种。It can be understood that the computer device 100 used in the embodiment of the present application may be a device including both receiving and transmitting hardware, that is, a device having receiving and transmitting hardware capable of performing bidirectional communication on a bidirectional communication link. Such devices may include cellular or other communication devices having a single line display or a multi-line display or a cellular or other communication device without a multi-line display. Specifically, the computer device 100 may be a desktop terminal or a mobile terminal, and the computer device 100 may also be specifically one of a mobile phone, a tablet computer, a notebook computer, and the like.
本领域技术人员可以理解,图1中示出的应用环境,仅仅是与本申请方案一种应用场景,并不构成对本申请方案应用场景的限定,其他的应用环境还可以包括比图1中所示更多或更少的计算机设备,例如图1中仅示出1个计算机设备,可以理解的,该集群资源调度系统还可以包括一个或多个其他服务,具体此处不作限定。Those skilled in the art can understand that the application environment shown in Figure 1 is only an application scenario related to the solution of this application, and does not constitute a limitation on the application scenario of the solution of this application. More or fewer computer devices are shown, for example, only one computer device is shown in FIG. 1 , it can be understood that the cluster resource scheduling system may also include one or more other services, which are not specifically limited here.
另外,如图1所示,该集群资源调度系统还可以包括存储器200,用于存储数据,如集群的历史任务执行信息,例如YARN集群中执行的任务ID,任务开始运行时间,任务结束运行时间,任务执行所需CPU等,如集群中各队列的初始资源需求信息,具体的,如集群中队列A的初始资源需求信息,队列B的初始资源需求信息,队列C的初始资源需求信息等。In addition, as shown in Figure 1, the cluster resource scheduling system may also include a memory 200 for storing data, such as historical task execution information of the cluster, such as the task ID executed in the YARN cluster, the task start time, and the task end time , the CPU required for task execution, etc., such as the initial resource requirement information of each queue in the cluster, specifically, such as the initial resource requirement information of queue A, the initial resource requirement information of queue B, and the initial resource requirement information of queue C in the cluster.
需要说明的是,图1所示的集群资源调度系统的场景示意图仅仅是一个示例,本申请实施例描述的集群资源调度系统以及场景是为了更加清楚的说明本申请实施例的技术方案,并不构成对于本申请实施例提供的技术方案的限定,本领域普通技术人员可知,随着集群资源调度系统的演变和新业务场景的出现,本申请实施例提供的技术方案对于类似的技术问题,同样适用。It should be noted that the schematic diagram of the scenario of the cluster resource scheduling system shown in Figure 1 is just an example. The cluster resource scheduling system and the scenario described in the embodiment of this application are for more clearly illustrating the technical solution of the embodiment of the application, and are not intended to Constituting a limitation on the technical solutions provided by the embodiments of the present application, those skilled in the art know that with the evolution of the cluster resource scheduling system and the emergence of new business scenarios, the technical solutions provided by the embodiments of the present application are equally applicable to similar technical problems Be applicable.
首先,本申请实施例中提供一种集群资源调度方法,该集群资源调度方法的执行主体为集群资源调度装置,该集群资源调度装置应用于计算机设备,该集群资源调度方法包括:获取集群的历史任务执行信息,所述集群中包括用于执行任务的多个队列;根据所述历史任务执行信息确定所述集群中各队列的初始资源需求信息,所述初始资源需求信息包括所述各队列在预设第一时间段内每一时刻的初始资源值;获取所述各队列的实时资源需求信息,根据所述实时资源需求信息和所述初始资源需求信息确定所述各队列在下一时刻的资源修正值;根据所述初始资源需求信息和所述资源修正值,对所述各队列进行资源分配。First, an embodiment of the present application provides a cluster resource scheduling method. The execution subject of the cluster resource scheduling method is a cluster resource scheduling device. The cluster resource scheduling device is applied to computer equipment. The cluster resource scheduling method includes: obtaining the history of the cluster task execution information, the cluster includes a plurality of queues for executing tasks; determine the initial resource requirement information of each queue in the cluster according to the historical task execution information, and the initial resource requirement information includes that each queue is in Presetting the initial resource value at each moment in the first time period; obtaining the real-time resource demand information of the queues, and determining the resources of the queues at the next time according to the real-time resource demand information and the initial resource demand information Correction value: according to the initial resource requirement information and the resource correction value, perform resource allocation to each of the queues.
如图2所示,为本申请实施例中集群资源调度方法的一个实施例流程示意图,该集群资源调度方法可以包括如下步骤301~304,具体如下:As shown in Figure 2, it is a schematic flow chart of an embodiment of the cluster resource scheduling method in the embodiment of the present application. The cluster resource scheduling method may include the following steps 301-304, specifically as follows:
301、获取集群的历史任务执行信息,所述集群中包括用于执行任务的多个队列。301. Acquire historical task execution information of a cluster, where the cluster includes multiple queues for executing tasks.
集群的历史任务执行信息是指在过去的一段时间内在集群上执行的任务信息,通常情况下,集群包括用于执行任务的多个队列,如队列1、队列2、队列3等,每个队列包含一定量的集群资源,进入集群的任务会被分配到一个队列中进行处理。历史任务执行信息包括任务ID、任务开始运行时间、任务结束运行时间、执行任务所需CPU(单位:cu/min)、任务等级以及任务所属队列。集群的历史任务执行信息在集群的历史日志中,需要进行集群资源调度时,可以请求集群后台获取集群历史日志,然后从集群历史日志中获取集群的历史任务执行信息,例如,当集群为YARN集群时,可以请求YARN集群后台获取集群历史日志中历史任务执行信息。The historical task execution information of the cluster refers to the task information executed on the cluster in the past period of time. Usually, the cluster includes multiple queues for executing tasks, such as queue 1, queue 2, queue 3, etc., each queue Contains a certain amount of cluster resources, and tasks entering the cluster will be assigned to a queue for processing. Historical task execution information includes task ID, task start time, task end time, CPU required to execute the task (unit: cu/min), task level, and the queue to which the task belongs. The historical task execution information of the cluster is in the historical log of the cluster. When cluster resource scheduling is required, you can request the cluster background to obtain the cluster historical log, and then obtain the historical task execution information of the cluster from the cluster historical log. For example, when the cluster is a YARN cluster , you can request the YARN cluster background to obtain historical task execution information in the cluster history log.
302、根据所述历史任务执行信息确定所述集群中各队列的初始资源需求信息,所述初始资源需求信息包括所述各队列在预设第一时间段内每一时刻的初始资源值。302. Determine initial resource requirement information of each queue in the cluster according to the historical task execution information, where the initial resource requirement information includes the initial resource value of each queue at each moment within a preset first time period.
初始资源需求信息包括集群中各队列在预设第一时间段内每一时刻的初始资源值,初始资源值是根据历史任务执行信息确定的集群中各队列在预设第一时间段内每一时刻所需的资源预测值,预设第一时间段可以根据用户需要进行设置,可以为一天中的0时到24时,也可以为一天中的其它任意时间段,如早上8时到晚上8时。本实施例在获取集群的历史任务执行信息后,根据历史任务执行信息确定集群中各队列的初始资源需求信息,以便后续步骤中根据初始资源需求信息对集群资源进行动态调度。The initial resource demand information includes the initial resource value of each queue in the cluster at each moment in the preset first time period. The resource forecast value required at any time, the preset first time period can be set according to user needs, it can be from 0:00 to 24:00 in a day, or any other time period in a day, such as 8:00 a.m. to 8:00 p.m. hour. In this embodiment, after acquiring the historical task execution information of the cluster, the initial resource requirement information of each queue in the cluster is determined according to the historical task execution information, so that the cluster resources can be dynamically scheduled according to the initial resource requirement information in subsequent steps.
在一具体实施方式中,如图3所示,步骤302中所述根据所述历史任务执行信息确定所述集群中各队列的初始资源需求信息,可以包括如下步骤401~402,具体如下:In a specific implementation manner, as shown in FIG. 3, determining the initial resource requirement information of each queue in the cluster according to the historical task execution information in step 302 may include the following steps 401-402, specifically as follows:
401、根据所述历史任务执行信息,确定所述集群中各队列在预设第一时间段内每一时刻的历史资源需求值;401. According to the historical task execution information, determine the historical resource demand value of each queue in the cluster at each moment within a preset first time period;
402、根据所述历史资源需求值,确定所述集群中各队列的初始资源需求信息。402. Determine initial resource requirement information of each queue in the cluster according to the historical resource requirement value.
各队列在每一时刻的历史资源需求值为各队列在每一时刻的运行中的任务的资源需求和,例如,队列1在t时刻运行任务A和任务B,任务A运行中每分钟所需资源为5cu/min,任务B运行中每分钟所需资源为6cu/min,则队列1在t时刻的历史资源需求值为11cu/min。前述步骤中提到历史任务执行信息包括任务ID、任务开始运行时间、任务结束运行时间、执行任务所需CPU(单位:cu/min)、任务等级以及任务所属队列,在获取集群的历史任务执行信息后,即可根据历史任务执行信息确定各队列在预设第一时间段内每一时刻执行的任务以及每一时刻执行的任务的资源需求和,进而可以确定各队列在预设第一时间段内每一时刻的历史资源需求值,然后根据各队列在预设第一时间段内每一时刻的历史资源需求值,确定集群中各队列的初始资源需求信息。The historical resource demand value of each queue at each moment is the sum of the resource requirements of the running tasks of each queue at each moment. For example, queue 1 runs task A and task B at time t, and task A needs The resource is 5cu/min, and the required resource per minute of task B is 6cu/min, then the historical resource demand value of queue 1 at time t is 11cu/min. The historical task execution information mentioned in the preceding steps includes the task ID, task start time, task end time, CPU required to execute the task (unit: cu/min), task level, and the queue to which the task belongs. information, the tasks executed by each queue at each moment in the preset first time period and the resource requirements of the tasks executed at each moment can be determined according to the historical task execution information, and then it can be determined that each queue is executed at the preset first time The historical resource demand value at each moment in the period, and then determine the initial resource demand information of each queue in the cluster according to the historical resource demand value of each queue at each moment in the preset first time period.
在一具体实施方式中,步骤401中所述根据所述历史任务执行信息,确定所述集群中各队列在预设第一时间段内每一时刻的历史资源需求值,可以包括如下步骤501~502,具体如下:In a specific implementation manner, in step 401, according to the historical task execution information, determining the historical resource demand value of each queue in the cluster at each moment within the preset first time period may include the following steps 501- 502, as follows:
501、根据所述历史任务执行信息,确定所述集群中各队列的任务时间序列及所述各队列中的任务在执行时间内的平均资源需求值;501. According to the historical task execution information, determine the task time sequence of each queue in the cluster and the average resource demand value of the tasks in each queue within the execution time;
502、根据所述任务时间序列及所述平均资源需求值,确定所述集群中各队列在预设第一时间段内每一时刻的历史资源需求值。502. Determine, according to the task time series and the average resource demand value, the historical resource demand value of each queue in the cluster at each moment within a preset first time period.
各队列的任务时间序列是指各队列在各时间段内执行的任务序列,根据各队列的任务时间序列可以确定各队列在每时刻执行的任务,例如,如表1所示,队列1在0-5min内执行任务A,在1-5min内执行任务B,在5-15min内执行任务C,根据队列1的任务时间序列可以确定队列1在0-1min内执行任务A,在1-5min内执行任务A和任务B,在5-15min内执行任务C。任务在执行时间内的平均资源需求量指任务在执行时间内每一分钟平均所需的资源量,其值为任务所需资源量除以任务的运行时间,例如,如表1所示,任务A的运行时间为5min,任务A所需的资源量为30(cu/min),则任务A在执行时间内的平均资源需求值为30/5=6(cu/min)。The task time sequence of each queue refers to the task sequence executed by each queue in each time period. According to the task time sequence of each queue, the tasks executed by each queue at each moment can be determined. For example, as shown in Table 1, queue 1 is at 0 - Execute task A within 5 minutes, execute task B within 1-5 minutes, and execute task C within 5-15 minutes. According to the task time sequence of queue 1, it can be determined that queue 1 executes task A within 0-1 minutes, and within 1-5 minutes Execute task A and task B, and perform task C within 5-15 minutes. The average resource demand of a task within the execution time refers to the average amount of resources required by the task per minute during the execution time, and its value is divided by the amount of resources required by the task divided by the running time of the task. The running time of A is 5 minutes, and the amount of resources required by task A is 30 (cu/min), then the average resource demand value of task A during the execution time is 30/5=6 (cu/min).
表1任务数据表Table 1 Task data table
历史任务执行信息包括任务ID、任务开始运行时间、任务结束运行时间、执行任务所需CPU(单位:cu/min)、任务等级以及任务所属队列,本实施例在确定集群中各队列在每一时刻的历史资源需求值时,可以首先根据历史任务执行信息中任务ID、任务开始运行时间、任务结束运行时间、任务等级以及任务所属队列确定集群中各队列的任务时间序列,以及根据历史任务执行信息中的任务开始运行时间、任务结束运行时间以及执行任务所需CPU确定所述各队列的任务在执行时间内的平均资源需求值,然后遍历各队列的任务时间序列,并根据各队列中的任务在执行时间内的平均资源需求值确定集群中各队列在预设第一时间段内每一时刻的历史资源需求值。例如,表1中,0-1分钟执行任务A,在1-5分钟执行任务A和任务B,在5-15分钟执行任务C,任务A的平均资源需求值为6(cu/min),任务B的平均资源需求值为5(cu/min),任务C的平均资源需求值为5(cu/min),则在0-1分钟的历史资源需求值为6(cu/min),1-5分钟的历史资源需求值为11(cu/min),5-15分钟的历史资源需求值为5(cu/min)。Historical task execution information includes task ID, task start time, task end time, CPU required to execute the task (unit: cu/min), task level, and the queue to which the task belongs. To determine the historical resource demand value at any time, you can first determine the task time sequence of each queue in the cluster based on the task ID, task start time, task end time, task level, and task queue in the historical task execution information, and determine the task time sequence according to the historical task execution The task start running time, the task ending running time and the CPU required to execute the task in the information determine the average resource demand value of the task in each queue within the execution time, and then traverse the task time series of each queue, and according to the task in each queue The average resource demand value of the task within the execution time determines the historical resource demand value of each queue in the cluster at each moment within the preset first time period. For example, in Table 1, task A is executed in 0-1 minutes, task A and task B are executed in 1-5 minutes, and task C is executed in 5-15 minutes. The average resource demand value of task A is 6 (cu/min), The average resource demand value of task B is 5 (cu/min), and the average resource demand value of task C is 5 (cu/min), then the historical resource demand value of 0-1 minute is 6 (cu/min), 1 - The historical resource demand value for 5 minutes is 11 (cu/min), and the historical resource demand value for 5-15 minutes is 5 (cu/min).
在一具体实施方式中,如图3所示,步骤402中所述根据所述历史资源需求值,确定所述集群中各队列的初始资源需求信息,可以包括如下步骤503~504,具体如下:In a specific implementation manner, as shown in FIG. 3, determining the initial resource requirement information of each queue in the cluster according to the historical resource requirement value in step 402 may include the following steps 503-504, specifically as follows:
503、根据所述历史资源需求值,确定所述各队列在所述第一时间段内每一时刻的初始资源值;503. Determine the initial resource value of each queue at each moment in the first time period according to the historical resource demand value;
504、根据所述各队列在所述第一时间段内每一时刻的初始资源值,确定所述集群中各队列的初始资源需求信息。504. Determine initial resource requirement information of each queue in the cluster according to the initial resource value of each queue at each moment in the first time period.
本实施例中可以实时对各队列进行资源分配,也可以间隔预设时间对各队列进行资源分配。当实时对各队列进行资源分配时,各队列在第一时间段内每一时刻的初始资源值可以为各队列在第一时间段内每一时刻的历史资源需求值,则确定各队列在第一时间段内每一时刻的历史资源需求值后,可以直接将各队列在第一时间段内每一时刻的历史资源需求值作为各队列在第一时间段内每一时刻的初始资源值,并根据各队列在第一时间段内每一时刻的初始资源值,确定集群中各队列的初始资源需求信息。In this embodiment, resource allocation may be performed to each queue in real time, or resource allocation may be performed to each queue at intervals of a preset time. When allocating resources to each queue in real time, the initial resource value of each queue at each moment in the first time period can be the historical resource demand value of each queue at each moment in the first time period, then it is determined that each queue is at After the historical resource demand value at each moment in a time period, the historical resource demand value of each queue at each moment in the first time period can be directly used as the initial resource value of each queue at each moment in the first time period, And according to the initial resource value of each queue at each moment in the first time period, the initial resource requirement information of each queue in the cluster is determined.
当间隔预设时间对各队列进行资源分配时,为了满足预设时间内的任务资源需求,本实施例中将预设第一时间段按照预设间隔进行切分,将第一时间段切分为若干个时间窗口,并将时间窗口内的历史资源需求值中的最大值作为该时间窗口内每一时刻的初始资源值。例如,第一时间段为0时到24时,按照每15分钟一个间隔对第一时间段进行切分,假设0-15分钟的时间窗口内执行的任务如表1所示,则0-15分钟内每一时刻的初始资源值为y0=Max(6+5,5)=11。When resources are allocated to each queue at intervals of preset time intervals, in order to meet the task resource requirements within the preset time intervals, in this embodiment, the preset first time period is divided according to preset intervals, and the first time period is divided into There are several time windows, and the maximum value of the historical resource demand value in the time window is used as the initial resource value at each moment in the time window. For example, the first time period is from 0:00 to 24:00, and the first time period is divided according to an interval of 15 minutes. Assuming that the tasks executed in the time window of 0-15 minutes are as shown in Table 1, then 0-15 The initial resource value at each moment in a minute is y 0 =Max(6+5,5)=11.
当每一时刻的初始资源值为该时刻所属的时间窗口内的历史资源需求值中的最大值时,可以根据各队列在预设第一时间段内每一时刻的历史资源需求值,确定第一时间段内每一时刻所属的时间窗口内的历史资源需求值中的最大值,然后根据第一时间段内每一时刻所属的时间窗口内的历史资源需求值中的最大值,确定各队列在第一时间段内每一时刻的初始资源值,再根据各队列在第一时间段内每一时刻的初始资源值,确定集群中各队列的初始资源需求信息。When the initial resource value at each moment is the maximum value among the historical resource demand values within the time window to which this moment belongs, the second can be determined according to the historical resource demand values of each queue at each moment within the preset first time period. The maximum value of the historical resource demand value in the time window to which each moment belongs in a time period, and then determine each queue according to the maximum value in the historical resource demand value in the time window to which each moment belongs to in the first time period The initial resource value at each moment in the first time period, and then determine the initial resource demand information of each queue in the cluster according to the initial resource value of each queue at each moment in the first time period.
303、获取所述各队列的实时资源需求信息,根据所述实时资源需求信息和所述初始资源需求信息确定所述各队列在下一时刻的资源修正值。303. Acquire real-time resource requirement information of each queue, and determine a resource correction value of each queue at a next moment according to the real-time resource requirement information and the initial resource requirement information.
实时资源需求信息为各队列实时所需的资源值,初始资源需求信息为历史任务执行信息确定的各队列的资源需求预测值,资源修正值是根据实时资源需求信息和初始资源需求信息确定的,用于表征资源需求预测值与各队列的实时资源需求值之间偏差的偏差值。本实施例获取各队列的实时资源需求信息后,根据实时资源需求信息和初始资源需求信息确定各队列在下一时刻的资源修正值,以便后续步骤中根据资源修正值对各队列进行资源分配。The real-time resource demand information is the real-time resource value required by each queue, the initial resource demand information is the predicted resource demand value of each queue determined by the historical task execution information, and the resource correction value is determined according to the real-time resource demand information and the initial resource demand information. The deviation value used to represent the deviation between the resource demand forecast value and the real-time resource demand value of each queue. In this embodiment, after obtaining the real-time resource demand information of each queue, the resource correction value of each queue at the next moment is determined according to the real-time resource demand information and the initial resource demand information, so as to allocate resources to each queue according to the resource correction value in subsequent steps.
在一具体实施方式中,继续参照图3所示,步骤303中所述根据所述实时资源需求信息和所述初始资源需求信息确定所述各队列在下一时刻的资源修正值,可以包括如下步骤403~404,具体如下:In a specific implementation manner, continuing to refer to FIG. 3 , determining the resource correction value of each queue at the next moment according to the real-time resource requirement information and the initial resource requirement information in step 303 may include the following steps 403~404, the details are as follows:
403、根据所述实时资源需求信息和所述初始资源需求信息,分别确定所述各队列在预设第二时间段内每一时刻的实时资源需求值和初始资源值,所述第二时间段包含于所述第一时间段内;403. According to the real-time resource requirement information and the initial resource requirement information, respectively determine the real-time resource requirement value and the initial resource value of each queue at each moment within a preset second time period, the second time period included within said first time period;
404、根据所述各队列在所述第二时间段内每一时刻的实时资源需求值和初始资源值,确定所述各队列在下一时刻的资源修正值。404. Determine a resource correction value of each queue at a next moment according to the real-time resource demand value and the initial resource value of each queue at each moment within the second time period.
预设第二时间段包含于预设第一时间段内,也就是说第二时间段是第一时间段中的一部分时间段,例如第一时间段为0时至24时,第二时间段为1时至2时,为了更精确的确定各队列在下一时刻的资源修正值,预设第二时间段为包括当前时刻的时间段,例如,下一时刻为t+1时刻,第二时间段为t-n时刻至t时刻。本实施例在确定各队列在下一时刻的资源修正值时,可以根据实时资源需求信息确定在预设第二时间段内每一时刻的实时资源需求值,以及根据初始资源需求信息确定各队列在预设第二时间段内每一时刻的初始资源值,然后根据各队列在预设第二时间段内每一时刻的实时资源需求值和初始资源值,确定各队列在下一时刻的资源修正值。The preset second time period is included in the preset first time period, that is to say, the second time period is a part of the first time period, for example, the first time period is from 0:00 to 24:00, and the second time period From 1 o'clock to 2 o'clock, in order to more accurately determine the resource correction value of each queue at the next moment, the preset second time period is the time period including the current moment, for example, the next moment is t+1 time, the second time The segment is from time t-n to time t. In this embodiment, when determining the resource correction value of each queue at the next moment, the real-time resource demand value at each moment within the preset second time period can be determined according to the real-time resource demand information, and the real-time resource demand value of each queue can be determined according to the initial resource demand information. Preset the initial resource value at each moment in the second time period, and then determine the resource correction value of each queue at the next moment according to the real-time resource demand value and initial resource value of each queue at each moment in the preset second time period .
在一具体实施方式中,步骤404中所述根据所述各队列在所述第二时间段内每一时刻的实时资源需求值和初始资源值,确定所述各队列在下一时刻的资源修正值,可以包括如下步骤505~506,具体如下:In a specific implementation manner, in step 404, according to the real-time resource demand value and the initial resource value of each queue at each moment within the second time period, determine the resource correction value of each queue at the next moment , may include the following steps 505-506, specifically as follows:
505、根据所述各队列在所述第二时间段内每一时刻的实时资源需求值和初始资源值,确定所述各队列在所述第二时间段内每一时刻的资源差值;505. Determine the resource difference value of each queue at each moment in the second time period according to the real-time resource demand value and the initial resource value of each queue at each moment in the second time period;
506、根据所述资源差值,确定所述各队列在下一时刻的资源修正值。506. Determine a resource correction value of each queue at a next moment according to the resource difference.
各队列在第二时间段内每一时刻的资源差值为各队列在第二时间段内每一时刻的实时资源需求值与初始资源值之间的差值,在确定各队列在第二时间段内每一时刻的资源差值时,可以对各队列在第二时间段内每一时刻的实时资源需求值和初始资源需求值进行差值运行。例如,当第二时间段为Ts时刻到Te时刻时,各队列在第二时间段内每一时刻的资源差值Ri=rti-yi,其中,Ri为i时刻的资源差值,i∈Ts→Te,rti为i时刻的实时资源需求值,yi为i时刻的初始资源值。The resource difference of each queue at each moment in the second time period is the difference between the real-time resource demand value and the initial resource value of each queue at each moment in the second time period. When calculating the resource difference at each moment in the period, the difference operation may be performed on the real-time resource demand value and the initial resource demand value of each queue at each moment in the second time period. For example, when the second time period is from time T s to time T e , the resource difference R i =rt i -y i of each queue at each moment in the second time period, where R i is the resource at time i Difference, i∈T s →T e , rt i is the real-time resource demand value at time i, and y i is the initial resource value at time i.
得到各队列在第二时间段内每一时刻的资源差值后,对各队列在第二时间段内每一时刻的资源差值分别进行求和后再求均值,得到各队列在下一时刻的资源修正值。例如,当第二时间段为Ts时刻到Te时刻时,各队列在下一时刻的资源修正值其中,D为下一时刻的资源修正值,Ts为第二时间段的开始时刻,Te为第二时间段的结束时刻,i∈Ts→Te,rti为i时刻的实时资源需求值,yi为i时刻的初始资源值,(rti-yi)为i时刻的资源差值。After obtaining the resource differences of each queue at each moment in the second time period, the resource differences of each queue at each moment in the second time period are respectively summed and then averaged to obtain the resource difference of each queue at the next moment Resource modifier. For example, when the second time period is from time T s to time T e , the resource correction value of each queue at the next time Among them, D is the resource correction value at the next moment, T s is the start time of the second time period, T e is the end time of the second time period, i∈T s →T e , rt i is the real-time resource at time i demand value, y i is the initial resource value at time i, and (rt i -y i ) is the resource difference at time i.
304、根据所述初始资源需求信息和所述资源修正值,对所述各队列进行资源分配。304. Perform resource allocation to the queues according to the initial resource requirement information and the resource correction value.
初始资源需求信息包括各队列在预设第一时间段内每一时刻的初始资源值,而初始资源值是根据历史任务执行信息确定的资源需求预测值,其与实时资源需求值之间通常会存在一定的偏差,本实施例中得到各队列在下一时刻的资源修正值,根据资源修正值对初始资源需求信息中的初始资源值进行修正,再根据修正后的初始资源值对各队列进行资源分配,使得各队列分配到的集群资源更加均匀合理,能够以尽量少的资源数提高任务执行的效率,提高了集群资源的利用率,减少任务执行的时间。The initial resource demand information includes the initial resource value of each queue at each moment in the preset first time period, and the initial resource value is the resource demand forecast value determined according to the historical task execution information, and there is usually a gap between the real-time resource demand value and the real-time resource demand value. There is a certain deviation. In this embodiment, the resource correction value of each queue at the next moment is obtained, and the initial resource value in the initial resource demand information is corrected according to the resource correction value, and then resource allocation for each queue is performed according to the corrected initial resource value. Allocation makes the cluster resources allocated to each queue more even and reasonable, improves the efficiency of task execution with as few resources as possible, improves the utilization of cluster resources, and reduces the time for task execution.
在一具体实施方式中,继续参照图3所示,步骤304中所述根据所述初始资源需求信息和所述资源修正值,对所述各队列进行资源分配,可以包括如下步骤405~406,具体如下:In a specific implementation manner, continuing to refer to FIG. 3 , in step 304, according to the initial resource requirement information and the resource correction value, performing resource allocation to each of the queues may include the following steps 405-406, details as follows:
405、根据所述初始资源需求信息和所述资源修正值,确定所述各队列在下一时刻的目标资源需求值;405. Determine the target resource demand value of each queue at the next moment according to the initial resource demand information and the resource correction value;
406、根据所述目标资源需求值,对所述各队列进行资源分配。406. Perform resource allocation on each of the queues according to the target resource demand value.
目标资源需求值为根据初始资源需求信息和资源修正值确定的各队列在下一时刻所需的资源值,本实施例确定各队列在下一时刻的资源修正值后,根据所述初始资源需求信息和所述资源修正值确定各队列在下一时刻的目标资源需求值,再根据各队列在下一时刻的目标资源需求值以及各队列的优先级为各队列分配资源,使得可以为各队列动态分配集群资源,提高了集群资源的利用率,能够以尽量少的资源数提高任务执行的效率,减少任务执行的时间。例如,确定队列1的目标资源需求值为ynext1,队列2的目标资源需求值为ynext2,队列3的目标资源需求值为ynext3,则可依据队列1、队列2以及队列3的优先级以及确定的各队列的目标资源需求值为各队列分配集群资源。在根据目标资源需求值对各队列进行资源分配之前,本实施例还将各队列在下一时刻的目标资源需求值与各队列在下一时刻的实时资源需求值进行比较,当各队列在下一时刻的目标资源需求值不满足各队列在下一时刻的实时资源需求值时,继续获取各队列的实时资源需求信息,根据所述实时资源需求信息和所述初始资源需求信息确定所述各队列在下一时刻的资源修正值,根据所述初始资源需求信息和所述资源修正值,确定所述各队列在下一时刻的目标资源需求值的步骤,直至各队列在下一时刻的目标资源需求值满足各队列在下一时刻的实时资源需求值。The target resource demand value is the resource value required by each queue at the next moment determined according to the initial resource demand information and the resource correction value. In this embodiment, after determining the resource correction value of each queue at the next moment, according to the initial resource demand information and The resource correction value determines the target resource demand value of each queue at the next moment, and then allocates resources for each queue according to the target resource demand value of each queue at the next moment and the priority of each queue, so that cluster resources can be dynamically allocated to each queue , improve the utilization rate of cluster resources, improve the efficiency of task execution with as few resources as possible, and reduce the time of task execution. For example, if the target resource demand value of queue 1 is determined to be y next1 , the target resource demand value of queue 2 is y next2 , and the target resource demand value of queue 3 is y next3 , then the priority of queue 1, queue 2, and queue 3 can be determined And the determined target resource demand value of each queue allocates cluster resources to each queue. Before allocating resources to each queue according to the target resource demand value, this embodiment also compares the target resource demand value of each queue at the next moment with the real-time resource demand value of each queue at the next moment. When the target resource demand value does not meet the real-time resource demand value of each queue at the next moment, continue to obtain the real-time resource demand information of each queue, and determine the real-time resource demand information of each queue according to the real-time resource demand information and the initial resource demand information. According to the resource correction value of the initial resource demand information and the resource correction value, the step of determining the target resource demand value of each queue at the next moment until the target resource demand value of each queue at the next moment meets the requirements of each queue at the next moment Real-time resource demand value at a moment.
在一具体实施方式中,步骤405中所述根据所述初始资源需求信息和所述资源修正值,确定所述各队列在下一时刻的目标资源需求值,可以包括如下步骤507~508,具体如下:In a specific implementation manner, in step 405, according to the initial resource requirement information and the resource correction value, determining the target resource requirement value of each queue at the next moment may include the following steps 507-508, specifically as follows :
507、根据所述初始资源需求信息,确定所述各队列在所述下一时刻的初始资源值;507. Determine the initial resource value of each queue at the next moment according to the initial resource requirement information;
508、根据所述各队列在所述下一时刻的初始资源值和所述资源修正值,确定所述各队列在下一时刻的目标资源需求值。508. Determine the target resource demand value of each queue at a next time according to the initial resource value of each queue at the next time and the resource correction value.
各队列在下一时刻的初始资源值为根据历史任务执行信息确定的各队列在下一时刻的预测资源需求值,初始资源需求信息中包括各队列在下一时刻的初始资源值。本实施例中确定各队列在下一时刻的目标资源需求值时,首先根据初始资源需求信息,确定各队列在下一时刻的初始资源值,然后根据资源修正值对各队列在下一时刻的初始资源值进行修正,得到各队列在下一时刻的目标资源需求值。例如,各队列在下一时刻的资源需求值为yt,则各队列在下一时刻的目标资源需求值ynext=yt+D,其中,ynext为下一时刻的目标资源需求值,D为下一时刻的资源修正值。The initial resource value of each queue at the next moment is the predicted resource demand value of each queue at the next moment determined according to the historical task execution information, and the initial resource demand information includes the initial resource value of each queue at the next moment. In this embodiment, when determining the target resource demand value of each queue at the next moment, first determine the initial resource value of each queue at the next moment according to the initial resource demand information, and then calculate the initial resource value of each queue at the next moment according to the resource correction value Correction is performed to obtain the target resource demand value of each queue at the next moment. For example, the resource demand value of each queue at the next moment is y t , then the target resource demand value of each queue at the next moment y next =y t +D, where y next is the target resource demand value at the next moment, and D is The resource modifier for the next moment.
为了更好实现本申请实施例中集群资源调度方法,在集群资源调度方法基础之上,本申请实施例中还提供一种集群资源调度装置,如图4所示,所述集群资源调度装置600包括:In order to better implement the cluster resource scheduling method in the embodiment of the present application, on the basis of the cluster resource scheduling method, the embodiment of the present application also provides a cluster resource scheduling device, as shown in FIG. 4 , the cluster resource scheduling device 600 include:
信息获取单元601,用于获取集群的历史任务执行信息,所述集群中包括用于执行任务的多个队列;An information acquisition unit 601, configured to acquire historical task execution information of a cluster, where the cluster includes multiple queues for executing tasks;
信息确定单元602,用于根据所述历史任务执行信息确定所述集群中各队列的初始资源需求信息,所述初始资源需求信息包括所述各队列在预设第一时间段内每一时刻的初始资源值;An information determining unit 602, configured to determine initial resource requirement information of each queue in the cluster according to the historical task execution information, where the initial resource requirement information includes the initial resource value;
修正值确定单元603,用于获取所述各队列的实时资源需求信息,根据所述实时资源需求信息和所述初始资源需求信息确定所述各队列在下一时刻的资源修正值;A correction value determining unit 603, configured to acquire real-time resource demand information of each queue, and determine a resource correction value of each queue at a next moment according to the real-time resource demand information and the initial resource demand information;
资源调度单元604,用于根据所述初始资源需求信息和所述资源修正值,对所述各队列进行资源分配。The resource scheduling unit 604 is configured to allocate resources to the queues according to the initial resource requirement information and the resource correction value.
本申请实施例中,根据集群的历史任务执行信息确定各队列的初始资源需求信息,根据各队列的初始资源需求信息和各队列的实时资源需求信息确定各队列在下一时刻的资源修正值,并根据初始资源需求信息和资源修正值对各队列进行资源分配,能够以尽量少的资源数提高任务执行的效率,提高了集群资源的利用率,减少了任务执行的时间。In the embodiment of the present application, the initial resource demand information of each queue is determined according to the historical task execution information of the cluster, and the resource correction value of each queue at the next moment is determined according to the initial resource demand information of each queue and the real-time resource demand information of each queue, and Allocating resources to each queue according to the initial resource demand information and the resource correction value can improve the efficiency of task execution with as few resources as possible, improve the utilization rate of cluster resources, and reduce the time of task execution.
在本申请一些实施例中,所述信息确定单元602具体用于:In some embodiments of the present application, the information determining unit 602 is specifically configured to:
根据所述历史任务执行信息,确定所述集群中各队列在预设第一时间段内每一时刻的历史资源需求值;According to the historical task execution information, determine the historical resource demand value of each queue in the cluster at each moment within the preset first time period;
根据所述历史资源需求值,确定所述集群中各队列的初始资源需求信息。Determine initial resource requirement information of each queue in the cluster according to the historical resource requirement value.
在本申请一些实施例中,所述信息确定单元602具体还用于:In some embodiments of the present application, the information determining unit 602 is further configured to:
根据所述历史任务执行信息,确定所述集群中各队列的任务时间序列及所述各队列中的任务在执行时间内的平均资源需求值;According to the historical task execution information, determine the task time sequence of each queue in the cluster and the average resource demand value of the tasks in each queue within the execution time;
根据所述任务时间序列及所述平均资源需求值,确定所述集群中各队列在预设第一时间段内每一时刻的历史资源需求值。According to the task time series and the average resource demand value, determine the historical resource demand value of each queue in the cluster at each moment within a preset first time period.
在本申请一些实施例中,所述信息确定单元602具体还用于:In some embodiments of the present application, the information determining unit 602 is further configured to:
根据所述历史资源需求值,确定所述各队列在所述第一时间段内每一时刻的初始资源值;determining the initial resource value of each queue at each moment within the first time period according to the historical resource demand value;
根据所述各队列在所述第一时间段内每一时刻的初始资源值,确定所述集群中各队列的初始资源需求信息。The initial resource requirement information of each queue in the cluster is determined according to the initial resource value of each queue at each moment in the first time period.
在本申请一些实施例中,所述修正值确定单元603具体用于:In some embodiments of the present application, the correction value determination unit 603 is specifically configured to:
根据所述实时资源需求信息和所述初始资源需求信息,分别确定所述各队列在预设第二时间段内每一时刻的实时资源需求值和初始资源值,所述第二时间段包含于所述第一时间段内;According to the real-time resource demand information and the initial resource demand information, respectively determine the real-time resource demand value and the initial resource value of each queue at each moment within a preset second time period, the second time period being included in within said first period of time;
根据所述各队列在所述第二时间段内每一时刻的实时资源需求值和初始资源值,确定所述各队列在下一时刻的资源修正值。According to the real-time resource demand value and the initial resource value of each queue at each moment within the second time period, determine the resource correction value of each queue at a next moment.
在本申请一些实施例中,所述修正值确定单元603具体还用于:In some embodiments of the present application, the correction value determination unit 603 is specifically further configured to:
根据所述各队列在所述第二时间段内每一时刻的实时资源需求值和初始资源值,确定所述各队列在所述第二时间段内每一时刻的资源差值;determining the resource difference of each queue at each moment in the second time period according to the real-time resource demand value and the initial resource value of the queues at each moment in the second time period;
根据所述资源差值,确定所述各队列在下一时刻的资源修正值。According to the resource difference value, the resource correction value of each queue at the next moment is determined.
在本申请一些实施例中,所述资源调度单元604具体用于:In some embodiments of the present application, the resource scheduling unit 604 is specifically configured to:
根据所述初始资源需求信息和所述资源修正值,确定所述各队列在下一时刻的目标资源需求值;determining the target resource demand value of each queue at the next moment according to the initial resource demand information and the resource correction value;
根据所述目标资源需求值,对所述各队列进行资源分配。Resource allocation is performed on each of the queues according to the target resource demand value.
在本申请一些实施例中,所述资源调度单元604具体还用于:In some embodiments of the present application, the resource scheduling unit 604 is specifically further configured to:
根据所述初始资源需求信息,确定所述各队列在所述下一时刻的初始资源值;determining the initial resource value of each queue at the next moment according to the initial resource requirement information;
根据所述各队列在所述下一时刻的初始资源值和所述资源修正值,确定所述各队列在下一时刻的目标资源需求值。Determine the target resource demand value of each queue at the next moment according to the initial resource value of each queue at the next moment and the resource correction value.
本申请实施例还提供一种计算机设备,其集成了本申请实施例所提供的任一种集群资源调度装置,所述计算机设备包括:The embodiment of the present application also provides a computer device, which integrates any cluster resource scheduling device provided in the embodiment of the present application, and the computer device includes:
一个或多个处理器;one or more processors;
存储器;以及storage; and
一个或多个应用程序,其中所述一个或多个应用程序被存储于所述存储器中,并配置为由所述处理器执行上述集群资源调度方法实施例中任一实施例中所述的集群资源调度方法中的步骤。One or more application programs, wherein the one or more application programs are stored in the memory and are configured to be executed by the processor as described in any one of the cluster resource scheduling method embodiments above. Steps in a resource scheduling method.
本申请实施例还提供一种计算机设备,其集成了本申请实施例所提供的任一种集群资源调度装置。如图5所示,其示出了本申请实施例所涉及的计算机设备的结构示意图,具体来讲:The embodiment of the present application further provides a computer device, which integrates any cluster resource scheduling device provided in the embodiment of the present application. As shown in Figure 5, it shows a schematic structural diagram of the computer equipment involved in the embodiment of the present application, specifically:
该计算机设备可以包括一个或者一个以上处理核心的处理器701、一个或一个以上计算机可读存储介质的存储器702、电源703和输入单元704等部件。本领域技术人员可以理解,图5中示出的计算机设备结构并不构成对计算机设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。其中:The computer device may include a processor 701 of one or more processing cores, a memory 702 of one or more computer-readable storage media, a power supply 703, an input unit 704 and other components. Those skilled in the art can understand that the structure of the computer device shown in FIG. 5 does not constitute a limitation on the computer device, and may include more or less components than shown in the figure, or combine some components, or arrange different components. in:
处理器701是该计算机设备的控制中心,利用各种接口和线路连接整个计算机设备的各个部分,通过运行或执行存储在存储器702内的软件程序和/或模块,以及调用存储在存储器702内的数据,执行计算机设备的各种功能和处理数据,从而对计算机设备进行整体监控。可选的,处理器701可包括一个或多个处理核心;优选的,处理器701可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器701中。The processor 701 is the control center of the computer equipment. It uses various interfaces and lines to connect various parts of the entire computer equipment. By running or executing software programs and/or modules stored in the memory 702, and calling the Data, perform various functions of computer equipment and process data, so as to monitor the computer equipment as a whole. Optionally, the processor 701 may include one or more processing cores; preferably, the processor 701 may integrate an application processor and a modem processor, wherein the application processor mainly processes operating systems, user interfaces, and application programs, etc. , the modem processor mainly handles wireless communications. It can be understood that the foregoing modem processor may not be integrated into the processor 701 .
存储器702可用于存储软件程序以及模块,处理器701通过运行存储在存储器702的软件程序以及模块,从而执行各种功能应用以及数据处理。存储器702可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据计算机设备的使用所创建的数据等。此外,存储器702可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。相应地,存储器702还可以包括存储器控制器,以提供处理器701对存储器702的访问。The memory 702 can be used to store software programs and modules, and the processor 701 executes various functional applications and data processing by running the software programs and modules stored in the memory 702 . The memory 702 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application program required by a function (such as a sound playback function, an image playback function, etc.); Data created by the use of computer equipment, etc. In addition, the memory 702 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage devices. Correspondingly, the memory 702 may further include a memory controller to provide the processor 701 with access to the memory 702 .
计算机设备还包括给各个部件供电的电源703,优选的,电源703可以通过电源管理系统与处理器701逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。电源703还可以包括一个或一个以上的直流或交流电源、再充电系统、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。The computer device also includes a power supply 703 for supplying power to various components. Preferably, the power supply 703 can be logically connected to the processor 701 through a power management system, so that functions such as charging, discharging, and power consumption management can be realized through the power management system. The power supply 703 may also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components.
该计算机设备还可包括输入单元704,该输入单元704可用于接收输入的数字或字符信息,以及产生与用户设置以及功能控制有关的键盘、鼠标、操作杆、光学或者轨迹球信号输入。The computer device can also include an input unit 704, which can be used to receive input numbers or character information, and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
尽管未示出,计算机设备还可以包括显示单元等,在此不再赘述。具体在本实施例中,计算机设备中的处理器701会按照如下的指令,将一个或一个以上的应用程序的进程对应的可执行文件加载到存储器702中,并由处理器701来运行存储在存储器702中的应用程序,从而实现各种功能,如下:Although not shown, the computer device may also include a display unit, etc., which will not be repeated here. Specifically, in this embodiment, the processor 701 in the computer device loads the executable file corresponding to the process of one or more application programs into the memory 702 according to the following instructions, and the processor 701 runs the executable file stored in the The application program in memory 702, thus realizes various functions, as follows:
获取集群的历史任务执行信息,所述集群中包括用于执行任务的多个队列;Obtain historical task execution information of the cluster, where the cluster includes multiple queues for executing tasks;
根据所述历史任务执行信息确定所述集群中各队列的初始资源需求信息,所述初始资源需求信息包括所述各队列在预设第一时间段内每一时刻的初始资源值;determining initial resource requirement information of each queue in the cluster according to the historical task execution information, where the initial resource requirement information includes the initial resource value of each queue at each moment within a preset first time period;
获取所述各队列的实时资源需求信息,根据所述实时资源需求信息和所述初始资源需求信息确定所述各队列在下一时刻的资源修正值;Acquiring the real-time resource requirement information of each queue, and determining the resource correction value of each queue at the next moment according to the real-time resource requirement information and the initial resource requirement information;
根据所述初始资源需求信息和所述资源修正值,对所述各队列进行资源分配。Resource allocation is performed on each of the queues according to the initial resource requirement information and the resource correction value.
本领域普通技术人员可以理解,上述实施例的各种方法中的全部或部分步骤可以通过指令来完成,或通过指令控制相关的硬件来完成,该指令可以存储于一计算机可读存储介质中,并由处理器进行加载和执行。Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructions, or by instructions controlling related hardware, and the instructions can be stored in a computer-readable storage medium, and is loaded and executed by the processor.
为此,本申请实施例提供一种计算机可读存储介质,该存储介质可以包括:只读存储器(ROM,Read Only Memory)、随机存取记忆体(RAM,Random Access Memory)、磁盘或光盘等。其上存储有计算机程序,所述计算机程序被处理器进行加载,以执行本申请实施例所提供的任一种集群资源调度方法中的步骤。例如,所述计算机程序被处理器进行加载可以执行如下步骤:To this end, an embodiment of the present application provides a computer-readable storage medium, which may include: a read-only memory (ROM, Read Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, etc. . A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in any cluster resource scheduling method provided in the embodiments of the present application. For example, the computer program being loaded by the processor may perform the following steps:
获取集群的历史任务执行信息,所述集群中包括用于执行任务的多个队列;Obtain historical task execution information of the cluster, where the cluster includes multiple queues for executing tasks;
根据所述历史任务执行信息确定所述集群中各队列的初始资源需求信息,所述初始资源需求信息包括所述各队列在预设第一时间段内每一时刻的初始资源值;determining initial resource requirement information of each queue in the cluster according to the historical task execution information, where the initial resource requirement information includes the initial resource value of each queue at each moment within a preset first time period;
获取所述各队列的实时资源需求信息,根据所述实时资源需求信息和所述初始资源需求信息确定所述各队列在下一时刻的资源修正值;Acquiring the real-time resource requirement information of each queue, and determining the resource correction value of each queue at the next moment according to the real-time resource requirement information and the initial resource requirement information;
根据所述初始资源需求信息和所述资源修正值,对所述各队列进行资源分配。Resource allocation is performed on each of the queues according to the initial resource requirement information and the resource correction value.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见上文针对其他实施例的详细描述,此处不再赘述。In the above-mentioned embodiments, the descriptions of each embodiment have their own emphases. For the part that is not described in detail in a certain embodiment, refer to the detailed description of other embodiments above, and will not be repeated here.
具体实施时,以上各个单元或结构可以作为独立的实体来实现,也可以进行任意组合,作为同一或若干个实体来实现,以上各个单元或结构的具体实施可参见前面的方法实施例,在此不再赘述。During specific implementation, each of the above units or structures can be implemented as an independent entity, or can be combined arbitrarily as the same or several entities. For the specific implementation of each of the above units or structures, please refer to the previous method embodiments, here No longer.
以上各个操作的具体实施可参见前面的实施例,在此不再赘述。For the specific implementation of the above operations, reference may be made to the foregoing embodiments, and details are not repeated here.
以上对本申请实施例所提供的一种集群资源调度方法、装置、计算机设备及存储介质进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。The above is a detailed introduction of a cluster resource scheduling method, device, computer equipment and storage medium provided by the embodiments of the present application. In this paper, specific examples are used to illustrate the principles and implementation methods of the present application. The description of the above embodiments It is only used to help understand the method of the present application and its core idea; at the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation and application scope. In summary, this The content of the description should not be understood as limiting the application.
Claims (11)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210152693.0A CN116661957A (en) | 2022-02-18 | 2022-02-18 | Cluster resource scheduling method, device, computer equipment and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210152693.0A CN116661957A (en) | 2022-02-18 | 2022-02-18 | Cluster resource scheduling method, device, computer equipment and storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN116661957A true CN116661957A (en) | 2023-08-29 |
Family
ID=87715863
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210152693.0A Pending CN116661957A (en) | 2022-02-18 | 2022-02-18 | Cluster resource scheduling method, device, computer equipment and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN116661957A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119473615A (en) * | 2024-11-13 | 2025-02-18 | 深圳计算科学研究院 | Database node resource allocation method, device, equipment and medium |
-
2022
- 2022-02-18 CN CN202210152693.0A patent/CN116661957A/en active Pending
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119473615A (en) * | 2024-11-13 | 2025-02-18 | 深圳计算科学研究院 | Database node resource allocation method, device, equipment and medium |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US12081454B2 (en) | Systems and methods for provision of a guaranteed batch | |
| CN111694646B (en) | Resource scheduling method, device, electronic equipment and computer readable storage medium | |
| WO2018120845A1 (en) | Resource allocation method and resource manager | |
| CN112600761B (en) | Resource allocation method, device and storage medium | |
| WO2024016596A1 (en) | Container cluster scheduling method and apparatus, device, and storage medium | |
| CN114489978B (en) | Resource scheduling methods, devices, equipment and storage media | |
| CN112134964B (en) | Controller allocation method, computer equipment, storage media and network business system | |
| CN114155026B (en) | Resource allocation method, device, server and storage medium | |
| CN109960575B (en) | Computing power sharing method, system and related equipment | |
| CN109117280B (en) | Electronic device and method and storage medium for limiting inter-process communication | |
| CN110427273A (en) | Scheduling memory method, apparatus, equipment and storage medium | |
| US11709707B2 (en) | Low latency distributed counters for quotas | |
| CN109002364A (en) | Optimization method, electronic device and the readable storage medium storing program for executing of interprocess communication | |
| CN116662020B (en) | Dynamic management method and system for application service, electronic equipment and storage medium | |
| CN109117279B (en) | Electronic device and method and storage medium for limiting inter-process communication | |
| CN116661957A (en) | Cluster resource scheduling method, device, computer equipment and storage medium | |
| CN117407160A (en) | A hybrid deployment method of online tasks and offline tasks in edge computing scenarios | |
| CN115080657B (en) | A method, system and device for allocating operation tokens for distributed storage | |
| CN114745338A (en) | Flow control method, flow control device, storage medium and server | |
| CN112286695A (en) | Server resource allocation method and edge data center | |
| CN115934335A (en) | Task processing method and related equipment | |
| CN113391927A (en) | Method, device and system for processing business event and storage medium | |
| CN115391042B (en) | Resource allocation method and device, electronic equipment and storage medium | |
| CN117176672B (en) | Message queue resource determination method, device and resource intelligent scheduling system | |
| CN115168057B (en) | Resource scheduling method and device based on k8s cluster |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination |