Resource allocation method and device, electronic equipment and readable storage medium

By receiving task requirements and obtaining resource usage in the Hadoop distributed system, resource computing tasks are allocated to multiple containers, which solves the problem of resource computing task allocation complexity and achieves efficient allocation and utilization of resources.

CN118708341APending Publication Date: 2024-09-27DUXIAOMAN TECH (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410794614.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-19
Publication Date
2024-09-27

AI Technical Summary

Technical Problem

The resource allocation process of resource computing tasks in the cluster is complicated. Especially when one cluster cannot meet the task requirements, it needs to be distributed to multiple clusters through gateways, which complicates the resource allocation process.

Method used

In the Hadoop distributed system, the task requirements are received, the resource allocation requirements of the resource computing tasks and the resource usage of the current node container are obtained. Based on this information, the resource computing tasks are allocated to multiple containers to avoid directly submitting them to the gateway for distribution.

Benefits of technology

It simplifies the resource allocation process, improves resource utilization efficiency, avoids resource overload and no-load conditions, and reduces the workload of resource allocation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118708341A
    Figure CN118708341A
Patent Text Reader

Abstract

The invention provides a resource allocation method and device, electronic equipment and a readable storage medium, and the method comprises the steps: receiving a resource calculation task generated according to a task demand, and the task demand is a task demand corresponding to a task submitted to a distributed system by a client; obtaining a resource allocation demand of the resource calculation task; the resource use condition of the nodes in the current containers is obtained, and the resource use condition comprises the remaining storage space of the nodes in the containers and the performance parameters and the distribution probability parameters of the containers; and based on the resource use condition, allocating the resource calculation task to the plurality of containers according to the resource allocation demand. According to the resource utilization condition and the resource allocation demand of the node container, the resource allocation is carried out, the resource calculation task is prevented from being submitted to the gateway, and the resource allocation process is simplified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of resource processing technology, and in particular to a resource allocation method, device, electronic device and readable storage medium. Background Art

[0002] A cluster is an environment composed of nodes and data planes. A resource computing task is usually submitted to a cluster and resources are allocated within the cluster. However, if a cluster cannot meet the task requirements of the resource computing task, the resource computing task needs to be submitted to the gateway, which distributes the resource computing task to each cluster, making the resource allocation process of the resource computing task complicated. Summary of the invention

[0003] In view of this, embodiments of the present invention provide a resource allocation method, device, electronic device and readable storage medium to solve the problem of complex resource allocation process of resource computing tasks.

[0004] According to one aspect of the present invention, a resource allocation method is provided, which is applied to a Hadoop distributed system, comprising:

[0005] Receiving a resource computing task generated according to a task requirement, wherein the task requirement is a task requirement corresponding to a task submitted by a client to a distributed system;

[0006] Obtaining resource allocation requirements for the resource computing task;

[0007] Obtaining resource usage of nodes in each current container, wherein the resource usage includes remaining storage space of each node in the container, and performance parameters and allocation probability parameters of the container;

[0008] Based on the resource usage, the resource computing task is allocated to a number of the containers according to the resource allocation requirements.

[0009] Optionally, before obtaining the resource allocation requirement of the resource computing task, the resource allocation method further includes:

[0010] Obtaining historical processing information of the resource computing task or reporting information uploaded by the client;

[0011] The resource allocation requirements of the resource computing task are analyzed and obtained according to the historical processing information or the reporting information.

[0012] Optionally, after allocating the resource computing task to a plurality of the containers based on the resource usage and according to the resource allocation requirement, the resource allocation method further includes:

[0013] Obtaining real-time resource usage of the container at preset time intervals;

[0014] The resource allocation demand is allocated to a plurality of the containers according to the real-time resource usage.

[0015] Optionally, after obtaining the resource allocation requirement of the resource computing task, the resource allocation method further includes:

[0016] Obtaining demand information for a first container in the resource allocation demand, where the first container is a pre-marked container type;

[0017] Migrating the historical tasks in the first container to other idle containers according to the demand information;

[0018] The computing task is allocated to the first container.

[0019] According to a second aspect of the present invention, there is provided a resource allocation device, which is applied to a Hadoop distributed system and comprises:

[0020] A first receiving module is used to receive a resource computing task generated according to a task requirement, where the task requirement is a task requirement corresponding to a task submitted by a client to a distributed system;

[0021] A second receiving module is used to obtain the resource allocation requirements of the resource computing task;

[0022] A third receiving module is used to obtain resource usage of nodes in each current container, wherein the resource usage includes the remaining storage space of each node in the container, and the performance parameters and allocation probability parameters of the container;

[0023] The first processing module is used to allocate the resource computing task to a plurality of the containers based on the resource usage and according to the resource allocation requirement.

[0024] Optionally, the resource allocation device further includes:

[0025] A fourth receiving module, used to obtain the historical processing information of the resource computing task or the reporting information uploaded by the client;

[0026] The second processing module is used to analyze and obtain the resource allocation requirements of the resource computing task according to the historical processing information or the reporting information.

[0027] Optionally, the resource allocation device further includes:

[0028] A third processing module is used to obtain the real-time resource usage of the container at a preset time interval;

[0029] The fourth processing module is used to allocate the resource allocation demand to a plurality of the containers according to the real-time resource usage.

[0030] Optionally, the resource allocation device further includes:

[0031] A fifth receiving module, configured to obtain demand information for a first container in the resource allocation demand, where the first container is a pre-marked container type;

[0032] A fifth processing module, configured to migrate the historical tasks in the first container to other idle containers according to the demand information;

[0033] A sixth processing module is used to distribute the computing task to the first container.

[0034] According to a third aspect of the present invention, there is provided an electronic device, comprising:

[0035] Processor; and

[0036] Memory for storing programs,

[0037] The program includes instructions, and when the instructions are executed by a processor, the processor executes any one of the methods according to the first aspect of the present invention.

[0038] According to a fourth aspect of the present invention, there is provided a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute any method according to the first aspect of the present invention.

[0039] One or more technical solutions provided in the embodiments of the present invention generate resource computing tasks according to the task requirements corresponding to the tasks when the Hadoop distributed system receives the tasks submitted by the client to the distributed system. Then the resource allocation requirements of the resource computing tasks are obtained, and the resource usage of each node container is obtained. Then the resource computing tasks are allocated to several containers of each node based on the resource usage and resource allocation requirements of the node container. The present invention uses the Hadoop distributed system to allocate resources according to the resource usage and resource allocation requirements of the node container, avoids submitting the resource computing tasks to the gateway, and simplifies the resource allocation process. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] Further details, features and advantages of the invention are disclosed in the following description of exemplary embodiments in conjunction with the accompanying drawings, in which:

[0041] Figure 1 A flow chart of a resource allocation method according to an exemplary embodiment of the present invention is shown;

[0042] Figure 2 A distributed system composition diagram according to an exemplary embodiment of the present invention is shown;

[0043] Figure 3 A schematic block diagram of a resource allocation device according to an exemplary embodiment of the present invention is shown;

[0044] Figure 4 A block diagram of an exemplary electronic device that can be used to implement an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0045] Embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments of the present invention are only for exemplary purposes and are not intended to limit the scope of protection of the present invention.

[0046] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.

[0047] The term "including" and its variations used in this document are open inclusions, that is, "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions of other terms will be given in the following description. It should be noted that the concepts of "first", "second", etc. mentioned in the present invention are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0048] It should be noted that the modifications of "one" and "plurality" mentioned in the present invention are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0049] The names of the messages or information exchanged between multiple devices in the embodiments of the present invention are only used for illustrative purposes, and are not used to limit the scope of these messages or information.

[0050] The solution of the present invention is described below with reference to the accompanying drawings, and the technical solution provided by the embodiment of the present invention is explained in detail through specific embodiments and their application scenarios.

[0051] In the case of resource allocation for distributed computing tasks, the conventional method is for the Hadoop distributed system to provide two scheduling plug-ins, one of which adopts fair scheduling and the other adopts capacity scheduling. However, the resource allocation requirements of actual resource computing tasks are relatively complex. The fair scheduling method cannot be applied to all resource computing tasks, and the capacity scheduling method cannot take into account the resource allocation requirements of resource computing tasks. In addition, the development of scheduling plug-ins will increase the workload of resource allocation.

[0052] In view of this, the present invention provides a resource allocation method, device, electronic device and readable storage medium, wherein the resource allocation method is applied to any electronic device with resource allocation function, and the electronic device includes but is not limited to: personal mobile terminal device, computer or server device, etc.

[0053] like Figure 1 As shown, Figure 1 1 is a flow chart of a resource allocation method provided by an embodiment of the present invention. The resource allocation method is applied to a Hadoop distributed system and may include the following steps S101 to S104:

[0054] S101, receiving a resource computing task generated according to a task requirement, where the task requirement is a task requirement corresponding to a task submitted by a client to a distributed system.

[0055] As an implementation method, the Hadoop distributed system is a distributed computing platform that allows clients to easily build and use it. Clients can easily develop and run applications that process massive data on the Hadoop distributed system. The three core components of the Hadoop distributed system include: storage system (HDFS, Hadoop Distributed FileSystem), computing link MapReduce, and resource scheduling platform YARN. Among them, the storage system HDFS is used to store data. The computing link MapReduce refers to the process of calculating the data stored in the storage system, including data reading, processing and output. The resource scheduling platform YARN refers to the process of allocating resource computing tasks to each node in the cluster for processing, including task scheduling, resource management, etc. The resource scheduling platform YARN is one of the core components of the Hadoop distributed system. It is used for resource management and scheduling of distributed computing tasks, enabling the Hadoop distributed system to handle more types of workloads and provide server computing resources for computing programs.

[0056] When the Hadoop distributed system receives a task submitted by a client, it analyzes the task requirements and generates corresponding resource computing tasks based on the task requirements.

[0057] As a specific implementation method, the resource scheduling platform YARN includes three components: resource manager (RM), node manager NodeManager and application manager ApplicationMaster. The resource manager RM is used to allocate and schedule global resources of the Hadoop distributed system to ensure that multiple tasks can share the cluster. The cluster is obtained by dividing the global resources of the Hadoop distributed system, and each cluster has its own properties.

[0058] When the client submits task A to the Hadoop distributed system, if task A is generated based on user consumption behavior, the data of task A is stored in the storage system HDFS. The computing link MapReduce processes the stored data of task A and obtains the task requirement of task A as a behavioral analysis of the user consumption behavior, and generates a resource computing task for task A based on the behavioral analysis. The resource computing task is then received by the resource manager RM in the resource scheduling platform YARN.

[0059] S102: Obtain resource allocation requirements for resource computing tasks.

[0060] As an implementation method, the storage system HDFS of the Hadoop distributed system stores the resource information required by Task A. The resource information identifies the number of clusters and cluster requirements required by Task A, and also identifies the priority level of resource calculation for Task A. Then the resource scheduling platform YARN receives the resource information and generates the resource allocation requirements for the resource calculation tasks corresponding to Task A.

[0061] As a specific implementation method, the client submits Task A to the Hadoop distributed system. The MapReduce computing link in the Hadoop distributed system will analyze and process Task A, obtain the number of clusters and cluster requirements required by Task A, and obtain the priority level of resource calculation for Task A based on the content submitted by the client. The priority level of resource calculation for Task A can also be obtained by the MapReduce computing link. After the MapReduce computing link outputs the processing results, the resource scheduling platform YARN receives the processed resource information.

[0062] S103, obtaining resource usage of nodes in each current container, where the resource usage includes the remaining storage space of each node in the container, as well as performance parameters and allocation probability parameters of the container.

[0063] As an implementation method, the node manager NodeManager in the resource scheduling platform YARN obtains the resource usage of each container. A container is a data structure that can be used to store and organize multiple elements. A node is a basic unit for storing data in the container data structure. Usually, a container consists of multiple nodes, each of which contains a value or other data, and a pointer to the next node.

[0064] The resource usage obtained by the node manager NodeManager includes the remaining storage space for storing data in each node in each container, which is used to determine which nodes the resource computing task can be allocated to. The resource usage obtained by the node manager NodeManager also includes the performance parameters and allocation probability parameters of each container. Since containers are divided into two categories, sequence containers and associated containers, different types of containers have different performances. The performance parameters in this embodiment are used to characterize the ability of the corresponding container to process various resource computing tasks, and different allocation probabilities are pre-set for each container according to the different processing capabilities of each container, so as to ensure that resource computing tasks can be preferentially allocated to containers with idle nodes and the best performance.

[0065] S104, based on resource usage, allocate resource computing tasks to a number of containers according to resource allocation requirements.

[0066] As an implementation method, after obtaining the resource usage of each container, the node manager NodeManager allocates the resource computing tasks of Task A to the containers that meet the cluster quantity and cluster requirements, have idle nodes and the best performance according to the priority level, based on the number of clusters and cluster requirements obtained by MapReduce in the computing link, as well as the priority level of Task A, so as to achieve the purpose of resource allocation according to resource usage and resource allocation requirements.

[0067] As a specific implementation method, if the number of clusters and cluster requirements required for the resource allocation demand of task A obtained by MapReduce in the calculation link are determined, whether the priority of the current task A is at the top, if not, the resource calculation task of task A waits until the priority of task A is the first. Then the node manager NodeManager obtains the resource usage of each container at this moment. For example, in container X, nodes such as x1, x3, and x8 are idle, and in container Y, nodes such as y5, y6, y7, y9, and y11 are idle. A container that meets the number of clusters and cluster requirements is selected from the idle containers, and the resource calculation task of task A is allocated to the selected container.

[0068] In one embodiment of the present invention, before obtaining the resource allocation requirement of the resource computing task in S102, the resource allocation method further includes:

[0069] S102a, obtaining historical processing information of resource computing tasks or reporting information uploaded by the client;

[0070] S102b: Analyze and obtain resource allocation requirements of the resource computing task based on historical processing information or reporting information.

[0071] As an implementation method, when submitting Task A, the client uploads the report information of Task A. The report information refers to information that can reflect the number of clusters, cluster requirements and priority levels required for Task A. The report information is pre-set by the user of the client to achieve the purpose of manually setting cluster requirements and manually setting priority levels. The client submits Task A and the report information of Task A, so that the MapReduce computing link in the Hadoop distributed system can analyze the report information of Task A to obtain the number of clusters, cluster requirements and priority levels required for Task A.

[0072] As an implementation method, if the Hadoop distributed system is not the first time to receive the resource computing task of Task A, it means that the historical processing information of Task A is stored in the storage system HDFS. Therefore, when Task A submitted by the client is received, the historical processing information of Task A is obtained from the storage HDFS, and the computing link MapReduce in the Hadoop distributed system analyzes the historical processing information of Task A to obtain the number of clusters, cluster requirements and priority level required for Task A.

[0073] In one embodiment of the present invention, S104, after allocating resource computing tasks to a plurality of containers according to resource allocation requirements based on resource usage, the resource allocation method further includes:

[0074] S104a, obtaining real-time resource usage of the container at preset time intervals;

[0075] S104b, allocating resource allocation requirements to a number of containers according to real-time resource usage.

[0076] As an implementation method, after the resource computing task of task A is allocated, it is necessary to obtain the real-time resource usage of the container at a preset time interval, that is, monitor the changes in the idle state of each node in the container, and then allocate task A from each node of the original container to the idle nodes in other containers according to the real-time resource usage, or allocate task A from each node of the original container to the idle nodes in the original container. If it is allocated to the idle nodes of other containers, the container needs to meet the resource allocation requirements of task A.

[0077] This embodiment achieves the purpose of adjusting the running containers in real time according to the idle changes of the containers after task A allocates resources, avoiding the situation where the running containers are overloaded and the remaining containers are idle, and allocating the resource computing tasks to multiple containers that meet the resource allocation requirements as much as possible, reducing the probability of the container itself being overloaded.

[0078] As a specific implementation method, the node manager NodeManager obtains the resource usage of each container at this moment, selects containers that meet the cluster quantity and cluster requirements from the idle containers, such as container w1, container w2, container w3 and container w4, and allocates the resource computing task of task A to the selected containers w1, container w2, container w3 and container w4. After that, the node manager NodeManager obtains the resource usage of each container in real time. If the resource usage indicates that container w1 and container w2 are about to be fully loaded, and container w5 and container w6 are idle, the resource computing task of task A is allocated from container w1 and container w2 to container w5 and container w6 to reduce the burden of container w1 and container w2, among which container w5 and container w6 also meet the resource allocation requirements of task A.

[0079] In one embodiment of the present invention, after obtaining the resource allocation requirements of the resource computing task in S104, the resource allocation method further includes:

[0080] S104c, obtaining demand information for a first container in a resource allocation demand, where the first container is a pre-marked container type;

[0081] S104d, migrating historical tasks in the first container to other idle containers according to the demand information;

[0082] S104e, allocating the computing task to the first container.

[0083] As an implementation method, different containers are marked differently in advance. If the resource allocation requirements of task A specify the requirements for a certain identified first container, that is, the resource computing task of processing task A must require the participation of the first container, then the historical tasks running in the first container are migrated to other idle containers to achieve the purpose of freeing up the first container for the resource computing task of task A, and then the resource computing task of task A is allocated to the first container. In this implementation, the resource allocation requirements of the historical tasks do not include the limitation of the first container.

