[go: up one dir, main page]

CN114661462A - Resource allocation method, system, computer-readable storage medium, and electronic device - Google Patents

Resource allocation method, system, computer-readable storage medium, and electronic device Download PDF

Info

Publication number
CN114661462A
CN114661462A CN202210212325.0A CN202210212325A CN114661462A CN 114661462 A CN114661462 A CN 114661462A CN 202210212325 A CN202210212325 A CN 202210212325A CN 114661462 A CN114661462 A CN 114661462A
Authority
CN
China
Prior art keywords
target
job
computing
computing resource
resource type
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
Application number
CN202210212325.0A
Other languages
Chinese (zh)
Inventor
王敏
贺荣徽
何万青
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba China Co Ltd
Original Assignee
Alibaba China Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Alibaba China Co Ltd filed Critical Alibaba China Co Ltd
Priority to CN202210212325.0A priority Critical patent/CN114661462A/en
Publication of CN114661462A publication Critical patent/CN114661462A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5072Grid computing
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5038Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5044Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering hardware capabilities
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5055Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering software capabilities, i.e. software resources associated or available to the machine

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application discloses a resource allocation method, a system, a computer readable storage medium and an electronic device. Wherein, the method comprises the following steps: acquiring operation characteristic information of target operation to be executed by a target computing cluster; determining a target computing resource type based on the job characteristic information; and allocating target computing resources for the target computing cluster, wherein the target computing resources are computing resources required by the target computing cluster to execute the target job, and the computing resource type of the target computing resources is the target computing resource type. The method and the device solve the technical problem of unreasonable resource allocation caused by selecting similar computing resources for all jobs in the prior art.

Description

资源分配方法、系统、计算机可读存储介质及电子设备Resource allocation method, system, computer-readable storage medium, and electronic device

技术领域technical field

本申请涉及人工智能领域,具体而言,涉及一种资源分配方法、系统、计算机可读存储介质及电子设备。The present application relates to the field of artificial intelligence, and in particular, to a resource allocation method, system, computer-readable storage medium, and electronic device.

背景技术Background technique

云计算平台也称云平台,是指基于硬件资源和软件资源的服务,提供计算、网络和存储能力。随着云计算和人工智能的发展,云计算服务平台上云的需求越来越多,对计算规格也要求多样化,单个集群的规模也越来越大。Cloud computing platform, also known as cloud platform, refers to services based on hardware resources and software resources, providing computing, network and storage capabilities. With the development of cloud computing and artificial intelligence, there are more and more cloud demands on cloud computing service platforms, and the requirements for computing specifications are also diversified, and the scale of a single cluster is also increasing.

目前,相关云计算服务平台在对作业进行处理的过程中,对所有作业选择同类计算资源进行统一处理,导致资源分配不合理,无法发挥云上计算资源的优势。At present, in the process of processing jobs, the relevant cloud computing service platform selects the same computing resources for all jobs for unified processing, resulting in unreasonable resource allocation and unable to take advantage of the computing resources on the cloud.

针对上述的问题,目前尚未提出有效的解决方案。For the above problems, no effective solution has been proposed yet.

发明内容SUMMARY OF THE INVENTION

本申请实施例提供了一种资源分配方法、系统、计算机可读存储介质及电子设备,以至少解决由于现有技术中对所有作业选择同类计算资源造成的资源分配不合理的技术问题。Embodiments of the present application provide a resource allocation method, system, computer-readable storage medium, and electronic device to at least solve the technical problem of unreasonable resource allocation caused by selecting the same computing resources for all jobs in the prior art.

根据本申请实施例的一个方面,提供了一种资源分配方法,包括:获取目标计算集群待执行的目标作业的作业特征信息;基于作业特征信息确定目标计算资源类型;为目标计算集群分配目标计算资源,其中,目标计算资源为目标计算集群执行目标作业所需的计算资源,目标计算资源的计算资源类型为目标计算资源类型。According to an aspect of the embodiments of the present application, a resource allocation method is provided, including: acquiring job feature information of a target job to be executed by a target computing cluster; determining a target computing resource type based on the job feature information; allocating target computing to a target computing cluster resources, where the target computing resource is the computing resource required by the target computing cluster to execute the target job, and the computing resource type of the target computing resource is the target computing resource type.

根据本申请实施例的另一方面,还提供了一种资源分配方法,包括:响应作业创建指令,创建目标作业以及执行目标作业的目标计算集群,并显示目标作业的作业特征信息;显示基于作业特征信息所确定的目标计算资源类型;响应资源分配指令,显示为目标计算集群所分配的目标计算资源,其中,目标计算资源为目标计算集群执行目标作业所需的计算资源,目标计算资源的计算资源类型为目标计算资源类型。According to another aspect of the embodiments of the present application, a resource allocation method is also provided, including: responding to a job creation instruction, creating a target job and a target computing cluster for executing the target job, and displaying job feature information of the target job; The target computing resource type determined by the feature information; in response to the resource allocation instruction, the target computing resources allocated to the target computing cluster are displayed, wherein the target computing resources are the computing resources required by the target computing cluster to execute the target job, and the computing resources of the target computing resources The resource type is the target computing resource type.

根据本申请实施例的另一方面,还提供了一种资源分配装置,包括:获取模块,用于获取目标计算集群待执行的目标作业的作业特征信息;确定模块,用于基于作业特征信息确定目标计算资源类型;分配模块,用于为目标计算集群分配目标计算资源,其中,目标计算资源为目标计算集群执行目标作业所需的计算资源,目标计算资源的计算资源类型为目标计算资源类型。According to another aspect of the embodiments of the present application, a resource allocation device is further provided, including: an acquisition module, configured to acquire job feature information of a target job to be executed by a target computing cluster; a determination module, configured to determine based on the job feature information The target computing resource type; the allocation module is used to allocate target computing resources to the target computing cluster, wherein the target computing resources are the computing resources required by the target computing cluster to execute the target job, and the computing resource type of the target computing resources is the target computing resource type.

根据本申请实施例的另一方面,还提供了一种资源分配装置,包括:第一响应模块,用于响应作业创建指令,创建目标作业以及执行目标作业的目标计算集群,并显示目标作业的作业特征信息;显示模块,用于显示基于作业特征信息所确定的目标计算资源类型;第二响应模块,用于响应资源分配指令,显示为目标计算集群所分配的目标计算资源,其中,目标计算资源为目标计算集群执行目标作业所需的计算资源,目标计算资源的计算资源类型为目标计算资源类型。According to another aspect of the embodiments of the present application, a resource allocation apparatus is also provided, including: a first response module, configured to respond to a job creation instruction, create a target job and a target computing cluster for executing the target job, and display the target job's job feature information; a display module for displaying the target computing resource type determined based on the job feature information; a second response module for responding to a resource allocation instruction and displaying target computing resources allocated for the target computing cluster, wherein the target computing The resource is the computing resource required by the target computing cluster to execute the target job, and the computing resource type of the target computing resource is the target computing resource type.

根据本申请实施例的另一方面,还提供了一种资源分配系统,包括:调度器,用于接收目标对象提交的目标作业;特征收集组件,用于获取目标计算集群待执行的目标作业的作业特征信息,并基于作业特征信息确定目标计算资源类型;资源管理组件,用于根据目标计算资源类型确定目标计算资源,为调度器创建任务队列,然后基于任务队列向调度器添加目标计算资源;调度器还基于预设的调度策略将目标计算资源分配至目标计算集群的计算节点所对应的任务队列中,以使目标计算集群中的计算节点执行目标作业。According to another aspect of the embodiments of the present application, a resource allocation system is also provided, including: a scheduler, configured to receive a target job submitted by a target object; Job feature information, and determine the target computing resource type based on the job feature information; the resource management component is used to determine the target computing resource according to the target computing resource type, create a task queue for the scheduler, and then add the target computing resource to the scheduler based on the task queue; The scheduler also allocates the target computing resources to the task queues corresponding to the computing nodes of the target computing cluster based on the preset scheduling policy, so that the computing nodes in the target computing cluster execute the target job.

根据本申请实施例的另一方面,还提供了一种计算机可读存储介质,计算机可读存储介质中存储有计算机程序,其中,计算机程序被设置为运行时执行上述的资源分配方法。According to another aspect of the embodiments of the present application, a computer-readable storage medium is also provided, where a computer program is stored in the computer-readable storage medium, wherein the computer program is configured to execute the above-mentioned resource allocation method when running.

根据本申请实施例的另一方面,还提供了一种电子设备,电子设备包括一个或多个处理器;存储器,用于存储一个或多个程序,当一个或多个程序被一个或多个处理器执行时,使得一个或多个处理器实现用于运行程序,其中,程序被设置为运行时执行上述的资源分配方法。According to another aspect of the embodiments of the present application, there is also provided an electronic device, the electronic device includes one or more processors; a memory for storing one or more programs, when the one or more programs are processed by one or more The processor, when executed, causes one or more processors to be implemented for running a program, wherein the program is configured to execute the resource allocation method described above at runtime.

在本发明实施例中,采用基于作业的作业特征信息为每个作业分配不同类计算资源的方式,通过获取目标计算集群待执行的目标作业的作业特征信息,然后基于作业特征信息确定目标计算资源类型,从而为目标计算集群分配目标计算资源,其中,目标计算资源为目标计算集群执行目标作业所需的计算资源,目标计算资源的计算资源类型为目标计算资源类型。In the embodiment of the present invention, a method of allocating different types of computing resources to each job based on job feature information of the job is adopted, the job feature information of the target job to be executed by the target computing cluster is obtained, and then the target computing resource is determined based on the job feature information. The target computing resource is allocated to the target computing cluster, wherein the target computing resource is the computing resource required by the target computing cluster to execute the target job, and the computing resource type of the target computing resource is the target computing resource type.

在上述过程中,为目标计算集群分配目标计算资源,实现了基于不同类计算资源对各作业进行处理,避免了对所有作业选择同类计算资源所存在的资源浪费或不足的现象,从而提高了资源分配的合理性,进而提高了作业运行效率,提升了用户体验。此外,在本申请中,基于作业特征信息确定目标计算资源类型,从而确定了对各目标作业进行处理的最合适的计算资源的计算资源类型,避免了人工选择计算资源的差异性和不准确性,进一步提高了作业运行效率。In the above process, target computing resources are allocated to the target computing cluster, which realizes the processing of each job based on different types of computing resources, and avoids the phenomenon of resource waste or insufficiency in selecting the same computing resources for all jobs, thereby improving resources. The rationality of the allocation, thereby improving the operation efficiency of the job and improving the user experience. In addition, in the present application, the target computing resource type is determined based on the job feature information, so as to determine the most suitable computing resource type of computing resource for processing each target job, avoiding the difference and inaccuracy of manual selection of computing resources , which further improves the operation efficiency of the operation.

由此可见,本申请所提供的方案达到了基于作业的作业特征信息为每个作业分配不同类计算资源的目的,从而实现了提高资源分配合理性的技术效果,进而解决了由于现有技术中对所有作业选择同类计算资源造成的资源分配不合理的技术问题。It can be seen that the solution provided by the present application achieves the purpose of allocating different types of computing resources to each job based on the job feature information of the job, thereby achieving the technical effect of improving the rationality of resource allocation, and further solving the problems caused by the prior art. The technical problem of unreasonable resource allocation caused by selecting the same computing resources for all jobs.

附图说明Description of drawings

此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:The drawings described herein are used to provide further understanding of the present application and constitute a part of the present application. The schematic embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation of the present application. In the attached image:

图1是根据本申请实施例的一种可选的电子设备(或移动设备)的硬件结构框图;1 is a block diagram of a hardware structure of an optional electronic device (or mobile device) according to an embodiment of the present application;

图2是根据本申请实施例的一种可选的电子设备(或移动设备)作为发送端的一种实施例;FIG. 2 is an embodiment in which an optional electronic device (or mobile device) is used as a transmitting end according to an embodiment of the present application;

图3是根据本申请实施例的一种可选的资源分配方法的流程图;3 is a flowchart of an optional resource allocation method according to an embodiment of the present application;

图4是根据现有技术的一种资源分配方法的示意图;4 is a schematic diagram of a resource allocation method according to the prior art;

图5是根据现有技术的一种资源分配方法的示意图;5 is a schematic diagram of a resource allocation method according to the prior art;

图6是根据本申请实施例的一种可选的资源分配方法的时序图;6 is a sequence diagram of an optional resource allocation method according to an embodiment of the present application;

图7是根据本申请实施例的一种可选的特征收集组件的示意图;7 is a schematic diagram of an optional feature collection component according to an embodiment of the present application;

图8是根据本申请实施例的一种可选的资源分配方法的流程图;8 is a flowchart of an optional resource allocation method according to an embodiment of the present application;

图9是根据本申请实施例的一种可选的人机交互操作的示意图;9 is a schematic diagram of an optional human-computer interaction operation according to an embodiment of the present application;

图10是根据本申请实施例的一种可选的资源分配装置的示意图;FIG. 10 is a schematic diagram of an optional resource allocation apparatus according to an embodiment of the present application;

图11是根据本申请实施例的一种可选的资源分配装置的示意图;FIG. 11 is a schematic diagram of an optional resource allocation apparatus according to an embodiment of the present application;

图12是根据本申请实施例的一种可选的资源分配系统的示意图;12 is a schematic diagram of an optional resource allocation system according to an embodiment of the present application;

图13是根据本申请实施例的一种可选的电子设备的结构框图。FIG. 13 is a structural block diagram of an optional electronic device according to an embodiment of the present application.

具体实施方式Detailed ways

为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分的实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。In order to make those skilled in the art better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only The embodiments are part of the present application, but not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the scope of protection of the present application.

需要说明的是,本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be noted that the terms "first", "second", etc. in the description and claims of the present application and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific sequence or sequence. It is to be understood that data so used may be interchanged under appropriate circumstances so that the embodiments of the application described herein can be practiced in sequences other than those illustrated or described herein. Furthermore, the terms "comprising" and "having" and any variations thereof, are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those expressly listed Rather, those steps or units may include other steps or units not expressly listed or inherent to these processes, methods, products or devices.

实施例1Example 1

根据本申请实施例,还提供了一种资源分配方法的实施例,需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。According to the embodiments of the present application, an embodiment of a resource allocation method is also provided. It should be noted that the steps shown in the flowcharts of the accompanying drawings may be executed in a computer system such as a set of computer-executable instructions, and, Although a logical order is shown in the flowcharts, in some cases steps shown or described may be performed in an order different from that herein.

本申请实施例一所提供的方法实施例可以在移动终端、电子设备或者类似的运算装置中执行。图1示出了一种用于实现资源分配方法的电子设备(或移动设备)的硬件结构框图。如图1所示,电子设备10(或移动设备10)可以包括一个或多个(图中采用102a、102b,……,102n来示出)处理器(处理器可以包括但不限于微处理器MCU或可编程逻辑器件FPGA等的处理装置)、用于存储数据的存储器104、以及用于通信功能的传输模块106。除此以外,还可以包括:显示器、输入/输出接口(I/O接口)、通用串行总线(USB)端口(可以作为BUS总线的端口中的一个端口被包括)、网络接口、电源和/或相机。本领域普通技术人员可以理解,图1所示的结构仅为示意,其并不对上述电子装置的结构造成限定。例如,电子设备10还可包括比图1中所示更多或者更少的组件,或者具有与图1所示不同的配置。The method embodiment provided in Embodiment 1 of the present application may be executed in a mobile terminal, an electronic device, or a similar computing device. FIG. 1 shows a block diagram of a hardware structure of an electronic device (or mobile device) for implementing a resource allocation method. As shown in FIG. 1 , the electronic device 10 (or the mobile device 10 ) may include one or more (shown as 102a, 102b, . . . , 102n in the figure) processors (the processors may include but are not limited to microprocessors A processing device such as an MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission module 106 for communication functions. In addition, may also include: display, input/output interface (I/O interface), universal serial bus (USB) port (may be included as one of the ports of the BUS bus), network interface, power supply and/or or camera. Those of ordinary skill in the art can understand that the structure shown in FIG. 1 is only a schematic diagram, which does not limit the structure of the above electronic device. For example, electronic device 10 may also include more or fewer components than shown in FIG. 1 , or have a different configuration than that shown in FIG. 1 .

应当注意到的是上述一个或多个处理器和/或其他数据处理电路在本文中通常可以被称为“数据处理电路”。该数据处理电路可以全部或部分的体现为软件、硬件、固件或其他任意组合。此外,数据处理电路可为单个独立的处理模块,或全部或部分的结合到电子设备10(或移动设备)中的其他元件中的任意一个内。如本申请实施例中所涉及到的,该数据处理电路作为一种处理器控制(例如与接口连接的可变电阻终端路径的选择)。It should be noted that the one or more processors and/or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuit may be embodied in whole or in part as software, hardware, firmware or any other combination. Furthermore, the data processing circuitry may be a single, stand-alone processing module, or incorporated in whole or in part into any of the other elements in electronic device 10 (or mobile device). As referred to in the embodiments of the present application, the data processing circuit acts as a kind of processor control (eg, selection of a variable resistance termination path connected to an interface).

存储器104可用于存储应用软件的软件程序以及模块,如本申请实施例中的资源分配方法对应的程序指令/数据存储装置,处理器通过运行存储在存储器104内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的资源分配方法。存储器104可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器104可进一步包括相对于处理器远程设置的存储器,这些远程存储器可以通过网络连接至电子设备10。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 104 can be used to store software programs and modules of the application software, such as a program instruction/data storage device corresponding to the resource allocation method in the embodiment of the present application. This kind of function application and data processing, that is, to realize the above-mentioned resource allocation method. Memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, memory 104 may further include memory located remotely from the processor, which may be connected to electronic device 10 through a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

传输装置106用于经由一个网络接收或者发送数据。上述的网络具体实例可包括电子设备10的通信供应商提供的无线网络。在一个实例中,传输装置106包括一个网络适配器(Network Interface Controller,NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输装置106可以为射频(Radio Frequency,RF)模块,其用于通过无线方式与互联网进行通讯。Transmission means 106 are used to receive or transmit data via a network. The specific example of the above-mentioned network may include the wireless network provided by the communication provider of the electronic device 10 . In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (Radio Frequency, RF) module, which is used for wirelessly communicating with the Internet.

显示器可以例如触摸屏式的液晶显示器(LCD),该液晶显示器可使得用户能够与电子设备10(或移动设备)的用户界面进行交互。The display may be, for example, a touch screen-style liquid crystal display (LCD) that enables a user to interact with the user interface of the electronic device 10 (or mobile device).

图1示出的硬件结构框图,不仅可以作为上述电子设备10(或移动设备)的示例性框图,还可以作为上述服务器的示例性框图,一种可选实施例中,图2以框图示出了使用上述图1所示的电子设备10(或移动设备)作为发送端的一种实施例。如图2所示,电子设备10(或移动设备)可以经由数据网络连接或电子连接到一个或多个服务器108,其中,前述的服务器可以是同一服务器集群中的服务器,可选的,服务器集群可以是资源集群、计算集群等服务器集群,服务器可以是资源服务器、计算服务器、安全服务器或游戏服务器等服务器。一种可选实施例中,上述电子设备10(或移动设备)可以是手机、平板、电脑或智能佩戴设备。数据网络连接可以是局域网连接、广域网连接、因特网连接,或其他类型的数据网络连接。电子设备10(或移动设备)可以执行以连接到由一个服务器(例如计算服务器)或一组服务器执行的网络服务。网络服务器110是基于网络的用户服务,诸如社交网络、云资源、电子邮件、在线支付或其他在线应用,也可以是云服务器。The block diagram of the hardware structure shown in FIG. 1 can be used not only as an exemplary block diagram of the above electronic device 10 (or mobile device), but also as an exemplary block diagram of the above server. In an optional embodiment, FIG. 2 is a block diagram An embodiment of using the electronic device 10 (or mobile device) shown in FIG. 1 as the sending end is presented. As shown in FIG. 2, the electronic device 10 (or mobile device) may be connected or electronically connected to one or more servers 108 via a data network, wherein the aforementioned servers may be servers in the same server cluster, or alternatively, a server cluster It can be a server cluster such as a resource cluster and a computing cluster, and the server can be a server such as a resource server, a computing server, a security server, or a game server. In an optional embodiment, the above-mentioned electronic device 10 (or mobile device) may be a mobile phone, a tablet, a computer or a smart wearable device. The data network connection may be a local area network connection, a wide area network connection, an Internet connection, or other type of data network connection. The electronic device 10 (or mobile device) may execute to connect to a network service executed by a server (eg, a computing server) or a group of servers. The web server 110 is a web-based user service, such as social networking, cloud resources, email, online payment or other online applications, and may also be a cloud server.

在上述运行环境下,本申请提供了如图3所示的资源分配方法。图3是根据本申请实施例的一种可选的资源分配方法的流程图。且在本申请中,以资源分配系统作为本实施例的执行主体,资源分配系统至少包括资源调度组件、特征收集组件以及资源管理组件,其中,资源调度组件、特征收集组件以及资源管理组件分别相互连接。Under the above operating environment, the present application provides a resource allocation method as shown in FIG. 3 . FIG. 3 is a flowchart of an optional resource allocation method according to an embodiment of the present application. And in this application, the resource allocation system is used as the execution body of this embodiment, and the resource allocation system at least includes a resource scheduling component, a feature collection component, and a resource management component, wherein the resource scheduling component, the feature collection component, and the resource management component are mutually mutually exclusive. connect.

步骤S202,获取目标计算集群待执行的目标作业的作业特征信息。Step S202: Obtain job feature information of a target job to be executed by the target computing cluster.

在步骤S202中,可以通过电子设备、服务器、应用系统等装置获取目标计算集群待执行的目标作业的作业特征信息,在本实施例中,可以通过资源分配系统中的资源调度组件获取目标计算集群待执行的目标作业,然后通过资源分配系统中的特征收集组件获取目标作业的作业特征信息。其中,资源分配系统可以基于用户在手机、电脑、平板等终端设备上的目标应用中执行的如查询词条、浏览页面、切换程序等期望操作以生成目标作业,然后由特征提取组件对目标作业的作业特征信息进行提取。可选的,目标作业的作业特征信息至少包括作业信息以及系统特征信息;目标计算集群可以作为云计算服务平台,且目标计算集群可以是HPC(High Performance Computing,高性能计算)集群,其可以由用户在目标计算资源被分配前预先基于资源分配系统进行创建,且目标计算集群中包括多个计算节点,每个计算节点为一台服务器。In step S202, the job feature information of the target job to be executed by the target computing cluster may be obtained through an electronic device, a server, an application system, etc., and in this embodiment, the target computing cluster may be obtained through a resource scheduling component in the resource allocation system The target job to be executed, and then obtain job characteristic information of the target job through the characteristic collection component in the resource allocation system. Among them, the resource allocation system can generate the target job based on the desired operations performed by the user in the target application on the mobile phone, computer, tablet and other terminal devices, such as querying entries, browsing pages, switching programs, etc., and then the feature extraction component performs the target job. The job feature information is extracted. Optionally, the job feature information of the target job includes at least job information and system feature information; the target computing cluster can be used as a cloud computing service platform, and the target computing cluster can be an HPC (High Performance Computing, high-performance computing) cluster, which can be composed of The user creates the target computing resource in advance based on the resource allocation system before the target computing resource is allocated, and the target computing cluster includes a plurality of computing nodes, and each computing node is a server.

需要说明的是,通过获取作业特征信息,可以便于后续确定与目标作业对应的目标计算资源类型。It should be noted that obtaining the job feature information can facilitate subsequent determination of the target computing resource type corresponding to the target job.

步骤S204,基于作业特征信息确定目标计算资源类型。Step S204, determining the target computing resource type based on the job feature information.

在步骤S204中,可以基于特征收集组件将作业特征信息与特征数据库、互联网、云服务器或其它存储区域中的预设特征信息进行比对,以根据与目标作业的作业特征信息最吻合的预设特征信息所对应的计算资源类型确定目标计算资源类型。可选的,特征收集组件还可以将作业特征信息直接与各预设计算资源类型进行比对,以根据比对结果确定目标计算资源类型。可选的,特征收集组件还可以将作业特征信息输入至训练好的网络学习模型中,以基于网络学习模型的输出结果确定目标计算资源类型。In step S204, based on the feature collection component, the job feature information may be compared with the preset feature information in the feature database, the Internet, a cloud server, or other storage areas, so as to obtain the preset feature information that best matches the job feature information of the target job. The computing resource type corresponding to the feature information determines the target computing resource type. Optionally, the feature collection component may also directly compare the job feature information with each preset computing resource type, so as to determine the target computing resource type according to the comparison result. Optionally, the feature collection component may also input job feature information into the trained network learning model, so as to determine the target computing resource type based on the output result of the network learning model.

需要说明的是,通过基于作业特征信息确定目标计算资源类型,实现了对处理各目标作业相对最合适的计算资源的计算资源类型的确定,避免了人工选择计算资源的差异性和不准确性,从而以便于后续基于不同类计算资源对各作业进行处理,并保证了对各作业的处理效率。It should be noted that by determining the target computing resource type based on the job feature information, the determination of the computing resource type that is the most suitable computing resource for processing each target job is realized, and the difference and inaccuracy of manual selection of computing resources are avoided. This facilitates subsequent processing of each job based on different types of computing resources, and ensures the processing efficiency of each job.

步骤S206,为目标计算集群分配目标计算资源,其中,目标计算资源为目标计算集群执行目标作业所需的计算资源,目标计算资源的计算资源类型为目标计算资源类型。Step S206: Allocate target computing resources to the target computing cluster, where the target computing resources are computing resources required by the target computing cluster to execute the target job, and the computing resource type of the target computing resources is the target computing resource type.

在步骤S206中,可以基于资源分配系统中的资源调度组件为目标计算集群分配目标计算资源。可选的,在为目标计算集群分配目标计算资源之前,资源分配系统中的资源管理组件可以基于目标计算资源类型在资源数据库、互联网、云服务器或其它存储区域中查询到与该目标计算资源类型对应的计算资源,从而将该查询到的计算资源作为目标计算资源发送至资源调度组件,以使得资源调度组件为目标计算集群分配目标计算资源。In step S206, target computing resources may be allocated to the target computing cluster based on the resource scheduling component in the resource allocation system. Optionally, before allocating a target computing resource to a target computing cluster, the resource management component in the resource allocation system can query the resource database, the Internet, a cloud server or other storage area based on the type of the target computing resource to find the type of the target computing resource. corresponding computing resources, so that the queried computing resources are sent to the resource scheduling component as the target computing resources, so that the resource scheduling component allocates the target computing resources to the target computing cluster.

需要说明的是,通过为目标计算集群分配目标计算资源,实现了基于不同类计算资源对各作业进行处理,避免了对所有作业选择同类计算资源所存在的资源浪费或不足的现象,从而提高了资源分配的合理性,进而提高作业运行效率,提升用户体验。It should be noted that, by allocating target computing resources to the target computing cluster, each job is processed based on different types of computing resources, avoiding the phenomenon of resource waste or insufficiency in selecting the same computing resources for all jobs, thereby improving The rationality of resource allocation, thereby improving the efficiency of job operation and improving the user experience.

在现有技术中,存在一种公有云上的自动化伸缩方案,如图4所示,该方案根据CPU,内存等总体负载进行自动伸缩来调整计算集群的计算规模。同样的,在另一种关于HPC解决方案的自动化伸缩方案中,如图5所示,该方案是与单个HPC集群绑定的,针对该HPC集群的负载情况向云端伸缩计算资源,以调整计算集群的计算规模。然而,在前述两种方案中,对于HPC集群的调度器资源弹性能力,其都根据系统workload(负荷量)或作业队列进行判断,即前述过程仅仅是根据作业队列进行通用处理,且往往对所有作业统一处理,选择同类计算资源,并没有考虑作业本身应用特点对计算资源的需求,也不会针对作业特性进行收集分析,并根据分析结果联动选择计算资源,从而会导致分配不合理的问题。In the prior art, there is an automatic scaling scheme on the public cloud, as shown in FIG. 4 , the scheme adjusts the computing scale of the computing cluster by performing automatic scaling according to the overall load such as CPU and memory. Similarly, in another automatic scaling solution for HPC solutions, as shown in Figure 5, this solution is bound to a single HPC cluster, and the computing resources are scaled to the cloud according to the load situation of the HPC cluster to adjust the computing The computing scale of the cluster. However, in the above two solutions, the resource elasticity capability of the scheduler of the HPC cluster is judged according to the system workload (load) or the job queue, that is, the aforementioned process is only based on the job queue for general processing, and it is often used for all Jobs are processed uniformly and similar computing resources are selected, without considering the computing resource requirements of the application characteristics of the job itself, nor will it collect and analyze the job characteristics, and select computing resources according to the analysis results, which will lead to unreasonable allocation problems.

基于上述步骤S202至步骤S206所限定的方案,可以获知,在本发明实施例中,采用基于作业的作业特征信息为每个作业分配不同类计算资源的方式,通过获取目标计算集群待执行的目标作业的作业特征信息,然后基于作业特征信息确定目标计算资源类型,从而为目标计算集群分配目标计算资源,其中,目标计算资源为目标计算集群执行目标作业所需的计算资源,目标计算资源的计算资源类型为目标计算资源类型。Based on the solutions defined in the above steps S202 to S206, it can be known that, in this embodiment of the present invention, the method of allocating different types of computing resources to each job based on job feature information of the job is adopted, and the target computing cluster to be executed is obtained by obtaining the target computing resources. Job feature information of the job, and then determine the target computing resource type based on the job feature information, so as to allocate target computing resources to the target computing cluster, where the target computing resources are the computing resources required by the target computing cluster to execute the target job, and the computing resources of the target computing resources The resource type is the target computing resource type.

容易注意到的是,在上述过程中,为目标计算集群分配目标计算资源,实现了基于不同类计算资源对各作业进行处理,避免了对所有作业选择同类计算资源所存在的资源浪费或不足的现象,从而提高了资源分配的合理性,进而提高了作业运行效率,提升了用户体验。此外,在本申请中,基于作业特征信息确定目标计算资源类型,从而确定了对各目标作业进行处理的最合适的计算资源的计算资源类型,避免了人工选择计算资源的差异性和不准确性,进一步提高了作业运行效率。It is easy to notice that in the above process, target computing resources are allocated to the target computing cluster, which realizes the processing of each job based on different types of computing resources, and avoids the waste or shortage of resources that exist in selecting the same computing resources for all jobs. Therefore, the rationality of resource allocation is improved, the operation efficiency of the job is improved, and the user experience is improved. In addition, in the present application, the target computing resource type is determined based on the job feature information, so as to determine the most suitable computing resource type of computing resource for processing each target job, avoiding the difference and inaccuracy of manual selection of computing resources , which further improves the operation efficiency.

由此可见,本申请所提供的方案达到了基于作业的作业特征信息为每个作业分配不同类计算资源的目的,从而实现了提高资源分配合理性的技术效果,进而解决了由于现有技术中对所有作业选择同类计算资源造成的资源分配不合理的技术问题。It can be seen that the solution provided by the present application achieves the purpose of allocating different types of computing resources to each job based on the job feature information of the job, thereby achieving the technical effect of improving the rationality of resource allocation, and further solving the problems caused by the prior art. The technical problem of unreasonable resource allocation caused by selecting the same computing resources for all jobs.

在一种可选的实施例中,在获取目标计算集群待执行的目标作业的作业特征信息的过程中,特征收集组件可以从资源调度组件所对应的作业列表中获取目标作业的作业信息,然后基于目标计算集群确定目标作业所对应的系统特征信息。其中,资源调度组件用于接收目标对象提交的目标作业,并将目标作业分配至目标计算集群的计算节点中,作业信息至少包括:目标作业运行时的容器依赖信息,系统特征信息至少包括:计算节点的网络带宽、内存占用率。In an optional embodiment, in the process of obtaining job feature information of a target job to be executed by the target computing cluster, the feature collection component may obtain job information of the target job from a job list corresponding to the resource scheduling component, and then The system feature information corresponding to the target job is determined based on the target computing cluster. The resource scheduling component is used for receiving the target job submitted by the target object, and assigning the target job to the computing nodes of the target computing cluster, the job information at least includes: container dependency information when the target job is running, and the system feature information at least includes: computing The network bandwidth and memory usage of the node.

可选的,如图6所示,当资源调度组件获取到用户提交的目标作业后,资源调度组件可以将目标作业分配至目标计算集群的计算节点中。之后,特征收集组件可以从资源调度组件对应的作业列表中获取目标作业的作业信息,其中,作业信息至少包括目标作业运行时的容器依赖信息以及作业名称、作业详情信息、软件信息、队列等,其中,作业详情信息可以包括目标作业的大小、内容等信息。接着,特征收集组件可以收集目标计算集群中各计算节点的运行数据以获取系统特征信息,从而基于作业信息和系统特征信息确定作业特征信息。其中,运行数据表征目标计算集群中各计算节点的运行情况,系统特征信息至少包括计算节点的网络带宽、内存占用率等信息。Optionally, as shown in FIG. 6 , after the resource scheduling component obtains the target job submitted by the user, the resource scheduling component may allocate the target job to the computing nodes of the target computing cluster. After that, the feature collection component can obtain job information of the target job from the job list corresponding to the resource scheduling component, where the job information at least includes container dependency information when the target job is running, job name, job detail information, software information, queue, etc., The job detail information may include information such as the size and content of the target job. Next, the feature collection component can collect the operation data of each computing node in the target computing cluster to obtain system feature information, so as to determine the job feature information based on the job information and the system feature information. The operation data represents the operation status of each computing node in the target computing cluster, and the system characteristic information at least includes information such as network bandwidth and memory occupancy rate of the computing node.

需要说明的是,通过获取目标作业的作业信息和系统特征信息,实现了对目标作业的作业特征信息的准确确定,使得后续基于作业特征信息确定的目标计算资源类型更加准确,从而高效使用计算资源,提升作业运行效率。It should be noted that by acquiring the job information and system feature information of the target job, the job feature information of the target job is accurately determined, so that the target computing resource type determined based on the job feature information is more accurate, so that computing resources can be used efficiently. , improve the operation efficiency.

在一种可选的实施例中,在基于作业特征信息确定目标计算资源类型的过程中,特征收集组件可以基于作业特征信息从预设特征数据库中进行计算资源类型查询,得到查询结果,并在查询结果表征预设特征数据库中存在与目标作业的作业特征信息所对应的计算资源类型时,确定预设特征数据库中与目标作业的作业特征信息所对应的计算资源类型为目标计算资源类型,在查询结果表征预设特征数据库中不存在与目标作业的作业特征信息所对应的计算资源类型时,对目标作业的作业特征信息与预设的计算资源类型所对应的目标作业特征信息进行比对,根据比对结果确定目标计算资源类型。其中,预设特征数据库中至少存储有历史作业的作业特征信息、计算资源类型,以及历史作业的作业特征信息与计算资源类型之间的关联关系,计算资源类型为目标计算集群执行历史作业所需的计算资源的类型。In an optional embodiment, in the process of determining the target computing resource type based on the job feature information, the feature collection component may query the computing resource type from a preset feature database based on the job feature information, obtain the query result, and store it in the The query result indicates that when there is a computing resource type corresponding to the job feature information of the target job in the preset feature database, determine that the computing resource type corresponding to the job feature information of the target job in the preset feature database is the target computing resource type, and The query result indicates that when there is no computing resource type corresponding to the job feature information of the target job in the preset feature database, the job feature information of the target job is compared with the target job feature information corresponding to the preset computing resource type, and Determine the target computing resource type according to the comparison result. Among them, the preset feature database stores at least job feature information of historical jobs, computing resource types, and an association relationship between job feature information of historical jobs and computing resource types, and computing resource types are required by the target computing cluster to execute historical jobs. The type of computing resource.

可选的,如图7所示,特征收集组件可以将当前运行的目标作业的作业特征信息与预设特征数据库中的所有历史作业的作业特征信息进行比对,以确定与目标作业的作业特征信息相似度超过预设阈值的历史作业的作业特征信息,从而得到查询结果。可选的,特征收集组件也可以将当前运行的目标作业的作业特征信息与预设特征数据库中的相同行业的历史作业的作业特征信息进行比对,以更快速地确定与目标作业的作业特征信息相似的历史作业的作业特征信息。Optionally, as shown in FIG. 7 , the feature collection component can compare the job feature information of the currently running target job with the job feature information of all historical jobs in the preset feature database to determine the job feature of the target job. Job feature information of historical jobs whose information similarity exceeds a preset threshold, thereby obtaining query results. Optionally, the feature collection component can also compare the job feature information of the currently running target job with the job feature information of the historical jobs of the same industry in the preset feature database, so as to more quickly determine the job feature of the target job. Job feature information of historical jobs with similar information.

进一步地,当查询结果表征预设特征数据库中存在与目标作业的作业特征信息所对应的计算资源类型时,也即预设特征数据库中存在历史作业的作业特征信息与目标作业的作业特征信息的相似度超过阈值时,特征收集组件可以将与目标作业的作业特征信息相似度最高的历史作业的作业特征信息所对应的计算资源类型确定为与目标作业的作业特征信息所对应的计算资源类型。Further, when the query result indicates that there is a computing resource type corresponding to the job feature information of the target job in the preset feature database, that is, there is a difference between the job feature information of the historical job and the job feature information of the target job in the preset feature database. When the similarity exceeds the threshold, the feature collection component may determine the computing resource type corresponding to the job feature information of the historical job with the highest similarity to the job feature information of the target job as the computing resource type corresponding to the job feature information of the target job.

当查询结果表征预设特征数据库中不存在与目标作业的作业特征信息所对应的计算资源类型时,也即预设特征数据库中所有历史作业的作业特征信息与目标作业的作业特征信息的相似度均不超过阈值时,特征收集组件可以将目标作业的作业特征信息与预设的计算资源类型所对应的目标作业特征信息进行比对,根据比对结果确定目标计算资源类型。其中,预设的计算资源类型至少包括容器化实例计算资源类型、超级计算集群计算资源类型、物理机计算资源类型以及虚拟机计算资源类型。When the query result indicates that there is no computing resource type corresponding to the job feature information of the target job in the preset feature database, that is, the similarity between the job feature information of all historical jobs in the preset feature database and the job feature information of the target job When neither exceeds the threshold, the feature collection component may compare the job feature information of the target job with the target job feature information corresponding to the preset computing resource type, and determine the target computing resource type according to the comparison result. The preset computing resource types include at least a containerized instance computing resource type, a supercomputing cluster computing resource type, a physical computer computing resource type, and a virtual machine computing resource type.

需要说明的是,通过借助历史作业的作业特征信息以及计算资源类型确定目标计算资源类型,实现了对每个目标作业所对应的目标计算资源类型更准确的判断。此外,在基于历史作业无法确定目标计算资源类型的情况下,基于预设的目标作业特征信息确定目标计算资源类型,提高了本申请的适用性,避免了无法获取到目标作业所对应的目标计算资源类型的现象发生。It should be noted that by determining the target computing resource type by means of the job feature information of the historical job and the computing resource type, a more accurate judgment of the target computing resource type corresponding to each target job is achieved. In addition, in the case where the target computing resource type cannot be determined based on historical jobs, the target computing resource type is determined based on the preset target job feature information, which improves the applicability of the present application and avoids failure to obtain the target computing resource corresponding to the target job. The phenomenon of resource type occurs.

在一种可选的实施例中,在对目标作业的作业特征信息与预设的计算资源类型所对应的目标作业特征信息进行比对,根据比对结果确定目标计算资源类型的过程中,特征收集组件可以根据目标作业运行时的容器依赖信息确定目标作业的作业运行形式,并在作业运行形式表征目标作业运行在容器中时,确定目标计算资源类型为容器化实例计算资源类型,其中,容器化实例计算资源类型表征目标作业运行时依赖于容器。In an optional embodiment, in the process of comparing the job feature information of the target job with the target job feature information corresponding to the preset computing resource type, and determining the target computing resource type according to the comparison result, the feature The collection component can determine the job running form of the target job according to the container dependency information when the target job is running, and when the job running form characterizes the target job running in the container, determine the target computing resource type as the containerized instance computing resource type, where the container The instance computing resource type characterizes the target job's runtime dependency on the container.

可选的,如图7所示,特征收集组件可以根据目标作业运行时的容器依赖信息,以确定目标作业的运行形式,并基于目标作业的运行形式确定目标作业是否运行在容器中,也即是否容器化运行,在本实施例中,前述的容器可以是docker或singularity或其它容器。其中,docker是一个开源的应用容器引擎,其让开发者可以打包他们的应用以及依赖包到一个可移植的镜像中,然后发布到任何操作系统的机器上,也可以实现虚拟化;singularity是一个开放源码容器平台,具体地,其是一种针对HPC工作负载进行优化的,允许不受信任的用户以可信的方式运行不受信任的容器。进一步地,当目标作业的运行形式表征目标作业运行在容器中时,特征收集组件可以确定目标计算资源类型为容器化实例计算资源类型。Optionally, as shown in FIG. 7 , the feature collection component can determine the running form of the target job according to the container dependency information when the target job is running, and determine whether the target job runs in the container based on the running form of the target job, that is, Whether to run in a containerized manner, in this embodiment, the aforementioned container may be docker or singularity or other containers. Among them, docker is an open source application container engine, which allows developers to package their applications and dependencies into a portable image, and then publish them to machines of any operating system, which can also be virtualized; singularity is a An open source container platform, in particular, is one optimized for HPC workloads that allows untrusted users to run untrusted containers in a trusted manner. Further, when the running form of the target job indicates that the target job runs in the container, the feature collection component may determine that the target computing resource type is the containerized instance computing resource type.

需要说明的是,基于容器依赖信息确定目标计算资源类型是否为容器化实例计算资源类型,可以实现对目标计算资源类型与容器化实例计算资源类型的关联关系的准确确定,从而便于获取到准确的目标计算资源类型。It should be noted that determining whether the target computing resource type is a containerized instance computing resource type based on the container dependency information can accurately determine the relationship between the target computing resource type and the containerized instance computing resource type, so as to facilitate obtaining accurate data. Target compute resource type.

在一种可选的实施例中,在作业运行形式表征目标作业未运行在容器中时,特征收集组件可以检测计算节点的实时最大网络带宽是否大于第一预设带宽,并且,计算节点所对应的平均带宽是否大于第二预设带宽,并在实时最大网络带宽大于第一预设带宽,或者,平均带宽大于第二预设带宽时,确定目标计算资源类型为超级计算集群计算资源类型,其中,超级计算集群计算资源类型表征目标作业的运行受网络带宽的影响程度最大。In an optional embodiment, when the job running form indicates that the target job is not running in the container, the feature collection component can detect whether the real-time maximum network bandwidth of the computing node is greater than the first preset bandwidth, and the corresponding Whether the average bandwidth is greater than the second preset bandwidth, and when the real-time maximum network bandwidth is greater than the first preset bandwidth, or, when the average bandwidth is greater than the second preset bandwidth, determine that the target computing resource type is a supercomputing cluster computing resource type, wherein , the computing resource type of supercomputing cluster indicates that the running of the target job is most affected by the network bandwidth.

可选的,如图7所示,在作业运行形式表征目标作业未运行在容器中时,特征收集组件可以监控该目标作业所对应的计算节点的网络带宽,并检测该目标作业所对应的计算节点的网络瓶颈的实时最大带宽(即实时最大网络带宽)是否大于第一预设带宽以及该目标作业所对应的计算节点的网络负载压力的平均带宽(即平均带宽)是否大于第二预设带宽。当前述的计算节点的实时最大网络带宽大于第一预设带宽a(即图7中的阈值a)或者平均带宽大于第二预设带宽b(即图7中的阈值b)时,特征收集组件够可以确定该目标作业对应的目标计算资源类型为超级计算集群计算资源类型。Optionally, as shown in Figure 7, when the job running form indicates that the target job is not running in the container, the feature collection component can monitor the network bandwidth of the computing node corresponding to the target job, and detect the computing node corresponding to the target job. Whether the real-time maximum bandwidth (that is, the real-time maximum network bandwidth) of the network bottleneck of the node is greater than the first preset bandwidth and whether the average bandwidth (that is, the average bandwidth) of the network load pressure of the computing node corresponding to the target job is greater than the second preset bandwidth . When the real-time maximum network bandwidth of the aforementioned computing node is greater than the first preset bandwidth a (ie the threshold a in FIG. 7 ) or the average bandwidth is greater than the second preset bandwidth b (ie the threshold b in FIG. 7 ), the feature collection component It can be determined that the target computing resource type corresponding to the target job is the computing resource type of the supercomputing cluster.

需要说明的是,基于目标作业对应的计算节点的实时最大网络带宽和平均带宽确定目标计算资源类型是否为超级计算集群计算资源类型,可以实现对目标计算资源类型与超级计算集群计算资源类型的关联关系的准确确定,从而便于获取到准确的目标计算资源类型。It should be noted that whether the target computing resource type is a supercomputing cluster computing resource type is determined based on the real-time maximum network bandwidth and average bandwidth of the computing node corresponding to the target job, and the association between the target computing resource type and the supercomputing cluster computing resource type can be realized. Accurate determination of the relationship, so as to facilitate the acquisition of the accurate target computing resource type.

在一种可选的实施例中,在实时最大网络带宽小于或等于第一预设带宽,并且,平均带宽小于或等于第二预设带宽时,特征收集组件可以检测计算节点的内存占用率是否大于预设占用率,并在内存占用率大于预设占用率时,确定目标计算资源类型为物理机计算资源类型,在内存占用率小于或等于预设占用率时,确定目标计算资源类型为虚拟机计算资源类型。In an optional embodiment, when the real-time maximum network bandwidth is less than or equal to the first preset bandwidth, and the average bandwidth is less than or equal to the second preset bandwidth, the feature collection component can detect whether the memory occupancy rate of the computing node is not greater than the preset occupancy rate, and when the memory occupancy rate is greater than the preset occupancy rate, determine that the target computing resource type is a physical computer computing resource type, and when the memory occupancy rate is less than or equal to the preset occupancy rate, determine that the target computing resource type is virtual Computer computing resource type.

可选的,如图7所示,在实时最大网络带宽小于或等于第一预设带宽,并且,平均带宽小于或等于第二预设带宽时,特征收集组件可以监控与目标作业对应的计算节点的CPU(central processing unit,中央处理器)占用率,也即内存占用率,并检测该CPU占用率是否大于预设占用率。可选的,特征收集组件可以检测CPU平均占用率是否大于预设占用率,也可以检测CPU最大占用率是否大于预设占用率。Optionally, as shown in FIG. 7 , when the real-time maximum network bandwidth is less than or equal to the first preset bandwidth, and the average bandwidth is less than or equal to the second preset bandwidth, the feature collection component can monitor the computing node corresponding to the target job. The CPU (central processing unit, central processing unit) occupancy rate, that is, the memory occupancy rate, is detected, and whether the CPU occupancy rate is greater than the preset occupancy rate is detected. Optionally, the feature collection component can detect whether the average CPU occupancy rate is greater than the preset occupancy rate, and can also detect whether the maximum CPU occupancy rate is greater than the preset occupancy rate.

进一步地,在内存占用率大于预设占用率时,特征收集组件可以确定目标计算资源类型为物理机计算资源类型。反之,在内存占用率小于或等于预设占用率时,特征收集组件可以确定目标计算资源类型为VM(Virtual Machine,虚拟机)计算资源类型。Further, when the memory occupancy rate is greater than the preset occupancy rate, the feature collection component may determine that the target computing resource type is a physical computer computing resource type. Conversely, when the memory occupancy rate is less than or equal to the preset occupancy rate, the feature collection component may determine that the target computing resource type is a VM (Virtual Machine, virtual machine) computing resource type.

需要说明的是,基于目标作业对应的内存占用率确定目标计算资源类型为物理机计算资源类型还是虚拟机计算资源类型,可以实现对目标计算资源类型与物理机计算资源类型和虚拟机计算资源类型的关联关系的准确确定,从而便于获取到准确的目标计算资源类型。It should be noted that determining whether the target computing resource type is a physical computer computing resource type or a virtual machine computing resource type based on the memory occupancy rate corresponding to the target job can realize the comparison between the target computing resource type and the physical computer computing resource type and the virtual machine computing resource type. Accurate determination of the association relationship, so as to facilitate the acquisition of accurate target computing resource types.

需要强调的是,前述对目标计算资源类型是否为容器化实例计算资源类型,或超级计算集群计算资源类型,或物理机计算资源类型,或虚拟机计算资源类型的判断顺序可以基于实际需求而有所更改。It should be emphasized that the aforementioned judgment order for whether the target computing resource type is a containerized instance computing resource type, a supercomputing cluster computing resource type, a physical computer computing resource type, or a virtual machine computing resource type can be determined based on actual needs. changed.

在一种可选的实施例中,在对目标作业的作业特征信息与预设的计算资源类型所对应的目标作业特征信息进行比对,根据比对结果确定目标计算资源类型之后,特征收集组件可以将目标作业对应的作业详情信息以及系统特征信息存储至预设特征数据库中。In an optional embodiment, after comparing the job feature information of the target job with the target job feature information corresponding to the preset computing resource type, and determining the target computing resource type according to the comparison result, the feature collecting component The job detail information and system feature information corresponding to the target job can be stored in the preset feature database.

可选的,如图7所示,特征收集组件可以将目标作业对应的作业详情信息和系统特征信息以及目标作业与目标计算资源类型的关联关系存储至预设特征数据库中,以丰富预设特征数据库中的数据,提升特征数据库中的数据的多样性,从而在下一次特征收集组件获取到新的目标作业的作业特征信息时,可以更快速的获取到对应的目标计算资源类型。其中,作业详情信息至少包括目标作业对应的大小、内容等信息。Optionally, as shown in FIG. 7 , the feature collection component can store the job detail information and system feature information corresponding to the target job and the association relationship between the target job and the target computing resource type in the preset feature database, so as to enrich the preset features. The data in the database improves the diversity of the data in the feature database, so that the next time the feature collection component obtains job feature information of a new target job, the corresponding target computing resource type can be obtained more quickly. The job detail information includes at least information such as size and content corresponding to the target job.

在一种可选的实施例中,在为目标计算集群分配目标计算资源的过程中,资源分配系统可以基于资源管理组件向云服务器申请与目标计算资源类型所对应的目标计算资源,然后基于资源管理组件向资源调度组件创建任务队列,并基于任务队列向资源调度组件添加目标计算资源,从而基于资源调度组件所对应的调度策略将目标计算资源分配至目标计算集群的计算节点所对应的任务队列中。其中,资源管理组件用于对目标作业所需的计算资源的生命周期进行管理,云服务器用于对目标作业所需的计算资源进行生产管理。In an optional embodiment, in the process of allocating target computing resources to the target computing cluster, the resource allocation system may apply to the cloud server for target computing resources corresponding to the target computing resource type based on the resource management component, and then based on the resource management component The management component creates a task queue to the resource scheduling component, and adds target computing resources to the resource scheduling component based on the task queue, so as to allocate the target computing resources to the task queues corresponding to the computing nodes of the target computing cluster based on the scheduling policy corresponding to the resource scheduling component middle. The resource management component is used to manage the life cycle of the computing resources required by the target job, and the cloud server is used to perform production management of the computing resources required by the target job.

具体地,如图6、7所示,当特征收集组件确定了目标计算资源类型后,特征收集组件向资源管理组件发送资源生产请求,并将目标计算资源类型发送至资源管理组件。可选的,特征收集组件也可以在确定了目标计算资源类型,并收到目标计算集群扩容的消息后,将目标计算资源类型发送至资源管理组件。之后,由资源管理组件向云服务器申请与目标计算资源类型所对应的目标计算资源,其中,云服务器内至少存储有前述的容器化实例计算资源类型所对应的计算资源、超级计算集群计算资源类型所对应的计算资源、物理机计算资源类型所对应的计算资源以及虚拟机计算资源类型所对应的计算资源。Specifically, as shown in FIGS. 6 and 7 , after the feature collection component determines the target computing resource type, the feature collection component sends a resource production request to the resource management component, and sends the target computing resource type to the resource management component. Optionally, the feature collection component may also send the target computing resource type to the resource management component after determining the target computing resource type and receiving the message of expansion of the target computing cluster. After that, the resource management component applies to the cloud server for the target computing resource corresponding to the target computing resource type, wherein the cloud server at least stores the computing resource corresponding to the aforementioned containerized instance computing resource type and the supercomputing cluster computing resource type. The corresponding computing resources, the computing resources corresponding to the physical computer computing resource types, and the computing resources corresponding to the virtual machine computing resource types.

进一步地,如图6所示,当目标计算资源申请成功后,资源管理组件可以向资源调度组件创建任务队列,并基于任务队列向资源调度组件添加目标计算资源,同时维护目标计算集群中所有计算资源的生命周期。其中,至少在基于任务队列向资源调度组件添加目标计算资源之前,资源管理组件还需要创建目标计算集群,即将计算节点加入至资源调度组件,以保证能够成功运行作业。Further, as shown in FIG. 6 , after the target computing resource application is successful, the resource management component can create a task queue to the resource scheduling component, and add target computing resources to the resource scheduling component based on the task queue, while maintaining all computing resources in the target computing cluster. The life cycle of the resource. Among them, at least before adding target computing resources to the resource scheduling component based on the task queue, the resource management component also needs to create a target computing cluster, that is, adding computing nodes to the resource scheduling component to ensure that jobs can be successfully run.

更进一步地,资源调度组件可以基于自身的调度策略将目标计算资源与目标作业分配至目标计算集群的计算节点所对应的任务队列中,以使得目标计算集群能够基于各目标计算资源运行对应的目标作业。Further, the resource scheduling component can allocate target computing resources and target jobs to the task queues corresponding to the computing nodes of the target computing cluster based on its own scheduling strategy, so that the target computing cluster can run the corresponding target based on each target computing resource. Operation.

需要说明的是,通过基于资源管理组件向资源调度组件创建任务队列,并基于资源调度组件为目标计算集群的计算节点分配对应的任务队列,以使得目标计算集群能够基于各目标计算资源对对应的目标作业进行处理,从而避免了对所有作业选择同类计算资源所存在的资源浪费或不足的现象,提高了资源分配的合理性。It should be noted that the task queue is created to the resource scheduling component based on the resource management component, and the corresponding task queue is allocated to the computing nodes of the target computing cluster based on the resource scheduling component, so that the target computing cluster can be based on each target computing resource. The target job is processed, thereby avoiding the phenomenon of resource waste or shortage of selecting the same computing resources for all jobs, and improving the rationality of resource allocation.

在一种可选的实施例中,在为目标计算集群分配目标计算资源之后,并在资源管理组件检测到资源调度组件完成目标作业之后,资源管理组件可以从任务队列中移除目标计算资源,并向云服务器发送资源释放消息,以释放目标计算资源。In an optional embodiment, after the target computing resource is allocated to the target computing cluster, and after the resource management component detects that the resource scheduling component completes the target job, the resource management component can remove the target computing resource from the task queue, And send a resource release message to the cloud server to release the target computing resources.

可选的,如图6所示,当资源调度组件中的任一目标作业执行完成中,资源调度组件可以向资源管理组件发送执行完成的信息,也可以由资源管理组件从资源调度组件中获取相关信息,以供资源管理组件确定资源调度组件完成目标作业。之后,资源管理组件可以将任务队列中移除与完成的目标作业对应的目标计算资源,并向云服务器发送资源释放消息,以释放该目标计算资源。Optionally, as shown in FIG. 6 , when the execution of any target job in the resource scheduling component is completed, the resource scheduling component may send the execution completion information to the resource management component, or may be obtained by the resource management component from the resource scheduling component. Relevant information for the resource management component to determine that the resource scheduling component completes the target job. After that, the resource management component can remove the target computing resource corresponding to the completed target job from the task queue, and send a resource release message to the cloud server to release the target computing resource.

需要说明的是,通过在目标作业完成后,对目标作业所对应的目标计算资源进行释放,可以避免在下一次需要利用该目标计算资源时,无法成功使用的情况发生,从而提高对各计算资源的利用率。It should be noted that, by releasing the target computing resources corresponding to the target job after the target job is completed, it can avoid the situation that the target computing resource cannot be used successfully next time when the target computing resource needs to be used, thereby improving the utilization of each computing resource. utilization.

在一种可选的实施例中,在基于作业特征信息确定目标计算资源类型之后,资源管理组件可以在目标作业的数量为多个时,根据多个目标作业的作业特征信息创建多个任务队列,并按照多个任务队列所对应的计算资源类型确定每个目标作业所对应的目标计算资源,从而基于目标计算资源执行多个目标作业。其中,每个任务队列对应不同计算资源类型的计算资源。In an optional embodiment, after determining the target computing resource type based on the job feature information, the resource management component may create multiple task queues according to the job feature information of the multiple target jobs when the number of target jobs is multiple , and determine the target computing resources corresponding to each target job according to the computing resource types corresponding to the multiple task queues, so as to execute multiple target jobs based on the target computing resources. Wherein, each task queue corresponds to computing resources of different computing resource types.

具体地,当存在多个目标作业时,资源管理组件可以基于多个目标作业的作业特征信息的类别创建多个任务队列,即将相似度相对较高的作业特征信息作为相同类,将相似度相对较低的作业特征信息作为不同类,且任务队列的数量与作业特征信息的类别数量相等。其中,每个任务队列对应不同计算资源类型的计算资源,从而可以基于多个任务队列所对应的计算资源类型确定每个目标作业所对应的目标计算资源,并基于目标计算资源执行对应的目标作业。可选的,资源管理组件可以基于前述的方法确定多个目标作业的作业特征信息,也可以基于测试与经验,大致确定各目标作业的行业性质与特征,并将其作为作业特征信息。Specifically, when there are multiple target jobs, the resource management component can create multiple task queues based on the categories of job feature information of the multiple target jobs. The lower job feature information is regarded as a different class, and the number of task queues is equal to the number of categories of the job feature information. Among them, each task queue corresponds to computing resources of different computing resource types, so that the target computing resources corresponding to each target job can be determined based on the computing resource types corresponding to the multiple task queues, and the corresponding target jobs can be executed based on the target computing resources. . Optionally, the resource management component can determine job feature information of multiple target jobs based on the aforementioned method, or can roughly determine the industry nature and characteristics of each target job based on testing and experience, and use it as job feature information.

需要说明的是,通过根据多个目标作业的作业特征信息创建多个任务队列,并基于多个任务队列确定目标计算资源,可以在目标作业的数量为多个时,提高本申请的工作效率以及各目标作业的运行效率。It should be noted that by creating multiple task queues according to the job feature information of multiple target jobs, and determining target computing resources based on the multiple task queues, the work efficiency of the application can be improved when the number of target jobs is multiple. The running efficiency of each target job.

需要说明的是,本申请充分考虑扩容或弹性需求,根据目标作业的作业特征信息做出资源决策,且目标作业执行完成后计算资源自动释放,避免了现有技术中静态分布计算资源不能体现云的时效性,存在资源浪费或者不足的情况,以及无法满足作业需要弹性的场景的现象。同时,基于作业特征信息决策计算资源类型,可以避免人工选择计算资源的带来的差异,从而提高用户使用体验。It should be noted that this application fully considers expansion or flexibility requirements, makes resource decisions based on job feature information of the target job, and automatically releases computing resources after the target job is executed, avoiding that statically distributed computing resources in the prior art cannot reflect cloud computing. The timeliness of the operation, there is a waste or shortage of resources, and the phenomenon that the operation cannot meet the needs of flexibility. At the same time, the decision of computing resource type based on job feature information can avoid differences caused by manual selection of computing resources, thereby improving user experience.

由此可见,本申请所提供的方案达到了基于作业的作业特征信息为每个作业分配不同类计算资源的目的,从而实现了提高资源分配合理性的技术效果,进而解决了由于现有技术中对所有作业选择同类计算资源造成的资源分配不合理的技术问题。It can be seen that the solution provided by the present application achieves the purpose of allocating different types of computing resources to each job based on the job feature information of the job, thereby achieving the technical effect of improving the rationality of resource allocation, and further solving the problems caused by the prior art. The technical problem of unreasonable resource allocation caused by selecting the same computing resources for all jobs.

需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本申请所必须的。It should be noted that, for the sake of simple description, the foregoing method embodiments are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited by the described action sequence. Because in accordance with the present application, certain steps may be performed in other orders or concurrently. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例的方法。From the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is better implementation. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product in essence or in a part that contributes to the prior art, and the computer software product is stored in a storage medium (such as ROM/RAM, magnetic disk, CD-ROM), including several instructions to make a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) execute the methods of the various embodiments of the present application.

实施例2Example 2

在上述运行环境下,本申请提供了如图8所示的资源分配方法。图8是根据本申请实施例的一种可选的资源分配方法的流程图。Under the above operating environment, the present application provides a resource allocation method as shown in FIG. 8 . FIG. 8 is a flowchart of an optional resource allocation method according to an embodiment of the present application.

步骤S302,响应作业创建指令,创建目标作业以及执行目标作业的目标计算集群,并显示目标作业的作业特征信息。Step S302, in response to the job creation instruction, create a target job and a target computing cluster for executing the target job, and display job feature information of the target job.

在步骤S302中,如图9所示,前述的资源分配系统可以响应用户输入的作业创建指令,创建目标作业,然后可以由资源调度组件获取目标作业,并由特征收集组件从资源调度组件中获取目标作业,以收集目标作业的作业特征信息。同时,资源分配系统中的资源管理组件还可以创建执行目标作业的目标计算集群。In step S302, as shown in FIG. 9, the aforementioned resource allocation system can create a target job in response to the job creation instruction input by the user, and then the target job can be obtained by the resource scheduling component, and obtained from the resource scheduling component by the feature collection component target job to collect job characteristic information of the target job. At the same time, the resource management component in the resource allocation system can also create a target computing cluster for executing the target job.

进一步地,当特征收集组件完成对目标作业的作业特征信息的收集后,资源分配系统可以通过显示界面将目标作业的作业特征信息显示给后台操作人员或用户,以供后台操作人员或用户查看。Further, after the feature collection component completes the collection of job feature information of the target job, the resource allocation system can display the job feature information of the target job to the background operator or user through the display interface for viewing by the background operator or user.

需要说明的是,通过响应用户的作业创建指令,创建目标作业和目标计算集群,以用于保证对用户的操作的进行正常反馈。同时,通过显示作业特征信息,以更好的供后台操作人员能够对资源分配系统进行监督,防止出现错误指令或错误的作业特征信息所导致的目标作业执行错误,从而提高目标作业执行的稳定性。其中,错误的作业特征信息可以是空白的作业特征信息等。It should be noted that, by responding to the user's job creation instruction, a target job and a target computing cluster are created, so as to ensure normal feedback of the user's operation. At the same time, by displaying the job feature information, the background operators can better supervise the resource allocation system, preventing the target job execution error caused by wrong instructions or wrong job feature information, thereby improving the stability of target job execution. . The erroneous job feature information may be blank job feature information or the like.

步骤S304,显示基于作业特征信息所确定的目标计算资源类型。Step S304, displaying the target computing resource type determined based on the job feature information.

在步骤S304中,如图9所示,在特征收集组件基于前述的方法确定了目标计算资源类型后,资源分配系统可以通过显示界面显示每个目标作业及其对应的目标计算资源类型给后台操作人员或用户。In step S304, as shown in FIG. 9, after the feature collection component determines the target computing resource type based on the aforementioned method, the resource allocation system can display each target job and its corresponding target computing resource type to the background operation through the display interface person or user.

需要说明的是,通过显示目标计算资源类型,可以进一步地便于后台操作人员对资源分配系统进行监督,防止目标作业以及目标计算资源类型的错误配对,或是出现错误的目标计算资源类型所导致的目标作业执行错误,从而提高目标作业执行的稳定性。其中,错误的目标计算资源类型可以是空白的计算资源类型或是云服务器、数据库等存储区域中不存在的计算资源类型。It should be noted that by displaying the target computing resource type, it can further facilitate the background operator to supervise the resource allocation system, and prevent the wrong pairing of the target job and the target computing resource type, or the error caused by the wrong target computing resource type. The target job is executed incorrectly, thereby improving the stability of the target job execution. The wrong target computing resource type may be a blank computing resource type or a computing resource type that does not exist in a storage area such as a cloud server and a database.

步骤S306,响应资源分配指令,显示为目标计算集群所分配的目标计算资源,其中,目标计算资源为目标计算集群执行目标作业所需的计算资源,目标计算资源的计算资源类型为目标计算资源类型。Step S306, responding to the resource allocation instruction, displaying the target computing resources allocated by the target computing cluster, wherein the target computing resources are the computing resources required by the target computing cluster to perform the target job, and the computing resource type of the target computing resources is the target computing resource type .

在步骤S306中,如图9所示,资源分配系统可以响应后台操作人员或用户输入的资源分配指令,为目标计算集群分配目标计算资源,并显示为目标计算集群所分配的目标计算资源(即图9中的显示分配结果)。In step S306, as shown in FIG. 9, the resource allocation system may respond to the resource allocation instruction input by the background operator or the user, allocate target computing resources to the target computing cluster, and display the target computing resources allocated to the target computing cluster (ie display assignment results in Figure 9).

需要说明的是,通过显示为目标计算集群所分配的目标计算资源,可以更进一步地便于后台操作人员对资源分配系统进行监督,避免资源分配系统将同一类目标计算资源分配给所有目标作业或多个目标计算资源分配给同一目标作业的现象发生,从而提高目标作业执行的稳定性。It should be noted that by displaying the target computing resources allocated to the target computing cluster, it can further facilitate the background operators to supervise the resource allocation system, and prevent the resource allocation system from allocating the same type of target computing resources to all target jobs or multiple target jobs. The phenomenon that multiple target computing resources are allocated to the same target job occurs, thereby improving the stability of target job execution.

需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本申请所必须的。It should be noted that, for the sake of simple description, the foregoing method embodiments are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited by the described action sequence. Because in accordance with the present application, certain steps may be performed in other orders or concurrently. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例的方法。From the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is better implementation. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product in essence or in a part that contributes to the prior art, and the computer software product is stored in a storage medium (such as ROM/RAM, magnetic disk, CD-ROM), including several instructions to make a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) execute the methods of the various embodiments of the present application.

实施例3Example 3

根据本发明实施例,还提供了一种用于实施上述资源分配方法的资源分配装置,如图10所示,该装置包括:According to an embodiment of the present invention, a resource allocation apparatus for implementing the above resource allocation method is also provided. As shown in FIG. 10 , the apparatus includes:

获取模块402,用于获取目标计算集群待执行的目标作业的作业特征信息;an obtaining module 402, configured to obtain job feature information of a target job to be executed by the target computing cluster;

确定模块404,用于基于作业特征信息确定目标计算资源类型;a determining module 404, configured to determine the target computing resource type based on the job feature information;

分配模块406,用于为目标计算集群分配目标计算资源,其中,目标计算资源为目标计算集群执行目标作业所需的计算资源,目标计算资源的计算资源类型为目标计算资源类型。The allocation module 406 is configured to allocate target computing resources to the target computing cluster, wherein the target computing resources are computing resources required by the target computing cluster to execute the target job, and the computing resource type of the target computing resources is the target computing resource type.

此处需要说明的是,上述获取模块402、确定模块404和分配模块406对应于实施例1中的步骤S202至步骤S206,三个模块与对应的步骤所实现的实例和应用场景相同,但不限于上述实施例1所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在实施例1提供的电子设备10中。It should be noted here that the above-mentioned acquisition module 402, determination module 404 and allocation module 406 correspond to steps S202 to S206 in Embodiment 1, and the three modules have the same instances and application scenarios as the corresponding steps. It is limited to the content disclosed in the above-mentioned Embodiment 1. It should be noted that, as a part of the apparatus, the above-mentioned modules may run in the electronic device 10 provided in Embodiment 1.

