Resource request processing method and device, computer equipment, readable storage medium and program product
By receiving resource requests and filtering resource nodes based on the computational resource quantity information and standard value, the problem of unoptimized resource allocation in the existing technology is solved, and the efficiency of resource requests and the maximum standard value is achieved.
Patent Information
- Application Number
- CN202411790976.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-03-18
AI Technical Summary
The prior art cannot guarantee the maximization of standard value in resource request scheduling, resulting in unoptimized resource allocation.
By receiving resource requests, the computing resource quantity information is determined, the initial resource node without image computing resources is obtained, the candidate resource nodes are filtered according to the target processor and memory resource quantity, and the filter and allocate according to the standard value.
Resource allocation is realized based on the resource requested computing resource quantity information and the standard value of the resource node, ensuring that the target resource node meets the resource request while maximizing the standard value, taking into account the account resource request requirements and the standard value of the resource node.
Smart Images

Figure CN119645571A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method, apparatus, computer device, computer-readable storage medium and computer program product for processing resource requests. Background Art
[0002] A virtual machine is a software entity that simulates a complete computer system on a physical computer. A virtual machine can run multiple operating systems and applications on a physical computer, and each virtual machine has hardware resources such as CPU, memory, and GPU.
[0003] Normally, a virtual machine is activated through a resource request. When a virtual machine is activated, hardware resources such as CPU, memory, and GPU need to be allocated to the virtual machine. In related technologies, scheduling can be performed based on the number and combination of resource requests and the remaining amount of resources of each resource node. However, different resource nodes and different resources correspond to different standard values, and this method cannot guarantee the maximization of the standard value. Summary of the invention
[0004] Based on this, it is necessary to provide a method, apparatus, computer device, computer-readable storage medium and computer program product for processing resource requests that can guarantee standard values in response to the above technical problems.
[0005] In a first aspect, the present application provides a method for processing a resource request, comprising:
[0006] In response to receiving a resource request from an account, determining computing resource quantity information corresponding to the resource request;
[0007] In the case that the computing resource amount information does not include the target image computing resource amount, acquiring an initial resource node without image computing resources from preset resource nodes;
[0008] According to the target processor resource amount and the target memory resource amount in the computing resource amount information, determining, from the initial resource nodes, candidate resource nodes whose processor resource amount is greater than or equal to the target processor resource amount and whose memory resource amount is greater than or equal to the target memory resource amount;
[0009] A candidate resource node whose standard value is greater than or equal to a first preset value is determined as a target resource node, and the target resource node is allocated to the account.
[0010] In one of the embodiments, when the computing resource amount information does not include the image computing resource amount, the method further includes:
[0011] In the case where all preset resource nodes include image computing resources, determining a target processor resource amount and a target memory resource amount according to the computing resource amount information;
[0012] According to the image computing resource type corresponding to the preset resource node, a target resource node is determined from the preset resource nodes, and the target resource node is allocated to the account.
[0013] In one of the embodiments, determining the target resource node from the preset resource nodes according to the image computing resource type corresponding to the preset resource node includes:
[0014] Determine the remaining processor resource amount and the remaining memory resource amount corresponding to the preset resource node according to the image computing resource type corresponding to the preset resource node;
[0015] Determine as a candidate resource node a preset resource node whose remaining processor resource amount is greater than or equal to the target processor resource amount and whose remaining memory resource amount is greater than or equal to the target memory resource amount;
[0016] A candidate resource node whose standard value is less than a second preset value is determined as a target resource node.
[0017] In one embodiment, determining the remaining processor resource amount and the remaining memory resource amount corresponding to the preset resource node according to the image computing resource type corresponding to the preset resource node includes:
[0018] Determining a first standard value corresponding to the preset resource node according to the image computing resource type corresponding to the preset resource node;
[0019] According to the first standard value, the remaining processor resource amount and the remaining memory resource amount corresponding to the preset resource node are determined.
[0020] In one of the embodiments, when the computing resource amount information does not include the target image computing resource amount, obtaining an initial resource node without image computing resources from a preset resource node includes:
[0021] In a case where the computing resource amount information includes the computing resource amount of the target image, determining the computing resource type of the target image according to the computing resource amount information;
[0022] An initial resource node matching the target image computing resource type is obtained from preset resource nodes.
[0023] In one of the embodiments, when the computing resource amount information includes the computing resource amount of the target image, the method further includes:
[0024] In a case where the computing resource amount information does not include the target image computing resource type, determining an original resource node including the image computing resource from preset resource nodes;
[0025] Determining a first standard value corresponding to the original resource node according to the image computing resource type corresponding to the original resource node;
[0026] An original resource node whose first standard value is greater than or equal to a third preset value is determined as an initial resource node.
[0027] In a second aspect, the present application also provides a resource request processing device, including:
[0028] A receiving module, configured to determine, in response to receiving a resource request from an account, information about the amount of computing resources corresponding to the resource request;
[0029] An acquisition module, configured to acquire an initial resource node without image computing resources from preset resource nodes when the computing resource amount information does not include the target image computing resource amount;
[0030] A determination module, configured to determine, from the initial resource nodes, a candidate resource node whose processor resource amount is greater than or equal to the target processor resource amount and whose memory resource amount is greater than or equal to the target memory resource amount according to the target processor resource amount and the target memory resource amount in the computing resource amount information;
[0031] The allocation module is used to determine the candidate resource nodes whose standard values are greater than or equal to the first preset value as target resource nodes, and allocate the target resource nodes to the account.
[0032] In one embodiment, the device is further used for:
[0033] In the case where all preset resource nodes include image computing resources, determining a target processor resource amount and a target memory resource amount according to the computing resource amount information;
[0034] According to the image computing resource type corresponding to the preset resource node, a target resource node is determined from the preset resource nodes, and the target resource node is allocated to the account.
[0035] In one embodiment, the device is further used for:
[0036] Determine the remaining processor resource amount and the remaining memory resource amount corresponding to the preset resource node according to the image computing resource type corresponding to the preset resource node;
[0037] Determine as a candidate resource node a preset resource node whose remaining processor resource amount is greater than or equal to the target processor resource amount and whose remaining memory resource amount is greater than or equal to the target memory resource amount;
[0038] A candidate resource node whose standard value is less than a second preset value is determined as a target resource node.
[0039] In one embodiment, the device is further used for:
[0040] Determining a first standard value corresponding to the preset resource node according to the image computing resource type corresponding to the preset resource node;
[0041] According to the first standard value, the remaining processor resource amount and the remaining memory resource amount corresponding to the preset resource node are determined.
[0042] In one embodiment, the acquisition module is further used for:
[0043] In a case where the computing resource amount information includes the computing resource amount of the target image, determining the computing resource type of the target image according to the computing resource amount information;
[0044] An initial resource node matching the target image computing resource type is obtained from preset resource nodes.
[0045] In one embodiment, the acquisition module is further used for:
[0046] In a case where the computing resource amount information does not include the target image computing resource type, determining an original resource node including the image computing resource from preset resource nodes;
[0047] Determining a first standard value corresponding to the original resource node according to the image computing resource type corresponding to the original resource node;
[0048] An original resource node whose first standard value is greater than or equal to a third preset value is determined as an initial resource node.
[0049] In a third aspect, an embodiment of the present disclosure further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of any one of the methods in the embodiments of the present disclosure are implemented.
[0050] In a fourth aspect, the embodiments of the present disclosure further provide a computer-readable storage medium, wherein a computer program is stored thereon, and when the computer program is executed by a processor, the steps of any one of the methods in the embodiments of the present disclosure are implemented.
[0051] In a fifth aspect, the embodiments of the present disclosure further provide a computer program product, wherein the computer program product includes a computer program, and when the computer program is executed by a processor, the steps of any one of the methods in the embodiments of the present disclosure are implemented.
[0052] The above-mentioned resource request processing method, device, computer equipment, computer-readable storage medium and computer program product, when receiving a resource request from an account, determine the computing resource amount information corresponding to the resource request, and when the computing resource amount information does not include the target image computing resource amount, obtain the initial resource node without image computing resources from the preset resource nodes, and determine the candidate resource nodes whose processor resource amount is greater than or equal to the target processor resource amount and whose memory resource amount is greater than or equal to the target memory resource amount from the initial resource nodes according to the target processing resource amount and the target memory resource amount in the computing resource amount information, determine the candidate resource node whose standard value is greater than or equal to the first preset value as the target resource node, and allocate the target resource node to the account, so as to realize the allocation of resource nodes according to the computing resource amount information corresponding to the resource request and the standard value of the resource node, ensure that the target resource node meets the resource request while maximizing the standard value, take into account the resource request requirements of the account and the standard value of the resource node, and be suitable for more application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0054] Figure 1 A schematic diagram of a process flow of a method for processing a resource request in an embodiment;
[0055] Figure 2 A flowchart of a method for processing resource requests in another embodiment;
[0056] Figure 3 A flowchart of a method for processing resource requests in another embodiment;
[0057] Figure 4 A flowchart of a method for processing resource requests in another embodiment;
[0058] Figure 5 is a structural block diagram of a device for processing resource requests in one embodiment;
[0059] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0060] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0061] In one embodiment, Figure 1 As shown, a method for processing resource requests is provided. This embodiment uses the method applied to a terminal as an example for illustration. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0062] Step S110, in response to receiving a resource request from an account, determining computing resource quantity information corresponding to the resource request;
[0063] Exemplarily, an account can call a resource node by sending a resource request. In one example, a resource node can be a virtual node with computing resources, and the computing resources can be of various types, such as image computing resources, processor resources, memory resources, etc., which can be determined according to actual application scenarios.
[0064] A resource request may be a request for calling a resource node. The resource request may correspond to computing resource quantity information. The computing resource quantity information may include the required computing resource quantity corresponding to the resource request. In an example, the computing resource quantity information may include the computing resource quantity corresponding to different computing resource types.
[0065] In a possible implementation, the resource node may correspond to a virtual machine, each virtual machine corresponds to a computing resource, and the resource request may include a virtual machine call request.
[0066] Step S120, when the computing resource amount information does not include the target image computing resource amount, obtaining an initial resource node without image computing resources from preset resource nodes;
[0067] Exemplarily, it is determined whether the computing resource quantity information includes a target image computing resource quantity, that is, whether the resource request has an image computing resource requirement. If there is no target image computing resource quantity, it can be considered that the resource request has no image computing resource requirement.
[0068] When the resource request does not require image computing resources, an initial resource node without image computing resources is obtained from the preset resource nodes. In one example, the preset resource node may be an idle resource node to be selected, and the preset resource node may be determined based on the status of the resource node in the actual application scenario.
[0069] In one example, the image computing resources may include, but are not limited to, GPU resources.
[0070] Step S130, determining, from the initial resource nodes, candidate resource nodes whose processor resources are greater than or equal to the target processor resources and whose memory resources are greater than or equal to the target memory resources, according to the target processor resources and the target memory resources in the computing resource information;
[0071] Exemplarily, the target processor resource amount and the target memory resource amount in the computing resource amount information are obtained. In one example, the target processor resource amount may be the processor resource amount required by the resource request, and the target memory resource amount may be the memory resource amount required by the resource request.
[0072] Optionally, the processor resource amount and memory resource amount corresponding to the candidate resource node are obtained. When the processor resource amount is greater than or equal to the target processor resource amount, it can be considered that the processor resource amount meets the resource request's demand for processor resources; when the memory resource amount is greater than or equal to the target memory resource amount, it can be considered that the memory resource amount meets the resource request's demand for memory resources.
[0073] The initial resource node whose processor resource amount is greater than or equal to the target processor resource amount and whose memory resource amount is greater than or equal to the target memory resource amount is determined as the candidate resource node, that is, at this time, the processor resource amount and memory resource amount of the candidate resource node both meet the requirements of the resource request.
[0074] Step S140: determine the candidate resource nodes whose standard values are greater than or equal to the first preset value as target resource nodes, and allocate the target resource nodes to the account.
[0075] Exemplarily, different candidate resource nodes correspond to different standard values, and the standard value can be determined according to the image computing resource type, image computing resource amount, processor resource type, processor resource amount, memory resource type, and memory resource amount corresponding to the resource node.
[0076] Optionally, a candidate resource node whose standard value is greater than or equal to a first preset value is determined as a target resource node, and the target resource node is allocated to an account corresponding to the resource request so that the account can call the target resource node.
[0077] In one example, the first preset value may be determined according to an actual application scenario. For example, the first preset value may be set according to the standard value corresponding to the candidate resource node to screen out the candidate resource node with the highest standard value and determine it as the target resource node.
[0078] In an embodiment of the present disclosure, upon receiving a resource request from an account, computing resource quantity information corresponding to the resource request is determined; if the computing resource quantity information does not include a target image computing resource quantity, an initial resource node without image computing resources is obtained from a preset resource node; based on the target processing resource quantity and the target memory resource quantity in the computing resource quantity information, a candidate resource node having a processor resource quantity greater than or equal to the target processor resource quantity and a memory resource quantity greater than or equal to the target memory resource quantity is determined from the initial resource node; a candidate resource node having a standard value greater than or equal to a first preset value is determined as the target resource node; and the target resource node is allocated to the account, thereby enabling allocation of resource nodes according to the computing resource quantity information corresponding to the resource request and the standard value of the resource node, ensuring that the target resource node meets the resource request while maximizing the standard value, taking into account both the resource request requirements of the account and the standard value of the resource node, and being suitable for more application scenarios.
[0079] In one embodiment, Figure 2 As shown, in the case where the computing resource amount information does not include the image computing resource amount, it also includes:
[0080] Step S150, when all preset resource nodes include image computing resources, determining a target processor resource amount and a target memory resource amount according to the computing resource amount information;
[0081] Step S160 , determining a target resource node from the preset resource nodes according to the image computing resource type corresponding to the preset resource node, and allocating the target resource node to the account.
[0082] Exemplarily, if all preset resource nodes include image computing resources, then the resource nodes including image computing resources must be allocated to the account, and the allocation can be screened according to the image computing resource types corresponding to the resource nodes.
[0083] Optionally, different image computing resource types may correspond to different standard values, and the target resource node may be screened from preset resource nodes based on the image computing resource type, the target processor resource amount, and the target memory resource amount.
[0084] In one example, the processor resource amount of the target resource node is greater than or equal to the target processor resource amount and the memory resource amount is greater than or equal to the target memory resource amount. In one example, a preset resource node of an image computing resource type with a lower standard value can be selected as the target resource node.
[0085] In the embodiment of the present disclosure, when the computing resource quantity information does not include the image computing resource quantity, if the preset resource nodes all include image computing resources, then according to the image computing resource type corresponding to the preset resource node, the target resource node is determined from the preset resource nodes and allocated to the account, so that when the resource request does not require image computing resources but the preset resource nodes all include image computing resources, the resource nodes can be screened according to the image computing resource type, and different image computing resource types can correspond to different standard values to maximize the standard value of the resource nodes. In addition, according to the image computing resource type, the resource nodes corresponding to the image computing resources with high standard values can be reserved for the resource requests corresponding to the subsequent image computing resources, thereby ensuring the rationality and reliability of resource node allocation and improving the utilization rate of the computing resources corresponding to the resource nodes.
[0086] In one embodiment, determining the target resource node from the preset resource nodes according to the image computing resource type corresponding to the preset resource node includes:
[0087] Determine the remaining processor resource amount and the remaining memory resource amount corresponding to the preset resource node according to the image computing resource type corresponding to the preset resource node;
[0088] Determine as a candidate resource node a preset resource node whose remaining processor resource amount is greater than or equal to the target processor resource amount and whose remaining memory resource amount is greater than or equal to the target memory resource amount;
[0089] A candidate resource node whose standard value is less than a second preset value is determined as a target resource node.
[0090] Exemplarily, when screening the target resource node, the remaining processor resource amount and the remaining memory resource amount corresponding to the preset resource node are first determined according to the image computing resource type. In one example, the remaining processor resource amount can be the processor resource amount reserved according to the image computing resource type, and the remaining memory resource amount can be the memory resource amount reserved according to the image computing resource type.
[0091] Optionally, a preset resource node whose remaining processor resource amount is greater than or equal to the target processor resource amount and whose remaining memory resource amount is greater than or equal to the target memory resource amount is determined as a candidate resource node.
[0092] In one example, the standard value of the candidate resource node is obtained, and the candidate resource node whose standard value is less than the second preset value is determined as the target resource node. The second preset value can be determined according to the actual application scenario. For example, the second preset value can be set according to the standard value of the candidate resource node to screen out the target resource node with the lowest standard value.
[0093] In the disclosed embodiment, when determining the target resource node according to the image computing resource type, the remaining processor resource amount and the remaining memory resource amount corresponding to the preset resource node are first determined according to the image computing resource type corresponding to the preset resource node, and the preset resource node whose remaining processor resource amount and remaining memory resource amount meet the resource request is determined as a candidate resource node, and the target resource node is determined from the candidate resource nodes, where the standard value is less than the second preset value, thereby enabling the determination of the resource node based on the combination of the image computing resource type and the standard value, while ensuring that the target resource node meets the resource requirements, taking the standard value into account, and maximizing the standard value of the preset resource node, which is suitable for more application scenarios.
[0094] In one embodiment, determining the remaining processor resource amount and the remaining memory resource amount corresponding to the preset resource node according to the image computing resource type corresponding to the preset resource node includes:
[0095] Determining a first standard value corresponding to the preset resource node according to the image computing resource type corresponding to the preset resource node;
[0096] According to the first standard value, the remaining processor resource amount and the remaining memory resource amount corresponding to the preset resource node are determined.
[0097] Exemplarily, when reserving resources according to the image computing resource type, the first standard value corresponding to the preset resource node is determined according to the image computing resource type. The first standard value may be a standard value corresponding to the image computing resource type, and different image computing resource types correspond to different first standard values.
[0098] According to the first standard value, the amount of remaining processor resources and the amount of remaining memory resources reserved are determined. Exemplarily, the amount of remaining processor resources and the amount of remaining memory resources can be determined according to the first standard value. In one example, in order to ensure the maximization of the standard value, the higher the first standard value is, the higher the amount of remaining processor resources and the amount of remaining memory resources are, which can be determined according to the actual application scenario. In one example, the corresponding second standard value can be determined according to the processor resource type and memory resource type corresponding to the preset resource node, and the reserved remaining processor resources and the amount of remaining memory resources are determined according to the ratio of the first standard value to the second standard value.
[0099] In the disclosed embodiment, different image computing resource types correspond to different first standard values, and the remaining processor resources and remaining memory resources of the preset resource nodes are allocated according to the first standard values, so that resource nodes that meet the resource request can be screened out while taking into account the first standard values corresponding to different image computing resource types, so as to satisfy the current resource request while taking into account the subsequent resource requests corresponding to the image computing resource requirements, thereby ensuring the utilization rate of the image computing resources while taking into account the standard value of the resources.
[0100] In one embodiment, Figure 3 As shown, when the computing resource amount information does not include the target image computing resource amount, obtaining the initial resource node without image computing resources from the preset resource node includes:
[0101] Step S121, when the computing resource amount information includes the computing resource amount of the target image, determining the computing resource type of the target image according to the computing resource amount information;
[0102] Step S122: acquiring an initial resource node that matches the target image computing resource type from preset resource nodes.
[0103] Exemplarily, when the computing resource quantity information includes the target image computing resource quantity, it can be considered that the resource request of the account at this time corresponds to the demand for image computing resources, and a resource node with image computing resources needs to be allocated to the account.
[0104] Optionally, the target image computing resource type is determined based on the computing resource amount information. In one example, if the account has a demand for the image computing resource type, the computing resource amount information includes the target image computing resource type, that is, the image computing resource type required by the account.
[0105] According to the target image computing resource type, the initial resource node is screened from the preset resource nodes. In one example, the initial resource node has an image computing resource corresponding to the target image computing resource type.
[0106] In the embodiment of the present disclosure, if the computing resource quantity information corresponding to the resource request includes the target image computing resource quantity, an initial resource node matching the target image computing resource type is obtained from the preset resource nodes, thereby being able to quickly and accurately screen out the resource nodes corresponding to the image computing resource type required by the resource request, which is suitable for more application scenarios.
[0107] In one embodiment, when the computing resource amount information includes the computing resource amount of the target image, the method further includes:
[0108] In a case where the computing resource amount information does not include the target image computing resource type, determining an original resource node including the image computing resource from preset resource nodes;
[0109] Determining a first standard value corresponding to the original resource node according to the image computing resource type corresponding to the original resource node;
[0110] An original resource node whose first standard value is greater than or equal to a third preset value is determined as an initial resource node.
[0111] Exemplarily, if the account has no demand for the image computing resource type, the target image resource type is not included in the computing resource amount information. At this time, the original resource node including the image computing resource is determined from the preset resource nodes.
[0112] Exemplarily, the first standard value corresponding to the original resource node is determined according to the image computing resource type corresponding to the original resource node, and different image computing resource types may correspond to different first standard values. The original resource node whose first standard value is greater than or equal to the third preset value is determined as the initial resource node, that is, the original resource node with a higher first standard value is selected as the initial resource node for subsequent screening.
[0113] Optionally, the third preset value may be determined according to an actual application scenario to screen out original resource nodes with a higher first standard value.
[0114] In the embodiment of the present disclosure, when the image computing resource type is not clearly defined in the resource request, the original resource node corresponding to the image computing resource type with a higher first standard value is determined as the initial resource node, thereby taking into account both the allocation of image computing resources and the maximization of the first standard value, ensuring the rationality and reliability of resource node allocation, and being suitable for more application scenarios.
[0115] Figure 4 is a flowchart of a method for processing a resource request according to an exemplary embodiment, referring to Figure 4As shown, it includes the resource request judgment stage and the node selection stage. Resource request judgment stage: (1) After receiving the virtual machine activation request (i.e., resource request), determine whether it contains GPU resources (i.e., image computing resources); (2) If the request does not contain GPU resources, filter out nodes with GPU resources and sufficient CPU (i.e., processor resources) and memory resources in the node resources (i.e., preset resource nodes); (3) If the request contains GPU resources, determine whether to specify a specific GPU model (i.e., the target image computing resource type). Node selection phase (scheduling strategy): (1) If the request does not have GPU resources and there are not enough nodes with GPU resources, select the node with a CPU / memory model with a higher standard value; (2) If the request does not have GPU resources and there are not enough nodes with GPU resources, first select the nodes that meet the CPU / memory reservation rules corresponding to the GPU. The rule is that the higher the standard value of the GPU model, the more CPU / memory is reserved. Secondly, select the node with a GPU model with a lower standard value from the nodes that meet the reservation rules; (3) If the request has GPU resources and there is no specified GPU model, select the node with a GPU model with a higher standard value; (4) If the request has GPU resources and there is a specified GPU model, select the node with a CPU / memory model with a higher standard value.
[0116] In the case of equal node resources, the disclosed embodiment can first allocate resource nodes of the same type with higher standard values, and can dynamically adjust according to the standard value while also avoiding the situation where GPU models with higher standard values have no CPU and memory resources to match and are left vacant. This embodiment can prioritize the allocation of resource nodes with higher standard values while also reserving resource nodes for possible resource requests in the future, which can maximize the standard value of the overall resource nodes; and this embodiment does not conflict with the existing resource node scheduling strategy and can be flexibly integrated into other scheduling strategies.
[0117] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0118] Based on the same inventive concept, the embodiment of the present application also provides a resource request processing device for implementing the resource request processing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiment of the processing device for one or more resource requests provided below can refer to the limitations of the resource request processing method above, and will not be repeated here.
[0119] In an exemplary embodiment, Figure 5 As shown, a resource request processing device 500 is provided, comprising:
[0120] The receiving module 510 is used to determine the computing resource quantity information corresponding to the resource request in response to receiving the resource request of the account;
[0121] An acquisition module 520 is configured to acquire an initial resource node without image computing resources from preset resource nodes when the computing resource amount information does not include the target image computing resource amount;
[0122] A determination module 530 is used to determine, from the initial resource nodes, a candidate resource node whose processor resource amount is greater than or equal to the target processor resource amount and whose memory resource amount is greater than or equal to the target memory resource amount according to the target processor resource amount and the target memory resource amount in the computing resource amount information;
[0123] The allocation module 540 is used to determine the candidate resource nodes whose standard values are greater than or equal to the first preset value as target resource nodes, and allocate the target resource nodes to the account.
[0124] In one embodiment, the device is further used for:
[0125] In the case where all preset resource nodes include image computing resources, determining a target processor resource amount and a target memory resource amount according to the computing resource amount information;
[0126] According to the image computing resource type corresponding to the preset resource node, a target resource node is determined from the preset resource nodes, and the target resource node is allocated to the account.
[0127] In one embodiment, the device is further used for:
[0128] Determine the remaining processor resource amount and the remaining memory resource amount corresponding to the preset resource node according to the image computing resource type corresponding to the preset resource node;
[0129] Determine as a candidate resource node a preset resource node whose remaining processor resource amount is greater than or equal to the target processor resource amount and whose remaining memory resource amount is greater than or equal to the target memory resource amount;
[0130] A candidate resource node whose standard value is less than a second preset value is determined as a target resource node.
[0131] In one embodiment, the device is further used for:
[0132] Determining a first standard value corresponding to the preset resource node according to the image computing resource type corresponding to the preset resource node;
[0133] According to the first standard value, the remaining processor resource amount and the remaining memory resource amount corresponding to the preset resource node are determined.
[0134] In one embodiment, the acquisition module is further used for:
[0135] In a case where the computing resource amount information includes the computing resource amount of the target image, determining the computing resource type of the target image according to the computing resource amount information;
[0136] An initial resource node matching the target image computing resource type is obtained from preset resource nodes.
[0137] In one embodiment, the acquisition module is further used for:
[0138] In a case where the computing resource amount information does not include the target image computing resource type, determining an original resource node including the image computing resource from preset resource nodes;
[0139] Determining a first standard value corresponding to the original resource node according to the image computing resource type corresponding to the original resource node;
[0140] An original resource node whose first standard value is greater than or equal to a third preset value is determined as an initial resource node.
[0141] Each module in the resource request processing device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0142] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 6As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data involved in the method described in this embodiment, such as computing resource quantity information. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for processing resource requests is implemented.
[0143] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0144] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0145] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0146] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0147] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0148] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0149] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0150] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for processing a resource request, characterized in that: The method comprises: In response to receiving a resource request from an account, determining computing resource quantity information corresponding to the resource request; In a case where the computing resource amount information does not include the target image computing resource amount, acquiring an initial resource node without image computing resources from preset resource nodes; According to the target processor resource amount and the target memory resource amount in the computing resource amount information, determining, from the initial resource nodes, candidate resource nodes whose processor resource amount is greater than or equal to the target processor resource amount and whose memory resource amount is greater than or equal to the target memory resource amount; A candidate resource node whose standard value is greater than or equal to a first preset value is determined as a target resource node, and the target resource node is allocated to the account.
2. The method according to claim 1, characterized in that In the case where the computing resource amount information does not include the image computing resource amount, the method further includes: In the case where all preset resource nodes include image computing resources, determining a target processor resource amount and a target memory resource amount according to the computing resource amount information; According to the image computing resource type corresponding to the preset resource node, a target resource node is determined from the preset resource nodes, and the target resource node is allocated to the account.
3. The method according to claim 2, characterized in that The step of determining a target resource node from the preset resource nodes according to the image computing resource type corresponding to the preset resource node includes: Determine the remaining processor resource amount and the remaining memory resource amount corresponding to the preset resource node according to the image computing resource type corresponding to the preset resource node; Determine as a candidate resource node a preset resource node whose remaining processor resource amount is greater than or equal to the target processor resource amount and whose remaining memory resource amount is greater than or equal to the target memory resource amount; A candidate resource node whose standard value is less than a second preset value is determined as a target resource node.
4. The method according to claim 3, characterized in that The determining, according to the image computing resource type corresponding to the preset resource node, the remaining processor resource amount and the remaining memory resource amount corresponding to the preset resource node comprises: Determining a first standard value corresponding to the preset resource node according to the image computing resource type corresponding to the preset resource node; According to the first standard value, the remaining processor resource amount and the remaining memory resource amount corresponding to the preset resource node are determined.
5. The method according to claim 1, characterized in that: When the computing resource amount information does not include the target image computing resource amount, obtaining an initial resource node without image computing resources from a preset resource node includes: In a case where the computing resource amount information includes the computing resource amount of the target image, determining the computing resource type of the target image according to the computing resource amount information; An initial resource node matching the target image computing resource type is obtained from preset resource nodes.
6. The method according to claim 5, characterized in that In the case where the computing resource amount information includes the target image computing resource amount, the method further includes: In a case where the computing resource amount information does not include the target image computing resource type, determining an original resource node including the image computing resource from preset resource nodes; Determining a first standard value corresponding to the original resource node according to the image computing resource type corresponding to the original resource node; An original resource node whose first standard value is greater than or equal to a third preset value is determined as an initial resource node.
7. A resource request processing device, characterized in that: The device comprises: A receiving module, configured to determine, in response to receiving a resource request from an account, information about the amount of computing resources corresponding to the resource request; An acquisition module, configured to acquire an initial resource node without image computing resources from preset resource nodes when the computing resource amount information does not include the target image computing resource amount; A determination module, configured to determine, from the initial resource nodes, a candidate resource node whose processor resource amount is greater than or equal to the target processor resource amount and whose memory resource amount is greater than or equal to the target memory resource amount according to the target processor resource amount and the target memory resource amount in the computing resource amount information; The allocation module is used to determine the candidate resource nodes whose standard values are greater than or equal to the first preset value as target resource nodes, and allocate the target resource nodes to the account.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.