[0084] As a specific implementation method, in the resource allocation requirements of task A, the cluster requirement is to allocate at least one first container. Then select an idle first container from the many containers and allocate the resource computing task of task A to it. If there is no idle first container, select the first container that runs historical task B, migrate historical task B to other containers that meet the resource allocation requirements of historical task B, and allocate the resource computing task of task A to the vacant first container. Among them, the resource requirements of historical task B do not limit the allocation to the first container.

[0085] The resource allocation method provided in the embodiment of the present invention generates a resource computing task according to the task requirements corresponding to the task when the Hadoop distributed system receives the task submitted by the client to the distributed system. Then the resource allocation requirements of the resource computing task are obtained, and the resource usage of each node container is obtained. Then the resource computing task is allocated to several containers of each node based on the resource usage and resource allocation requirements of the node container. The present invention uses the Hadoop distributed system to allocate resources according to the resource usage and resource allocation requirements of the node container, avoids submitting the resource computing task to the gateway, and simplifies the resource allocation process.

[0086] Corresponding to the above embodiment, see Figure 3 The embodiment of the present invention further provides a resource allocation device 300, which is applied to a Hadoop distributed system. The resource allocation device 300 includes:

[0087] The first receiving module 301 is used to receive a resource computing task generated according to a task requirement, where the task requirement is a task requirement corresponding to a task submitted by a client to a distributed system;

[0088] The second receiving module 302 is used to obtain the resource allocation requirements of the resource computing task;

[0089] The third receiving module 303 is used to obtain the resource usage of the nodes in each current container, where the resource usage includes the remaining storage space of each node in the container, and the performance parameters and allocation probability parameters of the container;

[0090] The first processing module 304 is used to allocate resource computing tasks to a number of containers based on resource usage and resource allocation requirements.

[0091] Optionally, the resource allocation device 300 further includes:

[0092] The fourth receiving module 305 is used to obtain historical processing information of resource computing tasks or reporting information uploaded by the client;

[0093] The second processing module 306 is used to analyze and obtain the resource allocation requirements of the resource computing task according to the historical processing information or the reporting information.

[0094] Optionally, the resource allocation device 300 further includes:

[0095] The third processing module 307 is used to obtain the real-time resource usage of the container according to a preset time interval;

[0096] The fourth processing module 308 is used to allocate resource allocation requirements to a number of containers according to real-time resource usage.

[0097] Optionally, the resource allocation device 300 further includes:

[0098] A fifth receiving module 309 is used to obtain demand information for a first container in a resource allocation demand, where the first container is a pre-marked container type;

[0099] A fifth processing module 310 is used to migrate the historical tasks in the first container to other idle containers according to the demand information;

[0100] The sixth processing module 311 is used to distribute the computing task to the first container.

[0101] The resource allocation device provided in the embodiment of the present invention generates a resource computing task according to the task requirements corresponding to the task when the Hadoop distributed system receives the task submitted by the client to the distributed system. Then the resource allocation requirements of the resource computing task are obtained, and the resource usage of each node container is obtained. Then the resource computing task is allocated to several containers of each node based on the resource usage and resource allocation requirements of the node container. The present invention uses the Hadoop distributed system to allocate resources according to the resource usage and resource allocation requirements of the node container, avoids submitting the resource computing task to the gateway, and simplifies the resource allocation process.

[0102] The exemplary embodiment of the present invention also provides an electronic device, comprising: at least one processor; and a memory connected to the at least one processor in communication. The memory stores a computer program that can be executed by the at least one processor, and the computer program is used to cause the electronic device to perform the method according to the embodiment of the present invention when executed by the at least one processor.

[0103] Exemplary embodiments of the present invention also provide a non-transitory computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor of a computer, is used to cause the computer to perform a method according to an embodiment of the present invention.

[0104] An exemplary embodiment of the present invention further provides a computer program product, including a computer program, wherein the computer program is used to cause the computer to perform a method according to an embodiment of the present invention when executed by a processor of a computer.

[0105] refer to Figure 4 , a block diagram of an electronic device 400 that can be used as a server or client of the present invention will now be described, which is an example of a hardware device that can be applied to various aspects of the present invention. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0106] like Figure 4 As shown, the electronic device 400 includes a computing unit 401, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 402 or a computer program loaded from a storage unit 408 into a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the electronic device 400 can also be stored. The computing unit 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.