可选的,获取模块还包括:子获取模块,用于从资源调度组件所对应的作业列表中获取目标作业的作业信息,其中,资源调度组件用于接收目标对象提交的目标作业,并将目标作业分配至目标计算集群的计算节点中;第一子确定模块,用于基于目标计算集群确定目标作业所对应的系统特征信息,其中,作业特征信息至少包括作业信息以及系统特征信息,作业信息至少包括:目标作业运行时的容器依赖信息,系统特征信息至少包括:计算节点的网络带宽、内存占用率。Optionally, the acquisition module further includes: a sub-acquisition module, configured to acquire job information of the target job from the job list corresponding to the resource scheduling component, wherein the resource scheduling component is used to receive the target job submitted by the target object, and assign the target job to the target job. The job is allocated to the computing nodes of the target computing cluster; the first sub-determination module is used to determine the system characteristic information corresponding to the target job based on the target computing cluster, wherein the job characteristic information at least includes job information and system characteristic information, and the job information at least It includes: container dependency information when the target job is running, and the system feature information at least includes: network bandwidth and memory usage of computing nodes.

可选的,确定模块还包括:查询模块,用于基于作业特征信息从预设特征数据库中进行计算资源类型查询,得到查询结果,其中,预设特征数据库中至少存储有历史作业的作业特征信息、计算资源类型,以及历史作业的作业特征信息与计算资源类型之间的关联关系,计算资源类型为目标计算集群执行历史作业所需的计算资源的类型;第二子确定模块,用于在查询结果表征预设特征数据库中存在与目标作业的作业特征信息所对应的计算资源类型时,确定预设特征数据库中与目标作业的作业特征信息所对应的计算资源类型为目标计算资源类型;第一处理模块,用于在查询结果表征预设特征数据库中不存在与目标作业的作业特征信息所对应的计算资源类型时,对目标作业的作业特征信息与预设的计算资源类型所对应的目标作业特征信息进行比对,根据比对结果确定目标计算资源类型。Optionally, the determining module further includes: a query module, configured to query the computing resource type from a preset feature database based on the job feature information, and obtain a query result, wherein the preset feature database stores at least job feature information of historical jobs. , computing resource type, and the relationship between job feature information of historical jobs and computing resource type, where the computing resource type is the type of computing resources required by the target computing cluster to execute historical jobs; the second sub-determination module is used for querying The result indicates that when there is a computing resource type corresponding to the job feature information of the target job in the preset feature database, the computing resource type corresponding to the job feature information of the target job in the preset feature database is determined as the target computing resource type; first The processing module is configured to, when the query result indicates that there is no computing resource type corresponding to the job feature information of the target job in the preset feature database, the target job corresponding to the job feature information of the target job and the preset computing resource type The feature information is compared, and the target computing resource type is determined according to the comparison result.

