CN113590329A - Resource processing method and device - Google Patents

Resource processing method and device Download PDF

Info

Publication number
CN113590329A
CN113590329A CN202110881960.3A CN202110881960A CN113590329A CN 113590329 A CN113590329 A CN 113590329A CN 202110881960 A CN202110881960 A CN 202110881960A CN 113590329 A CN113590329 A CN 113590329A
Authority
CN
China
Prior art keywords
resource
service
resources
candidate
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110881960.3A
Other languages
Chinese (zh)
Inventor
米书杰
孟海峰
李云天
马闯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202110881960.3A priority Critical patent/CN113590329A/en
Publication of CN113590329A publication Critical patent/CN113590329A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/465Distributed object oriented systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The disclosure provides a resource processing method and device, and relates to the field of artificial intelligence in computer technology. The specific implementation scheme is as follows: and acquiring a service processing request, wherein the service processing request comprises an identifier of the first service. The method comprises the steps of obtaining a first preset label of a first service and resource demand information corresponding to the first service, wherein the resource demand information comprises at least one resource type required by the first service and resource demand corresponding to each resource type. And acquiring second preset labels corresponding to the plurality of candidate resources and the residual resource amount corresponding to each candidate resource. According to a first preset label of the first service, resource demand information corresponding to the first service, second preset labels corresponding to a plurality of candidate resources respectively, and the residual resource amount corresponding to each candidate resource, determining a target resource corresponding to the first service in the plurality of candidate resources, and allocating the target resource to the first service. Therefore, decoupling of resources is effectively realized, and the stability of the system can be improved.

Description

