Resource processing method and device

By providing preset tags for services and resources and allocating resources based on the tags, the problem of low system stability caused by resource coupling in distributed architecture is solved, and resource decoupling and system stability are improved.

CN113590329BActive Publication Date: 2025-04-11BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110881960.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-02
Publication Date
2025-04-11
Estimated Expiration
2041-08-02

AI Technical Summary

Technical Problem

In a distributed architecture environment, the existing technology is randomly selected during resource allocation, resulting in multiple services deployed on each host, with high resource coupling and low system stability.

Method used

By providing preset tags for services and resources separately, allocating according to matching tags when resource allocation is allocated, ensuring that services are allocated only in resources that match tags.

Benefits of technology

It realizes resource decoupling, reduces resource coupling between services, and improves system stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113590329B_ABST
    Figure CN113590329B_ABST
Patent Text Reader

Abstract

The present disclosure provides a resource processing method and device, which relate to the field of artificial intelligence in computer technology. The specific implementation scheme is: obtain a business processing request, which includes an identifier of a first business. Obtain a first preset tag of the first business and resource demand information corresponding to the first business, the resource demand information including at least one resource type required by the first business, and the resource demand corresponding to each resource type. Obtain a second preset tag corresponding to each of a plurality of candidate resources, and the remaining resource amount corresponding to each candidate resource. According to the first preset tag of the first business, the resource demand information corresponding to the first business, the second preset tag corresponding to each of a plurality of candidate resources, and the remaining resource amount corresponding to each candidate resource, determine the target resource corresponding to the first business among the plurality of candidate resources, and allocate the target resource to the first business. This effectively realizes the decoupling of resources, thereby improving the stability of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence in computer technology, and in particular to a resource processing method and device. Background Art

[0002] In the process of business processing, it is usually necessary to allocate corresponding resources to the business, such as server resources, database resources, etc.

[0003] In the current distributed architecture environment, each distributed host includes many resources. When allocating resources, the existing technology usually randomly selects from the available resources of any host to allocate corresponding resources to the business. However, this will result in the deployment of multiple businesses on each distributed host.

[0004] Therefore, in the implementation of the prior art, the coupling of allocated resources between various services is high, so that when a problem occurs in one service, the corresponding service with resource coupling will also be affected, thereby resulting in low stability of the system. Summary of the invention

[0005] The present disclosure provides a resource processing method and device.

[0006] According to a first aspect of the present disclosure, a resource processing method is provided, comprising:

[0007] Obtaining a service processing request, where the service processing request includes an identifier of the first service;

[0008] Acquire a first preset tag of the first service and resource requirement information corresponding to the first service, wherein the resource requirement information includes at least one resource type required by the first service and a resource requirement corresponding to each resource type;

[0009] Acquire a second preset label corresponding to each of a plurality of candidate resources and a remaining resource amount corresponding to each candidate resource, wherein the plurality of candidate resources are resources corresponding to the at least one resource type;

[0010] According to the first preset label of the first business, the resource demand information corresponding to the first business, the second preset labels corresponding to the multiple candidate resources, and the remaining resource amount corresponding to each candidate resource, the target resource corresponding to the first business is determined among the multiple candidate resources, and the target resource is allocated to the first business.

[0011] According to a second aspect of the present disclosure, there is provided a resource processing device, comprising:

[0012] A first acquisition module, used to acquire a service processing request, where the service processing request includes an identifier of a first service;

[0013] A second acquisition module is used to acquire a first preset tag of the first service and resource demand information corresponding to the first service, wherein the resource demand information includes at least one resource type required by the first service and a resource demand amount corresponding to each resource type;

[0014] A third acquisition module is used to acquire second preset tags corresponding to each of a plurality of candidate resources and a remaining resource amount corresponding to each candidate resource, wherein the plurality of candidate resources are resources corresponding to the at least one resource type;

[0015] A processing module is used to determine the target resource corresponding to the first business among the multiple candidate resources based on the first preset label of the first business, the resource demand information corresponding to the first business, the second preset label corresponding to each of the multiple candidate resources, and the remaining resource amount corresponding to each candidate resource, and allocate the target resource to the first business.

[0016] According to a third aspect of the present disclosure, there is provided an electronic device, including:

[0017] at least one processor; and

[0018] a memory communicatively connected to the at least one processor; wherein,

[0019] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described in the first aspect.

[0020] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute the method described in the first aspect.

[0021] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising: a computer program, wherein the computer program is stored in a readable storage medium, at least one processor of an electronic device can read the computer program from the readable storage medium, and the at least one processor executes the computer program so that the electronic device executes the method described in the first aspect.

[0022] The technology disclosed herein solves the problem of low system stability caused by resource coupling.

[0023] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0025] Figure 1 A schematic diagram of implementing resource allocation provided in an embodiment of the present disclosure;

[0026] Figure 2 A flowchart of a resource processing method provided by an embodiment of the present disclosure;

[0027] Figure 3 The process of the resource processing method provided in the embodiment of the present disclosure Figure 2 ;

[0028] Figure 4 A schematic diagram of allocating target resources to a first service provided by an embodiment of the present disclosure;

[0029] Figure 5 The process of the resource processing method provided in the embodiment of the present disclosure Figure 3 ;

[0030] Figure 6 A schematic diagram of implementing the dynamic adjustment of target resources provided by an embodiment of the present disclosure;

[0031] Figure 7 A schematic diagram of implementing a preset tag provided in an embodiment of the present disclosure;

[0032] Figure 8 A processing structure diagram of a resource processing method provided in an embodiment of the present disclosure;

[0033] Fig. 9 is a schematic diagram of the structure of a resource processing device according to an embodiment of the present disclosure;

[0034] Fig.10 It is a block diagram of an electronic device used to implement the resource processing method of the embodiment of the present disclosure. DETAILED DESCRIPTION

[0035] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0036] In order to better understand the technical solution of the present disclosure, the related technologies involved in the present disclosure are further introduced in detail below.

[0037] With the continuous development of computer technology, the current distributed architecture has also made great progress. In the current complex distributed architecture environment, with the transition from service-oriented architecture (SOA) to microservice concepts, and the introduction of containerization technologies such as Kubernetes, Spring Cloud, and Service Mesh, the current full-stack resources tend to be "cloud-based", multi-instance, and multi-cluster shared.

[0038] Usually, in the process of business processing, it is necessary to allocate corresponding resources to the business to ensure the normal execution of the business, such as server resources, database resources, disk resources, etc. In a distributed architecture environment, each distributed host includes a lot of resources. In the related technology, when allocating resources, it is usually a random selection from the available resources of any host, and the selected resources are allocated to the current business. However, this will result in the deployment of many businesses on each distributed host.