可选的,第一处理模块还包括:第三子确定模块,用于根据目标作业运行时的容器依赖信息确定目标作业的作业运行形式;第四子确定模块,用于在作业运行形式表征目标作业运行在容器中时,确定目标计算资源类型为容器化实例计算资源类型,其中,容器化实例计算资源类型表征目标作业运行时依赖于容器。Optionally, the first processing module further includes: a third sub-determination module for determining the job running form of the target job according to the container dependency information when the target job is running; a fourth sub-determining module for characterizing the target in the job running form When the job runs in the container, it is determined that the target computing resource type is the containerized instance computing resource type, wherein the containerized instance computing resource type indicates that the target job depends on the container when running.

可选的,资源分配装置还包括:第二处理模块,用于在作业运行形式表征目标作业未运行在容器中时,检测计算节点的实时最大网络带宽是否大于第一预设带宽,并且,计算节点所对应的平均带宽是否大于第二预设带宽;第五子确定模块,在实时最大网络带宽大于第一预设带宽,或者,平均带宽大于第二预设带宽时,确定目标计算资源类型为超级计算集群计算资源类型,其中,超级计算集群计算资源类型表征目标作业的运行受网络带宽的影响程度最大。Optionally, the resource allocation device further includes: a second processing module, configured to detect whether the real-time maximum network bandwidth of the computing node is greater than the first preset bandwidth when the job running form indicates that the target job is not running in the container, and calculate Whether the average bandwidth corresponding to the node is greater than the second preset bandwidth; the fifth sub-determination module, when the real-time maximum network bandwidth is greater than the first preset bandwidth, or when the average bandwidth is greater than the second preset bandwidth, determine that the target computing resource type is The computing resource type of the supercomputing cluster, wherein the computing resource type of the supercomputing cluster indicates that the running of the target job is most affected by the network bandwidth.

可选的,资源分配装置还包括:第三处理模块,用于在实时最大网络带宽小于或等于第一预设带宽,并且,平均带宽小于或等于第二预设带宽时,检测计算节点的内存占用率是否大于预设占用率;第六子确定模块,用于在内存占用率大于预设占用率时,确定目标计算资源类型为物理机计算资源类型;第七子确定模块,用于在内存占用率小于或等于预设占用率时,确定目标计算资源类型为虚拟机计算资源类型。Optionally, the resource allocation device further includes: a third processing module, configured to detect the memory of the computing node when the real-time maximum network bandwidth is less than or equal to the first preset bandwidth, and the average bandwidth is less than or equal to the second preset bandwidth. Whether the occupancy rate is greater than the preset occupancy rate; the sixth sub-determination module is used to determine that the target computing resource type is the physical computer computing resource type when the memory occupancy rate is greater than the preset occupancy rate; the seventh sub-determination module is used for memory When the occupancy rate is less than or equal to the preset occupancy rate, it is determined that the target computing resource type is the virtual machine computing resource type.

可选的,资源分配装置还包括:存储模块,用于将目标作业对应的作业详情信息以及系统特征信息存储至预设特征数据库中。Optionally, the resource allocation apparatus further includes: a storage module, configured to store job detail information and system feature information corresponding to the target job in a preset feature database.

可选的,分配模块还包括:第四处理模块,用于基于资源管理组件向云服务器申请与目标计算资源类型所对应的目标计算资源,其中,资源管理组件用于对目标作业所需的计算资源的生命周期进行管理,云服务器用于对目标作业所需的计算资源进行生产管理;第五处理模块,用于基于资源管理组件向资源调度组件创建任务队列,并基于任务队列向资源调度组件添加目标计算资源;子分配模块,用于基于资源调度组件所对应的调度策略将目标计算资源分配至目标计算集群的计算节点所对应的任务队列中。Optionally, the allocation module further includes: a fourth processing module, configured to apply to the cloud server for target computing resources corresponding to the target computing resource type based on the resource management component, wherein the resource management component is used for computing required by the target job. The life cycle of the resource is managed, and the cloud server is used for production management of the computing resources required by the target job; the fifth processing module is used to create a task queue to the resource scheduling component based on the resource management component, and send the resource scheduling component to the resource scheduling component based on the task queue. A target computing resource is added; a sub-allocation module is used to allocate the target computing resource to the task queue corresponding to the computing node of the target computing cluster based on the scheduling policy corresponding to the resource scheduling component.

可选的,资源分配装置还包括:第六处理模块,用于在资源管理组件检测到资源调度组件完成目标作业之后,从任务队列中移除目标计算资源,并向云服务器发送资源释放消息,以释放目标计算资源。Optionally, the resource allocation device further includes: a sixth processing module for removing the target computing resource from the task queue after the resource management component detects that the resource scheduling component completes the target job, and sends a resource release message to the cloud server, to free up target computing resources.

可选的,资源分配装置还包括:创建模块,用于在目标作业的数量为多个时,根据多个目标作业的作业特征信息创建多个任务队列,其中,每个任务队列对应不同计算资源类型的计算资源;第八子确定模块,用于按照多个任务队列所对应的计算资源类型确定每个目标作业所对应的目标计算资源;第七处理模块,用于基于目标计算资源执行多个目标作业。Optionally, the resource allocation device further includes: a creation module for creating multiple task queues according to job feature information of multiple target jobs when the number of target jobs is multiple, wherein each task queue corresponds to different computing resources. type of computing resources; the eighth sub-determination module is used to determine the target computing resources corresponding to each target job according to the computing resource types corresponding to the multiple task queues; the seventh processing module is used to execute multiple tasks based on the target computing resources target job.

实施例4Example 4

根据本发明实施例,还提供了一种用于实施上述资源分配方法的资源分配装置,如图11所示,该装置包括:According to an embodiment of the present invention, a resource allocation apparatus for implementing the above resource allocation method is also provided. As shown in FIG. 11 , the apparatus includes:

第一响应模块502,用于响应作业创建指令,创建目标作业以及执行目标作业的目标计算集群,并显示目标作业的作业特征信息;a first response module 502, configured to respond to the job creation instruction, create a target job and a target computing cluster for executing the target job, and display job feature information of the target job;