Resource processing method and device
Technical Field
The present disclosure relates to the field of artificial intelligence in computer technologies, and in particular, to a resource processing method and apparatus.
Background
In the process of processing the service, it is usually necessary to allocate corresponding resources, such as server resources, database resources, and the like, to the service.
In the current distributed architecture environment, each distributed host includes many resources, and in the prior art, when resource allocation is performed, generally, a random selection is performed among available resources of any host to allocate corresponding resources for services, however, this may result in deployment of multiple services on each distributed host.
Therefore, in the implementation manner in the prior art, the coupling of the allocated resources between the services is high, and thus when one service has a problem, the service with the corresponding resource coupling is also affected, thereby resulting in low system stability.
Disclosure of Invention
The disclosure provides a resource processing method and device.
According to a first aspect of the present disclosure, there is provided a resource processing method, including:
acquiring a service processing request, wherein the service processing request comprises an identifier of a first service;
acquiring a first preset label of the first service and resource demand information corresponding to the first service, wherein the resource demand information comprises at least one resource type required by the first service and a resource demand amount corresponding to each resource type;
acquiring a second preset label corresponding to each of a plurality of candidate resources and a residual resource amount corresponding to each candidate resource, wherein the plurality of candidate resources are resources corresponding to the at least one resource type;
determining a target resource corresponding to the first service in the candidate resources according to a first preset label of the first service, resource demand information corresponding to the first service, second preset labels corresponding to the candidate resources, and a remaining resource amount corresponding to each candidate resource, and allocating the target resource to the first service.
According to a second aspect of the present disclosure, there is provided a resource processing apparatus including:
a first obtaining module, configured to obtain a service processing request, where the service processing request includes an identifier of a first service;
a second obtaining module, configured to obtain a first preset tag of the first service and resource demand information corresponding to the first service, where 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 obtaining module, configured to obtain a second preset tag corresponding to each of a plurality of candidate resources and a remaining resource amount corresponding to each candidate resource, where the plurality of candidate resources are resources corresponding to the at least one resource type;
and the processing module is used for determining a target resource corresponding to the first service in the candidate resources according to a first preset label of the first service, resource demand information corresponding to the first service, second preset labels corresponding to the candidate resources and the residual resource amount corresponding to each candidate resource, and allocating the target resource to the first service.
According to a third aspect of the present disclosure, there is provided an electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of the first aspect.
According to a fourth aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of the first aspect.
According to a fifth aspect of the present disclosure, there is provided a computer program product comprising: a computer program, stored in a readable storage medium, from which at least one processor of an electronic device can read the computer program, execution of the computer program by the at least one processor causing the electronic device to perform the method of the first aspect.
The technology according to the present disclosure solves the problem of low system stability caused by resource coupling.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
fig. 1 is a schematic diagram of an implementation of resource allocation provided by an embodiment of the present disclosure;
FIG. 2 is a flow chart of a resource processing method provided by an embodiment of the present disclosure;
fig. 3 is a second flowchart of a resource processing method provided in the embodiment of the present disclosure;
fig. 4 is a schematic diagram of allocating target resources for a first service according to an embodiment of the present disclosure;
fig. 5 is a flowchart of a resource processing method according to the embodiment of the present disclosure;
FIG. 6 is a schematic diagram illustrating an implementation of dynamically adjusting a target resource according to an embodiment of the present disclosure;
fig. 7 is a schematic diagram illustrating an implementation of a preset tag according to an embodiment of the present disclosure;
fig. 8 is a processing structure diagram of a resource processing method according to an embodiment of the present disclosure;
FIG. 9 is a schematic structural diagram of a resource processing apparatus according to an embodiment of the disclosure;
fig. 10 is a block diagram of an electronic device for implementing a resource processing method of an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In order to better understand the technical solution of the present disclosure, the related art related to the present disclosure is further described in detail below.
With the continuous development of computer technology, the current distributed Architecture has made a great deal of progress, and in the current complex distributed Architecture environment, with the transition from Service-Oriented Architecture (SOA) to micro-Service concept and the introduction of containerization technologies such as kubernets, Spring Cloud, Service Mesh, etc., the current full stack resources tend to be "Cloud", multi-instance, and multi-cluster commonalization.
In the related art, resource allocation is generally performed at random among available resources of any host, and the selected resource is allocated to the current service, however, this may result in deployment of many services on each host in the distributed type.
For example, server resources may be taken as an example, and are understood with reference to fig. 1, where fig. 1 is a schematic implementation diagram of resource allocation provided by the embodiment of the present disclosure.
As shown in fig. 1, it is assumed that a current system architecture includes a plurality of clusters, where each cluster includes a plurality of servers, and when server resource allocation is performed for each service, available server resources are arbitrarily allocated on each cluster, which may cause a situation shown in fig. 1, that is, an order service, a commodity service, and a user service are simultaneously allocated to server resources of cluster 1, and an order service, a commodity service, and a user service are simultaneously allocated to server resources of cluster 2, and an order service, a commodity service, and a user service are simultaneously allocated to server resources of cluster 3.
Therefore, the coupling of the allocated resources among the services is high, and when one of the services has a problem, the service with the corresponding resource coupling is also affected, for example, for the situation shown in fig. 1, when an order service corresponding to a server resource on the cluster 1 has a problem, a commodity service and a user service corresponding to the server resource on the cluster 1 may both have a problem, and further, the stability of the system may be low.
Aiming at the problems in the prior art, the technical concept is as follows: by respectively providing the labels for the service and the resource, when the resource is allocated, the resource is allocated according to the matched label, for example, the resource is allocated only in the server of the corresponding order label for the order service, so that the resource decoupling can be effectively realized, and the system stability is improved.
The resource processing method provided by the present disclosure is described below with reference to specific embodiments, and it should be noted that the execution main bodies of the embodiments in the present disclosure may be, for example, a server, a processor, a microprocessor, and other devices with a data processing function, and the embodiment does not limit a specific implementation manner of the execution main body.
First, a resource processing method provided by the embodiment of the present disclosure is described with reference to fig. 2, and fig. 2 is a flowchart of the resource processing method provided by the embodiment of the present disclosure.
As shown in fig. 2, the method includes:
s201, a service processing request is obtained, wherein the service processing request comprises an identifier of a first service.
In this embodiment, a service processing request may be first obtained, where the service processing request includes an identifier of a first service, and the identifier of the first service is used to indicate that a current service processing request allocates resources for the first service request, where the identifier of the first service may be, for example, a service name, a service code, and the like.
The first service in the present disclosure may be any type of task to be processed, for example, the first service may be an order type task to be processed, for example, an address modification function for adding an order may be performed, or a logistics information query function for adding an order may be performed, and the like.
S202, acquiring a first preset label of the first service and resource demand information corresponding to the first service, wherein the resource demand information comprises at least one resource type required by the first service and a resource demand amount corresponding to each resource type.
In this embodiment, the first service corresponds to a first preset tag, and in a possible implementation manner, the first preset tag includes at least one of the following: service type, scene type, resource state, sharing identification. The service type may indicate a specific type of the current service, for example, the specific type may be an order service, a user service, a commodity service, or the like; the scenario type may indicate an application scenario of the currently applied resource, such as temporary activity, burn-after-use, offline, test, and the like; and the resource status can be whether the resource is maintained, whether the resource is upgraded, etc.; the sharing flag may indicate whether the current resource is shared, shared alone, or the like. In an actual implementation process, the specific implementation manners of the service type, the resource type, the service state, and the shared identifier introduced above may all be selected according to actual requirements, and this embodiment does not particularly limit this.
In a possible implementation manner, it can be understood that the specific content of the first preset tag actually indicates what resources are needed by the current first service, for example, based on the content described above, the first preset tag may indicate that the current first service needs exclusive resources for processing a test of an order service, and on this basis, the specific implementation manner of the first preset tag may be selected and expanded according to an actual need.
The first preset tag may be, for example, manually preset, or may also be output by a preset model after the service information of the first service is input to the preset model.
In this embodiment, resource requirement information corresponding to the first service may also be obtained, where the resource requirement information may include at least one resource type required by the first service, and the resource type in this embodiment may include at least one of the following: in an actual implementation process, a resource type specifically required by the first service may be selected according to an actual requirement, for example, the current first service requires the server resource and the disk resource, or the current first service requires the server resource, the disk resource, and the memory resource.
The resource demand information may further include a resource demand corresponding to each resource type, for example, the resource demand of the current first service request CPU resource and memory resource, where the resource demand of the CPU resource is 50Ghz (gigahertz), and the resource demand of the memory resource is 25 GB.
In a possible implementation manner, for example, in the implementation process of obtaining the first preset tag of the first service and the resource requirement information corresponding to the first service, if the service processing request includes the relevant information of the first service, for example, the first preset tag and the resource requirement information may be obtained from the service processing request. In another possible implementation manner, the first preset tag and the resource requirement information may be stored in a preset storage unit corresponding to the service, for example, and in another possible implementation manner, the first preset tag and the resource requirement information may be obtained from the preset storage unit corresponding to the service, for example.
S203, obtaining a second preset label corresponding to each of a plurality of candidate resources and a residual resource amount corresponding to each candidate resource, wherein the plurality of candidate resources are resources corresponding to at least one resource type.
In this embodiment, a plurality of candidate resources exist, where a candidate resource is a resource corresponding to at least one resource type required by the first service, for example, if at least one resource type required by the current first service is a CPU resource and a memory resource, the plurality of candidate resources may be at least one CPU resource and at least one memory resource.
In a possible implementation manner, the second preset tag includes at least one of the following: service type, scene type, resource state, sharing identification. The specific implementation manner is similar to the first preset tag described above, except that the second preset tag is set for a preset resource.
In a possible implementation manner, the remaining resource amount in this embodiment is a resource amount of a resource other than an allocated resource and a pre-configured resource, where the allocated resource is a resource already allocated to the corresponding service, the pre-configured resource is a resource which is already allocated to some services, and the resource other than the allocated resource and the pre-configured resource is the remaining resource, where the resource amount of the remaining resource is the remaining resource amount in this embodiment.
In this embodiment, when determining the remaining resource amount, the resource amount excluding the allocated resources and the pre-configured resources is determined as the remaining resource amount, which can effectively avoid resource allocation errors caused after the pre-configured resources are erroneously allocated to the first service, thereby effectively ensuring the correctness of resource allocation.
In a possible implementation manner, in an implementation process of obtaining the second preset tag and the remaining resource amount corresponding to each of the plurality of candidate resources, the second preset tag and the remaining resource amount corresponding to each of the candidate resources may be, for example, in a preset storage unit corresponding to the resource, and then, the second preset tag and the remaining resource amount corresponding to each of the candidate resources may be, for example, obtained from the preset storage unit corresponding to the resource; or, in another possible implementation manner, the second preset tag corresponding to each candidate resource may also be stored in association with each candidate resource, so that, for example, the second preset tag corresponding to each candidate resource may be directly obtained according to each candidate resource, and the remaining resource amount corresponding to each candidate resource may be directly read.
S204, according to a first preset label of the first service, resource demand information corresponding to the first service, second preset labels corresponding to the candidate resources, and the residual resource amount corresponding to each candidate resource, determining a target resource corresponding to the first service from the candidate resources, and allocating the target resource to the first service.
Based on the above description, it may be determined that a first preset tag and resource requirement information of the first service, and a second preset tag and a remaining resource amount corresponding to each candidate resource may be currently determined, and then resources may be allocated to the first service according to these information, specifically, a target resource corresponding to the first service may be determined in a plurality of candidate resources according to the above described information, and then the target resource may be allocated to the first service.
In a possible implementation manner, matching may be performed according to a first preset tag and a second preset tag, so as to determine a candidate resource matched with the preset tag as a resource that can be allocated to the first service, and then determine, as a target resource corresponding to the first service, a candidate resource in which a remaining resource amount satisfies a resource demand amount of the first service among the candidate resources matched with the tag.
Based on the implementation mode, on the basis that the allocated target resource meets the resource demand of the first service, the target resource is allocated to the first service according to the matching of the preset label, the resource is allocated based on the preset label, decoupling of the resource can be effectively achieved, specifically, the resource matched with the label is allocated to the corresponding service, so that different services can be allocated to different resources, the introduced condition that a plurality of services are deployed by the same server resource at the same time is avoided, decoupling allocation of the resource is effectively guaranteed, based on the resource allocation mode, when a certain service has a problem, because decoupling of the absence of the resource, influence on other services is avoided, and stability of the system is effectively guaranteed.
The resource processing method provided by the embodiment of the disclosure comprises the following steps: and acquiring a service processing request, wherein the service processing request comprises an identifier of the first service. The method comprises the steps of obtaining a first preset label of a first service and resource demand information corresponding to the first service, wherein the resource demand information comprises at least one resource type required by the first service and resource demand corresponding to each resource type. And acquiring a second preset label corresponding to each of the plurality of candidate resources and the residual resource amount corresponding to each candidate resource, wherein the plurality of candidate resources are resources corresponding to at least one resource type. According to a first preset label of the first service, resource demand information corresponding to the first service, second preset labels corresponding to a plurality of candidate resources respectively, and the residual resource amount corresponding to each candidate resource, determining a target resource corresponding to the first service in the plurality of candidate resources, and allocating the target resource to the first service. The preset labels corresponding to the services and the resources are respectively set, and then when the resources are allocated to the first service, the resources are allocated according to the preset labels and the required resource amount, so that the corresponding resources can be allocated to the first service according to the matched labels on the basis of meeting the required resource amount of the first service, decoupling of the resources is effectively achieved, and stability of the system can be improved.
Based on the foregoing embodiments, the following describes in further detail the resource processing method provided by the embodiment of the present disclosure with reference to fig. 3 to 4, where fig. 3 is a second flowchart of the resource processing method provided by the embodiment of the present disclosure, and fig. 4 is a schematic diagram of allocating target resources for the first service provided by the embodiment of the present disclosure.
As shown in fig. 3, the method includes:
s301, a service processing request is obtained, wherein the service processing request comprises an identifier of the first service.
S302, a first preset label of a first service and resource demand information corresponding to the first service are obtained, 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.
S303, obtaining a second preset label corresponding to each of a plurality of candidate resources and a residual resource amount corresponding to each candidate resource, wherein the plurality of candidate resources are resources corresponding to at least one resource type.
The implementation manners of S301 to S303 are similar to the implementation manners of S201 to S203 described above, and are not described herein again.
S304, matching is carried out according to a first preset label of the first service and second preset labels corresponding to the plurality of candidate resources, and at least one label matching resource corresponding to the first service is determined in the plurality of candidate resources, wherein the second preset label corresponding to each label matching resource is the same as the first preset label of the first service.
In this embodiment, when determining a target resource corresponding to a first service, matching may be performed according to a first preset tag of the first service and a second preset tag corresponding to each of a plurality of candidate resources, so that at least one tag matching resource corresponding to the first service may be determined in the plurality of candidate resources, and it may be understood that the tag matching resource described in this embodiment is a resource in which the second preset tag matches with the first preset tag of the first service.
In this embodiment, for example, the matching of the tags may be that the tags are the same, and then the second preset tag corresponding to the tag matching resource in this embodiment and the first preset tag of the first service may be the same, for example, the first preset tag of the first service includes "order service" to indicate that the service type of the first service is order service, and meanwhile, the second preset tag corresponding to the tag matching resource includes "order service" to indicate that the current resource is an available resource for the order service.
Or in an optional implementation manner, matching of the tags may also be that a mapping relationship exists between the first preset tag and the second preset tag, and the specific implementation manner of matching of the tags is not particularly limited in this embodiment, and may be selected according to actual requirements.
For example, it can be understood based on the illustration that resources are allocated to the first service based on the matching of the first preset label and the second preset label, and also taking the server resource as an example, the allocated resources may be, for example, as shown in fig. 4, see fig. 4, where server 1-1, server 1-2, server 1-3 are currently included in cluster 1, server 2-2, server 2-3 are included in cluster 2, and so on.
For example, the resource is currently allocated for an order service a, where a first preset tag corresponding to the order service a includes "order service", where each server in fig. 4 may be used as a candidate resource, and then matching may be performed according to the preset tag first. Assuming that the second preset tags corresponding to the server 1-1, the server 1-2, and the server 1-3 all include "order service", it may be determined that the second preset tags of the server 1-1, the server 1-2, and the server 1-3 all match the first preset tag, and therefore the server 1-1, the server 1-2, and the server 1-3 may actually be a tag matching resource, and then further selection may be performed in the tag matching resource according to the remaining resource amount, so as to determine the target resource.
S305, according to at least one resource type required by the first service, determining the residual resource amount corresponding to each resource type in the label matching resources.
After the tag matching resources are determined, matching operation of the preset tags is actually completed, and when the target resources are determined, besides matching of the preset tags, it is further required to ensure that resources allocated to the first service can meet the resource demand of the first resource, so that the remaining resource amount corresponding to each resource type in the tag matching resources can be determined according to at least one resource type required by the first service.
It can be understood that, in the tag matching resources, the resources actually include resources of various resource types, for example, at least one server resource, at least one CPU resource, at least one disk resource, and at least one memory resource, it may be determined that, in the tag matching resources, 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 an actual implementation process, a specific implementation manner of the resource type may be selected according to an actual requirement, which is not limited in this embodiment.
S306, for any resource type, at least one preliminary resource with the resource demand amount corresponding to the resource type larger than or equal to a first remaining resource amount is determined in the label matching resource, wherein the first remaining resource amount is the remaining resource amount corresponding to the resource type in the label matching resource.
After determining the resource demand amount corresponding to each resource type, the target resource may be determined according to the resource demand amount and the service demand amount of the first service, and it can be understood that, when resource allocation is performed, resource allocation is actually performed on resources of each resource type.
It may be determined that the tag matching resources include resources of each resource type, for example, a remaining resource amount corresponding to the server resource may be determined in the tag matching resources, and the resource demand information corresponding to the first service includes a resource demand amount corresponding to the server resource, in order to ensure that the allocated resources can meet the demand of the first service, at least one preliminary resource whose resource demand amount corresponding to the server resource is greater than or equal to the resource demand amount corresponding to the server resource may be determined in the tag matching resources, where the determined preliminary resource is a resource whose preset tag and remaining resource amount both meet the demand of the first service.
For example, as can be understood in conjunction with fig. 4, based on the above description, it can be determined that, for the order service a, the server 1-1, the server 1-2, and the server 1-3 may actually match resources for the label, and assuming that the remaining resource amount of the server 1-1 is greater than the resource demand amount of the order service a for the server resources, the remaining resource amount of the server 1-2 is greater than the resource demand amount of the order service a for the server resources, and the remaining resource amount of the server 1-3 is less than the resource demand amount of the order service a for the server resources, it can be determined that the server 1-1 and the server 1-2 satisfy the resource demand amount of the first service, and thus the server 1-1 and the server 1-2 can be determined as preliminary resources.
The above describes the implementation manner of determining the preliminary resource by taking the server resource as an example, and the implementation manner of determining the preliminary resource is similar for the remaining various possible resource types, which is not described herein again.
It should be further noted that, in this embodiment, the resource demand amount corresponding to each resource type of the first service may include, for example, an initial application resource amount and an increase resource amount, where the initial application resource amount is a resource amount required when the first service is initially executed, and the increase resource amount is a resource amount further required along with the execution process of the first service. For example, for a memory resource, the first service may complete deployment and operation of the first service only by 5GB under an initial condition, and then an initial application resource amount of the first service may be 5GB, but as the first service continuously operates, memory resources required by the first service inevitably increase, and then an increase resource amount needs to be allocated to the first service to ensure subsequent normal operation of the first service, for example, the increase resource amount of the first service is 50 GB.
In a possible implementation manner, the amount of the resource increase of the first service may be determined according to a resource increase rate of the first service, where the resource increase rate may be preset, or may also be calculated by a method such as model processing, machine algorithm, and the like; or, the resource increment of the first service may also be preset; alternatively, the resource increment of the first service may also be determined according to a preset algorithm, which is not particularly limited in this embodiment.
S307, in at least one preliminary resource corresponding to each resource type, determining a target resource corresponding to the first service.
Based on the above description, at least one preliminary resource may be determined, and it can be understood that any one preliminary resource in this embodiment satisfies the requirement of the first service, and therefore any one preliminary resource may be used as a target resource corresponding to the first service, and therefore, the target resource corresponding to the first service may be determined in at least one preliminary resource corresponding to each resource type.
In a possible implementation manner, for example, the selection may be randomly performed in at least one preliminary resource corresponding to each resource type, so as to determine the selected preliminary resource corresponding to each resource type, and thereby determine the target resource corresponding to the first service. Or, in at least one preliminary resource corresponding to each resource type, 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. Or, in at least one preliminary resource corresponding to each resource type, the minimum difference between the remaining resource amount and the resource demand amount of each resource type corresponding to the first service may be determined as the target resource, and the specific implementation manner of determining the target resource is not particularly limited in this embodiment, and may be selected according to the actual demand, which is not limited in this embodiment, as long as the target resource is determined according to the preliminary resource.
In this embodiment, for example, the determined target resource corresponding to each service may be as shown in fig. 4, referring to fig. 4, it is assumed that, for order service a, the determined target resource of the server resource is server 102, for order service B, the determined target resource of the server resource is server 1-1, and for other services, the determined target resource is as shown in fig. 4, which is not described again in this embodiment.
It is understood that the situation described in fig. 4 is only an exemplary illustration, and in an actual implementation process, the specifically allocated target resource for the first service may depend on the actual implementation, and the present embodiment does not limit this.
Based on fig. 4, it can be determined that, in this embodiment, on the basis of ensuring that the resource demand of the service can be satisfied, resource allocation according to the preset label is effectively ensured, so that decoupling of the resource can be effectively achieved, and it is avoided that when a service is in a problem due to resource coupling, other services are also affected therewith, for example, in the case of fig. 4, when an order service a is in a problem, there is no coupling between the resource of the order service a and the resources of the other services, so that the other services are not affected, and further, system stability can be effectively ensured.
The resource processing method provided by the embodiment of the disclosure comprises the following steps: and acquiring a service processing request, wherein the service processing request comprises an identifier of the first service. The method comprises the steps of obtaining a first preset label of a first service and resource demand information corresponding to the first service, wherein the resource demand information comprises at least one resource type required by the first service and resource demand corresponding to each resource type. And acquiring a second preset label corresponding to each of the plurality of candidate resources and the residual resource amount corresponding to each candidate resource, wherein the plurality of candidate resources are resources corresponding to at least one resource type. And matching according to a first preset label of the first service and a second preset label corresponding to each of the plurality of candidate resources, and determining at least one label matching resource corresponding to the first service in the plurality of candidate resources, wherein the second preset label corresponding to each label matching resource is the same as the first preset label of the first service. And determining the residual resource amount corresponding to each resource type in the label matching resources according to at least one resource type required by the first service. And aiming at any resource type, determining at least one preliminary resource of which the resource demand amount corresponding to the resource type is greater than or equal to a first residual resource amount in the label matching resources, wherein the first residual resource amount is the residual resource amount corresponding to the resource type in the label matching resources. And determining a target resource corresponding to the first service in at least one preliminary resource corresponding to each resource type. The label matching labels are determined in the candidate resources by matching according to the first preset labels and the second preset labels, so that resources can be effectively allocated to the first service according to the matching of the labels, resource decoupling is effectively achieved, then target resources are determined according to the resource demand of each resource type and the residual resource quantity of each resource type in the label matching resources, the determined target resources can be effectively guaranteed to meet the resource demand of the first service, decoupling of the resources is effectively achieved under the condition that the resource demand of the first service is met, and stability of the system is improved.
On the basis of the above introduction, the resource processing method provided in the embodiment of the present disclosure may further obtain the resource usage rate of the first service after allocating the target resource to the first service, and then dynamically adjust the target resource according to the resource usage rate, so as to improve the rationality of resource allocation, and the following sets fig. 5 to fig. 6 to describe an implementation manner of dynamic adjustment of the target resource, where fig. 5 is a flowchart three of the resource processing method provided in the embodiment of the present disclosure, and fig. 6 is an implementation schematic diagram of dynamic adjustment of the target resource provided in the embodiment of the present disclosure.
As shown in fig. 5, the method includes:
s501, acquiring the resource utilization rate of the first service.
In this embodiment, the target resource allocated to the first service may be dynamically tracked, so as to determine a resource usage of the allocated target resource by the first service, so as to obtain a resource usage rate of the first service, for example, the resource usage rate of the allocated target resource by the first service may be determined, and then the resource usage rate may be determined by dividing the resource usage rate by the resource amount of the allocated target resource.
It can be understood that the target resource in this embodiment includes resources of each resource type required by the first service, and therefore the resource usage rate also includes resource usage rates of each resource type correspondingly, for example, the resource usage rate may include resource usage rate of server resources, CPU usage rate, disk usage rate, memory usage rate, and the like.
S502, if the resource utilization rate is larger than or equal to a first threshold value, sending first alarm information to preset equipment, and obtaining the residual resource amount in the label matching resources.
For example, as can be understood by referring to fig. 6, as shown in fig. 6, in this embodiment, the resource usage rate may be compared with a first threshold, when the resource usage rate is greater than or equal to the first threshold, the resource supply is insufficient, and when the resource supply is insufficient, the operation stability of the first service may be reduced, at this time, a first alarm message may be sent to the preset device, where the first alarm message is used to indicate that the resource currently allocated for the first service is insufficient.
And then, dynamically adding a target resource allocated to the first service, and when the target resource allocated to the first service is added, ensuring that the added resource is also a resource matched with the tag, so that the resource can be dynamically adjusted according to the tag matched resource, and specifically, the remaining resource amount in the tag matched resource can be obtained, wherein the tag matched resource in the embodiment is a resource in which the second preset tag is the same as the first preset tag of the first service.
S503, if the residual resource amount in the label matching resources is larger than or equal to the resource amount to be increased, increasing the target resources allocated to the first service according to the label matching resources.
After obtaining the remaining resource amount in the tag matching resource, the remaining resource amount in the tag matching resource may be compared with the resource amount to be increased for the first service, so as to determine whether there are enough resources in the tag matching resource to perform dynamic increase.
In a possible implementation manner, if the remaining resource amount in the tag matching resources is greater than or equal to the resource amount to be increased, it indicates that the remaining resource amount in the current tag matching resource amount is sufficient to complete the dynamic increase of the target resource, and the target resource allocated to the first service may be increased according to the tag matching resources, specifically, a part of the resources in the tag matching resources is allocated to the first service, where the resource amount of the allocated part of resources is greater than or equal to the resource amount to be increased.
S504, if the residual resource amount in the label matching resources is smaller than the resource amount to be increased, capacity expansion is performed on the label matching resources, and target resources allocated to the first service are increased according to the capacity-expanded label matching resources.
In another possible implementation manner, if the remaining resource amount in the tag matching resource is smaller than the resource amount to be increased, which indicates that the remaining resource amount in the current tag matching resource amount is not enough to complete the dynamic increase of the target resource, the tag matching resource may be first expanded, and actually the expansion is to increase the resource amount of the tag matching resource, so as to ensure that the resource amount of the tag matching resource is enough to complete the dynamic increase of the target resource of the first service.
After the capacity expansion of the tag matching resource is performed, the target resource allocated to the first service may be increased according to the expanded tag matching resource, specifically, a part of the resource in the expanded tag matching resource is allocated to the first service, where the resource amount of the allocated part of the resource is greater than or equal to the resource amount to be increased.
The above-described dynamic increase of the target resource for the first service is introduced together with respect to the resources of each resource type, and it can be understood that, in the actual implementation process, the actual dynamic adjustment is performed for each resource type, that is, assuming that the resource allocation of the current server resource is insufficient, the server resource is dynamically increased according to the above-described implementation manner, and for example, the resource allocation of the current disk resource is insufficient, the disk resource is dynamically increased according to the above-described manner, and the dynamic increase manners of the target resource of each resource type are similar, which is not described in detail herein.
S505, if the resource utilization rate is smaller than or equal to a second threshold value, sending second alarm information to preset equipment, and reducing target resources allocated to the first service; the first threshold is greater than the second threshold.
And, for example, as can be understood by referring to fig. 6, as shown in fig. 6, in this embodiment, the resource usage rate may be compared with a second threshold, where the first threshold is greater than the second threshold, when the resource usage rate is less than or equal to the second threshold, the resource is supplied in excess, and when the resource is supplied in excess, waste of resources may be caused, at this time, a second alarm message may be sent to the preset device, where the second alarm message is used to indicate that the resource currently allocated for the first service is in excess.
And then, the target resources allocated to the first service need to be dynamically reduced, and the reduced target resources are released as unoccupied candidate resources, so that the resources in the system can be dynamically adjusted, and the waste of the resources is effectively avoided.
In another optional implementation manner, when the resource usage rate of the first service is greater than the second threshold and smaller than the first threshold, it may be determined that the resource supply of the first service is normal, and adjustment is not needed for a while, where specific settings of the first threshold and the second threshold may be selected according to actual requirements, which is not limited in this embodiment, as long as the first threshold is greater than the second threshold.
The resource processing method provided by the embodiment of the disclosure determines the resource usage of the first service by comparing the resource usage of the first service with the first threshold and the second threshold, increases the target resource allocated to the first service in time when the resource supply of the first service is insufficient, and decreases the target resource allocated to the first service in time when the resource supply of the first service is excessive, thereby effectively implementing dynamic adjustment of each candidate resource in the system, effectively ensuring that each service can allocate sufficient resources, and releasing the decreased target resource into an unoccupied candidate resource in the embodiment, thereby effectively implementing dynamic allocation of resources in the system, avoiding resource waste, and improving the rationality of resource allocation.
The resource processing method provided by the embodiment of the present disclosure may further display resource information on the graphical user interface, where the resource information includes at least one of the following: the resource utilization rate of the first service, the resource utilization rate corresponding to each candidate resource, the total amount of resources corresponding to each candidate resource, and the residual amount of resources corresponding to each candidate resource.
By displaying the resource information on the graphical user interface, the resource related information can be intuitively, quickly and effectively determined, so that the observability of the system resources is improved.
Based on the above-described embodiments, the following describes the resource processing method provided by the embodiment of the present disclosure in further system details with reference to fig. 7 and fig. 8, where fig. 7 is a schematic diagram of implementing a preset tag provided by the embodiment of the present disclosure, and fig. 8 is a processing structure diagram of the resource processing method provided by the embodiment of the present disclosure.
The preset tags may be understood by referring to fig. 7, and as shown in fig. 7, a multidimensional tag system is established for services and resources in the present disclosure, so that optimal decoupling and maximized resource sharing can be achieved.
The tag system is divided into two directions, which are respectively the system tag system shown in fig. 7, where the system tag system is a tag system set for a service, and the system tag system corresponds to a first preset tag described in the above embodiment, in a possible implementation manner, the first preset tag for the service may include User Generated Content (UGC) related to a User, Professional produced Content (PGC), Brand produced Content (BGC), and the like shown in fig. 7, order information related to an order, commodity information related to a commodity, commodity data, and the like, it may be understood that these tags are all optional tags, which may be understood as preset tags built in advance, and then, a selection may be performed among these tags according to actual requirements, so as to determine the first preset tag corresponding to each service, for example, if the current first service is a user service, a corresponding first preset tag may be selected from the introduced user-related tags, so as to match a corresponding resource in subsequent resource matching according to the first preset tag.
In addition, in the present disclosure, multi-dimensional label construction is performed on each resource, for example, a resource scene system shown in fig. 7 includes a scene type label, a service type label, an exclusive or shared label, a resource state label, and the like, and similarly, for each resource, a corresponding label may be selected from the resources, so as to determine a second preset resource corresponding to each label.
And then, matching is carried out according to the first preset label and the second preset label, so that the resource distribution can be realized based on the labels, and the resource decoupling can be effectively realized.
Based on the tag related implementation manner described in fig. 7, the following description is made in detail with reference to fig. 8, as shown in fig. 8, where the service tag management unit may add, delete, modify, and search a first preset tag required by a service, and a tag system is described in fig. 7, which is not described herein again.
And the resource tag management unit may add, delete, modify, and search a second preset tag required by the resource, where the tag system is also introduced in fig. 7, and is not described herein again.
And the service evaluation subunit in the project management unit may receive the service processing request after the service evaluation and design stage is completed, and perform full stack resource processing on the first service pair according to the service processing request, as shown in fig. 8, where the resource types are: server resources (Server), a relational database (MySql), a non-relational database (Redis, MemCache), File storage services (File Store, Bos), a Search engine (Elastic Search), and the like, quantize according to the type of resources required by the first service, that is, quantize resources required for prediction as shown in fig. 8.
The result of quantization can be, for example, xGhz for CPU, xGB for disk and xGB for memory as shown in FIG. 8.
The project management unit in the disclosure can also realize the creation of complex service, the application and maintenance of quantized resources, the management of service state, the check of applied resources of service, the check of the actually used resource amount and the pre-estimated amount of service, and the modification (capacity expansion, capacity reduction, release, etc.) of resources required by service.
The resource evaluation module in the present disclosure may perform resource evaluation according to the resource demand information of the first service, and then provide (output arrow in fig. 8) the target resource of the first service to the project management unit based on the methods described in the foregoing embodiments, and the project management unit may further allocate the target resource of the first service to the first service.
Correspondingly, the resource evaluation module maintains the remaining amount of the resource pool, and specifically, deducts the target resource allocated to the first service from the corresponding resource pool.
The embodiment also comprises a resource monitoring and alarming unit which can dynamically track the target resource allocated to the first service and perform corresponding feedback, when the actual use value of the target resource of the first service exceeds the pre-estimation value or the low pre-estimation value, the alarming unit can give an alarm, then the service monitoring and alarming unit can dynamically adjust the target resource of the first service, specifically, the target resource can be increased or decreased, and the service monitoring and alarming unit can also expand or contract the capacity of the resource in the resource pool, so as to realize the dynamic allocation and the dynamic adjustment of the resource, thereby effectively ensuring the rationality of the allocation of the system resource.
The resource management unit in this embodiment may also construct attributes of each type of resource, for example, determine and store the attributes of the resource, such as a threshold for hard disk resource size, a threshold for maximum IOPS of a hard disk, memory size, CPU size, a threshold for maximum connection for cluster or instance, and a threshold for QPS for cluster or instance for read/write. The construction data of the threshold value are mostly provided by a pressure test or a service provider. The resource management unit can also maintain the use relationship between various resources and projects, build a label system for various resources, check the project estimated value and the actual use value distributed by each resource, check the overall use value of each resource and the like.
In summary, the resource processing method provided by the embodiment of the present disclosure determines the target resource to be allocated to the service according to the preset tag, so that resource coupling between services can be effectively avoided, system stability is effectively improved, and a resource replenishment and resource feedback policy is established by dynamically tracking the use of the service and the resource, so that the sufficiency of the service resource is ensured in a compensation manner, unnecessary waste of the resource is ensured in a feedback manner, and the allocation rationality of the system resource is effectively ensured.
Fig. 9 is a schematic structural diagram of a resource processing apparatus according to an embodiment of the disclosure. As shown in fig. 9, the resource processing apparatus 900 of the present embodiment may include: a first obtaining module 901, a second obtaining module 902, a third obtaining module 903, and a processing module 904.
A first obtaining module 901, configured to obtain a service processing request, where the service processing request includes an identifier of a first service;
a second obtaining module 902, configured to obtain a first preset tag of the 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 amount corresponding to each resource type;
a third obtaining module 901, configured to obtain a second preset tag corresponding to each of a plurality of candidate resources and a remaining resource amount corresponding to each candidate resource, where the plurality of candidate resources are resources corresponding to the at least one resource type;
a processing module 904, configured to determine, according to a first preset tag of the first service, resource requirement information corresponding to the first service, a second preset tag corresponding to each of the multiple candidate resources, and a remaining resource amount corresponding to each candidate resource, a target resource corresponding to the first service among the multiple candidate resources, and allocate the target resource to the first service.
In a possible implementation manner, the processing module 904 is specifically configured to:
matching according to a first preset label of the first service and second preset labels corresponding to the multiple candidate resources, and determining at least one label matching resource corresponding to the first service in the multiple candidate resources, wherein the second preset label corresponding to each label matching resource is the same as the first preset label of the first service;
and determining a target resource corresponding to the first service in the label matching resources according to the resource demand information corresponding to the first service and the residual resource amount corresponding to each label matching resource.
In a possible implementation manner, the processing module 904 is specifically configured to:
determining the residual resource amount corresponding to each resource type in the label matching resources according to at least one resource type required by the first service;
for any one of the resource types, determining at least one preliminary resource of which a first remaining resource amount is greater than or equal to a resource demand amount corresponding to the resource type in the tag matching resource, wherein the first remaining resource amount is the remaining resource amount corresponding to the resource type in the tag matching resource;
and determining a target resource corresponding to the first service in at least one preliminary resource corresponding to each resource type.
In a possible implementation manner, for any one of the candidate resources, the remaining resource amount corresponding to the candidate resource is a resource amount of a resource other than the allocated resource and the pre-configured resource in the candidate resource.
In a possible implementation manner, the processing module 904 is further configured to:
acquiring the resource utilization rate of the first service;
and dynamically adjusting the target resource according to the resource utilization rate.
In a possible implementation manner, the processing module 904 is specifically configured to:
if the resource utilization rate is greater than or equal to a first threshold value, sending first alarm information to preset equipment, and increasing target resources allocated to the first service;
if the resource utilization rate is smaller than or equal to a second threshold value, sending second alarm information to preset equipment, and reducing target resources allocated to the first service;
the first threshold is greater than the second threshold.
In a possible implementation manner, the processing module 904 is specifically configured to:
acquiring the residual resource amount in the label matching resources;
if the residual resource amount in the label matching resources is more than or equal to the resource amount to be increased, increasing target resources allocated to the first service according to the label matching resources;
and if the residual resource amount in the label matching resources is less than the resource amount to be increased, performing capacity expansion on the label matching resources, and increasing target resources allocated to the first service according to the expanded label matching resources.
In a possible implementation manner, the processing module 904 is further configured to:
and after the target resource allocated to the first service is reduced, releasing the reduced target resource as an unoccupied candidate resource.
In a possible implementation manner, the processing module 904 is specifically configured to:
displaying resource information on a graphical user interface, wherein the resource information includes at least one of: the resource utilization rate of the first service, the resource utilization rate corresponding to each candidate resource, the total resource amount corresponding to each candidate resource, and the remaining resource amount corresponding to each candidate resource.
In a possible implementation manner, the first preset tag and/or the second preset tag includes at least one of the following: service type, scene type, resource state, sharing identification.
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.
The present disclosure also provides an electronic device and a readable storage medium according to an embodiment of the present disclosure.
According to an embodiment of the present disclosure, the present disclosure also provides a computer program product comprising: a computer program, stored in a readable storage medium, from which at least one processor of the electronic device can read the computer program, the at least one processor executing the computer program causing the electronic device to perform the solution provided by any of the embodiments described above.
FIG. 10 illustrates a schematic block diagram of an example electronic device 1000 that can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may 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 meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 10, the electronic device 1000 includes a computing unit 1001 that 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 necessary for the operation of the device 1000 can also be stored. The calculation unit 1001, the ROM1002, and the RAM 1003 are connected to each other by a bus 1004. An input/output (I/O) interface 1005 is also connected to bus 1004.
A number of components in device 1000 are connected to I/O interface 1005, including: an input unit 1006 such as a keyboard, a mouse, and the like; an output unit 1007 such as various types of displays, speakers, and the like; a storage unit 1008 such as a magnetic disk, an optical disk, or the like; and a communication unit 1009 such as a network card, a modem, a wireless communication transceiver, or the like. 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.
Computing unit 1001 may be a variety of general and/or special purpose 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, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The calculation unit 1001 executes the respective methods and processes described above, such as the resource processing method. For example, in some embodiments, the resource handling methods may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 1008. In some embodiments, part or all of the computer program may be loaded and/or installed onto device 1000 via ROM1002 and/or communications unit 1009. When the computer program is loaded into the 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 handling method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods 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, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The 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, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here 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 a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, 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 may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The Server can be a cloud Server, also called a cloud computing Server or a cloud host, and is a host product in a cloud computing service system, so as to solve the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service ("Virtual Private Server", or simply "VPS"). The server may also be a server of a distributed system, or a server incorporating a blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (23)

