Resource opening method and device, computer equipment and storage medium

By pre-allocating batch resources and parallel processing of target computing nodes, the problem of concurrent processing of resource activation requests caused by pessimistic locks is solved, and the efficiency and throughput of cloud host creation is improved, and the rapid and real-time resource delivery and service stability is achieved. .

CN119149224APending Publication Date: 2024-12-17BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411167319.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-23
Publication Date
2024-12-17

AI Technical Summary

Technical Problem

During the creation of cloud hosts, the pessimistic locking mechanism causes concurrent processing blockage of resource activation requests, and cannot achieve fast, accurate and real-time delivery, affecting the platform throughput and stability of customer service.

Method used

By acquiring the resource activation request for the current batch, the target computing node is pessimistic, and the batch resource pre-allocates and releases the lock, and then multiple threads are used to perform resource activation operations in parallel, reducing frequent locking and resource competition, and improving system throughput quantity and response speed.

Benefits of technology

On the premise of ensuring data accuracy, the resource activation efficiency in high concurrency scenarios has been significantly improved, and rapid and real-time resource delivery has been achieved, meeting customer needs and providing stable services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119149224A_ABST
    Figure CN119149224A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of cloud computing, in particular to a resource opening method and device, computer equipment and a storage medium, and the method comprises the steps: obtaining a resource opening request of a current batch, and applying a pessimistic lock to resources of a target computing node, pre-allocation of target computing node resources is completed according to the resource opening requests of the current batch, allocation information corresponding to the resource opening requests is obtained, and a pessimistic lock is released; resource opening operation is executed in parallel through the multiple called threads; according to the scheme, through batch resource preprocessing in the locking stage and parallel processing after lock release, the efficiency of resource opening in a high-concurrency scene is remarkably improved; through batch pre-allocation and parallel processing, the problems of frequent locking and resource competition are reduced, the throughput and response speed of the system are improved, and rapid and real-time resource delivery is realized on the premise of ensuring data accuracy, so that customer requirements can be better met, and stable services are provided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of cloud computing, and in particular to a resource provisioning method, device, computer equipment, and storage medium. Background Art

[0002] During the creation of a cloud host, the best computing node will be selected after screening by the scheduling service, and then the cloud host will be activated on this computing node.

[0003] In the process of resource activation, in order to avoid the resource occupation concurrency problem caused by data competition, the pessimistic locking mechanism is usually used to limit concurrency. That is, when a computing node needs to process multiple resource activation requests, the pessimistic locking mechanism can ensure that only one resource activation request can be processed normally at a time (that is, the resource activation operation is completed). During this period, other resource activation requests are in a blocked waiting state. Although this method can ensure the accuracy of data during resource competition, it will seriously restrict the throughput of the platform, and it is impossible to achieve fast, accurate, and real-time delivery, and it cannot provide customers with stable services. Summary of the invention

[0004] In order to solve the above technical problems, the present disclosure provides a resource provisioning method, apparatus, computer equipment and storage medium.

[0005] In a first aspect, the present disclosure provides a resource provisioning method, including:

[0006] When the resource activation request of the current batch is obtained, a pessimistic lock is set on the resources of the target computing node. The target computing node is the computing node determined by the scheduling service to process the resource activation requests in the current batch. According to each resource activation request in the current batch, the resources of the target computing node are pre-allocated, the allocation information corresponding to each resource activation request is obtained, and the pessimistic lock is released. The same number of threads as the resource activation requests are called, and the corresponding resource activation operations are performed according to the allocation information corresponding to each resource activation request.

[0007] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages:

[0008] The resource activation operation provided in this embodiment, when obtaining the resource activation requests of the current batch, puts a pessimistic lock on the resources of the target computing node, and releases the pessimistic lock after completing the pre-allocation of the target computing node resources according to the resource activation requests of the current batch and obtaining the allocation information corresponding to each resource activation request; and executes the resource activation operation in parallel through multiple threads called; in the scheme provided in this embodiment, the efficiency of resource activation in high-concurrency scenarios is significantly improved through batch resource preprocessing in the locking stage and parallel processing after releasing the lock; compared with the traditional pessimistic locking method, this scheme reduces the problems of frequent locking and resource competition through batch pre-allocation and parallel processing, improves the throughput and response speed of the system, and realizes fast and real-time resource delivery while ensuring data accuracy, so as to better meet customer needs and provide stable services.

[0009] In an optional implementation, when the resource provisioning request of the current batch is obtained, before the pessimistic lock is applied to the resources of the target computing node, the method further includes:

[0010] At least two resource provisioning requests are received; a request queue is formed by the at least two resource provisioning requests; and the request queue is divided into at least one batch with a preset number of resource provisioning requests as a batch.

[0011] In an optional implementation manner, the preset number is determined by:

[0012] The CPU load of the target computing node is read; and the number corresponding to the load interval to which the CPU load belongs is determined as a preset number.

[0013] In an optional implementation, after pre-allocating resources of the target computing node according to each resource provisioning request in the current batch, the method further includes:

[0014] Add labels to the pre-allocated resources in the target computing node. The labels are used to represent the usage status of the resources.

[0015] In an optional implementation manner, after calling the same number of threads as the resource provisioning requests and performing corresponding resource provisioning operations according to the allocation information corresponding to each resource provisioning request, the method further includes:

[0016] Record resource activation status in the log file.

[0017] In an optional embodiment, the method further comprises:

[0018] When a resource provisioning operation fails, the reason for the failure is recorded; and remedial actions corresponding to the reason are performed to complete resource provisioning.

[0019] In an optional implementation manner, when the cause is pre-allocation failure, performing a remedial operation corresponding to the cause to complete resource provisioning includes:

[0020] The resource pre-allocation operation is performed again based on the resource provisioning request, and the working thread is called to perform the resource provisioning operation again based on the allocation information obtained from the pre-allocation operation.

[0021] In a second aspect, the present disclosure provides a resource provisioning device, including:

[0022] The locking module is used to pessimistically lock the resources of the target computing node when obtaining the resource activation request of the current batch. The target computing node is the computing node determined by the scheduling service to process the resource activation requests in the current batch; the pre-allocation module is used to pre-allocate the resources of the target computing node according to each resource activation request in the current batch, obtain the allocation information corresponding to each resource activation request, and release the pessimistic lock; the resource activation module is used to call the same number of threads as the resource activation request, and perform corresponding resource activation operations according to the allocation information corresponding to each resource activation request.

[0023] In a third aspect, the present disclosure provides a computer device, including:

[0024] The memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the resource activation method of the first aspect of the invention and any embodiment thereof by executing the computer instructions.

[0025] In a fourth aspect, the present disclosure provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the resource provisioning method of the first aspect of the invention and any of its embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0027] In order to more clearly illustrate the embodiments of the present invention 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.

[0028] Figure 1 is a flowchart of a resource provisioning method provided according to an embodiment of the present disclosure;

[0029] Figure 2is a structural block diagram of a resource provisioning device provided according to an embodiment of the present disclosure;

[0030] Figure 3 It is a schematic diagram of the hardware structure of a computer device provided according to an embodiment of the present invention. DETAILED DESCRIPTION

[0031] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.

[0032] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0033] 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 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.

[0034] According to an embodiment of the present invention, a resource activation method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0035] In this embodiment, a resource provisioning method is provided, which can be used for computer devices, computing nodes, cloud servers, etc. Figure 1 is a flow chart of a resource provisioning method according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:

[0036] Step S101: When a resource activation request of the current batch is obtained, a pessimistic lock is placed on the resources of the target computing node.

[0037] Specifically, the target computing node is the computing node determined by the scheduling service for processing each resource provisioning request in the current batch. The resource provisioning request is a resource provisioning request issued by the client for creating a cloud host. The cloud platform receives the resource provisioning request generated by the client by calling the client's application programming interface (API), and uses the scheduler to determine the target computing node for processing each resource provisioning request from multiple computing nodes, and the target computing node processes the resource provisioning request.

[0038] Specifically, when high concurrency occurs, a large number of resource activation requests will be received in a short period of time. Therefore, there will be multiple resource activation requests to be processed by the target computing node after being determined by the scheduling service. In this case, in order to ensure the processing efficiency of the target computing node, it is necessary to batch process the resource activation requests according to the load of the target computing node. For example, when the load of the target computing node is low, all resource activation requests can be processed as a batch; when the load of the target computing node is high, all resource activation requests can be divided into multiple batches for batch processing.

[0039] Step S102: pre-allocate resources of the target computing node according to each resource activation request in the current batch, obtain allocation information corresponding to each resource activation request, and release the pessimistic lock.

[0040] Specifically, the resource provisioning request carries the demand for various resources for the cloud host to be created, including but not limited to the demand for CPU resources, the demand for memory resources, and the demand for hard disk resources.

[0041] Specifically, after the pessimistic lock is set on the resources of the target computing node, the resource pre-allocation operation of the current batch is started, and after the pre-allocation operation is completed, the pessimistic lock is released. The specific operation is to read the demand for each resource of each resource opening request from the resource opening request of the current batch in sequence, and pre-allocate each idle resource of the target computing node according to the demand for each resource of each resource opening request, and generate the allocation information corresponding to the resource opening request according to the pre-allocation result, and the allocation information includes but is not limited to the allocation identifier, the pre-allocation information of each resource and the resource status of each resource. Among them, the allocation identifier corresponds to the resource opening request and is used to uniquely identify the allocation information. The pre-allocation information of each resource includes but is not limited to the kernel identification information of the pre-allocated kernel, the address information of the pre-allocated memory, the space information of the pre-allocated disk, etc. The resource status of each resource includes but is not limited to the status of the pre-allocated resource and the pre-allocation result of each resource. The status of the pre-allocated resource is such as whether the idle resource allocated to the resource opening request belongs to a faulty resource or a normal resource, and the pre-allocation result of each resource includes pre-allocation success or pre-allocation failure.

[0042] Exemplarily, there are 5 resource activation requests in the current batch. After pessimistically locking the resources of the target computing node, each resource activation request in the current batch is read in turn. The pre-allocation operation is exemplified by taking the first resource activation request in the current batch as an example. When the first resource activation request is read, first, the demand for each resource is obtained from the first resource activation request; for example, the demand for CPU resources is 1 core, the demand for memory resources is 5G, and the demand for hard disk resources is 3G. Then, pre-allocate the idle resources in the target computing node according to the above resource demand; for example, allocate one core in the idle CPU resources to the first resource activation request, and obtain the kernel identification information of the pre-allocated core; allocate 5G memory space from the idle memory resources to the first resource activation request, and obtain the address information of the pre-allocated memory space (the address information can be the starting address and offset, or the first address and the last address); allocate 3G from the idle disk space to the first resource activation request, and obtain the space information of the pre-allocated disk (i.e., cylinder, head and sector information); finally, randomly generate an allocation identifier that uniquely corresponds to the first resource activation request, and generate the allocation information corresponding to the first resource activation request from the allocation identifier, kernel identification information, address information of the pre-allocated memory space and space information of the pre-allocated disk. After all resource activation requests in the current batch have completed the above operations, release the pessimistic lock.

[0043] Step S103: calling the same number of threads as the resource provisioning requests, and executing corresponding resource provisioning operations according to the allocation information corresponding to each resource provisioning request.

[0044] Specifically, the same number of threads as the resource provisioning request is called, and the multiple threads execute the resource provisioning operation in parallel on the target computing node according to the corresponding allocation information, thereby completing the creation of the cloud host.

[0045] For example, there are 5 resource provisioning requests in the current batch. After processing in step S102, allocation information corresponding to each resource provisioning request, i.e., 5 allocation information, is obtained. 5 threads are called, and each thread performs a corresponding resource provisioning operation according to the allocation information corresponding to a resource provisioning request. For example, thread 1 performs a resource provisioning operation corresponding to the first resource provisioning request according to the allocation information 1 of the first resource provisioning request.

[0046] The resource activation method provided in this embodiment, when obtaining the resource activation requests of the current batch, puts a pessimistic lock on the resources of the target computing node, and releases the pessimistic lock after completing the pre-allocation of the resources of the target computing node according to the resource activation requests of the current batch and obtaining the allocation information corresponding to each resource activation request; and executes the resource activation operation in parallel through multiple threads called; in the scheme provided in this embodiment, the efficiency of resource activation in high-concurrency scenarios is significantly improved through batch resource preprocessing in the locking stage and parallel processing after releasing the lock; compared with the traditional pessimistic locking method, this scheme reduces the problems of frequent locking and resource competition through batch pre-allocation and parallel processing, improves the throughput and response speed of the system, and realizes fast and real-time resource delivery while ensuring data accuracy, so as to better meet customer needs and provide stable services.

[0047] In an optional implementation, before step S101, the method further includes: receiving at least two resource provisioning requests; forming a request queue from the at least two resource provisioning requests; and dividing the request queue into at least one batch with a preset number of resource provisioning requests as a batch.

[0048] Exemplarily, after receiving at least two resource activation requests processed by the target computing node, first, in the order of receiving the resource activation requests, at least two resource activation requests are placed in a queue to form a request queue, such as request 1, request 2, ..., request 10. Then, taking a preset number of resource activation requests as a batch, at least two resource activation requests are divided into at least one batch. For example, taking 5 resource activation requests as a batch, the above 10 resource activation requests will be divided into two batches, the first batch is request 1 to request 5, and the second batch is request 6 to request 10. Finally, the resource activation requests in each batch are processed in turn according to the method of step S101 to step S103, and finally the processing of the 10 resource activation requests is completed. It should be noted that the number of resource activation requests in a batch (i.e., the preset number) can be dynamically adjusted according to the CPU load.

[0049] In an optional embodiment, the method for determining the preset number includes: reading the CPU load of the target computing node; and determining the number corresponding to the load interval to which the CPU load belongs as the preset number.

[0050] Exemplarily, a person skilled in the art performs statistical analysis based on the processing efficiency data of resource activation requests under different CPU load conditions to obtain a mapping relationship table between CPU load and batch processing quantity. Therefore, after receiving at least two resource activation requests processed by the target computing node, first read the CPU load corresponding to the target computing node at the receiving time, such as 30%; then, match the CPU load with multiple CPU load intervals provided in the mapping relationship table, and use the batch processing quantity 5 corresponding to the load interval [30, 60) to which the CPU load 30% belongs (i.e., the quantity corresponding to the load interval to which the CPU load belongs) as the preset quantity, which can be understood as the maximum value of the batch processing that the CPU can accept under the premise of ensuring the normal operation of the CPU. The method of determining the batch processing quantity by the CPU load condition in this embodiment improves the utilization rate of CPU resources under the premise of ensuring that the CPU maintains efficient operation.

[0051] In an optional implementation, after pre-allocating resources of the target computing node according to each resource activation request in the current batch, the method further includes: adding a label to the pre-allocated resources in the target computing node.

[0052] For example, taking memory resources as an example, when the memory resource demand is carried in the resource activation request, 5G is pre-allocated from the free memory resources of the target computing node to the resource activation request. After the pre-allocation operation is completed, an "allocated" label is added to the pre-allocated 5G memory space to avoid repeated allocation of allocated resources when executing subsequent pre-allocation operations, thereby ensuring the accuracy and efficiency of resource allocation.

[0053] In an optional implementation, after calling the same number of threads as the resource provisioning requests and executing corresponding resource provisioning operations according to allocation information corresponding to each resource provisioning request, the method further includes: recording the resource provisioning status in a log file.

[0054] Exemplarily, the resource activation status includes activation success and activation failure. After the calling thread executes the corresponding resource activation operation, the resource activation status is written into the log file so that those skilled in the art can view the specific execution status of the resource activation process later.

[0055] In an optional implementation, the method further includes: when the resource provisioning operation fails, recording the cause of the operation failure; and executing a remedial operation corresponding to the cause to complete the resource provisioning.

[0056] Exemplarily, the reason for the failure of the resource opening operation may exist in any link in the resource opening operation process, such as the failure of the resource opening operation due to the failure of the resource opening request to be received due to network reasons; the failure of the resource opening operation due to the failure of the resource pre-allocation operation; the failure of the resource opening operation due to the pre-allocated resources being faulty resources, etc. In each link of the resource opening operation, there are two possibilities of successful execution and failed execution. When the execution is successful, the subsequent operations are continued. If the execution fails, it means that the resource opening operation has failed. Therefore, when the resource opening operation fails, the reason for the operation failure can be determined by the current execution progress, and the reason for the operation failure is recorded in the log file. If the current execution progress is the acquisition link of the resource opening request, the reason for the failure of the resource opening operation is defaulted to the request acquisition failure, and the failure reason is written into the log file. After that, the request acquisition operation (i.e., the remedial operation corresponding to the reason for the failure of this operation) is re-executed to complete the resource opening operation. It should be noted that if at least one remedial operation is performed within the preset time period starting from the first failure of the resource activation operation and each remedial operation fails, the remedial operation is abandoned and a prompt message formed by the resource operation failure and the reason for the failure is sent to the client, so that the client re-initiates the resource activation request.

[0057] In an optional implementation, when the cause is pre-allocation failure, a remedial operation corresponding to the cause is executed to complete resource activation, including: re-performing a resource pre-allocation operation based on a resource activation request, and calling a working thread to re-perform a resource activation operation based on the allocation information obtained from the pre-allocation operation.

[0058] For example, when the resource provisioning operation fails, and its execution progress is in the pre-allocation stage, the reason for the failure of the resource provisioning operation is defaulted to pre-allocation failure, and the failure reason is written into the log file. At the same time, the resource pre-allocation operation (i.e., the remedial operation corresponding to the reason) is automatically executed, that is, the resource pre-allocation operation is re-performed based on the resource provisioning request, and when the pre-allocation is successful, the thread is called to execute the resource provisioning operation.

[0059] In this embodiment, a resource opening device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0060] This embodiment provides a resource provisioning device, such as Figure 2 As shown, including:

[0061] The locking module 201 is used to pessimistically lock the resources of the target computing node when obtaining the resource activation request of the current batch. The target computing node is the computing node determined by the scheduling service to process each resource activation request in the current batch.

[0062] The pre-allocation module 202 is used to pre-allocate resources of the target computing node according to each resource activation request in the current batch, obtain allocation information corresponding to each resource activation request, and release the pessimistic lock.

[0063] The resource provisioning module 203 is used to call the same number of threads as the resource provisioning requests, and execute corresponding resource provisioning operations according to the allocation information corresponding to each resource provisioning request.

[0064] In some optional embodiments, the device further comprises:

[0065] A receiving module is used to receive at least two resource provisioning requests; a forming module is used to form a request queue from at least two resource provisioning requests; and a dividing module is used to divide the request queue into at least one batch with a preset number of resource provisioning requests as a batch.

[0066] In some optional implementations, the method for determining the preset number in the division module includes:

[0067] The CPU load of the target computing node is read; and the number corresponding to the load interval to which the CPU load belongs is determined as a preset number.

[0068] In some optional embodiments, the device further comprises:

[0069] The labeling module is used to add labels to the pre-allocated resources in the target computing node, and the labels are used to characterize the usage status of the resources.