[0039] For example, we can take server resources as an example and combine Figure 1 To understand, Figure 1 A schematic diagram of implementing resource allocation provided in an embodiment of the present disclosure.

[0040] like Figure 1 As shown in the figure, assuming that the current system architecture includes multiple clusters, each of which includes multiple servers. Assuming that when allocating server resources for various services, the available server resources are arbitrarily allocated on each cluster, it may cause Figure 1 The situation shown means that the server resources in cluster 1 are allocated to the order business, commodity business, and user business at the same time; the server resources in cluster 2 are allocated to the order business, commodity business, and user business at the same time; and the server resources in cluster 3 are allocated to the order business, commodity business, and user business at the same time.

[0041] This will result in a high coupling of resource allocation between various businesses. When a problem occurs in one of the businesses, the corresponding business with resource coupling will also be affected. For example, Figure 1 In the situation shown, when a problem occurs with the order business corresponding to the server resources on cluster 1, it is possible that problems may occur with both the product business and the user business corresponding to the server resources on cluster 1, which may lead to low system stability.

[0042] In response to the problems in the prior art, the present disclosure proposes the following technical concept: by providing labels for services and resources respectively, when allocating resources, allocation is made according to the matching labels. For example, for order services, resources are only allocated in the server with the corresponding order label, thereby effectively realizing resource decoupling to improve system stability.

[0043] The resource processing method provided by the present disclosure is introduced below in conjunction with specific embodiments. It is worth noting that the execution subject of each embodiment in the present disclosure can be, for example, a server, a processor, a microprocessor and other devices with data processing functions, and this embodiment does not limit the specific implementation method of the execution subject.

[0044] First combine Figure 2 The resource processing method provided by the embodiment of the present disclosure is introduced. Figure 2 A flowchart of a resource processing method provided in an embodiment of the present disclosure.

[0045] like Figure 2 As shown, the method includes:

[0046] S201: Obtain a service processing request, where the service processing request includes an identifier of a first service.

[0047] In this embodiment, a business processing request can be first obtained, and the business processing request includes an identifier of the first business. The identifier of the first business is used to indicate that the current business processing request is to allocate resources for the first business request, where the identifier of the first business can be, for example, a business name, a business code, etc. This embodiment does not limit the specific implementation method of the identifier of the first business, as long as it can implement the indication of the first business.

[0048] And the first business in the present disclosure can be any type of task to be processed, for example, it can be an order-type task to be processed, for example, it can be a function to add an order to modify the address, or it can be a function to add an order to query logistics information, etc. This embodiment does not impose any special restrictions on the specific implementation method of the first business, it can be selected according to actual needs, and any task that needs to be processed in the system can be used as the first business in this embodiment.

[0049] S202: Obtain a first preset tag of a first service and resource requirement information corresponding to the first service, where the resource requirement information includes at least one resource type required by the first service and a resource requirement corresponding to each resource type.

[0050] In this embodiment, the first business corresponds to a first preset label. In a possible implementation, the first preset label includes at least one of the following: business type, scenario type, resource status, and sharing identifier. Among them, the business type can indicate the specific type of the current business, such as order business, user business, commodity business, etc.; the scenario type can indicate the application scenario of the current resource application, such as temporary activities, self-destructing, offline, testing, etc.; and the resource status can be whether the resource is maintained, whether the resource is upgraded, etc.; the sharing identifier can indicate whether the current resource is shared, whether it is exclusive, etc. In the actual implementation process, the specific implementation methods of the business type, resource type, business status, and sharing identifier introduced above can be selected according to actual needs, and this embodiment does not impose any special restrictions on this.

[0051] And in the actual implementation process, this embodiment does not impose any special restrictions on the specific implementation method of the first preset tag. In one possible implementation method, it can be understood that the specific content of the first preset tag actually indicates what kind of resources the current first business needs. For example, based on the content introduced above, the first preset tag can indicate the resources that the current first business needs to be exclusive for testing the order business, etc. On this basis, the specific implementation method of the first preset tag can be selected and expanded according to actual needs.

[0052] The first preset tag may be preset manually, or may be output by a preset model after the business information of the first business is input into the preset model. This embodiment also does not limit the specific implementation method for determining the first preset tag.

[0053] In this embodiment, resource requirement information corresponding to the first business can also be obtained, wherein the resource requirement information may include at least one resource type required for the first business. The resource type in this embodiment may include at least one of the following: server resources, central processing unit (CPU) resources, disk resources, and memory resources. In the actual implementation process, the specific resource type required by the first business can be selected according to actual needs. For example, the current first business requires server resources and disk resources, or the current first business requires server resources, disk resources, and memory resources. This embodiment does not impose any special restrictions on the at least one resource type required for the first business, which can be selected according to actual needs.

[0054] The resource demand information may also include the resource demand corresponding to each resource type. For example, the current first business requests CPU resources and memory resources, where the resource demand for CPU resources is 50Ghz (gigahertz) and the resource demand for memory resources is 25GB. In the actual implementation process, the resource demand information corresponding to the first business can be selected according to actual needs, and this embodiment does not impose any special restrictions on this.

[0055] And in the process of obtaining the first preset tag of the first service and the resource requirement information corresponding to the first service, in one possible implementation, for example, the relevant information of the first service is included in the service processing request, and the first preset tag and the resource requirement information can be obtained from the service processing request. In another possible implementation, the first preset tag and the resource requirement information can be stored in a preset storage unit corresponding to the service, and in another possible implementation, for example, the first preset tag and the resource requirement information can be obtained from the preset storage unit corresponding to the service.

[0056] S203: Obtain second preset labels corresponding to each of a plurality of candidate resources and a remaining resource amount corresponding to each candidate resource, wherein the plurality of candidate resources are resources corresponding to at least one resource type.

[0057] In this embodiment, there are multiple candidate resources, where the candidate resources are resources corresponding to at least one resource type required for the first business. For example, if the at least one resource type required for the current first business is CPU resources and memory resources, then the multiple candidate resources can be at least one CPU resource and at least one memory resource.

[0058] Each candidate resource has a corresponding second preset tag. For example, each CPU resource has a corresponding second preset tag, and each memory resource has a corresponding second preset tag. In a possible implementation, the second preset tag includes at least one of the following: business type, scenario type, resource status, and sharing identifier. The specific implementation is similar to the first preset tag described above, except that the second preset tag is set for the preset resource.