显示模块504,用于显示基于作业特征信息所确定的目标计算资源类型;A display module 504, configured to display the target computing resource type determined based on the job feature information;

第二响应模块506,用于响应资源分配指令,显示为目标计算集群所分配的目标计算资源,其中,目标计算资源为目标计算集群执行目标作业所需的计算资源,目标计算资源的计算资源类型为目标计算资源类型。The second response module 506 is configured to respond to the resource allocation instruction and display the target computing resources allocated to the target computing cluster, wherein the target computing resources are the computing resources required by the target computing cluster to execute the target job, and the computing resource type of the target computing resources Compute resource type for the target.

此处需要说明的是,上述第一响应模块502、显示模块504和第二响应模块506对应于实施例2中的步骤S302至步骤S306,三个模块与对应的步骤所实现的实例和应用场景相同,但不限于上述实施例2所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在实施例一提供的电子设备10中。It should be noted here that the above-mentioned first response module 502, display module 504 and second response module 506 correspond to steps S302 to S306 in Embodiment 2, and examples and application scenarios implemented by the three modules and corresponding steps The same, but not limited to the content disclosed in Example 2 above. It should be noted that, as a part of the apparatus, the above-mentioned modules may run in the electronic device 10 provided in the first embodiment.

实施例5Example 5

根据本发明实施例,还提供了一种用于实施上述资源分配方法的资源分配系统,如图12所示,该系统包括:According to an embodiment of the present invention, a resource allocation system for implementing the above resource allocation method is also provided. As shown in FIG. 12 , the system includes:

调度器,用于接收目标对象提交的目标作业。A scheduler for receiving target jobs submitted by target objects.

可选的,调度器负责接收用户提交的目标作业,并根据不同的调度策略,将目标作业分配到目标计算集群的具体计算资源上进行计算,同时监控各目标作业的运行状态,以得到每个目标作业对应的计算执行结果。其中,目标作业是目标计算集群的计算任务,不同的目标作业会配置有不同的资源需求、优先级、执行时间等参数,调度器可以针对不同目标作业的配置参数,采用不同的调度策略,以使目标计算集群更好的执行目标作业。当计算资源对应的目标作业较多时,调度器可以对目标作业进行排队及队列管理。调度器也可以监视目标作业的计算执行结果,对计算执行结果表征执行失败的目标作业重新提交执行。Optionally, the scheduler is responsible for receiving the target job submitted by the user, and according to different scheduling policies, assigns the target job to the specific computing resources of the target computing cluster for calculation, and monitors the running status of each target job to obtain each target job. The calculation execution result corresponding to the target job. Among them, the target job is the computing task of the target computing cluster. Different target jobs will be configured with different resource requirements, priorities, execution time and other parameters. The scheduler can use different scheduling strategies for the configuration parameters of different target jobs. Make the target computing cluster perform the target job better. When there are many target jobs corresponding to computing resources, the scheduler can queue and manage the target jobs. The scheduler can also monitor the calculation execution result of the target job, and resubmit for execution the target job whose calculation execution result indicates that the execution fails.

特征收集组件,用于获取目标计算集群待执行的目标作业的作业特征信息,并基于作业特征信息确定目标计算资源类型。The feature collection component is used to obtain job feature information of the target job to be executed by the target computing cluster, and determine the target computing resource type based on the job feature information.

可选的,特征收集组件与调度器相连,特征收集组件可以在目标计算集群侧通过访问调度器与目标计算集群,收集目标作业运行时的容器依赖信息以及网络带宽与内存占用率等系统特征信息,根据一定策略判断申请对应的计算资源类型,并向资源管理组件发送资源申请消息。需要说明的是,特征收集组件不同于传统的性能采集工具,其可以与云上资源管理组件,调度器以及其他单元统一组合起来,共同完成资源弹性与管理。此外,特征收集组件可以把作业特征信息进行收集,充分发挥云上数据优势,最终充分预判所需计算资源的计算资源类型。Optionally, the feature collection component is connected to the scheduler, and the feature collection component can access the scheduler and the target computing cluster on the target computing cluster side to collect container dependency information when the target job is running, and system feature information such as network bandwidth and memory usage. , according to a certain policy, determine the type of computing resource corresponding to the application, and send a resource application message to the resource management component. It should be noted that the feature collection component is different from the traditional performance collection tool. It can be combined with the cloud resource management component, scheduler and other units to jointly complete resource elasticity and management. In addition, the feature collection component can collect job feature information, give full play to the advantages of data on the cloud, and finally fully predict the type of computing resources required for computing resources.

资源管理组件,用于根据目标计算资源类型确定目标计算资源,为调度器创建任务队列,然后基于任务队列向调度器添加目标计算资源。The resource management component is used to determine the target computing resource according to the target computing resource type, create a task queue for the scheduler, and then add the target computing resource to the scheduler based on the task queue.

可选的,资源管理组件与特征收集组件、调度器相连,资源管理组件用于对目标作业所需的计算资源的生命周期进行管理,具体地,资源管理组件用于整个目标计算集群的计算资源创建、删除、计算资源加入、退出等生命周期管理。资源管理组件可以向云服务器申请其所确定的目标计算资源,并与调度器交互,通知调度器计算资源的加入、退出,以便调度器能够更新自己的调度策略,当调度器中对应的计算资源使用完成后,资源管理器还可以向云服务器释放该计算资源。与传统的相关系统的组成不同,由于云上的实例是可以弹性的申请、释放的,因此本申请的系统中包含了这部分专门的资源管理组件以用于集群计算资源的生命周期管理。其中,资源管理组件可以是独立部署的系统,也可以和调度器一起部署或者作为调度器的一个内部组件。Optionally, the resource management component is connected to the feature collection component and the scheduler, and the resource management component is used to manage the life cycle of the computing resources required by the target job. Specifically, the resource management component is used for the computing resources of the entire target computing cluster. Life cycle management such as creation, deletion, addition and withdrawal of computing resources. The resource management component can apply to the cloud server for the target computing resources determined by it, and interact with the scheduler to notify the scheduler of the addition and withdrawal of computing resources, so that the scheduler can update its own scheduling policy, when the corresponding computing resources in the scheduler After the use is completed, the resource manager can also release the computing resources to the cloud server. Different from the composition of traditional related systems, since instances on the cloud can be flexibly applied for and released, the system of this application includes this part of specialized resource management components for life cycle management of cluster computing resources. The resource management component may be an independently deployed system, or may be deployed together with the scheduler or as an internal component of the scheduler.

调度器还基于预设的调度策略将目标计算资源分配至目标计算集群的计算节点所对应的任务队列中,以使目标计算集群中的计算节点执行目标作业。The scheduler also allocates the target computing resources to the task queues corresponding to the computing nodes of the target computing cluster based on the preset scheduling policy, so that the computing nodes in the target computing cluster execute the target job.

可选的,调度器还用于在申请到对应的目标计算资源后,将目标计算资源分配至目标计算集群中相关服务器所对应的任务队列中,以供相关服务器执行对应的目标作业。Optionally, the scheduler is further configured to allocate the target computing resources to the task queue corresponding to the relevant server in the target computing cluster after applying for the corresponding target computing resource, so that the relevant server can execute the corresponding target job.

在一种可选的实施例中,资源分配系统还可以包括云服务器,云服务器与资源管理组件相连,用于对目标作业所需的计算资源进行生产管理,其中,云服务器内至少存储有容器化实例计算资源类型所对应的计算资源、超级计算集群计算资源类型所对应的计算资源、物理机计算资源类型所对应的计算资源以及虚拟机计算资源类型所对应的计算资源。In an optional embodiment, the resource allocation system may further include a cloud server, the cloud server is connected to the resource management component, and is used for production management of the computing resources required by the target job, wherein the cloud server stores at least containers The computing resources corresponding to the computing resource types of the instance, the computing resources corresponding to the computing resource types of the supercomputing cluster, the computing resources corresponding to the computing resource types of the physical machines, and the computing resources corresponding to the computing resource types of the virtual machines.

此处需要说明的是,上述调度器、特征收集组件、资源管理组件可用于实现实施例1中所提供的方法,调度器、特征收集组件、资源管理组件所实现的实例和应用场景与实施例1中实现的实例和应用场景相同,但不限于上述实施例1所公开的内容。It should be noted here that the above-mentioned scheduler, feature collection component, and resource management component can be used to implement the method provided in Embodiment 1, and examples and application scenarios and embodiments implemented by the scheduler, feature collection component, and resource management component. The examples and application scenarios implemented in 1 are the same, but are not limited to the content disclosed in the above-mentioned Embodiment 1.

实施例6Example 6

本申请的实施例可以提供一种电子设备,该电子设备可以是电子设备群中的任意一个电子设备。可选地,在本实施例中,上述电子设备也可以替换为移动终端等终端设备。Embodiments of the present application may provide an electronic device, and the electronic device may be any electronic device in an electronic device group. Optionally, in this embodiment, the above electronic device may also be replaced by a terminal device such as a mobile terminal.

可选地,在本实施例中,上述电子设备可以位于计算机网络的多个网络设备中的至少一个网络设备。Optionally, in this embodiment, the above-mentioned electronic device may be located in at least one network device among multiple network devices of a computer network.

在本实施例中,上述电子设备可以执行资源分配方法中以下步骤的程序代码:获取目标计算集群待执行的目标作业的作业特征信息;基于作业特征信息确定目标计算资源类型;为目标计算集群分配目标计算资源,其中,目标计算资源为目标计算集群执行目标作业所需的计算资源,目标计算资源的计算资源类型为目标计算资源类型。In this embodiment, the above-mentioned electronic device can execute the program code of the following steps in the resource allocation method: acquiring job feature information of a target job to be executed by the target computing cluster; determining the target computing resource type based on the job feature information; allocating to the target computing cluster Target computing resources, where the target computing resources are computing resources required by the target computing cluster to execute the target job, and the computing resource type of the target computing resources is the target computing resource type.

可选地,图13是根据本申请实施例的一种电子设备的结构框图。如图13所示,该电子设备10可以包括:一个或多个(图中仅示出一个)处理器102、存储器104以及存储控制器。Optionally, FIG. 13 is a structural block diagram of an electronic device according to an embodiment of the present application. As shown in FIG. 13 , the electronic device 10 may include: one or more (only one is shown in the figure) a processor 102 , a memory 104 and a storage controller.

其中,存储器可用于存储软件程序以及模块,如本申请实施例中的资源分配方法和装置对应的程序指令/模块,处理器通过运行存储在存储器内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的资源分配方法。存储器可包括高速随机存储器,还可以包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器可进一步包括相对于处理器远程设置的存储器,这些远程存储器可以通过网络连接至终端10。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory can be used to store software programs and modules, such as program instructions/modules corresponding to the resource allocation method and device in the embodiments of the present application, and the processor executes various functional applications by running the software programs and modules stored in the memory. and data processing, that is, to implement the above-mentioned resource allocation method. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory located remotely from the processor, and these remote memories may be connected to the terminal 10 through a network. Examples of such networks include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

处理器可以通过传输装置调用存储器存储的信息及应用程序,以执行下述步骤:获取目标计算集群待执行的目标作业的作业特征信息;基于作业特征信息确定目标计算资源类型;为目标计算集群分配目标计算资源,其中,目标计算资源为目标计算集群执行目标作业所需的计算资源,目标计算资源的计算资源类型为目标计算资源类型。The processor can call the information and application programs stored in the memory through the transmission device to perform the following steps: obtain job feature information of the target job to be executed by the target computing cluster; determine the target computing resource type based on the job feature information; allocate the target computing cluster to the target computing cluster. Target computing resources, where the target computing resources are computing resources required by the target computing cluster to execute the target job, and the computing resource type of the target computing resources is the target computing resource type.

可选的,上述处理器还可以执行如下步骤的程序代码:从资源调度组件所对应的作业列表中获取目标作业的作业信息,其中,资源调度组件用于接收目标对象提交的目标作业,并将目标作业分配至目标计算集群的计算节点中;基于目标计算集群确定目标作业所对应的系统特征信息,其中,作业特征信息至少包括作业信息以及系统特征信息,作业信息至少包括:目标作业运行时的容器依赖信息,系统特征信息至少包括:计算节点的网络带宽、内存占用率。Optionally, the above-mentioned processor may also execute the program code of the following steps: obtaining job information of the target job from the job list corresponding to the resource scheduling component, wherein the resource scheduling component is used for receiving the target job submitted by the target object, and assigning the job information to the target job. The target job is allocated to the computing nodes of the target computing cluster; the system characteristic information corresponding to the target job is determined based on the target computing cluster, wherein the job characteristic information at least includes job information and system characteristic information, and the job information at least includes: Container dependency information, and system feature information at least includes: network bandwidth and memory usage of computing nodes.

可选的,上述处理器还可以执行如下步骤的程序代码:基于作业特征信息从预设特征数据库中进行计算资源类型查询,得到查询结果,其中,预设特征数据库中至少存储有历史作业的作业特征信息、计算资源类型,以及历史作业的作业特征信息与计算资源类型之间的关联关系,计算资源类型为目标计算集群执行历史作业所需的计算资源的类型;在查询结果表征预设特征数据库中存在与目标作业的作业特征信息所对应的计算资源类型时,确定预设特征数据库中与目标作业的作业特征信息所对应的计算资源类型为目标计算资源类型;在查询结果表征预设特征数据库中不存在与目标作业的作业特征信息所对应的计算资源类型时,对目标作业的作业特征信息与预设的计算资源类型所对应的目标作业特征信息进行比对,根据比对结果确定目标计算资源类型。Optionally, the above-mentioned processor may also execute the program code of the following steps: based on the job feature information, perform a computing resource type query from a preset feature database to obtain a query result, wherein the preset feature database stores at least the jobs of the historical jobs. Feature information, computing resource types, and the relationship between job feature information of historical jobs and computing resource types, where the computing resource type is the type of computing resources required by the target computing cluster to execute historical jobs; the query results represent the preset feature database When there is a computing resource type corresponding to the job feature information of the target job, determine the computing resource type corresponding to the job feature information of the target job in the preset feature database as the target computing resource type; When there is no computing resource type corresponding to the job feature information of the target job, the job feature information of the target job is compared with the target job feature information corresponding to the preset computing resource type, and the target computing resource is determined according to the comparison result. Resource Type.

可选的,上述处理器还可以执行如下步骤的程序代码:根据目标作业运行时的容器依赖信息确定目标作业的作业运行形式;在作业运行形式表征目标作业运行在容器中时,确定目标计算资源类型为容器化实例计算资源类型,其中,容器化实例计算资源类型表征目标作业运行时依赖于容器。Optionally, the above-mentioned processor may further execute the program code of the following steps: determining the job running form of the target job according to the container dependency information when the target job runs; determining the target computing resource when the job running form represents that the target job is running in the container. The type is the containerized instance computing resource type, where the containerized instance computing resource type indicates that the target job depends on the container when running.

可选的,上述处理器还可以执行如下步骤的程序代码:在作业运行形式表征目标作业未运行在容器中时,检测计算节点的实时最大网络带宽是否大于第一预设带宽,并且,计算节点所对应的平均带宽是否大于第二预设带宽;在实时最大网络带宽大于第一预设带宽,或者,平均带宽大于第二预设带宽时,确定目标计算资源类型为超级计算集群计算资源类型,其中,超级计算集群计算资源类型表征目标作业的运行受网络带宽的影响程度最大。Optionally, the above-mentioned processor may also execute the program code of the following steps: when the job running form indicates that the target job is not running in the container, detect whether the real-time maximum network bandwidth of the computing node is greater than the first preset bandwidth, and the computing node Whether the corresponding average bandwidth is greater than the second preset bandwidth; when the real-time maximum network bandwidth is greater than the first preset bandwidth, or, when the average bandwidth is greater than the second preset bandwidth, determine that the target computing resource type is the supercomputing cluster computing resource type, Among them, the supercomputing cluster computing resource type indicates that the running of the target job is most affected by the network bandwidth.