1. A method of resource processing, comprising:
acquiring a service processing request, wherein the service processing request comprises an identifier of a first service;
acquiring a first preset label of the first service and resource demand information corresponding to the first service, wherein the resource demand information comprises at least one resource type required by the first service and a resource demand amount corresponding to each resource type;
acquiring a second preset label corresponding to each of a plurality of candidate resources and a residual resource amount corresponding to each candidate resource, wherein the plurality of candidate resources are resources corresponding to the at least one resource type;
determining a target resource corresponding to the first service in the candidate resources according to a first preset label of the first service, resource demand information corresponding to the first service, second preset labels corresponding to the candidate resources, and a remaining resource amount corresponding to each candidate resource, and allocating the target resource to the first service.
2. The method according to claim 1, wherein the determining, according to a first preset tag of the first service, resource demand information corresponding to the first service, a second preset tag corresponding to each of the candidate resources, and a remaining resource amount corresponding to each candidate resource, a target resource corresponding to the first service among the candidate resources comprises:
matching according to a first preset label of the first service and second preset labels corresponding to the multiple candidate resources, and determining at least one label matching resource corresponding to the first service in the multiple candidate resources, wherein the second preset label corresponding to each label matching resource is the same as the first preset label of the first service;
and determining a target resource corresponding to the first service in the label matching resources according to the resource demand information corresponding to the first service and the residual resource amount corresponding to each label matching resource.
3. The method according to claim 2, wherein the determining, according to the resource demand information corresponding to the first service and the remaining resource amount corresponding to each tag matching resource, a target resource corresponding to the first service in the tag matching resources comprises:
determining the residual resource amount corresponding to each resource type in the label matching resources according to at least one resource type required by the first service;
for any one of the resource types, determining at least one preliminary resource of which a first remaining resource amount is greater than or equal to a resource demand amount corresponding to the resource type in the tag matching resource, wherein the first remaining resource amount is the remaining resource amount corresponding to the resource type in the tag matching resource;
and determining a target resource corresponding to the first service in at least one preliminary resource corresponding to each resource type.
4. A method according to any of claims 1-3, wherein for any of the candidate resources, the remaining resource amount corresponding to the candidate resource is the resource amount of the resource other than the allocated resource and the pre-configured resource in the candidate resource.
5. The method of any of claims 1-4, after allocating the target resource to the first traffic, the method further comprising:
acquiring the resource utilization rate of the first service;
and dynamically adjusting the target resource according to the resource utilization rate.
6. The method of claim 5, wherein the dynamically adjusting the target resource based on the resource usage comprises:
if the resource utilization rate is greater than or equal to a first threshold value, sending first alarm information to preset equipment, and increasing target resources allocated to the first service;
if the resource utilization rate is smaller than or equal to a second threshold value, sending second alarm information to preset equipment, and reducing target resources allocated to the first service;
the first threshold is greater than the second threshold.
7. The method of claim 6, wherein the increasing the target resource allocated to the first traffic comprises:
acquiring the residual resource amount in the label matching resources;
if the residual resource amount in the label matching resources is more than or equal to the resource amount to be increased, increasing target resources allocated to the first service according to the label matching resources;
and if the residual resource amount in the label matching resources is less than the resource amount to be increased, performing capacity expansion on the label matching resources, and increasing target resources allocated to the first service according to the expanded label matching resources.
8. The method of claim 6, after the reducing the target resources allocated for the first traffic, the method further comprising:
releasing the reduced target resource as an unoccupied candidate resource.
9. The method of any of claims 1-7, further comprising:
displaying resource information on a graphical user interface, wherein the resource information includes at least one of: the resource utilization rate of the first service, the resource utilization rate corresponding to each candidate resource, the total resource amount corresponding to each candidate resource, and the remaining resource amount corresponding to each candidate resource.
10. The method of any of claims 1-9, the first preset tag and/or the second preset tag comprising at least one of: service type, scene type, resource state, sharing identification.
11. A resource processing apparatus comprising:
a first obtaining module, configured to obtain a service processing request, where the service processing request includes an identifier of a first service;
a second obtaining module, configured to obtain a first preset tag of the first service and resource demand information corresponding to the first service, where 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 obtaining module, configured to obtain a second preset tag corresponding to each of a plurality of candidate resources and a remaining resource amount corresponding to each candidate resource, where the plurality of candidate resources are resources corresponding to the at least one resource type;
and the processing module is used for determining a target resource corresponding to the first service in the candidate resources according to a first preset label of the first service, resource demand information corresponding to the first service, second preset labels corresponding to the candidate resources and the residual resource amount corresponding to each candidate resource, and allocating the target resource to the first service.
12. The apparatus of claim 11, wherein the processing module is specifically configured to:
matching according to a first preset label of the first service and second preset labels corresponding to the multiple candidate resources, and determining at least one label matching resource corresponding to the first service in the multiple candidate resources, wherein the second preset label corresponding to each label matching resource is the same as the first preset label of the first service;
and determining a target resource corresponding to the first service in the label matching resources according to the resource demand information corresponding to the first service and the residual resource amount corresponding to each label matching resource.
13. The apparatus of claim 12, wherein the processing module is specifically configured to:
determining the residual resource amount corresponding to each resource type in the label matching resources according to at least one resource type required by the first service;
for any one of the resource types, determining at least one preliminary resource of which a first remaining resource amount is greater than or equal to a resource demand amount corresponding to the resource type in the tag matching resource, wherein the first remaining resource amount is the remaining resource amount corresponding to the resource type in the tag matching resource;
and determining a target resource corresponding to the first service in at least one preliminary resource corresponding to each resource type.
14. The apparatus according to any of claims 11-13, wherein for any of the candidate resources, the remaining resource amount corresponding to the candidate resource is a resource amount of a resource other than the allocated resource and the pre-configured resource in the candidate resource.
15. The apparatus of any of claims 11-14, the processing module further to:
acquiring the resource utilization rate of the first service;
and dynamically adjusting the target resource according to the resource utilization rate.
16. The apparatus of claim 15, wherein the processing module is specifically configured to:
if the resource utilization rate is greater than or equal to a first threshold value, sending first alarm information to preset equipment, and increasing target resources allocated to the first service;
if the resource utilization rate is smaller than or equal to a second threshold value, sending second alarm information to preset equipment, and reducing target resources allocated to the first service;
the first threshold is greater than the second threshold.
17. The apparatus of claim 16, wherein the processing module is specifically configured to:
acquiring the residual resource amount in the label matching resources;
if the residual resource amount in the label matching resources is more than or equal to the resource amount to be increased, increasing target resources allocated to the first service according to the label matching resources;
and if the residual resource amount in the label matching resources is less than the resource amount to be increased, performing capacity expansion on the label matching resources, and increasing target resources allocated to the first service according to the expanded label matching resources.
18. The apparatus of claim 16, the processing module further to:
and after the target resource allocated to the first service is reduced, releasing the reduced target resource as an unoccupied candidate resource.
19. The apparatus according to any one of claims 11-17, the processing module being specifically configured to:
displaying resource information on a graphical user interface, wherein the resource information includes at least one of: the resource utilization rate of the first service, the resource utilization rate corresponding to each candidate resource, the total resource amount corresponding to each candidate resource, and the remaining resource amount corresponding to each candidate resource.
20. The apparatus of any of claims 11-19, the first preset tag and/or the second preset tag comprising at least one of: service type, scene type, resource state, sharing identification.
21. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-10.
22. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-10.
23. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-10.
CN202110881960.3A 2021-08-02 2021-08-02 Resource processing method and device Pending CN113590329A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110881960.3A CN113590329A (en) 2021-08-02 2021-08-02 Resource processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110881960.3A CN113590329A (en) 2021-08-02 2021-08-02 Resource processing method and device