[0059] And in this embodiment, each candidate resource also corresponds to its own remaining resource amount, wherein the remaining resource amount is the resource amount that can be allocated to the remaining services. In a possible implementation method, the remaining resource amount in this embodiment is the resource amount of resources other than the allocated resources and the pre-configured resources, wherein the allocated resources are the resources that have been allocated to the corresponding services, and the pre-configured resources are the resources that are pre-specified to be allocated to certain services. The resources other than the allocated resources and the pre-configured resources are the remaining resources, wherein the resource amount of the remaining resources is the remaining resource amount in this embodiment.

[0060] In this embodiment, when determining the remaining amount of resources, the amount of resources after deducting the allocated resources and the pre-configured resources is determined as the remaining amount of resources, which can effectively avoid resource allocation errors caused by erroneous allocation of pre-configured resources to the first business, thereby effectively ensuring the correctness of resource allocation.

[0061] Among them, in the process of obtaining the second preset tags and remaining resource amounts corresponding to each of multiple candidate resources, in one possible implementation method, the second preset tags and remaining resource amounts corresponding to each candidate resource can be, for example, in the preset storage unit corresponding to the resource, and then, for example, the second preset tags and remaining resource amounts corresponding to each candidate resource can be obtained from the preset storage unit corresponding to the resource; or, in another possible implementation method, the second preset tags corresponding to each candidate resource can also be stored in association with each candidate resource, and then, for example, the second preset tags corresponding to each candidate resource can be directly obtained according to each candidate resource, and the remaining resource amounts corresponding to each candidate resource can be directly read.

[0062] S204. Determine a target resource corresponding to the first business from among the multiple candidate resources based on a first preset tag of the first business, resource demand information corresponding to the first business, second preset tags corresponding to each of the multiple candidate resources, and the remaining resource amount corresponding to each candidate resource, and allocate the target resource to the first business.

[0063] Based on the above introduction, it can be determined that the first preset label and resource demand information of the first business, as well as the second preset label and remaining resource amount corresponding to each candidate resource can be determined. Then, resources can be allocated to the first business based on this information. Specifically, the target resources corresponding to the first business can be determined from multiple candidate resources based on the information introduced above, and then the target resources can be allocated to the first business.

[0064] In one possible implementation, matching can be performed based on a first preset tag and a second preset tag, so that candidate resources matching the preset tags are determined as resources that can be allocated to the first business, and then, among the candidate resources matching the tags, the candidate resources whose remaining resources meet the resource demand of the first business are determined as target resources corresponding to the first business.

[0065] Based on such an implementation method, it is possible to ensure that the allocated target resources meet the resource demand of the first business, while ensuring that the target resources are allocated to the first business based on the matching of preset tags. Allocating resources based on preset tags can effectively achieve resource decoupling. Specifically, resources matching the tags are allocated to corresponding businesses, thereby ensuring that different businesses are allocated different resources, avoiding the situation described above where many businesses are deployed on the same server resources at the same time, thereby effectively ensuring the decoupled allocation of resources. Based on such a resource allocation method, when a problem occurs in a certain business, because there is no resource decoupling, it will not affect the remaining businesses, thereby effectively ensuring the stability of the system.

[0066] The resource processing method provided by the embodiment of the present disclosure includes: obtaining a business processing request, the business processing request includes an identifier of a first business. Obtaining a first preset tag of the first business and resource demand information corresponding to the first business, the resource demand information including at least one resource type required by the first business and the resource demand corresponding to each resource type. Obtaining a second preset tag corresponding to each of a plurality of candidate resources and the remaining resource amount corresponding to each candidate resource, the plurality of candidate resources are resources corresponding to at least one resource type. According to the first preset tag of the first business, the resource demand information corresponding to the first business, the second preset tag corresponding to each of a plurality of candidate resources, and the remaining resource amount corresponding to each candidate resource, determining the target resource corresponding to the first business from the plurality of candidate resources, and allocating the target resource to the first business. By setting the preset tags corresponding to the business and the resource respectively, when allocating resources for the first business, the resources are allocated according to the preset tags and the required resource amount, so that the corresponding resources can be allocated to the first business according to the matching tags on the basis of satisfying the required resource amount of the first business, so as to effectively realize the decoupling of resources, thereby improving the stability of the system.

[0067] Based on the above embodiments, Figure 3 to Figure 4 The resource processing method provided by the embodiment of the present disclosure is further introduced in detail. Figure 3 The process of the resource processing method provided in the embodiment of the present disclosure Figure 2 , Figure 4 A schematic diagram of allocating target resources to a first service provided in an embodiment of the present disclosure.

[0068] like Figure 3 As shown, the method includes:

[0069] S301: Obtain a service processing request, where the service processing request includes an identifier of a first service.

[0070] S302: Obtain a first preset tag of a first service and resource requirement information corresponding to the first service, where the resource requirement information includes at least one resource type required by the first service and a resource requirement corresponding to each resource type.

[0071] S303: Obtain second preset labels corresponding to each of a plurality of candidate resources and a remaining resource amount corresponding to each candidate resource, wherein the plurality of candidate resources are resources corresponding to at least one resource type.

[0072] Among them, the implementation method of S301-S303 is similar to the implementation method of S201-S203 introduced above, and will not be repeated here.

[0073] S304. Match the first preset tag of the first business with the second preset tags corresponding to each of the multiple candidate resources, and determine at least one tag matching resource corresponding to the first business from the multiple candidate resources, wherein the second preset tag corresponding to each tag matching resource is the same as the first preset tag of the first business.

[0074] In this embodiment, when determining the target resource corresponding to the first business, matching can be performed based on the first preset tag of the first business and the second preset tags corresponding to each of the multiple candidate resources, so that at least one tag matching resource corresponding to the first business can be determined from the multiple candidate resources. It can be understood that the tag matching resource introduced in this embodiment is a resource that matches the second preset tag and the first preset tag of the first business.

[0075] In this embodiment, the matching of labels can be, for example, the same labels. In this embodiment, the second preset label corresponding to the label matching resource and the first preset label of the first business can be the same. For example, the first preset label of the first business includes "order business", indicating that the business type of the first business is order business. At the same time, the second preset label corresponding to the label matching resource includes "order business", indicating that the current resources are resources available for order business.

[0076] Or in an optional implementation, the tag matching may also be that there is a mapping relationship between the first preset tag and the second preset tag. This embodiment does not impose any particular limitation on the specific implementation of the tag matching, which may be selected according to actual needs.

[0077] For example, based on the diagram, it can be understood that resources are allocated to the first service based on the matching of the first preset tag and the second preset tag. Taking server resources as an example, the allocated resources can be, for example, Figure 4 As shown, see Figure 4 Currently, cluster 1 includes servers 1-1, 1-2, and 1-3, and cluster 2 includes servers 2-1, 2-2, and 2-3, and so on.

[0078] For example, currently resources are allocated for order business A, wherein the first preset tag corresponding to order business A includes "order business", wherein, Figure 4 Each server in the list can be used as a candidate resource, and can be matched first according to the preset tag. Assuming that the second preset tags corresponding to servers 1-1, 1-2, and 1-3 all include "order business", it can be determined that the second preset tags of servers 1-1, 1-2, and 1-3 all match the first preset tag, so servers 1-1, 1-2, and 1-3 can actually be tag matching resources, and then further selection can be made in the tag matching resources according to the remaining resources to determine the target resource.

[0079] S305: Determine the remaining resource amount corresponding to each resource type in the label matching resources according to at least one resource type required by the first service.

[0080] After determining the label matching resources, the matching operation of the preset label has actually been completed. When determining the target resources, in addition to matching the preset label, it is necessary to further ensure that the resources allocated to the first business can meet the resource demand of the first resource. Therefore, based on at least one resource type required by the first business, the remaining resource amounts corresponding to each resource type in the label matching resources can be determined.

[0081] It can be understood that the label matching resources actually include resources of various resource types, such as at least one server resource, at least one CPU resource, at least one disk resource, and at least one memory resource. Then, the remaining resource amount of each server resource, the remaining resource amount of each CPU resource, the remaining resource amount of each disk resource, and the remaining resource amount of each memory resource in the label matching resources can be determined. In the actual implementation process, the specific implementation method of the resource type can be selected according to actual needs, and this embodiment does not limit this.

[0082] S306. For any resource type, determine at least one preliminary resource in the label-matching resources whose resource demand corresponding to the resource type is greater than or equal to a first remaining resource amount, wherein the first remaining resource amount is the remaining resource amount corresponding to the resource type in the label-matching resources.

[0083] After determining the resource demand corresponding to each resource type, the target resource can be determined based on the resource demand and the business demand of the first business. It can be understood that when allocating resources, resources will actually be allocated for resources of each resource type. For the sake of ease of explanation, the following takes any resource type as an example to introduce the resource allocation processing method. Assuming that server resources are used as an example, the processing methods of other resource types are similar.

[0084] What can be determined is that the label matching resources include resources of various resource types. For example, the remaining resource amount corresponding to the server resources can be determined in the label matching resources, and the resource demand information corresponding to the first business includes the resource demand amount corresponding to the server resources. In order to ensure that the allocated resources can meet the needs of the first business, at least one preliminary resource whose resource demand amount corresponding to the server resources is greater than or equal to the resource demand amount corresponding to the server resources can be determined in the label matching resources. The preliminary resources determined here are resources whose preset labels and remaining resource amounts both meet the needs of the first business.

[0085] For example, you can combine Figure 4 To understand, based on the above introduction, it can be determined that for order business A, the servers 1-1, 1-2, and 1-3 can actually be label matching resources. Assuming that the remaining resources of server 1-1 are greater than the resource demand of order business A for server resources, and the remaining resources of server 1-2 are greater than the resource demand of order business A for server resources, and the remaining resources of server 1-3 are less than the resource demand of order business A for server resources, it can be determined that servers 1-1 and 1-2 meet the resource demand of the first business, and therefore servers 1-1 and 1-2 can be determined as preliminary resources.

[0086] The above is an introduction to the implementation method of determining preliminary resources using server resources as an example. The implementation method of determining preliminary resources for other possible resource types is similar and will not be repeated here.

[0087] It should also be noted that the resource demand corresponding to each resource type of the first service in this embodiment may include, for example, an initial application resource amount and an increase resource amount, wherein the initial application resource amount is the resource amount required when the first service is initially executed, and the increase resource amount is the resource amount further required as the execution process of the first service proceeds. For example, with respect to memory resources, the first service only needs 5GB to complete the deployment and operation of the first service in the initial situation, so the initial application resource amount of the first service can be 5GB, but as the first service continues to run, the memory resources required by the first service will inevitably increase, and the increase resource amount needs to be allocated to the first service to ensure the subsequent normal operation of the first service, for example, the increase resource amount of the first service is 50GB.

[0088] In one possible implementation, the growth resource amount of the first business may be determined based on the resource growth rate of the first business, wherein the resource growth rate may be preset, or may also be calculated through model processing, machine algorithm and other methods; or, the resource growth amount of the first business may also be preset; or, the resource growth amount of the first business may also be determined based on a preset algorithm, and this embodiment does not impose any special restrictions on this.

[0089] S307: Determine a target resource corresponding to the first service in at least one preliminary resource corresponding to each resource type.

[0090] Based on the above introduction, at least one preliminary resource can be determined. It can be understood that any preliminary resource in this embodiment meets the needs of the first business, so any preliminary resource can be used as the target resource corresponding to the first business. Therefore, the target resource corresponding to the first business can be determined in at least one preliminary resource corresponding to each resource type.

[0091] In a possible implementation, for example, a random selection may be made from at least one preliminary resource corresponding to each resource type, thereby determining the selected preliminary resource corresponding to each resource type, thereby determining the target resource corresponding to the first service. Alternatively, the preliminary resource with the largest resource identifier may be determined as the target resource, or the preliminary resource with the smallest resource identifier may be determined as the target resource, from at least one preliminary resource corresponding to each resource type. Alternatively, the target resource may be determined as the resource with the smallest difference between the remaining resource amount and the resource demand amount of each resource type corresponding to the first service from at least one preliminary resource corresponding to each resource type. This embodiment does not impose any special restrictions on the specific implementation method for determining the target resource, which may be selected according to actual needs. This embodiment does not impose any restrictions on this, as long as the target resource is determined based on the preliminary resource.

[0092] In this embodiment, the target resources corresponding to each service can be determined as follows, for example: Figure 4 As shown, see Figure 4 , assuming that the target resource of the server resource determined for order business A is server 102, the target resource of the server resource determined for order business B is server 1-1, and the target resource determined for other businesses is as follows Figure 4 As shown, this embodiment will not be described in detail.

[0093] Understandably, Figure 4 The described situation is only an exemplary description. In the actual implementation process, the target resources specifically allocated to the first service may depend on the actual implementation, and this embodiment does not limit this.

[0094] based on Figure 4 It can be determined that, in this embodiment, on the basis of ensuring that the resource demand of the business can be met, the allocation of resources according to the preset tags is effectively guaranteed, so that the decoupling of resources can be effectively realized to avoid that when a business has a problem due to resource coupling, the other businesses will also be affected. For example, Figure 4 In this case, when a problem occurs in order business A, since the resources of order business A are not coupled with the resources of other businesses, it will not affect other businesses, thus effectively ensuring the stability of the system.

[0095] The resource processing method provided by the embodiment of the present disclosure includes: obtaining a service processing request, the service processing request includes an identifier of a first service. Obtaining a first preset tag of the first service and resource demand information corresponding to the first service, wherein the resource demand information includes at least one resource type required by the first service and the resource demand corresponding to each resource type. Obtaining a second preset tag corresponding to each of a plurality of candidate resources and the remaining resource amount corresponding to each candidate resource, wherein the plurality of candidate resources are resources corresponding to at least one resource type. Matching is performed according to the first preset tag of the first service and the second preset tags corresponding to each of the plurality of candidate resources, and determining at least one tag matching resource corresponding to the first service from among the plurality of candidate resources, wherein the second preset tag corresponding to each tag matching resource is the same as the first preset tag of the first service. According to at least one resource type required by the first service, determining the remaining resource amount corresponding to each resource type in the tag matching resource. For any resource type, determining at least one preliminary resource in the tag matching resource whose resource demand corresponding to the resource type is greater than or equal to the first remaining resource amount, wherein the first remaining resource amount is the remaining resource amount corresponding to the resource type in the tag matching resource. Determine the target resource corresponding to the first service in at least one preliminary resource corresponding to each resource type. By matching the first preset tag and the second preset tag to determine the tag matching tag in the candidate resources, resources can be effectively allocated to the first business based on the tag matching to effectively achieve resource decoupling. Then, the target resources are determined based on the resource demand of each resource type and the remaining resource amount of each resource type in the tag matching resources, thereby effectively ensuring that the determined target resources meet the resource demand of the first business, thereby accurately and effectively ensuring that resources are effectively decoupled while meeting the resource demand of the first business, thereby improving the stability of the system.

[0096] Based on the above introduction, the resource processing method provided in the embodiment of the present disclosure can obtain the resource utilization rate of the first business after allocating the target resource to the first business, and then dynamically adjust the target resource according to the resource utilization rate, thereby improving the rationality of resource allocation. Figures 5 and 6 This paper introduces the implementation method of dynamic adjustment of target resources. Figure 5 The process of the resource processing method provided in the embodiment of the present disclosure Figure 3 , Figure 6 A schematic diagram of an implementation of dynamically adjusting target resources provided in an embodiment of the present disclosure.

[0097] like Figure 5 As shown, the method includes:

[0098] S501: Obtain resource usage of a first service.

[0099] In this embodiment, the target resources allocated to the first business can be dynamically tracked to determine the resource usage of the allocated target resources by the first business to obtain the resource utilization rate of the first business. For example, the resource usage of the allocated target resources by the first business can be determined, and then divided by the resource amount of the allocated target resources to determine the resource utilization rate.

[0100] It can be understood that the target resources in this embodiment include resources of various resource types required by the first business, so the resource utilization rate also corresponds to the resource utilization rate of each resource type, for example, it can include the resource utilization rate of server resources, CPU utilization rate, disk utilization rate, memory utilization rate, etc.

[0101] S502: If the resource usage rate is greater than or equal to a first threshold, a first alarm message is sent to a preset device, and a remaining amount of resources in the tag matching resources is obtained.

[0102] For example, you can refer to Figure 6 To understand, such as Figure 6 As shown, in this embodiment, the resource utilization rate can be compared with a first threshold. When the resource utilization rate is greater than or equal to the first threshold, it indicates that the resource supply is insufficient. When the resource supply is insufficient, it may cause the operating stability of the first business to decrease. At this time, a first alarm message can be sent to the preset device, wherein the first alarm message is used to indicate that the resources currently allocated to the first business are insufficient.

[0103] After that, it is necessary to dynamically increase the target resources allocated to the first business. When increasing the target resources allocated to the first business, it is necessary to ensure that the added resources are also label-matched resources. Therefore, the resources can be dynamically adjusted according to the label-matching resources. Specifically, the remaining resources in the label-matching resources can be obtained. The label-matching resources in this embodiment are resources with the same second preset label and the first preset label of the first business.

[0104] S503: If the remaining amount of resources in the label matching resources is greater than or equal to the amount of resources to be increased, increase the target resources allocated to the first service according to the label matching resources.

[0105] After obtaining the remaining amount of resources in the tag matching resources, the remaining amount of resources in the tag matching resources may be compared with the amount of resources to be increased for the first service to determine whether there are enough resources in the tag matching resources for dynamic increase.

[0106] In one possible implementation, if the remaining amount of resources in the label matching resources is greater than or equal to the amount of resources to be increased, it means that the remaining amount of resources in the current label matching resources is sufficient to complete the dynamic increase of the target resources, and the target resources allocated to the first business can be increased according to the label matching resources. Specifically, part of the resources in the label matching resources are allocated to the first business, wherein the amount of the allocated part of the resources is greater than or equal to the amount of resources to be increased.

[0107] S504: If the remaining amount of resources in the label matching resources is less than the amount of resources to be increased, the label matching resources are expanded, and the target resources allocated to the first service are increased according to the expanded label matching resources.

[0108] In another possible implementation, if the remaining amount of resources in the label matching resources is less than the amount of resources to be increased, it means that the remaining amount of resources in the current label matching resources is insufficient to complete the dynamic increase of the target resources. In this case, the label matching resources can be expanded first. In fact, expansion means increasing the amount of resources of the label matching resources to ensure that the amount of resources of the label matching resources is sufficient to complete the dynamic increase of the target resources for the first business.

[0109] After the label matching resources are expanded, the target resources allocated to the first business can be increased based on the expanded label matching resources. Specifically, part of the expanded label matching resources are allocated to the first business, wherein the amount of the allocated part of the resources is greater than or equal to the amount of resources to be increased.

[0110] The dynamic increase of target resources for the first business introduced above is introduced together with the resources of each resource type. It can be understood that in the actual implementation process, the actual dynamic adjustment is carried out separately for each resource type. That is to say, assuming that the current server resources are insufficiently allocated, then the server resources are dynamically increased according to the implementation method introduced above. For example, if the current disk resources are insufficiently allocated, then the disk resources are dynamically increased according to the method introduced above. The dynamic increase methods of target resources of each resource type are similar and will not be elaborated here one by one.

[0111] S505: If the resource usage rate is less than or equal to the second threshold, send a second alarm message to a preset device and reduce the target resources allocated to the first service; the first threshold is greater than the second threshold.

[0112] And, for example, see Figure 6 To understand, such as Figure 6As shown, in this embodiment, the resource utilization rate can also be compared with a second threshold, where the first threshold is greater than the second threshold. When the resource utilization rate is less than or equal to the second threshold, it indicates that the resources are over-supplied. When the resources are over-supplied, it may lead to waste of resources. At this time, a second alarm message can be sent to the preset device, where the second alarm message is used to indicate that the resources currently allocated to the first service are excessive.

[0113] Afterwards, it is necessary to dynamically reduce the target resources allocated to the first business and release the reduced target resources as unoccupied candidate resources to ensure that the resources in the system can be dynamically adjusted, thereby effectively avoiding waste of resources.

[0114] In another optional implementation, when the resource utilization rate of the first service is greater than the second threshold and less than the first threshold, it can be determined that the resource supply of the first service is normal and no adjustment is needed temporarily. The specific settings of the first threshold and the second threshold can be selected according to actual needs. This embodiment does not impose any restrictions on this, as long as the first threshold is greater than the second threshold.

[0115] The resource processing method provided by the embodiment of the present disclosure determines the resource usage of the first business by comparing the resource usage rate of the first business with the first threshold and the second threshold. When the resource supply of the first business is insufficient, the target resources allocated to the first business are promptly increased, and when the resource supply of the first business is excessive, the target resources allocated to the first business are promptly reduced, thereby effectively realizing dynamic adjustment of various candidate resources in the system, effectively ensuring that each business can be allocated sufficient resources, and in this embodiment, the reduced target resources are released as unoccupied candidate resources, which can effectively realize dynamic allocation of resources in the system to avoid waste of resources and improve the rationality of resource allocation.

[0116] The resource processing method provided by the embodiment of the present disclosure can also display resource information on a graphical user interface, wherein the resource information includes at least one of the following: resource utilization rate of the first business, resource utilization rate corresponding to each candidate resource, total resource amount corresponding to each candidate resource, and remaining resource amount corresponding to each candidate resource.

[0117] By displaying resource information on a graphical user interface, resource-related information can be determined intuitively, quickly and effectively, thereby improving the observability of system resources.

[0118] Based on the above-described embodiments, Figure 7 and Figure 8 The resource processing method provided by the embodiment of the present disclosure is further described in detail. Figure 7A schematic diagram of implementing a preset tag provided in an embodiment of the present disclosure is provided. Figure 8 A processing structure diagram of the resource processing method provided in an embodiment of the present disclosure.

[0119] You can first combine Figure 7 Understand the preset tags, such as Figure 7 As shown, in the present disclosure, a multi-dimensional labeling system is established for services and resources, so as to achieve optimal decoupling and maximize resource sharing.

[0120] The label system is divided into two directions: Figure 7 The system label system shown in the figure, wherein the system label system is a label system set for the business, which corresponds to the first preset label introduced in the above embodiment. In a possible implementation, the first preset label for the business may include Figure 7 As shown, user-related user-generated content (UGC), professionally produced content (PGC), brand produced content (BGC), etc., order information related to orders, product information related to products, product data, etc., it can be understood that these tags are all optional tags, which can be understood as pre-built preset tags. Then, you can choose from these tags according to actual needs to determine the first preset tag corresponding to each business. For example, if the current first business is the user business, you can select the corresponding first preset tag from the user-related tags introduced above, so as to match the corresponding resources according to the first preset tag in the subsequent resource matching.

[0121] In addition, this disclosure also constructs multi-dimensional labels for each resource, such as Figure 7 The resource scenario system shown includes scenario type tags, business type tags, exclusive or shared tags, resource status tags, etc. Similarly, for each resource, a corresponding tag can be selected from these resources to determine the second preset resource corresponding to each tag.

[0122] Afterwards, by matching the first preset tag with the second preset tag, resource allocation can be achieved based on the tags, thereby effectively achieving resource decoupling.

[0123] In the above Figure 7 Based on the label-related implementation methods introduced above, the following Figure 8 Provide detailed information, such as Figure 8 As shown, the business tag management unit can add, delete, modify, and search the first preset tag required for the business, and the tag system is in the above Figure 7 The above has been introduced and will not be repeated here.

[0124] And the resource tag management unit can add, delete, modify, and search the second preset tag required by the resource, wherein the tag system is in the above Figure 7 The same has been introduced and will not be repeated here.

[0125] And the business assessment subunit in the project management unit can receive a business processing request after the business review and design phase is completed, and according to the business processing request, the first business needs the full stack resources, such as Figure 8 The resource types shown in: server resources (Server), relational database (MySql), non-relational database (Redis, MemCache), file storage service (File Store, Bos), search engine (Elastic Search), etc. are quantified according to the resource types required by the first business, that is, Figure 8 Quantify the estimated resource requirements shown.

[0126] The quantified result can be, for example, Figure 8 As shown in the figure, the CPU requires xGhz, the disk requires xGB, and the memory requires xGB.

[0127] The project management unit in the present disclosure can also realize the creation of complex businesses, application and maintenance of quantified resources, management of business status, viewing of business applied resources, viewing of actual business resource usage and estimated usage, and modification of resources required for the business (expansion, reduction, release, etc.).

[0128] The resource evaluation module in the present disclosure can, for example, perform resource evaluation based on the resource demand information of the first service, and then provide the target resource of the first service based on the method described in the above embodiments ( Figure 8 The output arrow in the figure) is given to the project management unit, and the project management unit can further allocate the target resources of the first business to the first business.

[0129] Correspondingly, the resource evaluation module will maintain the remaining amount of the resource pool. Specifically, the target resources allocated to the first business will be deducted from the corresponding resource pool.

[0130] And the present embodiment also includes a resource monitoring and alarm unit, which can dynamically track the target resources allocated to the first business and provide corresponding feedback. When the actual usage value of the target resources of the first business exceeds or falls short of expectations, an alarm can be issued through the alarm unit. Thereafter, the business monitoring and alarm unit can dynamically adjust the target resources of the first business. Specifically, the target resources can be increased or decreased. The business monitoring and alarm unit can also expand or reduce the resources in the resource pool to achieve dynamic allocation and dynamic adjustment of resources, thereby effectively ensuring the rationality of system resource allocation.

[0131] And the resource management unit in this embodiment can also construct the properties of various resources, for example, determine and store the resource properties such as hard disk resource size, hard disk maximum IOPS threshold, memory size, CPU size, cluster or instance maximum connection threshold, cluster or instance read and write QPS threshold. Most of the threshold construction data is provided by stress testing or service providers. And the resource management unit can also maintain the usage relationship between various resources and projects, build a label system for various resources, view the estimated value and actual usage value of each resource's allocated project, view the overall usage value of each resource, etc.

