A method, device, electronic device and storage medium for processing computing resources
By dynamically allocating computing resources and adjusting resource allocation according to the computing resource utilization rate of the target job, the problem of waste and insufficient resources in the high-performance computing cluster is solved, and the operation efficiency of the job is improved.
Patent Information
- Application Number
- CN202111107663.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-22
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2041-09-22
AI Technical Summary
When allocating computing resources in high-performance computing clusters, there are often problems such as waste of resources or insufficient resources, resulting in reduced operational efficiency.
By periodically counting the computing resource usage rate of the target job, and dynamically allocating the computing resource usage of the target job in the next cycle based on the usage rate, avoiding resource waste and insufficient resources.
It effectively avoids waste and insufficient computing resources, improves the operation efficiency of the job, and ensures the timeliness of the calculation results.
Smart Images

Figure CN113806050B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer job scheduling, and in particular to a method, device, electronic device and storage medium for processing computing resources. Background Art
[0002] High-performance computing clusters generally refer to clusters formed by gathering computing power together to solve big problems in science, engineering or business, thereby providing higher performance than traditional data centers. High-performance computing is provided to fields such as physical chemistry, oil and gas exploration, life sciences, meteorology and environmental protection, and CAE simulation. The computing needs of various fields are generally achieved by uploading application computing jobs to HPC, and these jobs are called HPC jobs. Different HPC jobs in various fields require different types of computing resources, different amounts, and different computing times. In order to make full use of the computing resources in the HPC cluster and reduce the waste of computing resources, the present invention provides a method and device for dynamically allocating computing resources.
[0003] The current HPC computing resource allocation method is generally to allocate a certain amount of computing resources from the resource pool for this job to use. These allocated computing resources are exclusive and cannot be used by other jobs until the computing of this job is completed and released. In this process, the computing resources allocated to this job will not always remain fully utilized, but will fluctuate with the operation of the job, resulting in the following problems:
[0004] The computing resources allocated to a job are greater than the job's requirements, resulting in a waste of computing resources. Alternatively, the computing resources allocated to a job cannot meet the job's computing needs, resulting in a decrease in the job's running efficiency and a delay in the computing results. Summary of the invention
[0005] In order to solve the above technical problems or at least partially solve the above technical problems, the present application provides a method, device, electronic device and storage medium for processing computing resources.
[0006] According to one aspect of an embodiment of the present application, a method for processing computing resources is provided, including:
[0007] Obtaining a target job to which computing resources are to be allocated and an initial computing resource usage corresponding to the target job;
[0008] Allocating computing resources to the target job according to the initial computing resource usage, so that the target job runs in a current cycle;
[0009] Detecting the actual computing resource usage corresponding to the target job when it is running in the current cycle, and calculating the computing resource usage rate of the target job in the current cycle based on the initial computing resource usage and the actual computing resource usage;
[0010] The target computing resource usage amount to be allocated to the target job in the next cycle is determined according to the computing resource usage rate.
[0011] Furthermore, before allocating computing resources to the target job according to the initial computing resource usage so that the target job runs in the current cycle, the method further includes:
[0012] Get the unused computing resources of the computing cluster in the current cycle;
[0013] When the unused computing resources do not satisfy the initial computing resource usage, the target job is stored in a job queue.
[0014] Furthermore, after storing the target job in the job queue, the method further includes:
[0015] Monitor the computing resource usage data of jobs that have been run in the current cycle;
[0016] When it is determined according to the computing resource usage data that there is a computing resource being released, obtaining a computing resource release amount;
[0017] The computing resource release amount is sent to the job queue, so that the job queue compares the computing resource release amount with the initial computing resource usage, and submits the target job when the computing resource release amount meets the initial computing resource usage.
[0018] Furthermore, allocating computing resources to the target job according to the initial computing resource usage so that the target job runs in the current cycle includes:
[0019] In a case where the unused computing resources do not satisfy the initial computing resource usage, computing resources are allocated to the target job according to the initial computing resource usage, so that the target job runs in a current cycle.
[0020] Further, determining the target computing resource usage to be allocated to the target job in the next cycle according to the computing resource usage rate includes:
[0021] When the computing resource usage rate is greater than the preset resource usage rate, obtaining a first corresponding relationship between the preset resource usage rate and the computing resource usage amount;
[0022] Based on the first corresponding relationship, determine the newly added computing resource usage corresponding to the computing resource usage rate;
[0023] The target computing resource usage is determined according to the initial computing resource usage and the newly added computing resource usage.
[0024] Further, determining the target computing resource usage to be allocated to the target job in the next cycle according to the computing resource usage rate includes:
[0025] When the computing resource usage rate is less than the preset resource usage rate, obtaining a second corresponding relationship between the preset resource usage rate and the computing resource usage amount;
[0026] Based on the second corresponding relationship, determining a reduced computing resource usage corresponding to the computing resource usage rate;
[0027] The target computing resource usage is determined according to the initial computing resource usage and the reduced computing resource usage.
[0028] Further, after determining the target computing resource usage to be allocated to the target job in the next cycle according to the computing resource usage rate, the method further includes:
[0029] Obtaining the running progress of the target job at the end of the current cycle;
[0030] Predicting the remaining running time of the target job according to the target computing resource usage and the running progress;
[0031] When the remaining running time is less than the time length corresponding to the next cycle, the target computing resource usage of the target job in the next cycle is increased.
[0032] According to another aspect of an embodiment of the present application, a computing resource processing device is provided, including:
[0033] An acquisition module is used to acquire a target job to which computing resources are to be allocated and an initial computing resource usage corresponding to the target job;
[0034] an allocation module, configured to allocate computing resources to the target job according to the initial computing resource usage, so that the target job runs in a current cycle;
[0035] A detection module, used to detect the actual computing resource usage corresponding to the target job when it is running in the current cycle, and calculate the computing resource usage rate of the target job in the current cycle based on the initial computing resource usage and the actual computing resource usage;
[0036] A processing module is used to determine the computing resources to be allocated to the target job in the next cycle according to the computing resource usage rate.
[0037] According to another aspect of an embodiment of the present application, a storage medium is further provided, which includes a stored program, and the above steps are executed when the program is run.
[0038] According to another aspect of an embodiment of the present application, there is also provided an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; wherein: the memory is used to store computer programs; the processor is used to execute the steps in the above method by running the program stored in the memory.
[0039] The embodiment of the present application also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute the steps in the above method.
[0040] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: the present application periodically counts the computing resource usage rate of the target job, and dynamically allocates the target computing resource usage of the target job in the next cycle according to the computing resource usage rate. This avoids the waste of computing resources, and the situation where computing resources cannot meet the computing needs of the job, resulting in a decrease in job operation efficiency and delays in computing results. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0042] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0043] Figure 1 A flowchart of a method for processing computing resources provided in an embodiment of the present application;
[0044] Figure 2 A flowchart of a method for processing computing resources provided in another embodiment of the present application;
[0045] Figure 3 A flowchart of a method for processing computing resources provided in another embodiment of the present application;
[0046] Figure 4A block diagram of a computing resource processing device provided in an embodiment of the present application;
[0047] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. The schematic embodiments of the present application and their descriptions are used to explain the present application and do not constitute improper limitations on the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0049] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another similar entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0050] The embodiments of the present application provide a method, device, electronic device and storage medium for processing computing resources. The method provided in the embodiments of the present invention can be applied to any required electronic device, for example, it can be an electronic device such as a server or a terminal, which is not specifically limited here. For the convenience of description, it is referred to as an electronic device in the following.
[0051] According to one aspect of an embodiment of the present application, a method embodiment of a method for processing computing resources is provided. Figure 1 A flowchart of a method for processing computing resources provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method includes:
[0052] Step S11, obtaining the target job to which computing resources are to be allocated and the initial computing resource usage corresponding to the target job.
[0053] The computing resource processing method provided in the embodiment of the present application is applied to a high-performance computing cluster, which is used to provide high-performance computing for uploaded jobs in various fields, such as physical chemistry, oil and gas exploration, life sciences, meteorology and environmental protection, etc. Among them, the target job can be a job in the field of physical chemistry, a job in the field of oil and gas exploration, etc.
[0054] In an embodiment of the present application, before uploading a target job, the user will specify an initial computing resource usage corresponding to the target job, wherein the initial computing resource usage can be understood as the minimum computing resource usage required by the target job during operation.
[0055] Step S12, allocating computing resources to the target job according to the initial computing resource usage, so that the target job runs in the current cycle.
[0056] In the embodiment of the present application, step S12, allocating computing resources to the target job according to the initial computing resource usage, so that the target job runs in the current cycle, includes the following steps A1-A2:
[0057] Step A1, obtaining unused computing resources of the computing cluster in the current cycle.
[0058] In an embodiment of the present application, before the high-performance computing cluster allocates computing resources to the target job, it is necessary to obtain the unused computing resources of the high-performance computing cluster in the current cycle. It should be noted that the unused computing resources at this time include: computing resources that have not been used in the current cycle, and computing resources that are currently released.
[0059] Step A2: when the unused computing resources do not meet the initial computing resource usage, the computing resources are allocated to the target job according to the initial computing resource usage, so that the target job runs in the current cycle.
[0060] In an embodiment of the present application, the unused computing resources are compared with the initial computing resource usage. When the unused computing resources meet the initial computing resource usage, the computing resources corresponding to the initial computing resource usage are called from the unused computing resources to be allocated to the target job, so that the target job can run within the current cycle.
[0061] Step S13, detecting the actual computing resource usage corresponding to the target job when it runs in the current cycle, and calculating the computing resource usage rate of the target job in the current cycle based on the initial computing resource usage and the actual computing resource usage.
[0062] In the embodiment of the present application, after the target job runs in the current cycle, the running status of the target job is detected to determine the actual computing resource usage corresponding to the target job running in the current cycle. Then, after obtaining the actual computing resource usage, the ratio between the actual computing resource usage and the initial computing resource usage is calculated, and the ratio is used to determine the computing resource usage rate of the target job in the current cycle.
[0063] Step S14, determining the target computing resource usage to be allocated to the target job in the next cycle according to the computing resource usage rate.
[0064] This application periodically counts the computing resource usage of the target job, and dynamically allocates the target computing resource usage of the target job in the next cycle according to the computing resource usage. This avoids the waste of computing resources and the situation where computing resources cannot meet the computing needs of the job, resulting in a decrease in job operation efficiency and delayed calculation results.
[0065] In the embodiment of the present application, step S14, determining the target computing resource usage to be allocated to the target job in the next cycle according to the computing resource usage rate, includes the following steps B1-B3:
[0066] Step B1, when the computing resource usage rate is greater than the preset resource usage rate, obtain a first corresponding relationship between the preset resource usage rate and the computing resource usage amount.
[0067] In the embodiment of the present application, if the computing resource utilization rate is greater than the preset resource utilization rate, it means that the currently allocated computing resources cannot meet the operation of the target job in the current cycle. In order to ensure that the target job has sufficient computing resources in the next cycle, the embodiment of the present application establishes a first corresponding relationship between the preset resource utilization rate and the computing resource usage when the computing resource utilization rate is greater than the preset resource utilization rate. The first corresponding relationship includes: multiple preset resource utilization rate intervals, and the computing resource usage corresponding to each preset resource utilization rate interval.
[0068] Step B2: Based on the first corresponding relationship, determine the newly added computing resource usage corresponding to the computing resource usage rate.
[0069] In an embodiment of the present application, the computing resource usage corresponding to the computing resource usage rate is queried from the first corresponding relationship, and the computing resource usage is determined as the newly added computing resource usage.
[0070] Step B3, determining the target computing resource usage according to the initial computing resource usage and the newly added computing resource usage.
[0071] In an embodiment of the present application, the sum of the initial computing resource usage and the newly added computing resource usage is calculated, and the sum is determined as the target computing resource usage allocated to the target job in the next cycle.
[0072] In an embodiment of the present application, when the computing resource utilization rate is greater than the preset resource utilization rate, by increasing the computing resource utilization of the target job in the next cycle, the operating efficiency of the target job in the next cycle can be improved, so that the target job can be completed quickly and computing resources can be released.
[0073] In the embodiment of the present application, step S14, determining the target computing resource usage to be allocated to the target job in the next cycle according to the computing resource usage rate, includes the following steps C1-C3:
[0074] Step C1, when the computing resource usage rate is less than the preset resource usage rate, obtain a second corresponding relationship between the preset resource usage rate and the computing resource usage amount.
[0075] In the embodiment of the present application, if the computing resource utilization rate is less than the preset resource utilization rate, it means that the currently allocated computing resources can meet the operation of the target job in the current cycle. In order to avoid the situation where the target job wastes computing resources in the next cycle, the embodiment of the present application establishes a second corresponding relationship between the preset resource utilization rate and the computing resource usage when the computing resource utilization rate is less than the preset resource utilization rate. The second corresponding relationship includes: multiple preset resource utilization rate intervals, and the computing resource usage corresponding to each preset resource utilization rate interval.
[0076] Step C2: based on the second corresponding relationship, determine the reduced computing resource usage corresponding to the computing resource usage rate.
[0077] In an embodiment of the present application, the computing resource usage corresponding to the computing resource usage rate is queried from the second corresponding relationship, and the computing resource usage is determined as the reduced computing resource usage.
[0078] Step C3, determining the target computing resource usage according to the initial computing resource usage and the reduced computing resource usage.
[0079] In an embodiment of the present application, the difference between the initial computing resource usage and the reduced computing resource usage is calculated, and the difference is determined as the target computing resource usage allocated to the target job in the next cycle.
[0080] In the embodiment of the present application, when the computing resource utilization rate is less than the preset resource utilization rate, the computing resource utilization of the target job in the next cycle is reduced to avoid the situation where the target job wastes computing resources.
[0081] In the embodiment of the present application, before allocating computing resources to the target job according to the initial computing resource usage so that the target job runs in the current cycle, Figure 2 As shown, the method also includes:
[0082] Step S21, obtaining unused computing resources of the computing cluster in the current cycle.
[0083] Step S22: When the unused computing resources do not meet the initial computing resource usage, the target job is stored in the job queue.
[0084] In an embodiment of the present application, before the high-performance computing cluster allocates computing resources to the target job, it is necessary to obtain the unused computing resources of the high-performance computing cluster in the current cycle. It should be noted that the unused computing resources at this time include: computing resources that have not been used in the current cycle, and computing resources that are currently released.
[0085] In an embodiment of the present application, the unused computing resources are compared with the initial computing resource usage. When the unused computing resources do not meet the initial computing resource usage, the target job is stored in the job queue to wait for other jobs to complete and release the computing resources. The job queue will collect the computing resource release information, and the job queue will submit the jobs to be run in order.
[0086] In the embodiment of the present application, after storing the target job in the job queue, the method further includes the following steps D1-D3:
[0087] Step D1, monitoring computing resource usage data of jobs that have been run in the current cycle.
[0088] In an embodiment of the present application, the high-performance computing cluster monitors the computing resource usage data of the jobs that have been run in the current cycle, for example: monitoring whether the jobs that have been run in the current cycle release the computing resources they occupy after the running is completed.
[0089] Step D2, when it is determined according to the computing resource usage data that there is computing resource release, obtain the computing resource release amount.
[0090] In an embodiment of the present application, if there are released computing resources in the computing resource usage data, the computing resource release amounts corresponding to the released computing resources are counted.
[0091] Step D3, sending the computing resource release amount to the job queue, so that the job queue compares the computing resource release amount with the initial computing resource usage, and submits the target job when the computing resource release amount meets the initial computing resource usage.
[0092] In an embodiment of the present application, after obtaining the amount of computing resource release, the computing resource release amount will be sent to the job queue so that the job queue compares the computing resource release amount with the initial computing resource usage. When the computing resource release amount meets the initial computing resource usage, the target job is submitted to the high-performance computing cluster so that the high-performance computing cluster allocates computing resources to the target job.
[0093] In the embodiment of the present application, determining the target computing resource usage to be allocated to the target job in the next cycle according to the computing resource usage rate includes the following steps E1-E3:
[0094] Step E1, obtaining the running progress of the target job at the end of the current cycle.
[0095] Step E2: predict the remaining running time of the target job according to the target computing resource usage and running progress.
[0096] Step E3, when the remaining running time is less than the time length corresponding to the next cycle, increase the target computing resource usage of the target job in the next cycle.
[0097] In an embodiment of the present application, the remaining running time of the target job is predicted by the running progress of the target job and the target computing resource usage, and the remaining running time is compared with the time length corresponding to the next cycle. If the remaining running time is less than the time length corresponding to the next cycle, it means that the target job will be completed in the next cycle. At this time, the target computing resource usage of the target job in the next cycle can be increased to ensure that the target job can be completed quickly and the computing resources are released. Among them, increasing the computing resource usage of the target job in the next cycle can be to increase the computing resource usage according to a preset ratio.
[0098] Figure 3 A flowchart of a method for processing computing resources provided in an embodiment of the present application, the method is applied to a job queue, such as Figure 3 As shown, the method includes:
[0099] Step S31, obtaining a target job and an initial computing resource usage corresponding to the target job.
[0100] Step S32, monitoring computing resource release events, and determining the computing resource release amount based on the computing resource release events.
[0101] Step S33: when the computing resource release amount is greater than the initial computing resource usage, the target job is released.
[0102] In an embodiment of the present application, when the unused computing resources do not meet the initial computing resource usage, the target job is stored in the job queue, which can ensure that the job will not be lost. At the same time, the computing resource release amount is determined by monitoring the computing resource release event, and based on the computing resource release amount, it is determined whether the conditions for submitting the job are met, thereby ensuring that the target job is submitted to the high-performance computing cluster in a timely manner after the computing resources are released.
[0103] Figure 4 This is a block diagram of a computing resource processing device provided in an embodiment of the present application. The device can be implemented as part or all of an electronic device through software, hardware, or a combination of both. Figure 4 As shown, the device comprises:
[0104] An acquisition module 41 is used to acquire a target job to which computing resources are to be allocated and an initial computing resource usage corresponding to the target job;
[0105] An allocation module 42, configured to allocate computing resources to a target job according to the initial computing resource usage, so that the target job runs in a current cycle;
[0106] The detection module 43 is used to detect the actual computing resource usage corresponding to the target job when it is running in the current cycle, and calculate the computing resource usage rate of the target job in the current cycle based on the initial computing resource usage and the actual computing resource usage;
[0107] The processing module 44 is used to determine the computing resources to be allocated to the target job in the next cycle according to the computing resource usage rate.
[0108] In an embodiment of the present application, the computing resource processing device also includes: a comparison module for obtaining unused computing resources of the computing cluster in the current cycle; when the unused computing resources do not meet the initial computing resource usage, the target job is stored in the job queue.
[0109] In an embodiment of the present application, the computing resource processing device also includes: a monitoring module for monitoring the computing resource usage data of jobs that have been run in the current cycle; when it is determined based on the computing resource usage data that there is a release of computing resources, obtaining the amount of computing resource release; sending the amount of computing resource release to the job queue so that the job queue compares the amount of computing resource release with the initial computing resource usage, and submits the target job when the amount of computing resource release meets the initial computing resource usage.
[0110] In the embodiment of the present application, the allocation module 42 is used to allocate computing resources to the target job according to the initial computing resource usage when the unused computing resources do not meet the initial computing resource usage, so that the target job runs in the current cycle.
[0111] In an embodiment of the present application, processing module 44 is used to obtain a first corresponding relationship between a preset resource usage rate and a computing resource usage amount when the computing resource usage rate is greater than a preset resource usage rate; based on the first corresponding relationship, determine an additional computing resource usage amount corresponding to the computing resource usage rate; and determine a target computing resource usage amount based on the initial computing resource usage amount and the additional computing resource usage amount.
[0112] In an embodiment of the present application, the processing module 44 is used to obtain a second corresponding relationship between the preset resource usage and the computing resource usage when the computing resource usage is less than the preset resource usage; based on the second corresponding relationship, determine the reduced computing resource usage corresponding to the computing resource usage; and determine the target computing resource usage based on the initial computing resource usage and the reduced computing resource usage.
[0113] In an embodiment of the present application, the computing resource processing device also includes: a prediction module, which is used to obtain the running progress of the target job at the end of the current cycle; predict the remaining running time of the target job based on the target computing resource usage and the running progress; when the remaining running time is less than the time length corresponding to the next cycle, increase the target computing resource usage of the target job in the next cycle.
[0114] The present application also provides an electronic device, such as Figure 5 As shown, the electronic device may include: a processor 1501 , a communication interface 1502 , a memory 1503 and a communication bus 1504 , wherein the processor 1501 , the communication interface 1502 , and the memory 1503 communicate with each other via the communication bus 1504 .
[0115] Memory 1503, used for storing computer programs;
[0116] The processor 1501 is used to implement the steps of the above embodiment when executing the computer program stored in the memory 1503.
[0117] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0118] The communication interface is used for communication between the above terminal and other devices.
[0119] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0120] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0121] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which instructions are stored. When the computer-readable storage medium is executed on a computer, the computer executes the method for processing computing resources described in any of the above embodiments.
[0122] In another embodiment provided by the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute the method for processing computing resources described in any one of the above embodiments.
[0123] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk SolidState Disk), etc.
[0124] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.
[0125] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.
Claims
1. A method for processing computing resources, characterized in that: include: Obtaining a target job to which computing resources are to be allocated and an initial computing resource usage corresponding to the target job; Allocating computing resources to the target job according to the initial computing resource usage, so that the target job runs in a current cycle; Detecting the actual computing resource usage corresponding to the target job when it is running in the current cycle, and calculating the computing resource usage rate of the target job in the current cycle based on the initial computing resource usage and the actual computing resource usage; Determine, according to the computing resource usage rate, a target computing resource usage amount to be allocated to the target job in the next cycle; The step of determining the target computing resource usage to be allocated to the target job in the next cycle according to the computing resource usage rate includes: obtaining a first corresponding relationship between the preset resource usage rate and the computing resource usage rate when the computing resource usage rate is greater than the preset resource usage rate; determining the newly added computing resource usage rate corresponding to the computing resource usage rate based on the first corresponding relationship; and determining the target computing resource usage rate according to the initial computing resource usage rate and the newly added computing resource usage rate. After determining the target computing resource usage to be allocated to the target job in the next cycle according to the computing resource utilization rate, the method further includes: obtaining the running progress of the target job at the end of the current cycle; predicting the remaining running time of the target job according to the target computing resource usage and the running progress; and increasing the target computing resource usage of the target job in the next cycle if the remaining running time is less than the time length corresponding to the next cycle.
2. The method according to claim 1, characterized in that Before allocating computing resources to the target job according to the initial computing resource usage so that the target job runs in the current cycle, the method further includes: Get the unused computing resources of the computing cluster in the current cycle; When the unused computing resources do not satisfy the initial computing resource usage, the target job is stored in a job queue.
3. The method according to claim 2, characterized in that After storing the target job in the job queue, the method further includes: Monitor the computing resource usage data of jobs that have been run in the current cycle; When it is determined according to the computing resource usage data that there is a computing resource being released, obtaining a computing resource release amount; The computing resource release amount is sent to the job queue, so that the job queue compares the computing resource release amount with the initial computing resource usage, and submits the target job if the computing resource release amount meets the initial computing resource usage.
4. The method according to claim 2, characterized in that: The allocating computing resources to the target job according to the initial computing resource usage so that the target job runs in the current cycle includes: In a case where the unused computing resources do not satisfy the initial computing resource usage, computing resources are allocated to the target job according to the initial computing resource usage, so that the target job runs in a current cycle.
5. The method according to claim 1, characterized in that The step of determining the target computing resource usage amount to be allocated to the target job in the next cycle according to the computing resource usage rate includes: When the computing resource usage rate is less than the preset resource usage rate, obtaining a second corresponding relationship between the preset resource usage rate and the computing resource usage amount; Based on the second corresponding relationship, determining a reduced computing resource usage corresponding to the computing resource usage rate; The target computing resource usage is determined according to the initial computing resource usage and the reduced computing resource usage.
6. A computing resource processing device, characterized in that: include: An acquisition module is used to acquire a target job to which computing resources are to be allocated and an initial computing resource usage corresponding to the target job; an allocation module, configured to allocate computing resources to the target job according to the initial computing resource usage, so that the target job runs in a current cycle; A detection module, used to detect the actual computing resource usage corresponding to the target job when it is running in the current cycle, and calculate the computing resource usage rate of the target job in the current cycle based on the initial computing resource usage and the actual computing resource usage; A processing module, configured to determine the computing resources to be allocated to the target job in the next cycle according to the computing resource usage rate; The processing module is used to obtain a first corresponding relationship between the preset resource usage rate and the computing resource usage amount when the computing resource usage rate is greater than the preset resource usage rate; Based on the first corresponding relationship, determine the newly added computing resource usage corresponding to the computing resource usage rate; Determine the target computing resource usage based on the initial computing resource usage and the newly added computing resource usage; The computing resource processing device also includes: a prediction module for obtaining the running progress of the target job at the end of the current cycle; predicting the remaining running time of the target job based on the target computing resource usage and the running progress; and increasing the target computing resource usage of the target job in the next cycle when the remaining running time is less than the time length corresponding to the next cycle.
7. A storage medium, characterized in that: The storage medium includes a stored program, wherein the program executes the method according to any one of claims 1 to 5 when executed.
8. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; wherein: Memory, used to store computer programs; A processor, configured to execute the method according to any one of claims 1 to 5 by running a program stored in a memory.
Citation Information
Patent Citations
Resource scheduling method and device, electronic equipment and storage medium
CN111338785A
Resource allocation method and device, medium and equipment
CN111813545A