Publications (1)

Publication Number Publication Date
CN113590329A true CN113590329A (en) 2021-11-02

Family

ID=78253894

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110881960.3A Pending CN113590329A (en) 2021-08-02 2021-08-02 Resource processing method and device

Country Status (1)

Country Link
CN (1) CN113590329A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114095564A (en) * 2021-11-16 2022-02-25 百度在线网络技术(北京)有限公司 Data processing method and device, equipment and medium
CN115086341A (en) * 2022-06-22 2022-09-20 中国工商银行股份有限公司 Resource scheduling method and device, computer readable storage medium and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110858161A (en) * 2018-08-24 2020-03-03 阿里巴巴集团控股有限公司 Resource allocation method, device, system, equipment and medium
CN111813545A (en) * 2020-06-29 2020-10-23 北京字节跳动网络技术有限公司 Resource allocation method, device, medium and equipment
CN111988392A (en) * 2020-08-14 2020-11-24 腾讯科技(深圳)有限公司 Resource allocation method based on cloud service, related device, equipment and system
CN112527509A (en) * 2020-12-21 2021-03-19 北京百度网讯科技有限公司 Resource allocation method and device, electronic equipment and storage medium
CN112905342A (en) * 2021-02-07 2021-06-04 广州虎牙科技有限公司 Resource scheduling method, device, equipment and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110858161A (en) * 2018-08-24 2020-03-03 阿里巴巴集团控股有限公司 Resource allocation method, device, system, equipment and medium
CN111813545A (en) * 2020-06-29 2020-10-23 北京字节跳动网络技术有限公司 Resource allocation method, device, medium and equipment
CN111988392A (en) * 2020-08-14 2020-11-24 腾讯科技(深圳)有限公司 Resource allocation method based on cloud service, related device, equipment and system
CN112527509A (en) * 2020-12-21 2021-03-19 北京百度网讯科技有限公司 Resource allocation method and device, electronic equipment and storage medium
CN112905342A (en) * 2021-02-07 2021-06-04 广州虎牙科技有限公司 Resource scheduling method, device, equipment and computer readable storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114095564A (en) * 2021-11-16 2022-02-25 百度在线网络技术(北京)有限公司 Data processing method and device, equipment and medium
CN115086341A (en) * 2022-06-22 2022-09-20 中国工商银行股份有限公司 Resource scheduling method and device, computer readable storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
CN112650576B (en) Resource scheduling method, device, equipment, storage medium and computer program product
CN112559182B (en) Resource allocation method, device, equipment and storage medium
CN113641457A (en) Container creation method, device, apparatus, medium, and program product
CN113590329A (en) Resource processing method and device
CN113849312A (en) Data processing task allocation method and device, electronic equipment and storage medium
CN111880914A (en) Resource scheduling method, resource scheduling apparatus, electronic device, and storage medium
CN114356547B (en) Low-priority blocking method and device based on processor virtualization environment
CN113364877A (en) Data processing method, device, electronic equipment and medium
CN114155026A (en) Resource allocation method, device, server and storage medium
CN114911598A (en) Task scheduling method, device, equipment and storage medium
CN113986497B (en) Queue scheduling method, device and system based on multi-tenant technology
CN112905314A (en) Asynchronous processing method and device, electronic equipment, storage medium and road side equipment
CN114924745A (en) Operation method and device of deep learning compiler and electronic equipment
CN114742000A (en) SoC chip verification system, verification method and device based on FPGA cluster
CN112887407B (en) Job flow control method and device for distributed cluster
CN112527509A (en) Resource allocation method and device, electronic equipment and storage medium
CN112817992A (en) Method, device, electronic equipment and readable storage medium for executing change task
CN112615795A (en) Flow control method and device, electronic equipment, storage medium and product
CN116594563A (en) Distributed storage capacity expansion method and device, electronic equipment and storage medium
CN113377295B (en) Data storage and reading method, device and equipment for multi-producer single-consumer
CN113553216A (en) Data recovery method and device, electronic equipment and storage medium
CN114327819B (en) Task management method, device, equipment and storage medium
CN115145725A (en) Cloud equipment distribution method and device, electronic equipment and storage medium
US20230136226A1 (en) Techniques for auto-tuning compute load resources
CN113220233A (en) Data reading method, device and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination