A method, apparatus, and device for batch resource allocation in an application.
By adjusting the order of target applications and incorporating time-related factors, the problem of low efficiency in container resource allocation on elastic cloud servers was solved, achieving efficient resource utilization and allocation.
Patent Information
- Application Number
- CN202410661629.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-27
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2044-05-27
AI Technical Summary
Existing technologies are inefficient and prone to errors when allocating container resources on elastic cloud servers, resulting in resource waste and making it difficult to meet the requests of large-scale tenants and improve resource utilization.
By receiving resource allocation requests, the initial utilization status is determined based on the initial arrangement order of the target applications. The arrangement order is adjusted and combined with the time influence factor, and the process is repeated until the preset application conditions are met. Finally, computing resources are allocated in sequence.
It enables improved resource utilization and avoidance of resource waste under the demand for large-scale resource allocation, and completes the allocation of large-scale resources quickly and effectively.
Smart Images

Figure CN118631900B_ABST
Abstract
Description
Technical Field
[0001] The embodiments in this specification relate to the field of cloud computing technology, and in particular to a method, apparatus and device for batch allocation of resources for applications. Background Technology
[0002] With the development of cloud computing and container technologies, the deployment and management of applications through containerization has become widely adopted. Cloud platforms provide elastic cloud servers that can be automatically acquired and scaled elastically to meet the needs of different tenants. These elastic cloud servers have containers of corresponding sizes based on the tenant's requirements. Since container resource utilization has a significant impact on both performance and cost, accurately determining the size of the allocated containers is crucial.
[0003] Currently, the most common methods for providing elastic cloud server specifications are manually adjusting container resource quotas or using an initial adaptation approach. However, given the large number of resource clusters and host machines, these methods are inefficient and prone to errors. Furthermore, they often result in a significant amount of unused resources in containers after template deployment, failing to achieve effective resource conservation. Therefore, to accommodate more tenant requests and improve resource utilization, a more efficient method for allocating container resources is urgently needed. Summary of the Invention
[0004] The purpose of the embodiments in this specification is to provide a method, apparatus, and device for batch allocation of resources for applications, so as to solve the problem of how to effectively allocate container resources to applications in batches.
[0005] To address the aforementioned technical problems, embodiments of this specification provide a method for batch resource allocation for applications, comprising: receiving a resource allocation request; the resource allocation request being used to request the allocation of computing resources to multiple target applications; determining the initial utilization status of the target applications to the idle resource list based on the initial arrangement order of the target applications; adjusting the arrangement order of each target application and determining the re-utilization status corresponding to the idle resource list after adjustment; further adjusting the arrangement order of each target application based on the relationship between the initial utilization status and the re-utilization status, combined with a time influence factor; the time influence factor changing over time; repeatedly executing the steps of determining the re-utilization status, calculating the relationship between the initial utilization status and the re-utilization status, and adjusting the arrangement order until a preset application condition is met; and sequentially allocating the computing resources in the idle resource list to each target application according to the current arrangement order of the target applications.
[0006] In some implementations, adjusting the order of the target applications includes: swapping the positions of the corresponding target applications, shifting the corresponding multiple target applications, or reversing the order of the corresponding multiple target applications.
[0007] In some implementations, the step of readjusting the order of each target application based on the relationship between the initial use status and the reuse status, combined with the time influence factor, includes: if the reuse status is better than the initial use status, readjusting the order based on the adjusted order; or, if the initial use status is better than the reuse status, determining the probability of order change based on the time influence factor; and deciding whether to readjust the initial order or readjust the order based on the probability of order change according to the probability of order change.
[0008] Based on the above implementation method, the time influence factor decreases over time; correspondingly, the probability of the arrangement order changing decreases over time.
[0009] In some implementations, before determining the initial utilization status of the target application to the idle resource list by the initial arrangement order of the target application, the method further includes: determining resource information in the idle resource list; the resource information includes at least one of resource type, resource specification, and resource utilization rate; and constructing an initial arrangement order corresponding to the target application based on the resource information.
[0010] Based on the above implementation, the step of constructing an initial arrangement order corresponding to the target application based on the resource information includes: randomly generating at least two candidate arrangement orders; calculating resource fitness based on the resource information and the candidate arrangement orders; the resource fitness is used to describe the utilization rate of the target application for each idle resource; and integrating different candidate arrangement orders to obtain an initial arrangement order based on the resource fitness differences between different candidate arrangement orders.
[0011] Based on the foregoing implementation, constructing an initial arrangement order corresponding to the target application based on the resource information includes: determining specific resource requirements in the target application; the specific resource requirements are used to request computing resources of a specific specification; and constructing an initial arrangement order corresponding to the target application in combination with the specific resource requirements.
[0012] In some implementations, the preset application conditions include the number of repetitions reaching a preset number of cycles or the number of times the current utilization status is maintained reaching a preset maintenance threshold.
[0013] In some implementations, each target application corresponds to an elastic container; the specifications and resource quotas of the elastic container are adapted to the target application; the list of idle resources corresponds to an idle virtual machine; the virtual machine is used to place at least one of the elastic containers to achieve resource allocation to the elastic container.
[0014] This specification also proposes a resource batch allocation device for applications, comprising: a resource allocation request receiving module for receiving resource allocation requests; the resource allocation requests are for requesting the allocation of computing resources to multiple target applications; an initial utilization status determination module for determining the initial utilization status of target applications to the idle resource list based on the initial arrangement order of the target applications; a re-utilization status determination module for adjusting the arrangement order of each target application and determining the re-utilization status corresponding to the idle resource list after adjustment; an arrangement order readjustment module for readjusting the arrangement order of each target application based on the change relationship between the initial utilization status and the re-utilization status, combined with a time influence factor; the time influence factor changes over time; a repetition execution module for repeatedly executing the steps of determining the re-utilization status, calculating the change relationship, and adjusting the arrangement order until a preset application condition is met; the preset application condition is used to limit the resource utilization effect corresponding to the current arrangement order; and a resource allocation calculation module for sequentially allocating computing resources in the idle resource list to each target application according to the current arrangement order of each target application.
[0015] This specification also provides an electronic device, including a memory and a processor; the memory is used to store computer programs / instructions; the processor is used to execute the computer programs / instructions to implement the steps of the above-described resource batch allocation method for applications.
[0016] This specification also provides an embodiment of a computer storage medium storing a computer program / instruction, which, when executed, implements the steps of the above-described resource batch allocation method for an application.
[0017] This specification also provides a computer program product, including a computer program / instruction, which, when executed, implements the steps of the above-described resource batch allocation method for the application.
[0018] As can be seen from the technical solutions provided in the embodiments of this specification above, the resource batch allocation method for applications in the embodiments of this specification, upon receiving a resource allocation request, first completes the initial allocation of idle resources based on the initial order of the target applications and determines the corresponding resource utilization status; then, by adjusting the arrangement order of the target applications and determining the corresponding resource utilization status, the order of the target applications is adjusted accordingly by comparing the differences in resource utilization status before and after the order adjustment. Simultaneously, by introducing a time influence factor, it ensures that the order can adapt to various situations as much as possible. Multiple iterations are repeated until the preset application conditions are met, and then the allocation of computing resources is completed according to the final arrangement order of the target applications. Through the above method, in the case of a large-scale resource allocation requirement, by analyzing the resource utilization status of applications under different arrangement orders, the utilization rate during the final resource allocation is effectively guaranteed, while avoiding the time consumed by configuring containers of corresponding specifications for each application sequentially. This allows for fast and efficient completion of batch resource allocation for applications, demonstrating good practical application results. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments or prior art of this specification, the drawings used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a flowchart illustrating a method for batch resource allocation for an application, as described in this specification.
[0021] Figure 2 This is a schematic diagram of the overall architecture of a resource batch allocation system for an application, as described in an embodiment of this specification.
[0022] Figure 3 This is a block diagram of a resource batch allocation device for an application, as described in an embodiment of this specification. Detailed Implementation
[0023] The technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this specification.
[0024] To address the aforementioned technical problems, this specification introduces an application-specific resource batch allocation method according to an embodiment. The execution entity of this application-specific resource batch allocation method is a corresponding electronic device. Preferably, the electronic device can be a device that manages computing resources, or it can be a general computing device such as a server, industrial control computer, or PC. Specifically, as shown... Figure 1 As shown, the resource batch allocation method for applications may include the following specific implementation steps.
[0025] S110: Receive a resource allocation request; the resource allocation request is used to request the allocation of computing resources to multiple target applications.
[0026] A resource allocation request is used to request the allocation of computing resources to multiple target applications. Specifically, the resource allocation request may include the number of target applications and the computing resource requirements of different target applications. Based on the relevant information in the resource allocation request, the subsequent allocation of idle resources can be effectively arranged.
[0027] The target application can be an application used on the user's terminal, or it can correspond to different application processes running inside the server. In practical applications, any process that requires cloud-allocated computing resources can be set as the target application, and it is not limited to a specific type of application.
[0028] The resource allocation request can be a request for corresponding resources obtained by the device managing user terminals after integrating resource requests from applications on different terminals. Alternatively, the executing entity can directly receive resource allocation requests from multiple terminals, and then organize the resource needs of different terminals based on these requests for subsequent allocation operations. The specific configuration can be set according to the actual application situation, and there are no restrictions on it.
[0029] S120: Determine the initial utilization status of the target application's free resource list based on the initial sorting order of the target application.
[0030] When the target applications and resource requirements are relatively small, elastic containers can be allocated to each target application sequentially based on resource and specific needs. However, when the number of target applications is large, customizing and building containers sequentially consumes a significant amount of time and resources, which is clearly not suitable for actual application needs. In such cases, allocation should generally be based on currently available idle resources.
[0031] However, directly allocating computing resources based on the order of target applications can easily lead to resource waste. For example, the containers corresponding to target applications are usually set up in virtual machines. If the resources of the current virtual machine are insufficient to allocate to this application, a new virtual machine needs to be allocated to the application. This will inevitably result in some computing resources not being fully utilized. Therefore, it is necessary to adjust the order of target applications to optimize resource utilization.
[0032] The list of available resources is a pre-integrated list of virtual machines or other types of computing devices with available resources. The virtual machines in the list can have the same specifications. When allocating resources to a target application in the order of arrangement, it can be determined whether the remaining resources of the current virtual machine can be effectively allocated to the target application. If not, the resource allocation is completed through a new virtual machine. If it can, the resource allocation operation is performed and it is determined again whether the resource requirements of the next application can be met by the remaining resources of the virtual machine.
[0033] In practical applications, there may be situations where virtual machines have different specifications. In such cases, resources in these virtual machines can be allocated sequentially based on a specific order. The specific execution process is similar to that described above and will not be repeated here.
[0034] Initial utilization status refers to the resource utilization status of the target application after resources are allocated sequentially. Utilization status can reflect the utilization rate of computing resources. For example, given the corresponding CPU and memory specifications, utilization status can be reflected as CPU utilization and memory utilization. If all virtual machines in the idle resources have the same specifications, utilization status can more intuitively reflect the total number of virtual machines used by the application. Correspondingly, utilization status can also be a value calculated based on a combination of factors, including these. In practical applications, the method for calculating initial utilization status can be set according to specific needs, and there are no restrictions on this.
[0035] However, if allocation is based solely on the initial arrangement, it's difficult to guarantee that the current order is the optimal one; that is, adjusting the order might result in optimized resource utilization. Therefore, in subsequent steps, it's necessary to adjust the order of the target applications and determine the new utilization, adjusting the order step by step to achieve the best possible resource allocation effect.
[0036] In some implementations, the initial arrangement order can be set automatically in a certain way to optimize subsequent processing.
[0037] Specifically, the resource information in the list of idle resources can be determined, including at least one of resource type, resource specification, and resource utilization rate, and then an initial arrangement order corresponding to the target application can be constructed based on the resource information.
[0038] When constructing the initial arrangement order based on resource information, at least two candidate arrangement orders can be randomly generated first. Then, resource fitness is calculated based on the resource information and the candidate arrangement orders. The resource fitness is used to describe the utilization rate of the target application for each idle resource. Subsequently, based on the differences in resource fitness between different candidate arrangement orders, the different candidate arrangement orders are integrated to obtain the initial arrangement order.
[0039] The specific determination process can be implemented using the corresponding ideas of genetic algorithms. Virtual machines are used as the genes of individuals, recording the type of each virtual machine, the specifications of all containers within each virtual machine, and the utilization rate of each virtual machine. To ensure the globality of the initial solution, the initial population is generated as follows: For each individual: all containers that need to be placed are randomly shuffled and placed into the current virtual machine in sequence. If a container can fit, it is placed; if the constraints are not met, a new virtual machine is randomly generated, placed into this new virtual machine, and added to the individual.
[0040] The fitness of each individual is determined by its utilization rate; a higher value indicates a better individual. To improve efficiency, the price of all containers can be calculated first, avoiding redundant calculations. Then, the profit margin of each virtual machine within an individual is calculated and used as the fitness of each physical machine; a higher value again indicates better fitness. All virtual machines within an individual are then sorted in descending order of fitness (individuals themselves do not need to be sorted). Operators are selected using a tournament-style approach. The general idea is to randomly select two individuals, choose the better one as the parent, discard the weaker one, and maintain the same population size. This ensures that better individuals have a higher probability of being retained.
[0041] Crossover is crucial for genetic algorithms to find the global optimum. A good crossover operator expands the solution space and reduces the likelihood of prematurely getting trapped in local optima. The principle of crossover is to select two individuals from the parent generation with a certain probability, causing partial gene exchange to produce two new individuals (offspring). Specifically, in the parent generation, two individuals are selected probabilistically, and one of their first two physics machines (already sorted) is randomly chosen to be inserted into the other. This ensures that the superior traits of the parent genes are preserved in the offspring. Each newly inserted physics machine in the offspring increases the total number of virtual machines, and maintaining the same total number of virtual machines is a necessary condition for a feasible solution. Therefore, after inserting a new physics machine into the offspring, the newly added virtual machine type needs to be subtracted from the other physics machines. This can be done starting from the last physics machine of the individual (the last physics machine has lower fitness). After ensuring the total number of virtual machines remains unchanged, the aforementioned exchange-merge method can be used to optimize the last physics machine. It is important to note that special virtual machines must be placed in specific physics machines.
[0042] Preferably, specific resource requirements in the target application can also be determined, whereby these specific resource requirements request computing resources of a specific specification. To ensure that the resources allocated to the corresponding target application meet its specifications, an initial arrangement order corresponding to the specific target application can be constructed based on the position of the computing resources of that specific specification in the free resource list. This ensures that resources can be effectively allocated to this part of the application based on computing resources.
[0043] S130: Adjust the order of each target application and determine the reuse status of the corresponding idle resource list after the adjustment.
[0044] Based on the foregoing, directly allocating resources according to the initial order may not guarantee that the current order represents the optimal resource utilization. Therefore, the order of the target applications can be adjusted, and continuous optimization can be achieved by analyzing the utilization after adjustment.
[0045] The arrangement order can be adjusted in a preset manner. In some implementations, adjusting the arrangement order may involve swapping the positions of the corresponding target applications, shifting multiple corresponding target applications, or reversing the order of multiple corresponding target applications.
[0046] Swapping the positions of corresponding target applications can adjust the arrangement order by exchanging target applications in specific positions. Shifting primarily involves adjusting the positions of several adjacent target applications in the arrangement order together. For example, targets 10-30 can be moved 5 positions to the right in the current arrangement queue. Inversion mainly targets several adjacent target applications, reversing their order. For example, for target applications 10-30 in the arrangement order, the first and last positions of these target applications are swapped sequentially to adjust the order. The specific implementation methods described above are adjusted according to the actual application situation, such as the specific swap positions or the number of target applications selected, which will not be elaborated here. Other methods can also be used to adjust the order in practical applications, and there are no restrictions on these methods.
[0047] The reuse status refers to the resource utilization situation corresponding to the adjusted arrangement of target applications. The specific details of the reuse status can be found in the foregoing description and will not be repeated here.
[0048] S140: Based on the relationship between the initial use status and the reuse status, the order of each target application is readjusted in conjunction with the time influence factor; the time influence factor changes over time.
[0049] The relationship of change is mainly used to reflect the advantages and disadvantages between the initial utilization and the subsequent utilization. Since the utilization status can intuitively reflect the utilization rate of resources by different arrangement orders, the relationship of change can be obtained by comparing the initial utilization and the subsequent utilization.
[0050] Generally, if the initial utilization rate is greater than the subsequent utilization rate, it indicates that the original arrangement is better, and therefore the original arrangement should be maintained. If the subsequent utilization rate is greater than the initial utilization rate, it indicates that the adjusted arrangement has optimized resource utilization, and the order of the target application can be changed to the adjusted arrangement.
[0051] However, since the way to adjust the order of the target application is generally fixed, meaning that only a limited number of adjustments can be generated for the same order, in practical applications, the utilization of the adjusted order may be worse than the optimal choice, resulting in a "local optimum." This situation greatly reduces the analysis of the utilization of different orders, thus affecting the final resource allocation effect.
[0052] Therefore, to overcome this problem, the embodiments of this specification also introduce a time influence factor, which changes over time and affects the probability of changing the arrangement order. Specifically, if the reuse situation is better than the initial reuse situation, the order is readjusted based on the adjusted arrangement order. If the initial reuse situation is better than the reuse situation, in order to maximize the number of applied arrangement orders, the probability of changing the arrangement order can be determined based on the time influence factor. The probability of changing the arrangement order is then used to determine whether to readjust the initial arrangement order or to readjust the order based on the adjusted arrangement order. In this way, even when the utilization rate is poor after changing the order, a new arrangement order is used, thereby avoiding the possibility of "local optima".
[0053] Meanwhile, to avoid constantly changing the order and failing to obtain a final solution effectively, the time influence factor changes over time. Specifically, the time influence factor increases or decreases over time, thus causing the probability of changing the arrangement order based on different calculation methods to decrease over time. This ensures that the appropriate arrangement order is applied according to normal judgment logic in the later stages, guaranteeing that the loop process can end effectively.
[0054] The specific rate of change of the time-influence factor and the method for calculating the probability of changes in the order of arrangement based on the time-influence factor can be adjusted according to actual application needs, and will not be elaborated here.
[0055] S150: Repeat the steps of determining reuse status, calculating changes, and adjusting the arrangement order until the preset application conditions are met; the preset application conditions are used to limit the resource utilization effect corresponding to the current arrangement order.
[0056] Following this, based on the foregoing, the utilization status of the adjusted arrangement is calculated and compared with the utilization status corresponding to the retained arrangement to calculate the change relationship. The time impact factor is then considered to determine whether the original arrangement should be retained or replaced with the adjusted arrangement. This cyclical process is repeated to complete the adjustment process for different arrangement orders and the corresponding resource utilization calculation process.
[0057] After each loop, it can be determined whether the current arrangement meets the preset application conditions. The preset application conditions are mainly used to stop the loop and limit the resource utilization effect corresponding to the current arrangement order; that is, the loop will only exit when the current arrangement order has a good resource utilization. Specifically, the preset application condition may be that the number of times the current arrangement order has been maintained has reached a preset maintenance threshold. When the number of times the current arrangement order has reached the preset maintenance threshold, it means that the current arrangement order can maintain a relatively good level, and the large number of loops means that the time influence factor will not affect the normal arrangement order replacement, that is, the current arrangement order has a good application effect.
[0058] In practical applications, other types of preset application conditions can also be set. For example, the loop can be stopped after a certain number of iterations or when the utilization meets certain values, thus avoiding excessive processing time that could affect the normal resource allocation process, or stopping the loop as soon as possible to allocate resources when the sorting order is relatively good. Other types of preset application conditions can also be set according to needs in practical applications, which will not be elaborated further.
[0059] S160: Allocate computing resources in the idle resource list to each target application in sequence according to the current order of the target applications.
[0060] Once the arrangement order is determined, computing resources can be allocated based on the current arrangement order. The specific allocation method can be referred to the introduction on computing resource utilization mentioned above, so as to ensure that the resources in the virtual machine can be fully utilized and to avoid wasting too many idle resources.
[0061] The specific allocation process and the process of utilizing computing resources can be set according to the actual situation, and will not be elaborated here.
[0062] The following is combined Figure 2 Provide an example, such as Figure 2 As shown, the simulated annealing algorithm is first used to determine the number of virtual machines. Specifically, the solution space and initial values are determined first, followed by the initial temperature T0, annealing coefficient a, and initial solution x0. Then, the outer loop is executed, and the process ends based on conditions such as the optimal solution remaining unchanged for multiple consecutive iterations, reaching a certain number of iterations, or reaching a specified temperature. Simultaneously, the inner loop is executed to update the application's sorting order, generating new solutions using random swapping, shifting, or inversion methods. These new solutions are compared with the original solutions to determine whether to replace the old ones. The loop ends again based on conditions such as the optimal solution remaining unchanged for multiple consecutive iterations or reaching a certain number of iterations, thus completing the efficient batch allocation of resources for the application.
[0063] Based on the above embodiments and scenario examples, it can be seen that after receiving a resource allocation request, the method first completes the initial allocation of idle resources based on the initial order of the target applications and determines the corresponding resource utilization status. Then, by adjusting the order of the target applications and determining the corresponding resource utilization status, the method compares the differences in resource utilization before and after the order adjustment to adjust the order of the target applications accordingly. Simultaneously, by introducing a time-related factor, it ensures that the order can adapt to various situations as much as possible. This iterative process is repeated multiple times until the preset application conditions are met, and then the allocation of computing resources is completed according to the final order of the target applications. Through this method, in situations with large-scale resource allocation needs, by analyzing the resource utilization status of applications under different orderings, the utilization rate during final resource allocation is effectively guaranteed. At the same time, it avoids the time consumed by configuring containers of corresponding specifications for each application sequentially, thus quickly and effectively completing the batch resource allocation for applications, demonstrating good practical application results.
[0064] based on Figure 1 This specification describes a method for batch allocation of resources for applications, specifically an application-specific resource batch allocation device. This application-specific resource batch allocation device can be installed on a corresponding electronic device. For example... Figure 3 As shown, the resource batch allocation device for the application includes the following modules.
[0065] The resource allocation request receiving module 310 is used to receive resource allocation requests; the resource allocation requests are used to request the allocation of computing resources to multiple target applications.
[0066] The initial utilization status determination module 320 is used to determine the initial utilization status of the target application on the list of idle resources based on the initial arrangement order of the target applications.
[0067] The reuse status determination module 330 is used to adjust the arrangement order of each target application and determine the reuse status of the corresponding idle resource list after adjustment.
[0068] The sorting order readjustment module 340 is used to readjust the sorting order of each target application based on the relationship between the initial use status and the reuse status, combined with the time influence factor; the time influence factor changes over time.
[0069] The repeat execution module 350 is used to repeatedly execute the steps of determining the reuse status, calculating the change relationship, and adjusting the arrangement order until the preset application conditions are met; the preset application conditions are used to limit the resource utilization effect corresponding to the current arrangement order.
[0070] The computing resource allocation module 360 is used to allocate computing resources in the idle resource list to each target application in turn according to the current order of the target applications.
[0071] based on Figure 1 The corresponding resource batch allocation method for applications is provided in this specification, and an electronic device is provided in the embodiments. The electronic device may include a memory and a processor.
[0072] In this embodiment, the memory can be implemented in any suitable manner. For example, the memory can be a read-only memory, a hard disk drive, a solid-state drive, or a USB flash drive, etc. The memory can be used to store computer program instructions.
[0073] In this embodiment, the processor can be implemented in any suitable manner. For example, the processor can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers, etc. The processor can execute the computer program instructions to implement... Figure 1 The corresponding embodiment describes a method for batch allocation of resources for an application.
[0074] This specification provides a computer-readable storage medium storing a computer program / instructions thereon. The computer-readable storage medium can be read by a processor via the internal bus of a device, and the processor can then implement the program instructions in the computer-readable storage medium.
[0075] In this embodiment, the computer-readable storage medium can be implemented in any suitable manner. The computer-readable storage medium includes, but is not limited to, random access memory (RAM), read-only memory (ROM), cache, hard disk drive (HDD), memory card, etc. The computer storage medium stores computer program instructions. When the computer program instructions are executed, this specification is implemented. Figure 1 The corresponding embodiment is a program instruction or module for a resource batch allocation method for an application.
[0076] This specification also provides a computer program product, including a computer program / instructions. The computer program product may be a program written in a corresponding computer programming language, stored in a corresponding storage device in a program manner, and can be transmitted via a computer network. The computer program product can be executed by a processor. In this specification embodiment, when the computer program product is executed, it implements the following... Figure 1 The program instructions or modules of the application-specific resource batch allocation method in the corresponding embodiment.
[0077] It should be noted that the above-mentioned resource batch allocation method, device and equipment for applications can be applied to the field of cloud computing technology, or to other technical fields other than cloud computing technology, such as the financial field, without limitation.
[0078] Furthermore, the execution process of the above embodiments involves operations such as data acquisition, processing, use, and storage, all of which comply with the requirements of relevant laws and regulations.
[0079] Although the process described above includes multiple operations that occur in a specific order, it should be clearly understood that these processes may include more or fewer operations, which may be executed sequentially or in parallel (e.g., using parallel processors or a multithreaded environment).
[0080] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this specification. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0081] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0082] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0083] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0084] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0085] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape storage, disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0086] Those skilled in the art will understand that the embodiments of this specification can be provided as methods, systems, or computer program products. Therefore, the embodiments of this specification can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, the embodiments of this specification can take the form of computer program products implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0087] The embodiments described in this specification can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. The embodiments of this specification can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0088] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, system embodiments are basically similar to method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. In the description of this specification, the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the embodiments in this specification. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described can be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification and the features of different embodiments or examples.
[0089] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A method for batch allocation of resources for an application, characterized in that, include: Receive resource allocation requests; The resource allocation request is used to request the allocation of computing resources to multiple target applications; The initial utilization of the free resource list by the target application is determined by the initial sorting order of the target application; Adjust the order of each target application and determine the reuse status of the idle resource list corresponding to the adjusted order; Based on the relationship between the initial and subsequent use conditions, the order of application of each target is readjusted in conjunction with the time-influence factor; the time-influence factor changes over time. Repeat the steps of determining reuse status, calculating changes, and adjusting the arrangement order until the preset application conditions are met; the preset application conditions are used to limit the resource utilization effect corresponding to the current arrangement order; The computing resources in the list of available resources are allocated to each target application in turn, according to the current order of the target applications.
2. The method as described in claim 1, characterized in that, The adjustment of the order of the target applications includes: Swap the positions of the corresponding target applications, or Apply shift to the corresponding multiple targets, or, Reverse the order of the corresponding multiple target applications.
3. The method as described in claim 1, characterized in that, The process of readjusting the order of applications based on the relationship between initial and subsequent use, combined with the time-related factor, includes: If the reuse condition is better than the initial use condition, the order is readjusted based on the adjusted arrangement, or... When the initial utilization condition is better than the subsequent utilization condition, the probability of changing the arrangement order is determined based on the time influence factor; the probability of changing the arrangement order is used to determine the probability of whether to apply the adjusted arrangement order. The order of the initial arrangement is readjusted based on the probability of the change in the order, or the order is readjusted based on the already readjusted order.
4. The method as described in claim 3, characterized in that, The time-related factor increases or decreases over time; correspondingly, the probability of the arrangement order changing decreases over time.
5. The method as described in claim 1, characterized in that, Before determining the initial utilization status of the target application's free resource list based on the initial sorting order of the target applications, the method further includes: Determine the resource information in the list of available resources; the resource information includes at least one of resource type, resource specification, and resource utilization rate; Based on the resource information, an initial arrangement order corresponding to the target application is constructed.
6. The method as described in claim 5, characterized in that, The step of constructing the initial arrangement order corresponding to the target application based on the resource information includes: Randomly generate at least two candidate permutations; Resource fitness is calculated based on the resource information and candidate ranking; the resource fitness is used to describe the utilization rate of the target application for each idle resource; Based on the differences in resource fitness among different candidate permutation orders, the initial permutation order is obtained by integrating the different candidate permutation orders.
7. The method as described in claim 5, characterized in that, The step of constructing the initial arrangement order corresponding to the target application based on the resource information includes: Identify the specific resource requirements of the target application; these specific resource requirements are used to request computing resources of a specific specification. Based on the specific resource requirements, construct an initial arrangement order corresponding to the target application.
8. The method as described in claim 1, characterized in that, The preset application conditions include the number of repeated cycles reaching a preset number of cycles or the number of times the current utilization status is maintained reaching a preset maintenance threshold.
9. The method as described in claim 1, characterized in that, Each target application corresponds to an elastic container; the specifications and resource quotas of the elastic container are adapted to the target application; the list of idle resources corresponds to virtual machines in an idle state; the virtual machine is used to place at least one of the elastic containers to realize resource allocation of the elastic containers.
10. A resource batch allocation device for an application, characterized in that, include: The resource allocation request receiving module is used to receive resource allocation requests; The resource allocation request is used to request the allocation of computing resources to multiple target applications; The initial utilization status determination module is used to determine the initial utilization status of the target application on the list of free resources based on the initial sorting order of the target applications. The reuse status determination module is used to adjust the order of each target application and determine the reuse status of the corresponding idle resource list after the adjustment. The sorting order readjustment module is used to readjust the sorting order of each target application based on the relationship between the initial use status and the reuse status, combined with the time influence factor; the time influence factor changes over time. The repetitive execution module is used to repeatedly execute the steps of determining reuse status, calculating changes, and adjusting the arrangement order until the preset application conditions are met; the preset application conditions are used to limit the resource utilization effect corresponding to the current arrangement order; The computing resource allocation module is used to allocate computing resources in the idle resource list to each target application in turn according to the current order of the target applications.
11. An electronic device comprising a memory and a processor; characterized in that, The memory is used to store computer programs / instructions; the processor is used to execute the computer programs / instructions to implement the steps of the method as described in any one of claims 1-9.
12. A computer storage medium storing computer programs / instructions thereon, characterized in that, The computer program / instructions, when executed by a processor, are used to implement the steps of the method as described in any one of claims 1-9.
13. A computer program product comprising a computer program / instructions, characterized in that, The computer program / instructions, when executed by a processor, are used to implement the steps of the method as described in any one of claims 1-9.
Citation Information
Patent Citations
Cloud rendering resource scheduling method and device
CN111176836A
Equipment resource processing method and device, electronic equipment and storage medium
CN112527506A