可选的,上述处理器还可以执行如下步骤的程序代码:在实时最大网络带宽小于或等于第一预设带宽,并且,平均带宽小于或等于第二预设带宽时,检测计算节点的内存占用率是否大于预设占用率;在内存占用率大于预设占用率时,确定目标计算资源类型为物理机计算资源类型;在内存占用率小于或等于预设占用率时,确定目标计算资源类型为虚拟机计算资源类型。Optionally, the above-mentioned processor may also execute the program code of the following steps: when the real-time maximum network bandwidth is less than or equal to the first preset bandwidth, and the average bandwidth is less than or equal to the second preset bandwidth, detect the memory occupation of the computing node. Whether the memory occupancy rate is greater than the preset occupancy rate; when the memory occupancy rate is greater than the preset occupancy rate, the target computing resource type is determined as the physical computer computing resource type; when the memory occupancy rate is less than or equal to the preset occupancy rate, the target computing resource type is determined as The virtual machine computing resource type.

可选的,上述处理器还可以执行如下步骤的程序代码:在对目标作业的作业特征信息与预设的计算资源类型所对应的目标作业特征信息进行比对,根据比对结果确定目标计算资源类型之后,将目标作业对应的作业详情信息以及系统特征信息存储至预设特征数据库中。Optionally, the above-mentioned processor may also execute the program code of the following steps: comparing the job feature information of the target job with the target job feature information corresponding to the preset computing resource type, and determining the target computing resource according to the comparison result. After the type, the job detail information and system feature information corresponding to the target job are stored in the preset feature database.

可选的,上述处理器还可以执行如下步骤的程序代码:基于资源管理组件向云服务器申请与目标计算资源类型所对应的目标计算资源,其中,资源管理组件用于对目标作业所需的计算资源的生命周期进行管理,云服务器用于对目标作业所需的计算资源进行生产管理;基于资源管理组件向资源调度组件创建任务队列,并基于任务队列向资源调度组件添加目标计算资源;基于资源调度组件所对应的调度策略将目标计算资源分配至目标计算集群的计算节点所对应的任务队列中。Optionally, the above-mentioned processor may also execute the program code of the following steps: apply to the cloud server for the target computing resource corresponding to the target computing resource type based on the resource management component, wherein the resource management component is used for computing required for the target job. The life cycle of resources is managed, and the cloud server is used for production management of computing resources required by target jobs; task queues are created to resource scheduling components based on resource management components, and target computing resources are added to resource scheduling components based on task queues; resource-based The scheduling policy corresponding to the scheduling component allocates the target computing resources to the task queues corresponding to the computing nodes of the target computing cluster.

可选的,上述处理器还可以执行如下步骤的程序代码:在为目标计算集群分配目标计算资源之后,在资源管理组件检测到资源调度组件完成目标作业之后,从任务队列中移除目标计算资源,并向云服务器发送资源释放消息,以释放目标计算资源。Optionally, the above processor may also execute the program code of the following steps: after allocating the target computing resource to the target computing cluster, after the resource management component detects that the resource scheduling component completes the target job, remove the target computing resource from the task queue. , and send a resource release message to the cloud server to release the target computing resources.

可选的,上述处理器还可以执行如下步骤的程序代码:在基于作业特征信息确定目标计算资源类型之后,在目标作业的数量为多个时,根据多个目标作业的作业特征信息创建多个任务队列,其中,每个任务队列对应不同计算资源类型的计算资源;按照多个任务队列所对应的计算资源类型确定每个目标作业所对应的目标计算资源;基于目标计算资源执行多个目标作业。Optionally, the above-mentioned processor may also execute the program code of the following steps: after determining the target computing resource type based on the job feature information, when the number of target jobs is multiple, create multiple target jobs according to the job feature information of the multiple target jobs. A task queue, wherein each task queue corresponds to computing resources of different computing resource types; the target computing resources corresponding to each target job are determined according to the computing resource types corresponding to the multiple task queues; multiple target jobs are executed based on the target computing resources .

可选的,上述处理器还可以执行如下步骤的程序代码:响应作业创建指令,创建目标作业以及执行目标作业的目标计算集群,并显示目标作业的作业特征信息;显示基于作业特征信息所确定的目标计算资源类型;响应资源分配指令,显示为目标计算集群所分配的目标计算资源,其中,目标计算资源为目标计算集群执行目标作业所需的计算资源,目标计算资源的计算资源类型为目标计算资源类型。Optionally, the above-mentioned processor may also execute the program code of the following steps: in response to the job creation instruction, create a target job and a target computing cluster for executing the target job, and display job feature information of the target job; display the job feature information determined based on the job feature information. Target computing resource type; in response to the resource allocation instruction, display the target computing resources allocated to the target computing cluster, where the target computing resources are the computing resources required by the target computing cluster to execute the target job, and the computing resource type of the target computing resources is the target computing resource. Resource Type.

采用本申请实施例,提供了一种用于实施前述实施例中资源分配方法的电子设备。通过基于作业的作业特征信息为每个作业分配不同类计算资源,从而达到了提高资源分配合理性的目的,进而解决了由于现有技术中对所有作业选择同类计算资源造成的资源分配不合理的技术问题。Using the embodiment of the present application, an electronic device for implementing the resource allocation method in the foregoing embodiment is provided. By assigning different types of computing resources to each job based on the job feature information of the job, the purpose of improving the rationality of resource allocation is achieved, and the problem of unreasonable resource allocation caused by selecting the same computing resources for all jobs in the prior art is solved. technical problem.

本领域普通技术人员可以理解,图13所示的结构仅为示意,电子设备也可以是智能手机(如Android手机、iOS手机等)、平板电脑、掌声电脑以及移动互联网设备(MobileInternet Devices,MID)、PAD等终端设备。图13其并不对上述电子装置的结构造成限定。例如,电子设备10还可包括比图13中所示更多或者更少的组件(如网络接口、显示装置等),或者具有与图13所示不同的配置。Those of ordinary skill in the art can understand that the structure shown in FIG. 13 is for illustration only, and the electronic device can also be a smart phone (such as an Android mobile phone, an iOS mobile phone, etc.), a tablet computer, an applause computer, and a Mobile Internet Devices (MID) , PAD and other terminal equipment. FIG. 13 does not limit the structure of the above electronic device. For example, the electronic device 10 may also include more or fewer components than those shown in FIG. 13 (eg, network interfaces, display devices, etc.), or have a different configuration than that shown in FIG. 13 .

本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令终端设备相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:闪存盘、只读存储器(Read-Only Memory,ROM)、随机存取器(RandomAccess Memory,RAM)、磁盘或光盘等。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 instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium can Including: flash disk, read-only memory (Read-Only Memory, ROM), random access device (RandomAccess Memory, RAM), magnetic disk or optical disk, etc.

实施例7Example 7

本申请的实施例还提供了一种计算机可读存储介质。可选地,在本实施例中,上述计算机可读存储介质可以用于保存上述实施例一所提供的资源分配方法所执行的程序代码。Embodiments of the present application also provide a computer-readable storage medium. Optionally, in this embodiment, the above-mentioned computer-readable storage medium may be used to store program codes executed by the resource allocation method provided in the above-mentioned first embodiment.

可选地,在本实施例中,上述计算机可读存储介质可以位于计算机网络中电子设备群中的任意一个电子设备中,或者位于移动终端群中的任意一个移动终端中。Optionally, in this embodiment, the computer-readable storage medium may be located in any electronic device in an electronic device group in a computer network, or in any mobile terminal in a mobile terminal group.

可选地,在本实施例中,存储介质被设置为存储用于执行以下步骤的程序代码:获取目标计算集群待执行的目标作业的作业特征信息;基于作业特征信息确定目标计算资源类型;为目标计算集群分配目标计算资源,其中,目标计算资源为目标计算集群执行目标作业所需的计算资源,目标计算资源的计算资源类型为目标计算资源类型。Optionally, in this embodiment, the storage medium is configured to store program codes for executing the following steps: acquiring job feature information of a target job to be executed by the target computing cluster; determining the target computing resource type based on the job feature information; The target computing cluster allocates target computing resources, wherein the target computing resources are computing resources required by the target computing cluster to execute the target job, and the computing resource type of the target computing resources is the target computing resource type.

可选地,上述计算机可读存储介质还可以存储用于执行以下步骤的程序代码:从资源调度组件所对应的作业列表中获取目标作业的作业信息,其中,资源调度组件用于接收目标对象提交的目标作业,并将目标作业分配至目标计算集群的计算节点中;基于目标计算集群确定目标作业所对应的系统特征信息,其中,作业特征信息至少包括作业信息以及系统特征信息,作业信息至少包括:目标作业运行时的容器依赖信息,系统特征信息至少包括:计算节点的网络带宽、内存占用率。Optionally, the above-mentioned computer-readable storage medium may also store program code for performing the following steps: obtaining job information of the target job from a job list corresponding to the resource scheduling component, wherein the resource scheduling component is used to receive the target object submission. and assign the target job to the computing nodes of the target computing cluster; determine the system feature information corresponding to the target job based on the target computing cluster, wherein the job feature information at least includes job information and system feature information, and the job information at least includes : Container dependency information when the target job is running. The system feature information includes at least: network bandwidth and memory usage of the computing node.

可选地,上述计算机可读存储介质还可以存储用于执行以下步骤的程序代码:基于作业特征信息从预设特征数据库中进行计算资源类型查询,得到查询结果,其中,预设特征数据库中至少存储有历史作业的作业特征信息、计算资源类型,以及历史作业的作业特征信息与计算资源类型之间的关联关系,计算资源类型为目标计算集群执行历史作业所需的计算资源的类型;在查询结果表征预设特征数据库中存在与目标作业的作业特征信息所对应的计算资源类型时,确定预设特征数据库中与目标作业的作业特征信息所对应的计算资源类型为目标计算资源类型;在查询结果表征预设特征数据库中不存在与目标作业的作业特征信息所对应的计算资源类型时,对目标作业的作业特征信息与预设的计算资源类型所对应的目标作业特征信息进行比对,根据比对结果确定目标计算资源类型。Optionally, the above-mentioned computer-readable storage medium may also store program codes for performing the following steps: querying the computing resource type from a preset feature database based on job feature information, and obtaining a query result, wherein at least one of the preset feature database Stores job feature information and computing resource types of historical jobs, as well as the relationship between job feature information of historical jobs and computing resource types. The computing resource type is the type of computing resources required by the target computing cluster to execute historical jobs; The result indicates that when there is a computing resource type corresponding to the job feature information of the target job in the preset feature database, it is determined that the computing resource type corresponding to the job feature information of the target job in the preset feature database is the target computing resource type; The result indicates that when there is no computing resource type corresponding to the job feature information of the target job in the preset feature database, the job feature information of the target job is compared with the target job feature information corresponding to the preset computing resource type. The comparison results determine the target computing resource type.

可选地,上述计算机可读存储介质还可以存储用于执行以下步骤的程序代码:根据目标作业运行时的容器依赖信息确定目标作业的作业运行形式;在作业运行形式表征目标作业运行在容器中时,确定目标计算资源类型为容器化实例计算资源类型,其中,容器化实例计算资源类型表征目标作业运行时依赖于容器。Optionally, the above-mentioned computer-readable storage medium may further store program codes for executing the following steps: determining the job running form of the target job according to the container dependency information when the target job is running; indicating that the target job runs in the container in the job running form. When , the target computing resource type is determined to be the containerized instance computing resource type, wherein the containerized instance computing resource type indicates that the runtime of the target job depends on the container.

可选地,上述计算机可读存储介质还可以存储用于执行以下步骤的程序代码:在作业运行形式表征目标作业未运行在容器中时,检测计算节点的实时最大网络带宽是否大于第一预设带宽,并且,计算节点所对应的平均带宽是否大于第二预设带宽;在实时最大网络带宽大于第一预设带宽,或者,平均带宽大于第二预设带宽时,确定目标计算资源类型为超级计算集群计算资源类型,其中,超级计算集群计算资源类型表征目标作业的运行受网络带宽的影响程度最大。Optionally, the above-mentioned computer-readable storage medium may also store program code for executing the following steps: when the job running form indicates that the target job is not running in the container, detecting whether the real-time maximum network bandwidth of the computing node is greater than a first preset bandwidth, and whether the average bandwidth corresponding to the computing node is greater than the second preset bandwidth; when the real-time maximum network bandwidth is greater than the first preset bandwidth, or when the average bandwidth is greater than the second preset bandwidth, determine that the target computing resource type is super The computing resource type of the computing cluster, wherein the computing resource type of the supercomputing cluster indicates that the running of the target job is most affected by the network bandwidth.

可选地,上述计算机可读存储介质还可以存储用于执行以下步骤的程序代码:在实时最大网络带宽小于或等于第一预设带宽,并且,平均带宽小于或等于第二预设带宽时,检测计算节点的内存占用率是否大于预设占用率;在内存占用率大于预设占用率时,确定目标计算资源类型为物理机计算资源类型;在内存占用率小于或等于预设占用率时,确定目标计算资源类型为虚拟机计算资源类型。Optionally, the above-mentioned computer-readable storage medium can also store program codes for executing the following steps: when the real-time maximum network bandwidth is less than or equal to the first preset bandwidth, and when the average bandwidth is less than or equal to the second preset bandwidth, Detect whether the memory occupancy rate of the computing node is greater than the preset occupancy rate; when the memory occupancy rate is greater than the preset occupancy rate, determine that the target computing resource type is the physical computer computing resource type; when the memory occupancy rate is less than or equal to the preset occupancy rate, Determine the target computing resource type as the virtual machine computing resource type.

可选地,上述计算机可读存储介质还可以存储用于执行以下步骤的程序代码:在对目标作业的作业特征信息与预设的计算资源类型所对应的目标作业特征信息进行比对,根据比对结果确定目标计算资源类型之后,将目标作业对应的作业详情信息以及系统特征信息存储至预设特征数据库中。Optionally, the above-mentioned computer-readable storage medium may also store program codes for performing the following steps: when comparing the job feature information of the target job with the target job feature information corresponding to the preset computing resource type, according to the comparison After determining the target computing resource type from the result, the job detail information and system feature information corresponding to the target job are stored in a preset feature database.

可选地,上述计算机可读存储介质还可以存储用于执行以下步骤的程序代码:基于资源管理组件向云服务器申请与目标计算资源类型所对应的目标计算资源,其中,资源管理组件用于对目标作业所需的计算资源的生命周期进行管理,云服务器用于对目标作业所需的计算资源进行生产管理;基于资源管理组件向资源调度组件创建任务队列,并基于任务队列向资源调度组件添加目标计算资源;基于资源调度组件所对应的调度策略将目标计算资源分配至目标计算集群的计算节点所对应的任务队列中。Optionally, the above-mentioned computer-readable storage medium may also store program codes for performing the following steps: applying to the cloud server for a target computing resource corresponding to the target computing resource type based on the resource management component, wherein the resource management component is used for The life cycle of the computing resources required by the target job is managed, and the cloud server is used for production management of the computing resources required by the target job; a task queue is created to the resource scheduling component based on the resource management component, and added to the resource scheduling component based on the task queue. Target computing resources; the target computing resources are allocated to the task queues corresponding to the computing nodes of the target computing cluster based on the scheduling policy corresponding to the resource scheduling component.