[0070] In some optional embodiments, the device further comprises:

[0071] The update module is used to record the resource activation status in the log file.

[0072] In some optional embodiments, the device further comprises:

[0073] The recording module is used to record the reason for the failure of the resource provisioning operation when the resource provisioning operation fails; the remediation module is used to perform the remediation operation corresponding to the reason to complete the resource provisioning.

[0074] In some optional implementations, when the cause is pre-allocation failure, the remediation module includes:

[0075] The execution submodule is used to re-perform the resource pre-allocation operation based on the resource provisioning request, and call the working thread to re-perform the resource provisioning operation based on the allocation information obtained by the pre-allocation operation.

[0076] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0077] The resource activation device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0078] The embodiment of the present invention also provides a computer device having the above Figure 2 The resource provisioning device shown.

[0079] See also Figure 3 , Figure 3 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 3 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 3 A processor 10 is taken as an example.

[0080] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0081] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.

[0082] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0083] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0084] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0085] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0086] The above are only specific embodiments of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. 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 disclosure. Therefore, the present disclosure will not be limited to these embodiments herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A resource activation method, It is characterized in that include: When the resource activation request of the current batch is obtained, a pessimistic lock is placed on the resources of the target computing node, where the target computing node is the computing node determined by the scheduling service to process each resource activation request in the current batch; Pre-allocating resources of the target computing node according to each resource provisioning request in the current batch, obtaining allocation information corresponding to each resource provisioning request, and releasing a pessimistic lock; The same number of threads as the resource provisioning requests are called, and corresponding resource provisioning operations are performed according to the allocation information corresponding to each resource provisioning request.

2. The method according to claim 1, It is characterized in that Before pessimistically locking the resources of the target computing node when the resource provisioning request of the current batch is obtained, the method further includes: receiving at least two resource provisioning requests; Forming a request queue by the at least two resource provisioning requests; Taking a preset number of resource provisioning requests as a batch, the request queue is divided into at least one batch.

3. The method according to claim 2, It is characterized in that The method for determining the preset number includes: Read the CPU load of the target computing node; The number corresponding to the load interval to which the CPU load belongs is determined as the preset number.

4. The method according to any one of claims 1 to 3, It is characterized in that After pre-allocating resources of the target computing node according to each of the resource provisioning requests in the current batch, the method further includes: A label is added to the pre-allocated resources in the target computing node, where the label is used to characterize the usage status of the resource.

5. The method according to any one of claims 1 to 3, It is characterized in that After calling the same number of threads as the resource provisioning requests and performing corresponding resource provisioning operations according to allocation information corresponding to each resource provisioning request, the method further includes: Record resource activation status in the log file.

6. The method according to any one of claims 1 to 3, It is characterized in that The method further comprises: When the resource provisioning operation fails, the reason for the operation failure is recorded; Perform remedial actions corresponding to the cause to complete resource provisioning.

7. The method according to claim 6, It is characterized in that When the cause is pre-allocation failure, performing a remedial operation corresponding to the cause to complete resource provisioning includes: The resource pre-allocation operation is performed again based on the resource provisioning request, and the working thread is called to perform the resource provisioning operation again based on the allocation information obtained from the pre-allocation operation.

8. A resource activation device, It is characterized in that include: A locking module, used for pessimistically locking the resources of a target computing node when obtaining a resource activation request of the current batch, wherein the target computing node is a computing node determined by the scheduling service to process each resource activation request in the current batch; A pre-allocation module, used to pre-allocate resources of the target computing node according to each resource activation request in the current batch, obtain allocation information corresponding to each resource activation request, and release the pessimistic lock; The resource provisioning module is used to call the same number of threads as the resource provisioning requests, and execute corresponding resource provisioning operations according to the allocation information corresponding to each resource provisioning request.

9. A computer device, It is characterized in that include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the resource activation method according to any one of claims 1 to 7 by executing the computer instructions.

10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the resource provisioning method according to any one of claims 1 to 7.