[0132] To sum up, the resource processing method provided by the embodiment of the present disclosure can effectively avoid resource coupling between various businesses by allocating target resources to the business according to preset tags, effectively improve the stability of the system, and dynamically track the use of resources by businesses and resources, and establish strategies for resource replenishment and resource feedback, so as to ensure the sufficiency of business resources in a catch-up manner and avoid unnecessary waste of resources in a feedback manner, thereby effectively ensuring the rationality of system resource allocation.

[0133] Fig. 9 FIG. 1 is a schematic diagram of the structure of a resource processing device according to an embodiment of the present disclosure. Fig. 9 As shown, the resource processing device 900 of this embodiment may include: a first acquisition module 901 , a second acquisition module 902 , a third acquisition module 903 , and a processing module 904 .

[0134] A first acquisition module 901 is used to acquire a service processing request, where the service processing request includes an identifier of a first service;

[0135] A second acquisition module 902 is used to acquire a first preset tag of the first service and resource demand information corresponding to the first service, wherein the resource demand information includes at least one resource type required by the first service and a resource demand amount corresponding to each resource type;

[0136] A third acquisition module 901 is used to acquire second preset tags corresponding to each of a plurality of candidate resources and a remaining resource amount corresponding to each candidate resource, wherein the plurality of candidate resources are resources corresponding to the at least one resource type;

[0137] Processing module 904 is used to determine the target resource corresponding to the first business among the multiple candidate resources based on the first preset label of the first business, the resource demand information corresponding to the first business, the second preset label corresponding to each of the multiple candidate resources, and the remaining resource amount corresponding to each candidate resource, and allocate the target resource to the first business.

[0138] In a possible implementation, the processing module 904 is specifically configured to:

[0139] Matching is performed according to the first preset tag of the first service and the second preset tags corresponding to each of the multiple candidate resources, and determining at least one tag matching resource corresponding to the first service from the multiple candidate resources, wherein the second preset tag corresponding to each of the tag matching resources is the same as the first preset tag of the first service;

[0140] According to the resource demand information corresponding to the first service and the remaining resource amount corresponding to each of the label matching resources, the target resource corresponding to the first service is determined in the label matching resources.

[0141] In a possible implementation, the processing module 904 is specifically configured to:

[0142] Determine, according to at least one resource type required by the first service, the remaining resource amount corresponding to each resource type in the label matching resource;

[0143] For any of the resource types, determine at least one preliminary resource in the label matching resources whose first remaining resource amount is greater than or equal to the resource demand amount corresponding to the resource type, wherein the first remaining resource amount is the remaining resource amount corresponding to the resource type in the label matching resources;

[0144] A target resource corresponding to the first service is determined in at least one preliminary resource corresponding to each resource type.

[0145] In a possible implementation manner, for any of the candidate resources, the remaining resource amount corresponding to the candidate resource is the resource amount of the resources in the candidate resources excluding the allocated resources and the pre-configured resources.

[0146] In a possible implementation, the processing module 904 is further configured to:

[0147] Obtaining a resource usage rate of the first service;

[0148] The target resource is dynamically adjusted according to the resource utilization rate.

[0149] In a possible implementation, the processing module 904 is specifically configured to:

[0150] If the resource usage rate is greater than or equal to a first threshold, sending a first alarm message to a preset device and increasing the target resources allocated to the first service;

[0151] If the resource usage rate is less than or equal to a second threshold, sending a second alarm message to a preset device and reducing the target resources allocated to the first service;

[0152] The first threshold is greater than the second threshold.

[0153] In a possible implementation, the processing module 904 is specifically configured to:

[0154] Obtaining the remaining resources in the tag matching resources;

[0155] If the remaining amount of resources in the label matching resources is greater than or equal to the amount of resources to be increased, increasing the target resources allocated to the first service according to the label matching resources;

[0156] If the remaining amount of resources in the label matching resources is less than the amount of resources to be increased, the label matching resources are expanded, and the target resources allocated to the first service are increased according to the expanded label matching resources.

[0157] In a possible implementation, the processing module 904 is further configured to:

[0158] After reducing the target resources allocated to the first service, the reduced target resources are released as unoccupied candidate resources.

[0159] In a possible implementation, the processing module 904 is specifically configured to:

[0160] Resource information is displayed on a graphical user interface, wherein the resource information includes at least one of the following: resource utilization rate of the first business, resource utilization rate corresponding to each of the candidate resources, total resource amount corresponding to each of the candidate resources, and remaining resource amount corresponding to each of the candidate resources.

[0161] In a possible implementation manner, the first preset tag and / or the second preset tag includes at least one of the following: business type, scenario type, resource status, and sharing identifier.

[0162] The present disclosure provides a resource processing method and device, which are applied to the field of artificial intelligence in computer technology to achieve the purpose of improving system stability.

[0163] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device and a readable storage medium.

[0164] According to an embodiment of the present disclosure, the present disclosure also provides a computer program product, which includes: a computer program, the computer program is stored in a readable storage medium, at least one processor of an electronic device can read the computer program from the readable storage medium, and at least one processor executes the computer program so that the electronic device executes the solution provided by any of the above embodiments.

[0165] Fig.10 A schematic block diagram of an example electronic device 1000 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0166] like Fig.10 As shown, the electronic device 1000 includes a computing unit 1001, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1002 or a computer program loaded from a storage unit 1008 into a random access memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation of the device 1000 can also be stored. The computing unit 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.

[0167] A number of components in the device 1000 are connected to the I / O interface 1005, including: an input unit 1006, such as a keyboard, a mouse, etc.; an output unit 1007, such as various types of displays, speakers, etc.; a storage unit 1008, such as a disk, an optical disk, etc.; and a communication unit 1009, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1009 allows the device 1000 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0168] The computing unit 1001 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1001 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1001 performs the various methods and processes described above, such as resource processing methods. For example, in some embodiments, the resource processing method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 1008. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 1000 via ROM 1002 and / or communication unit 1009. When the computer program is loaded into RAM 1003 and executed by the computing unit 1001, one or more steps of the resource processing method described above may be performed. Alternatively, in other embodiments, the computing unit 1001 may be configured to perform the resource processing method in any other appropriate manner (e.g., by means of firmware).

[0169] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

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

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

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

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

[0174] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.

[0175] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution disclosed in this disclosure can be achieved, and this document is not limited here.

[0176] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A resource processing method, comprising: Obtaining a service processing request, where the service processing request includes an identifier of the first service; Acquire a first preset tag of the first service and resource requirement information corresponding to the first service, wherein the resource requirement information includes at least one resource type required by the first service and a resource requirement corresponding to each resource type; Acquire second preset tags corresponding to each of a plurality of candidate resources and a remaining resource amount corresponding to each candidate resource, wherein the plurality of candidate resources are resources corresponding to the at least one resource type, a service is deployed on each server resource in the cluster, and the first preset tag and the second preset tag both include a service type; Matching is performed according to the first preset tag of the first service and the second preset tags corresponding to each of the multiple candidate resources, and determining at least one tag matching resource corresponding to the first service from the multiple candidate resources, wherein the second preset tag corresponding to each of the tag matching resources is the same as the first preset tag of the first service; According to the resource demand information corresponding to the first service and the remaining resource amount corresponding to each of the label matching resources, determine the target resource corresponding to the first service in the label matching resources, and allocate the target resource to the first service, wherein the resource demand amount includes the initial application resource amount and the growth resource amount, and the growth resource amount is determined according to the resource growth rate of the first service; After allocating the target resource to the first service, the method further includes: Obtaining a resource usage rate of the first service; If the resource usage rate is greater than or equal to a first threshold, sending a first alarm message to a preset device and increasing the target resources allocated to the first service; If the resource usage rate is less than or equal to a second threshold, sending a second alarm message to a preset device and reducing the target resources allocated to the first service; The first threshold is greater than the second threshold; After reducing the target resources allocated to the first service, the method further includes: The reduced target resource is released as an unoccupied candidate resource.

2. The method according to claim 1, wherein: The determining, according to the resource demand information corresponding to the first service and the remaining resource amount corresponding to each label matching resource, the target resource corresponding to the first service in the label matching resource includes: Determine, according to at least one resource type required by the first service, the remaining resource amount corresponding to each resource type in the label matching resource; For any of the resource types, determine at least one preliminary resource in the label matching resources whose first remaining resource amount is greater than or equal to the resource demand amount corresponding to the resource type, wherein the first remaining resource amount is the remaining resource amount corresponding to the resource type in the label matching resources; A target resource corresponding to the first service is determined in at least one preliminary resource corresponding to each resource type.

3. The method according to claim 1 or 2, wherein: For any of the candidate resources, the remaining resource amount corresponding to the candidate resource is the resource amount of the candidate resources excluding the allocated resources and the pre-configured resources.

4. The method according to claim 1, wherein: The increasing of the target resources allocated to the first service includes: Obtaining the remaining resources in the tag matching resources; If the remaining amount of resources in the label matching resources is greater than or equal to the amount of resources to be increased, increasing the target resources allocated to the first service according to the label matching resources; If the remaining amount of resources in the label matching resources is less than the amount of resources to be increased, the label matching resources are expanded, and the target resources allocated to the first service are increased according to the expanded label matching resources.

5. The method according to any one of claims 1 to 2 and 4, further comprising: Resource information is displayed on a graphical user interface, wherein the resource information includes at least one of the following: resource utilization rate of the first business, resource utilization rate corresponding to each of the candidate resources, total resource amount corresponding to each of the candidate resources, and remaining resource amount corresponding to each of the candidate resources.

6. According to the method according to any one of claims 1-2 and 4, the first preset tag and / or the second preset tag further includes at least one of the following: scene type, resource status, and sharing identification.

7. A resource processing device, comprising: A first acquisition module, used to acquire a service processing request, where the service processing request includes an identifier of a first service; A second acquisition module is used to acquire a first preset tag of the first service and resource demand information corresponding to the first service, wherein the resource demand information includes at least one resource type required by the first service and a resource demand amount corresponding to each resource type; A third acquisition module is used to acquire second preset tags corresponding to each of a plurality of candidate resources and a remaining resource amount corresponding to each candidate resource, wherein the plurality of candidate resources are resources corresponding to the at least one resource type, a service is deployed on each server resource in the cluster, and the first preset tag and the second preset tag include a service type; a processing module, configured to match the first preset tag of the first service with the second preset tags corresponding to each of the plurality of candidate resources, and determine at least one tag matching resource corresponding to the first service from the plurality of candidate resources, wherein the second preset tag corresponding to each of the tag matching resources is the same as the first preset tag of the first service; According to the resource demand information corresponding to the first service and the remaining resource amount corresponding to each of the label matching resources, determine the target resource corresponding to the first service in the label matching resources, and allocate the target resource to the first service, wherein the resource demand amount includes the initial application resource amount and the growth resource amount, and the growth resource amount is determined according to the resource growth rate of the first service; The processing module is also used for: Obtaining a resource usage rate of the first service; Dynamically adjusting the target resource according to the resource utilization rate; The processing module is specifically used for: If the resource usage rate is greater than or equal to a first threshold, sending a first alarm message to a preset device and increasing the target resources allocated to the first service; If the resource usage rate is less than or equal to a second threshold, sending a second alarm message to a preset device and reducing the target resources allocated to the first service; The first threshold is greater than the second threshold; The processing module is also used for: After reducing the target resources allocated to the first service, the reduced target resources are released as unoccupied candidate resources.

8. The device according to claim 7, wherein: The processing module is specifically used for: Determine, according to at least one resource type required by the first service, the remaining resource amount corresponding to each resource type in the label matching resource; For any of the resource types, determine at least one preliminary resource in the label matching resources whose first remaining resource amount is greater than or equal to the resource demand amount corresponding to the resource type, wherein the first remaining resource amount is the remaining resource amount corresponding to the resource type in the label matching resources; A target resource corresponding to the first service is determined in at least one preliminary resource corresponding to each resource type.

9. The device according to claim 7 or 8, wherein: For any of the candidate resources, the remaining resource amount corresponding to the candidate resource is the resource amount of the candidate resources excluding the allocated resources and the pre-configured resources.

10. The device according to claim 7, wherein: The processing module is specifically used for: Obtaining the remaining resources in the tag matching resources; If the remaining amount of resources in the label matching resources is greater than or equal to the amount of resources to be increased, increasing the target resources allocated to the first service according to the label matching resources; If the remaining amount of resources in the label matching resources is less than the amount of resources to be increased, the label matching resources are expanded, and the target resources allocated to the first service are increased according to the expanded label matching resources.

11. The device according to any one of claims 7 to 8 and 10, wherein the processing module is specifically used for: The resource information is displayed on a graphical user interface, wherein: The resource information includes at least one of the following: resource utilization rate of the first service, resource utilization rate corresponding to each of the candidate resources, total resource amount corresponding to each of the candidate resources, and remaining resource amount corresponding to each of the candidate resources.

12. According to the device according to any one of claims 7-8 and 10, the first preset tag and / or the second preset tag further includes at least one of the following: scene type, resource status, and sharing identification.

13. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.

14. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 6.

15. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Resource allocation method, device and system, equipment and medium

    CN110858161A