[0107] A plurality of components in the electronic device 400 are connected to the I / O interface 405, including: an input unit 406, an output unit 407, a storage unit 408, and a communication unit 409. The input unit 406 may be any type of device capable of inputting information to the electronic device 400, and the input unit 406 may receive input digital or character information, and generate key signal inputs related to user settings and / or function control of the electronic device. The output unit 407 may be any type of device capable of presenting information, and may include, but is not limited to, a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 408 may include, but is not limited to, a disk, an optical disk. The communication unit 409 allows the electronic device 400 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks, and may include, but is not limited to, a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or a chipset, such as a Bluetooth™ device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.

[0108] The computing unit 401 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a central processing module (CPU), a graphics processing module (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 401 performs the various methods and processes described above. For example, in some embodiments, the resource allocation method may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 408. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 400 via the ROM 402 and / or the communication unit 409. In some embodiments, the computing unit 401 may be configured to perform the resource allocation method in any other appropriate manner (e.g., by means of firmware).

[0109] The program code for implementing the method of the present invention can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer or other programmable resource allocation device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code can be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.

[0110] In the context of the present invention, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0111] As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and / or device (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.

[0112] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0113] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0114] A computer system may include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship to each other.

Claims

1. A resource allocation method, applied to Hadoop distributed system, characterized in that: include: Receiving a resource computing task generated according to a task requirement, wherein the task requirement is a task requirement corresponding to a task submitted by a client to a distributed system; Obtaining resource allocation requirements for the resource computing task; Obtaining resource usage of nodes in each current container, wherein the resource usage includes remaining storage space of each node in the container, and performance parameters and allocation probability parameters of the container; Based on the resource usage, the resource computing task is allocated to a number of the containers according to the resource allocation requirements.

2. The resource allocation method according to claim 1, characterized in that: Before obtaining the resource allocation requirement of the resource computing task, the resource allocation method further includes: Obtaining historical processing information of the resource computing task or reporting information uploaded by the client; The resource allocation requirements of the resource computing task are analyzed and obtained according to the historical processing information or the reporting information.

3. The resource allocation method according to claim 1, characterized in that: After allocating the resource computing task to a plurality of the containers based on the resource usage and according to the resource allocation requirement, the resource allocation method further includes: Obtaining real-time resource usage of the container at preset time intervals; The resource allocation demand is allocated to a plurality of the containers according to the real-time resource usage.

4. The resource allocation method according to claim 1, characterized in that: After obtaining the resource allocation requirement of the resource computing task, the resource allocation method further includes: Obtaining demand information for a first container in the resource allocation demand, where the first container is a pre-marked container type; Migrating the historical tasks in the first container to other idle containers according to the demand information; The computing task is allocated to the first container.

5. A resource allocation device, applied to a Hadoop distributed system, characterized in that: include: A first receiving module is used to receive a resource computing task generated according to a task requirement, where the task requirement is a task requirement corresponding to a task submitted by a client to a distributed system; A second receiving module is used to obtain the resource allocation requirements of the resource computing task; A third receiving module is used to obtain resource usage of nodes in each current container, wherein the resource usage includes the remaining storage space of each node in the container, and the performance parameters and allocation probability parameters of the container; The first processing module is used to allocate the resource computing task to a plurality of the containers based on the resource usage and according to the resource allocation requirement.

6. The resource allocation device according to claim 5, characterized in that: The resource allocation device further includes: A fourth receiving module, used to obtain the historical processing information of the resource computing task or the reporting information uploaded by the client; The second processing module is used to analyze and obtain the resource allocation requirements of the resource computing task according to the historical processing information or the reporting information.

7. The resource allocation device according to claim 5, characterized in that: The resource allocation device further includes: A third processing module is used to obtain the real-time resource usage of the container at a preset time interval; The fourth processing module is used to allocate the resource allocation demand to a plurality of the containers according to the real-time resource usage.

8. The resource allocation device according to claim 5, characterized in that: The resource allocation device further includes: A fifth receiving module, configured to obtain demand information for a first container in the resource allocation demand, where the first container is a pre-marked container type; A fifth processing module, configured to migrate the historical tasks in the first container to other idle containers according to the demand information; A sixth processing module is used to distribute the computing task to the first container.

9. An electronic device, comprising: processor; as well as Memory for storing programs, The program includes instructions, which, when executed by the processor, cause the processor to perform the method according to any one of claims 1 to 4.

10. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to make a computer execute the method according to any one of claims 1-4.