可选地,上述计算机可读存储介质还可以存储用于执行以下步骤的程序代码:在为目标计算集群分配目标计算资源之后,在资源管理组件检测到资源调度组件完成目标作业之后,从任务队列中移除目标计算资源,并向云服务器发送资源释放消息,以释放目标计算资源。Optionally, the above-mentioned computer-readable storage medium can also store program code for executing the following steps: after the target computing resource is allocated to the target computing cluster, after the resource management component detects that the resource scheduling component completes the target job, from the task queue Remove the target computing resources from the server, and send a resource release message to the cloud server to release the target computing resources.

可选地,上述计算机可读存储介质还可以存储用于执行以下步骤的程序代码:在基于作业特征信息确定目标计算资源类型之后,在目标作业的数量为多个时,根据多个目标作业的作业特征信息创建多个任务队列,其中,每个任务队列对应不同计算资源类型的计算资源;按照多个任务队列所对应的计算资源类型确定每个目标作业所对应的目标计算资源;基于目标计算资源执行多个目标作业。Optionally, the above-mentioned computer-readable storage medium may also store program codes for performing the following steps: after determining the target computing resource type based on the job feature information, when the number of target jobs is multiple, according to the number of target jobs. Job feature information creates multiple task queues, wherein each task queue corresponds to computing resources of different computing resource types; the target computing resources corresponding to each target job are determined according to the computing resource types corresponding to the multiple task queues; The resource executes multiple target jobs.

可选地,上述计算机可读存储介质还可以存储用于执行以下步骤的程序代码:响应作业创建指令,创建目标作业以及执行目标作业的目标计算集群,并显示目标作业的作业特征信息;显示基于作业特征信息所确定的目标计算资源类型;响应资源分配指令,显示为目标计算集群所分配的目标计算资源,其中,目标计算资源为目标计算集群执行目标作业所需的计算资源,目标计算资源的计算资源类型为目标计算资源类型。Optionally, the above-mentioned computer-readable storage medium may also store program codes for executing the following steps: in response to a job creation instruction, creating a target job and a target computing cluster for executing the target job, and displaying job feature information of the target job; The target computing resource type determined by the job feature information; in response to the resource allocation instruction, display the target computing resources allocated to the target computing cluster, where the target computing resources are the computing resources required by the target computing cluster to execute the target job, and the target computing resources are The computing resource type is the target computing resource type.

上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The above-mentioned serial numbers of the embodiments of the present application are only for description, and do not represent the advantages or disadvantages of the embodiments.

在本申请的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above-mentioned embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.

在本申请所提供的几个实施例中,应该理解到,所揭露的技术内容,可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The apparatus embodiments described above are only illustrative, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components may be combined or Integration into another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of units or modules, and may be in electrical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.

另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.

所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as an independent product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, and the computer software products are stored in a storage medium , including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes .

以上所述仅是本申请的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本申请的保护范围。The above are only the preferred embodiments of the present application. It should be pointed out that for those skilled in the art, without departing from the principles of the present application, several improvements and modifications can also be made. It should be regarded as the protection scope of this application.

Claims (14)

1. A method for resource allocation, comprising:
acquiring operation characteristic information of a target operation to be executed by a target computing cluster;
determining a target computing resource type based on the job characterization information;
allocating target computing resources to the target computing cluster, wherein the target computing resources are computing resources required by the target computing cluster to execute the target job, and the computing resource type of the target computing resources is the target computing resource type.
2. The method of claim 1, wherein obtaining job characteristics information for a target job to be executed by a target compute cluster comprises:
acquiring the job information of the target job from a job list corresponding to a resource scheduling component, wherein the resource scheduling component is used for receiving the target job submitted by a target object and distributing the target job to the computing nodes of the target computing cluster;
determining system characteristic information corresponding to the target job based on the target computing cluster, wherein the job characteristic information at least comprises the job information and the system characteristic information, and the job information at least comprises: the container dependency information of the target operation runtime, the system characteristic information at least includes: and calculating the network bandwidth and the memory occupancy rate of the node.
3. The method of claim 2, wherein determining a target computing resource type based on the job characterization information comprises:
performing computing resource type query from a preset feature database based on the job feature information to obtain a query result, wherein the preset feature database at least stores job feature information and computing resource types of historical jobs and an incidence relation between the job feature information of the historical jobs and the computing resource types, and the computing resource types are types of computing resources required by the target computing cluster to execute the historical jobs;
when the query result represents that the computing resource type corresponding to the operation feature information of the target operation exists in the preset feature database, determining that the computing resource type corresponding to the operation feature information of the target operation in the preset feature database is the target computing resource type;
and when the query result indicates that the computing resource type corresponding to the operation characteristic information of the target operation does not exist in the preset characteristic database, comparing the operation characteristic information of the target operation with target operation characteristic information corresponding to a preset computing resource type, and determining the target computing resource type according to the comparison result.
4. The method according to claim 3, wherein comparing the job feature information of the target job with target job feature information corresponding to a preset computing resource type, and determining the target computing resource type according to the comparison result comprises:
determining the operation running form of the target operation according to the container dependence information of the target operation running;
when the job run form characterizes that the target job runs in a container, determining that the target computing resource type is a containerized instance computing resource type, wherein the containerized instance computing resource type characterizes that the target job runs in dependence on the container.
5. The method of claim 4, further comprising:
when the operation running form represents that the target operation does not run in the container, detecting whether the real-time maximum network bandwidth of the computing node is larger than a first preset bandwidth or not, and whether the average bandwidth corresponding to the computing node is larger than a second preset bandwidth or not;
when the real-time maximum network bandwidth is larger than the first preset bandwidth, or the average bandwidth is larger than the second preset bandwidth, determining that the target computing resource type is a super computing cluster computing resource type, wherein the super computing cluster computing resource type represents that the running of the target job is influenced by the network bandwidth to the maximum extent.
6. The method of claim 5, further comprising:
when the real-time maximum network bandwidth is smaller than or equal to the first preset bandwidth and the average bandwidth is smaller than or equal to the second preset bandwidth, detecting whether the memory occupancy rate of the computing node is larger than a preset occupancy rate;
when the memory occupancy rate is greater than the preset occupancy rate, determining that the target computing resource type is a physical machine computing resource type;
and when the memory occupancy rate is less than or equal to the preset occupancy rate, determining that the target computing resource type is the virtual machine computing resource type.
7. The method according to any one of claims 4 to 6, wherein after comparing the job characteristic information of the target job with target job characteristic information corresponding to a preset computing resource type and determining the target computing resource type according to the comparison result, the method further comprises:
and storing the operation detail information corresponding to the target operation and the system characteristic information into the preset characteristic database.
8. The method of claim 1, wherein allocating target computing resources for the target computing cluster comprises:
applying for a target computing resource corresponding to the target computing resource type to a cloud server based on a resource management component, wherein the resource management component is used for managing the life cycle of the computing resource required by the target job, and the cloud server is used for performing production management on the computing resource required by the target job;
creating a task queue to a resource scheduling component based on the resource management component, and adding the target computing resource to the resource scheduling component based on the task queue;
and allocating the target computing resource to a task queue corresponding to a computing node of the target computing cluster based on a scheduling policy corresponding to the resource scheduling component.
9. The method of claim 8, wherein after allocating target computing resources for the target computing cluster, the method further comprises:
after the resource management component detects that the resource scheduling component completes the target job, the target computing resource is removed from the task queue, and a resource release message is sent to the cloud server to release the target computing resource.
10. The method of claim 1, wherein after determining a target computing resource type based on the job characterization information, the method further comprises:
when the number of the target jobs is multiple, creating a plurality of task queues according to job characteristic information of the target jobs, wherein each task queue corresponds to computing resources of different computing resource types;
determining a target computing resource corresponding to each target operation according to the computing resource types corresponding to the plurality of task queues;
executing a plurality of the target jobs based on the target computing resources.
11. A method for resource allocation, comprising:
responding to a job creating instruction, creating a target job, executing a target computing cluster of the target job, and displaying job characteristic information of the target job;
displaying a target computing resource type determined based on the job characteristic information;
and responding to a resource allocation instruction, and displaying target computing resources allocated to the target computing cluster, wherein the target computing resources are computing resources required by the target computing cluster to execute the target job, and the computing resource type of the target computing resources is the target computing resource type.
12. A resource allocation system, comprising:
the scheduler is used for receiving a target job submitted by a target object;
the characteristic collection component is used for acquiring the job characteristic information of a target job to be executed by the target computing cluster and determining the type of the target computing resource based on the job characteristic information;
the resource management component is used for determining target computing resources according to the types of the target computing resources, creating a task queue for the scheduler, and then adding the target computing resources to the scheduler based on the task queue;
the scheduler further allocates the target computing resource to a task queue corresponding to a computing node of the target computing cluster based on a preset scheduling policy, so that the computing node in the target computing cluster executes the target job.
13. A computer-readable storage medium, in which a computer program is stored, wherein the computer program is arranged to perform the resource allocation method of any one of claims 1 to 11 when executed.
14. An electronic device, wherein the electronic device comprises one or more processors; memory for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement a method for running a program, wherein the program is arranged to, when running, perform the resource allocation method of any of claims 1 to 11.
CN202210212325.0A 2022-03-04 2022-03-04 Resource allocation method, system, computer-readable storage medium, and electronic device Pending CN114661462A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210212325.0A CN114661462A (en) 2022-03-04 2022-03-04 Resource allocation method, system, computer-readable storage medium, and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210212325.0A CN114661462A (en) 2022-03-04 2022-03-04 Resource allocation method, system, computer-readable storage medium, and electronic device

Publications (1)

Publication Number Publication Date
CN114661462A true CN114661462A (en) 2022-06-24

Family

ID=82026515

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210212325.0A Pending CN114661462A (en) 2022-03-04 2022-03-04 Resource allocation method, system, computer-readable storage medium, and electronic device

Country Status (1)

Country Link
CN (1) CN114661462A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115495249A (en) * 2022-10-31 2022-12-20 上海楷领科技有限公司 Task execution method of cloud cluster
CN115641079A (en) * 2022-10-20 2023-01-24 北京自如信息科技有限公司 Resource data processing method and device, electronic device and storage medium
CN116302452A (en) * 2023-05-18 2023-06-23 苏州浪潮智能科技有限公司 Job scheduling method, system, device, communication device and storage medium
CN117472516A (en) * 2023-12-27 2024-01-30 苏州元脑智能科技有限公司 Virtual resource scheduling method, device, cluster system, electronic equipment and medium
WO2024037173A1 (en) * 2022-08-17 2024-02-22 华为技术有限公司 Scheduler, job scheduling method and related device
CN118860673A (en) * 2024-09-26 2024-10-29 济南浪潮数据技术有限公司 Resource allocation method, device, electronic device, storage medium and program product
WO2024221921A1 (en) * 2023-04-23 2024-10-31 超聚变数字技术有限公司 Task scheduling method, and server and server cluster
CN119356890A (en) * 2024-12-26 2025-01-24 中国石油集团东方地球物理勘探有限责任公司 Method and device for resource management based on seismic operation characteristics in public cloud

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104391749A (en) * 2014-11-26 2015-03-04 北京奇艺世纪科技有限公司 Resource allocation method and device
CN106548262A (en) * 2015-09-21 2017-03-29 阿里巴巴集团控股有限公司 For the dispatching method of the resource of process task, device and system
CN113296929A (en) * 2020-06-29 2021-08-24 阿里巴巴集团控股有限公司 Resource matching method, device and system based on cloud computing

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104391749A (en) * 2014-11-26 2015-03-04 北京奇艺世纪科技有限公司 Resource allocation method and device
CN106548262A (en) * 2015-09-21 2017-03-29 阿里巴巴集团控股有限公司 For the dispatching method of the resource of process task, device and system
CN113296929A (en) * 2020-06-29 2021-08-24 阿里巴巴集团控股有限公司 Resource matching method, device and system based on cloud computing

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024037173A1 (en) * 2022-08-17 2024-02-22 华为技术有限公司 Scheduler, job scheduling method and related device
CN115641079A (en) * 2022-10-20 2023-01-24 北京自如信息科技有限公司 Resource data processing method and device, electronic device and storage medium
CN115495249A (en) * 2022-10-31 2022-12-20 上海楷领科技有限公司 Task execution method of cloud cluster
WO2024221921A1 (en) * 2023-04-23 2024-10-31 超聚变数字技术有限公司 Task scheduling method, and server and server cluster
CN116302452A (en) * 2023-05-18 2023-06-23 苏州浪潮智能科技有限公司 Job scheduling method, system, device, communication device and storage medium
CN116302452B (en) * 2023-05-18 2023-08-22 苏州浪潮智能科技有限公司 Job scheduling method, system, device, communication equipment and storage medium
CN117472516A (en) * 2023-12-27 2024-01-30 苏州元脑智能科技有限公司 Virtual resource scheduling method, device, cluster system, electronic equipment and medium
CN117472516B (en) * 2023-12-27 2024-03-29 苏州元脑智能科技有限公司 Virtual resource scheduling method, device, cluster system, electronic equipment and medium
CN118860673A (en) * 2024-09-26 2024-10-29 济南浪潮数据技术有限公司 Resource allocation method, device, electronic device, storage medium and program product
CN119356890A (en) * 2024-12-26 2025-01-24 中国石油集团东方地球物理勘探有限责任公司 Method and device for resource management based on seismic operation characteristics in public cloud
CN119356890B (en) * 2024-12-26 2025-05-16 中国石油集团东方地球物理勘探有限责任公司 Method and device for resource management based on seismic operation characteristics in public cloud

Similar Documents

Publication Publication Date Title
CN114661462A (en) Resource allocation method, system, computer-readable storage medium, and electronic device
CN111625331B (en) Task scheduling method, device, platform, server and storage medium
JP6373432B2 (en) Real-time optimization of computing infrastructure in virtual environment
CN111338774A (en) Distributed timing task scheduling system and computing device
CN111858054B (en) Resource scheduling system and method based on edge computing in heterogeneous environment
EP3668009A1 (en) Life cycle management method and device for network service
CN112395075B (en) Resource processing method, device and resource scheduling system
KR20160087706A (en) Apparatus and method for resource allocation of a distributed data processing system considering virtualization platform
US20180365075A1 (en) Resource Management Method and Apparatus
US9385964B2 (en) Resource management method and management server
CN108717379A (en) Electronic device, distributed task dispatching method and storage medium
CN107222531A (en) A kind of container cloud resource dispatching method
US20100042723A1 (en) Method and system for managing load in a network
KR20110083084A (en) Server operating device and method using virtualization
CN106713375A (en) Method and device for allocating cloud resources
US8725998B1 (en) Managing host computing devices with a host control component
CN114297067A (en) Script testing method and device
CN107846367A (en) A data transmission method and device
EP3358795B1 (en) Method and apparatus for allocating a virtual resource in network functions virtualization (nfv) network
JP2013196695A (en) Virtual machine allocation system and method of the same
CN115665251B (en) Edge cloud resource allocation method and system
WO2023138513A1 (en) Resource processing method and storage medium
EP3151513A1 (en) Service elastic method and device in cloud computing
CN113934525A (en) Hadoop cluster task scheduling method based on positive and negative feedback load scheduling algorithm
CN117579626B (en) Optimization method and system based on distributed realization of edge calculation

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