CN113535378A - Resource allocation method, storage medium and terminal equipment - Google Patents

Resource allocation method, storage medium and terminal equipment Download PDF

Info

Publication number
CN113535378A
CN113535378A CN202010313629.7A CN202010313629A CN113535378A CN 113535378 A CN113535378 A CN 113535378A CN 202010313629 A CN202010313629 A CN 202010313629A CN 113535378 A CN113535378 A CN 113535378A
Authority
CN
China
Prior art keywords
resource
resource allocation
service process
strategy
allocation
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
CN202010313629.7A
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.)
Shenzhen TCL Digital Technology Co Ltd
Original Assignee
Shenzhen TCL Digital 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 Shenzhen TCL Digital Technology Co Ltd filed Critical Shenzhen TCL Digital Technology Co Ltd
Priority to CN202010313629.7A priority Critical patent/CN113535378A/en
Publication of CN113535378A publication Critical patent/CN113535378A/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
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals

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 invention discloses a resource allocation method, a storage medium and a terminal device, wherein the method comprises the steps of determining a preset number of candidate resource allocation strategies of each service process by acquiring a plurality of service processes requesting resources and available resource data configured by the terminal device, determining a target resource allocation strategy corresponding to the terminal device according to a resource strategy set corresponding to each service process, and performing resource allocation according to the target resource allocation strategy. Therefore, the global optimization of each service process under the terminal equipment can be realized on the basis of realizing the optimal utilization rate of local resources of the service processes, so that the utilization rate of the resources in the terminal equipment is improved, and the problem that other service processes are blocked due to the fact that a certain service process occupies a large amount of resources is solved.

Description

Resource allocation method, storage medium and terminal equipment
Technical Field
The present invention relates to the field of terminal device technologies, and in particular, to a resource allocation method, a storage medium, and a terminal device.
Background
With the continuous development of terminal devices, the functions of the terminal devices are also continuously powerful. Meanwhile, the hardware requirements for the terminal devices are also increasing, for example, the requirements for the memory and the CPU, especially for the embedded device, often have the problem of insufficient hardware resources (for example, the performance of the memory and the CPU is relatively low). When a plurality of tasks simultaneously request resources from the terminal equipment, the available resources of the terminal equipment cannot meet the required resources of all the tasks, the resources are distributed to a certain task in a centralized manner, and the use of other personnel is influenced, so that the operation of a user is blocked. For example, when multiple pictures are acquired from the terminal device at the same time, the terminal device allocates a large amount of CPU and memory resources to the picture downloading task, which affects the use of other background programs to cause the user to operate the terminal device in a stuck state.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide a resource allocation method, a storage medium, and a terminal device, aiming at the deficiencies of the prior art.
In order to solve the technical problems, the technical scheme adopted by the invention is as follows:
a resource allocation method, wherein the method comprises the following steps:
acquiring a plurality of service processes requesting resources and available resource data configured by terminal equipment, wherein each service process in the plurality of service processes comprises the requested resource data;
for each service process, determining a resource allocation strategy set corresponding to the service process according to the available resource data and the request resource data corresponding to the service process;
selecting a preset number of candidate resource allocation strategies from the resource allocation strategy set corresponding to each service process to form a resource strategy set corresponding to each service process;
and determining a target resource allocation strategy corresponding to the terminal equipment according to the resource strategy set corresponding to each service process, and performing resource allocation according to the target resource allocation strategy.
The resource allocation method includes the steps that the request resource data include a plurality of request resource types and request quantity corresponding to each request resource type, the available resource data include a plurality of available resource types and available quantity corresponding to each available resource type, and the available resource types include the request resource types.
The resource allocation method, wherein, for each service process, determining the resource allocation policy set corresponding to the service process according to the available resource data and the request resource data corresponding to the service process specifically includes:
for each request resource type in each service process, determining a resource quantity threshold value according to the request quantity corresponding to the request resource type and the available quantity corresponding to the target available resource type, wherein the target available resource type is the same as the request resource type;
selecting a plurality of resource allocation quantities for each request resource type, wherein the resource allocation quantities in the resource allocation quantities are different from each other, and each resource point data is less than or equal to a resource quantity threshold corresponding to the request resource type;
and combining a plurality of resource allocation quantities corresponding to each request resource type to obtain a resource allocation strategy set corresponding to the service process, wherein the resource allocation strategy set comprises a plurality of resource allocation strategies, and the resource allocation strategies in the resource allocation strategies are different from each other.
In the resource allocation method, the resource allocation policy set includes a plurality of resource allocation policies, and each resource allocation policy in the plurality of resource allocation policies has at least one resource classification quantity corresponding to a request resource type, which is not zero.
In the resource allocation method, the selecting a preset number of candidate resource allocation policies from the resource allocation policy set corresponding to each service process to form the resource policy set corresponding to each service process specifically includes:
for each service process, calculating the resource utilization rate corresponding to each resource allocation strategy in the resource allocation strategy set corresponding to the service process;
and selecting a preset number of resource allocation strategies from the resource allocation strategy set corresponding to the service process according to the sequence of the resource utilization rate from large to small so as to form the resource strategy set corresponding to the service process.
The resource allocation method, wherein the determining a target resource allocation policy corresponding to the terminal device according to the resource policy set corresponding to each service process, and performing resource allocation according to the target resource allocation policy specifically includes:
selecting a candidate distribution strategy from a resource strategy set corresponding to each service process to form a plurality of candidate distribution strategy combinations;
respectively calculating the resource income of each candidate allocation strategy combination, and determining a target resource allocation strategy according to all the resource income;
and carrying out resource allocation according to the target resource allocation strategy.
According to the resource allocation method, the target resource allocation strategy is a resource allocation strategy with the highest resource profit.
In the resource allocation method, the selecting a candidate allocation policy from the resource policy set corresponding to each service process to form a plurality of candidate allocation policy combinations specifically includes:
for each service process, selecting a candidate allocation strategy in a resource strategy set corresponding to the service process;
combining the candidate distribution strategies selected by each service process to obtain a candidate distribution strategy combination;
and repeating the step of selecting a candidate allocation strategy in the resource strategy set corresponding to each service process until all the combinations of the candidate allocation strategies in each service process are obtained to obtain a plurality of candidate allocation strategy combinations, wherein the candidate allocation strategy combinations in the candidate allocation strategy combinations are different from each other.
A computer readable storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the steps in the resource allocation method as recited in any of the above.
A terminal device, comprising: a processor, a memory, and a communication bus; the memory has stored thereon a computer readable program executable by the processor;
the communication bus realizes connection communication between the processor and the memory;
the processor, when executing the computer readable program, implements the steps in the resource allocation method as described in any of the above.
Has the advantages that: compared with the prior art, the invention provides a resource allocation method, a storage medium and a terminal device, wherein the method comprises the steps of determining a preset number of candidate resource allocation strategies of each service process by acquiring a plurality of service processes requesting resources and available resource data configured by the terminal device, determining a target resource allocation strategy corresponding to the terminal device according to a resource strategy set corresponding to each service process, and performing resource allocation according to the target resource allocation strategies. Therefore, the global optimization of each service process under the terminal equipment can be realized on the basis of realizing the optimal utilization rate of local resources of the service processes, so that the utilization rate of the resources in the terminal equipment is improved, and the problem that other service processes are blocked due to the fact that a certain service process occupies a large amount of resources is solved.
Drawings
Fig. 1 is a flowchart of a resource allocation method provided in the present invention.
Fig. 2 is a schematic structural diagram of a terminal device provided in the present invention.
Detailed Description
The present invention provides a resource allocation method, a storage medium and a terminal device, and in order to make the objects, technical solutions and effects of the present invention clearer and clearer, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
The present embodiment provides a resource allocation method, which may be applied to an electronic device having a front-end camera function or a rear-end camera function, where the electronic device may be implemented in various forms. For example, a PC, a server, a mobile phone, a tablet PC, a palm PC, a Personal Digital Assistant (PDA), and the like. In addition, the functions realized by the method can be realized by calling the program code by a processor in the electronic equipment, and the program code can be saved in a computer storage medium.
As shown in fig. 1, the present embodiment provides a resource allocation method, which may include the following steps:
s10, obtaining a plurality of service processes requesting resources, and available resource data configured by the terminal device, wherein each service process in the plurality of service processes comprises the requested resource data.
Specifically, the service processes are service processes running in the terminal device and needing to acquire resources from the terminal device. Each service process in the plurality of service processes is a task which needs to be executed by the terminal equipment. The request resource data includes a plurality of request resource types and a request quantity corresponding to each request resource type, that is, the request resource data includes resource types of all resources that the service process needs to request and a quantity corresponding to each resource type. For example, the request resource data corresponding to the service process a is memory 3, CPU2 and bandwidth 1, and the request resource types that the service process a needs to request are memory, CPU and bandwidth, respectively, where the request number corresponding to the memory is 3, the request data corresponding to the CPU is 2, and the request data corresponding to the bandwidth is 1.
The available resource data comprises a plurality of available resource types and an available quantity corresponding to each available resource type, wherein the available resource types comprise a plurality of request resource types. It will be appreciated that each service process requests resources from the terminal device that the terminal device can provide. For example, the available resource types may include memory, CPU, and bandwidth, and the corresponding request resource type of the service process B includes memory and CPU. It should be noted that, of course, a plurality of available resource types included in the available resource data are all available resource types that can be provided by the terminal device, and the terminal device can obtain the available resource data by reading its own configuration information.
And S20, for each service process, determining a resource allocation policy set corresponding to the service process according to the available resource data and the request resource data corresponding to the service process.
Specifically, the resource allocation policy set includes a plurality of resource allocation policies, each resource allocation policy in the plurality of resource allocation policies is a manner in which the terminal device allocates resources for the service process, and the resource allocation policy includes a resource amount allocated by the terminal device for a resource corresponding to each requested resource type, which is denoted as an allocated resource amount. It can be understood that each resource allocation policy includes an allocation resource quantity corresponding to each request resource type, and the resource quantity corresponding to each request resource type that the terminal device needs to allocate to the service process can be determined according to the resource allocation policy. For example, the request resource types of the service process a are a memory, a CPU, and a bandwidth, respectively, and the resource allocation policy corresponding to the service process includes an allocation resource amount B corresponding to an allocation resource amount A, CPU corresponding to the memory and an allocation resource amount C corresponding to the bandwidth.
In an implementation manner of this embodiment, the determining, for each service process, a resource allocation policy set corresponding to the service process according to the available resource data and the request resource data corresponding to the service process specifically includes:
s21, for each request resource type in each service process, determining a resource quantity threshold value according to the request quantity corresponding to the request resource type and the available quantity corresponding to the target available resource type, wherein the target available resource type is the same as the request resource type;
s22, selecting a plurality of resource allocation quantities for each request resource type, wherein the resource allocation quantities in the resource allocation quantities are different from each other, and each resource data is less than or equal to a resource quantity threshold corresponding to the request resource type;
s23, combining the resource allocation quantities corresponding to the request resource types to obtain a resource allocation strategy set corresponding to the service process, wherein the resource allocation strategy set comprises a plurality of resource allocation strategies, and the resource allocation strategies in the resource allocation strategies are different from each other.
Specifically, in step S21, the threshold of the number of resources is the maximum number of resources that the terminal device can allocate for the requested resource type, for example, the threshold of the resource data corresponding to the memory in the service entry a is 5, and then the terminal device can allocate 5 memories at most for the service process a. In this embodiment, the resource quantity threshold is determined according to the request quantity corresponding to the request resource type and the available quantity corresponding to the target available resource type, where the target available resource type is an available resource type that is the same as the request resource type in the available resource types. For example, if the requested resource type is memory, then the target available resource type is also memory.
Further, when the resource quantity threshold is determined according to the request quantity and the available quantity, the request quantity may be used as the resource quantity threshold, the available data may be used as the resource data threshold, and the minimum value between the request quantity and the available quantity may be used as the resource data threshold. In one implementation of this embodiment, the minimum of the number of requests and the number of available requests is used as the resource data threshold. Therefore, after the request quantity corresponding to the request resource type and the available quantity corresponding to the target available resource type are acquired, the acquired request quantity and the acquired available quantity can be compared, and the smaller of the acquired request quantity and the acquired available quantity is selected as the resource data threshold. For example, when the number of requests is greater than or equal to the available number, the available number is taken as the resource number threshold; and conversely, when the request quantity is smaller than the available quantity, the request quantity is used as a resource quantity threshold value.
Further, in step S22, the resource allocation quantity is a quantity of resources requested to be allocated by the terminal device for the requested resource, each of the resource allocation quantities is greater than or equal to 0 and less than or equal to the resource quantity threshold, and the resource allocation quantities are different from each other. It will be appreciated that each resource allocation quantity is a quantity between 0 and a resource quantity threshold, e.g., a resource quantity threshold of 3, then the resource allocation quantity may be 1,2, etc. In addition, the number of the resource allocation quantities may be smaller than the number of all integers between 0 and the resource quantity threshold, or may be equal to the number of all integers between 0 and the resource quantity threshold, where all integers between 0 and the resource quantity threshold include 0 and the resource quantity threshold.
In one implementation of this embodiment, the number of resource allocation quantities is equal to the number of all integers between 0 and the resource quantity threshold, that is, the number of resource allocation quantities may be 0, 1. Therefore, for each request resource type of the service process, a plurality of resource allocation data can be obtained, for example, the request resource type of the service process a includes a memory and a CPU, a resource quantity threshold corresponding to the memory is 2, a resource quantity threshold corresponding to the CPU is 3, then a plurality of resource allocation quantities corresponding to the memory are respectively 0,1 and 2, and a plurality of resource allocation quantities corresponding to the CPU are respectively 0,1, 2 and 3.
Further, in the step S23, after acquiring a plurality of resource allocation quantities corresponding to each requested resource type, taking the plurality of resource allocation quantities corresponding to each requested resource as an allocation quantity set, then randomly selecting one resource allocation quantity from each allocation quantity set to combine to obtain a plurality of resource allocation policies, and the obtained plurality of resource allocation policies form a resource allocation policy set of the service process, where the resource allocation policies in the resource allocation policy set are different from each other. It should be noted that, in each resource allocation policy of the resource allocation policies, at least one resource classification quantity corresponding to a requested resource type is not zero, that is, the resource allocation policy set does not include a resource allocation policy in which the resource allocation quantity corresponding to each requested resource type is 0, that is, at least one resource allocation quantity corresponding to a requested resource type is not 0 in the resource allocation policy.
For example, the following steps are carried out: the service process A requests the resource type to include a memory and a CPU, wherein the distribution quantity set corresponding to the memory is {0, 1,2}, and the distribution quantity set corresponding to the CPU is {0, 1,2,3 }; then the resource allocation policy corresponding to the service process a can be expressed in the form of (amount of memory, amount of CPU), and then the resource allocation policies corresponding to the service processes are (0,1), (0,2), (0,3), (1,0), (1,1), (1,2), (1,3), (2,0), (2,1), (2,2) and (2, 3); then the resource allocation policy set corresponding to the service process a is { (0,1), (0,2), (0,3), (1,0), (1,1), (1,2), (1,3), (2,0), (2,1), (2,2), (2,3) }.
S30, selecting a preset number of candidate resource allocation strategies from the resource allocation strategy set corresponding to each service process to form a resource strategy set corresponding to each service process.
Specifically, the preset number may be preset, or may be determined according to the number of resource allocation policies in the resource allocation policy set, for example, the preset number is one-half of the resource allocation policies. In addition, the preset number of candidate resource allocation resources may be randomly selected in the resource allocation policy set, or may be selected according to a preset condition, for example, according to a resource utilization rate corresponding to the resource allocation policy.
In an implementation manner of this embodiment, the selecting a preset number of candidate resource allocation policies from a resource allocation policy set corresponding to each service process to form a resource policy set corresponding to each service process specifically includes:
s31, calculating the resource utilization rate corresponding to each resource allocation strategy in the resource allocation strategy set corresponding to each service process;
s32, according to the sequence of the resource utilization rate from big to small, selecting a preset number of resource allocation strategies in the resource allocation strategy set corresponding to the service process to form the resource strategy set corresponding to the service process.
Specifically, in the step S31, the resource utilization rate is a minimum value of first resource utilization rates corresponding to the request resource types in the service process, and the first resource utilization rate corresponding to each request resource type is calculated according to the available number of the available resource types corresponding to the resource request type and the allocated resource number corresponding to the request resource type in the resource allocation policy. Thus, the process of calculating the resource utilization rate corresponding to each resource allocation policy in the resource allocation policy set corresponding to the service process may include: for each resource allocation strategy of a service process, acquiring the resource allocation quantity corresponding to each request resource type in the resource allocation strategy, the actual use quantity of the request resource type in the service process and the available quantity corresponding to the request type; and calculating the first resource utilization rate corresponding to the request type according to the resource allocation quantity, the actual use quantity and the available quantity. The actual usage quantity refers to the sum of usage quantities distributed by the service process to the request tasks corresponding to the service process. It can be understood that each service process corresponds to a plurality of tasks, each task requests resources from the service process, and the usage amount is the amount of resources allocated to each task by the service process, and the actual usage amount is the sum of the usage amounts corresponding to the requested resource types allocated to all tasks in the service process.
In an implementation manner of this embodiment, the calculation formula of the first resource utilization rate may be:
Figure BDA0002458756120000091
wherein,
Figure BDA0002458756120000092
representing a service Process miFirst resource utilization, R, of the request resource type Kk(mi) Representing a service Process miThe number of resource allocations of request resource type K,
Figure BDA0002458756120000093
representing a service Process miNumber of uses, PM, of request resource types K allocated for a task tk(mi) Indicating the available amount corresponding to the requested resource type K.
Further, for each resource allocation strategy, after the first resource utilization rate corresponding to each requested resource type is obtained, the minimum first resource utilization rate of the first resource utilization rates is selected, and the minimum first resource utilization rate is used as the resource utilization rate corresponding to the resource allocation strategy. Thus, resource utilization of resource allocation policies
Figure BDA0002458756120000094
The expression may be:
Figure BDA0002458756120000095
wherein,
Figure BDA0002458756120000101
show clothesBusiness process miOf a request resource type k, Rk(mi) Representing a service Process miThe number of resource allocations of request resource type k,
Figure BDA0002458756120000102
representing a service Process miNumber of uses of request resource type k, PM, allocated for task tk(mi) Indicating the available amount corresponding to the requested resource type K.
Further, in the step S32, after the resource utilization rates corresponding to the resource allocation policies are obtained, in the resource allocation policy set, a preset number of resource allocation policies are selected according to the resource utilization rates corresponding to the resource allocation policies in a descending order, and a resource policy set is formed according to the resource allocation policies with the preset number obtained by selection, where the resource policy set includes the selected preset number of resource allocation policies. Wherein the preset number is a preset positive integer, for example, 3, 4, etc. Certainly, in practical application, the preset number may be determined according to the number of service processes in practical use, and when the number of service processes is large, the preset number may be small; conversely, when the number of service processes is small, the preset number may be large.
S40, determining a target resource allocation strategy corresponding to the terminal device according to the resource strategy set corresponding to each service process, and performing resource allocation according to the target resource allocation strategy.
Specifically, the target resource allocation policy refers to a policy that is determined by the terminal device to allocate resources to each service process, that is, the target resource allocation policy includes an allocation number corresponding to each requested resource type in each service process, and the terminal device allocates resources corresponding to each requested resource type to the service process according to the allocation number.
In an implementation manner of this embodiment, the determining a target resource allocation policy corresponding to a terminal device according to a resource policy set corresponding to each service process, and performing resource allocation according to the target resource allocation policy specifically includes:
selecting a candidate distribution strategy from a resource strategy set corresponding to each service process to form a plurality of candidate distribution strategy combinations;
respectively calculating the resource income of each candidate allocation strategy combination, and determining a target resource allocation strategy according to all the resource income;
and carrying out resource allocation according to the target resource allocation strategy.
Specifically, each of the candidate allocation policy combinations includes a candidate allocation policy of each service process, the candidate allocation policy is one resource allocation policy in a resource policy set corresponding to the service process, and at least one resource allocation policy corresponding to one service process is different in any two of the candidate allocation policy combinations. For example, the service process is divided into a service process a and a service process B, and the resource policy set corresponding to the service process a includes a resource allocation policy a1, a resource allocation policy B1, and a resource allocation policy C1; the resource strategy set corresponding to the service process B comprises a resource allocation strategy A2, a resource allocation strategy B2 and a resource allocation strategy C2; then, when the candidate allocation policy combination a in the candidate allocation policy combinations is composed of the resource allocation policy a1 and the resource allocation policy a2, none of the other candidate allocation policy combinations in the candidate allocation policy combinations may be composed of the resource allocation policy a1 and the resource allocation policy a2, for example, the candidate allocation policy combination B in the candidate allocation policy combinations may not be composed of the resource allocation policy a1 and the resource allocation policy a2, it may be composed of the resource allocation policy a1 and the resource allocation policy B2, it may be composed of the resource allocation policy a1 and the resource allocation policy C2, and so on.
Further, the calculation formula of the candidate allocation strategy combined resource profit may be:
Figure BDA0002458756120000111
Figure BDA0002458756120000112
wherein A represents a resource allocation policy combination, miDenotes the ith service Process, rikRepresenting a service Process miThe quantity of the required resources of the medium task t for the request resource type k; rk(mi) Representing a service Process miThe resource allocation quantity of the request resource type k; RT (reverse transcription)iFor service process miCorresponding maximum response duration, ERTiFor service process miCorresponding response duration, CostiFor service process miA corresponding maximum cost;
Figure BDA0002458756120000113
for service process miThe resource gain of (2) is expressed as:
Figure BDA0002458756120000114
wherein, beta represents a weight relation parameter between fairness and resource utilization rate, and beta belongs to [0, 1); v (A) is the fairness bias value, ske (m)i) Is the utilization deviation of the resource type on the terminal equipment, A represents the resource allocation strategy, miWhich represents the ith service process and the service process,
Figure BDA0002458756120000115
representing a service Process miA first resource utilization of request resource type k,
Figure BDA0002458756120000121
for service process miAn average value of the first resource utilization rates of all corresponding request resource types; k is the service process miThe number of all corresponding request resource types; rk(mi) Representing a service Process miThe resource allocation quantity of the request resource type k; λ and α are blending coefficients.
Further, in an implementation manner of this embodiment, the selecting a candidate allocation policy from the resource policy set corresponding to each service process to form a plurality of candidate allocation policy combinations specifically includes:
combining the candidate distribution strategies selected by each service process to obtain a candidate distribution strategy combination;
and repeating the step of selecting a candidate allocation strategy in the resource strategy set corresponding to each service process until all the combinations of the candidate allocation strategies in each service process are obtained to obtain a plurality of candidate allocation strategy combinations, wherein the candidate allocation strategy combinations in the candidate allocation strategy combinations are different from each other.
Specifically, after the resource policy sets corresponding to the service processes are combined, one resource policy is randomly selected from each resource policy set to be combined, so that a plurality of resource policy combinations are obtained. For example, the number of service processes includes service process a and service process B; the request resource types corresponding to the service process a and the service process B are both a memory and a CPU, and the resource allocation policies corresponding to the service process a and the service process B can both be expressed in the form of (the number of memories, the number of CPUs). Assuming that the resource policy set corresponding to the service process a is { (0,1), (1,2) } and the resource policy set corresponding to the service process B is { (1,1), (2,2) }, the candidate allocation policies corresponding to the service process a and the service process B are combined to be { (0,1), (1,1) }, { (0,1), (2,2) }, { (1,2), (1,1) } and { (1,2), (2,2) }.
Based on the resource allocation method, the present embodiment provides a computer-readable storage medium, where one or more programs are stored, and the one or more programs are executable by one or more processors to implement the steps in the resource allocation method, the storage medium, and the terminal device according to the foregoing embodiments.
Based on the resource allocation method, the present invention further provides a terminal device, as shown in fig. 2, which includes at least one processor (processor) 20; a display screen 21; and a memory (memory)22, and may further include a communication Interface (Communications Interface)23 and a bus 24. The processor 20, the display 21, the memory 22 and the communication interface 23 can communicate with each other through the bus 24. The display screen 21 is configured to display a user guidance interface preset in the initial setting mode. The communication interface 23 may transmit information. The processor 20 may call logic instructions in the memory 22 to perform the methods in the embodiments described above.
Furthermore, the logic instructions in the memory 22 may be implemented in software functional units and stored in a computer readable storage medium when sold or used as a stand-alone product.
The memory 22, which is a computer-readable storage medium, may be configured to store a software program, a computer-executable program, such as program instructions or modules corresponding to the methods in the embodiments of the present disclosure. The processor 20 executes the functional application and data processing, i.e. implements the method in the above-described embodiments, by executing the software program, instructions or modules stored in the memory 22.
The memory 22 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal device, and the like. Further, the memory 22 may include a high speed random access memory and may also include a non-volatile memory. For example, a variety of media that can store program codes, such as a usb disk, a removable hard disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk, may also be transient storage media.
In addition, the specific processes loaded and executed by the storage medium and the instruction processors in the terminal device are described in detail in the method, and are not stated herein.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A resource allocation method, the method comprising:
acquiring a plurality of service processes requesting resources and available resource data configured by terminal equipment, wherein each service process in the plurality of service processes comprises the requested resource data;
for each service process, determining a resource allocation strategy set corresponding to the service process according to the available resource data and the request resource data corresponding to the service process;
selecting a preset number of candidate resource allocation strategies from the resource allocation strategy set corresponding to each service process to form a resource strategy set corresponding to each service process;
and determining a target resource allocation strategy corresponding to the terminal equipment according to the resource strategy set corresponding to each service process, and performing resource allocation according to the target resource allocation strategy.
2. The method of claim 1, wherein the requested resource data includes a plurality of requested resource types and a requested amount corresponding to each requested resource type, and the available resource data includes a plurality of available resource types and an available amount corresponding to each available resource type, wherein the plurality of available resource types includes the plurality of requested resource types.
3. The method of claim 2, wherein the determining, for each service process, the resource allocation policy set corresponding to the service process according to the available resource data and the request resource data corresponding to the service process specifically comprises:
for each request resource type in each service process, determining a resource quantity threshold value according to the request quantity corresponding to the request resource type and the available quantity corresponding to the target available resource type, wherein the target available resource type is the same as the request resource type;
selecting a plurality of resource allocation quantities for each request resource type, wherein the resource allocation quantities in the resource allocation quantities are different from each other, and each resource point data is less than or equal to a resource quantity threshold corresponding to the request resource type;
and combining a plurality of resource allocation quantities corresponding to each request resource type to obtain a resource allocation strategy set corresponding to the service process, wherein the resource allocation strategy set comprises a plurality of resource allocation strategies, and the resource allocation strategies in the resource allocation strategies are different from each other.
4. The method according to claim 3, wherein the resource allocation policy set comprises a plurality of resource allocation policies, and each resource allocation policy in the plurality of resource allocation policies has at least one resource classification number corresponding to the requested resource type, which is not zero.
5. The method of claim 3, wherein the selecting a predetermined number of candidate resource allocation policies from the resource allocation policy set corresponding to each service process to form the resource policy set corresponding to each service process specifically comprises:
for each service process, calculating the resource utilization rate corresponding to each resource allocation strategy in the resource allocation strategy set corresponding to the service process;
and selecting a preset number of resource allocation strategies from the resource allocation strategy set corresponding to the service process according to the sequence of the resource utilization rate from large to small so as to form the resource strategy set corresponding to the service process.
6. The method of claim 1, wherein the determining a target resource allocation policy corresponding to the terminal device according to the resource policy set corresponding to each service process, and the resource allocation according to the target resource allocation policy specifically includes:
selecting a candidate distribution strategy from a resource strategy set corresponding to each service process to form a plurality of candidate distribution strategy combinations;
respectively calculating the resource income of each candidate allocation strategy combination, and determining a target resource allocation strategy according to all the resource income;
and carrying out resource allocation according to the target resource allocation strategy.
7. The method of claim 6, wherein the target resource allocation policy is a resource allocation policy with highest resource profit.
8. The method of claim 6, wherein the selecting a candidate allocation policy from the resource policy set corresponding to each service process to form a plurality of candidate allocation policy combinations specifically comprises:
for each service process, selecting a candidate allocation strategy in a resource strategy set corresponding to the service process;
combining the candidate distribution strategies selected by each service process to obtain a candidate distribution strategy combination;
and repeating the step of selecting a candidate allocation strategy in the resource strategy set corresponding to each service process until all the combinations of the candidate allocation strategies in each service process are obtained to obtain a plurality of candidate allocation strategy combinations, wherein the candidate allocation strategy combinations in the candidate allocation strategy combinations are different from each other.
9. A computer-readable storage medium storing one or more programs which are executable by one or more processors to implement the steps of the resource allocation method according to any one of claims 1 to 8.
10. A terminal device, comprising: a processor, a memory, and a communication bus; the memory has stored thereon a computer readable program executable by the processor;
the communication bus realizes connection communication between the processor and the memory;
the processor, when executing the computer readable program, implements the steps in the resource allocation method according to any of claims 1-8.
CN202010313629.7A 2020-04-20 2020-04-20 Resource allocation method, storage medium and terminal equipment Pending CN113535378A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010313629.7A CN113535378A (en) 2020-04-20 2020-04-20 Resource allocation method, storage medium and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010313629.7A CN113535378A (en) 2020-04-20 2020-04-20 Resource allocation method, storage medium and terminal equipment

Publications (1)

Publication Number Publication Date
CN113535378A true CN113535378A (en) 2021-10-22

Family

ID=78093792

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010313629.7A Pending CN113535378A (en) 2020-04-20 2020-04-20 Resource allocation method, storage medium and terminal equipment

Country Status (1)

Country Link
CN (1) CN113535378A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116245344A (en) * 2023-05-11 2023-06-09 成都愚创科技有限公司 Scientific research resource management method and system based on big data and readable medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102567113A (en) * 2010-12-13 2012-07-11 盛乐信息技术(上海)有限公司 Foreground program allocating system and realizing method
WO2013139037A1 (en) * 2012-03-23 2013-09-26 华为技术有限公司 Method and device for scheduling resources
CN104331321A (en) * 2014-10-09 2015-02-04 冷明 Cloud computing task scheduling method based on tabu search and load balancing
CN105988872A (en) * 2015-02-03 2016-10-05 阿里巴巴集团控股有限公司 CPU (central processing unit) resource allocation method and device and electronic equipment
CN106776025A (en) * 2016-12-16 2017-05-31 郑州云海信息技术有限公司 A kind of computer cluster job scheduling method and its device
WO2017138909A1 (en) * 2016-02-08 2017-08-17 Hewlett Packard Enterprise Development Lp Comparative advantage resource allocator
CN107391259A (en) * 2017-07-25 2017-11-24 广东欧珀移动通信有限公司 Method for processing resource and device, computer-readable recording medium, mobile terminal
CN108566424A (en) * 2018-04-11 2018-09-21 深圳市腾讯网络信息技术有限公司 Dispatching method, device and system based on server resource consumption forecast

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102567113A (en) * 2010-12-13 2012-07-11 盛乐信息技术(上海)有限公司 Foreground program allocating system and realizing method
WO2013139037A1 (en) * 2012-03-23 2013-09-26 华为技术有限公司 Method and device for scheduling resources
CN104331321A (en) * 2014-10-09 2015-02-04 冷明 Cloud computing task scheduling method based on tabu search and load balancing
CN105988872A (en) * 2015-02-03 2016-10-05 阿里巴巴集团控股有限公司 CPU (central processing unit) resource allocation method and device and electronic equipment
WO2017138909A1 (en) * 2016-02-08 2017-08-17 Hewlett Packard Enterprise Development Lp Comparative advantage resource allocator
CN106776025A (en) * 2016-12-16 2017-05-31 郑州云海信息技术有限公司 A kind of computer cluster job scheduling method and its device
CN107391259A (en) * 2017-07-25 2017-11-24 广东欧珀移动通信有限公司 Method for processing resource and device, computer-readable recording medium, mobile terminal
CN108566424A (en) * 2018-04-11 2018-09-21 深圳市腾讯网络信息技术有限公司 Dispatching method, device and system based on server resource consumption forecast

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116245344A (en) * 2023-05-11 2023-06-09 成都愚创科技有限公司 Scientific research resource management method and system based on big data and readable medium
CN116245344B (en) * 2023-05-11 2023-07-14 成都愚创科技有限公司 Scientific research resource management method and system based on big data and readable medium

Similar Documents

Publication Publication Date Title
US11032212B2 (en) Systems and methods for provision of a guaranteed batch
US8195798B2 (en) Application server scalability through runtime restrictions enforcement in a distributed application execution system
US8429666B2 (en) Computing platform with resource constraint negotiation
CN111309644B (en) Memory allocation method and device and computer readable storage medium
EP2977898B1 (en) Task allocation in a computing environment
US9817698B2 (en) Scheduling execution requests to allow partial results
CN111798113A (en) Resource allocation method, device, storage medium and electronic equipment
CN115421930B (en) Task processing method, system, device, equipment and computer readable storage medium
CN112860387A (en) Distributed task scheduling method and device, computer equipment and storage medium
CN114155026A (en) Resource allocation method, device, server and storage medium
CN113867973A (en) Resource allocation method and device
CN113485838A (en) Server distribution method and device, electronic equipment and computer readable storage medium
CN113535378A (en) Resource allocation method, storage medium and terminal equipment
CN115640113A (en) Multi-plane flexible scheduling method
US9501321B1 (en) Weighted service requests throttling
CN116932220A (en) Resource adjustment method and device for service cluster, electronic equipment and storage medium
CN112073532A (en) Resource allocation method and device
CN111913792A (en) Service processing method and device
CN114327862B (en) Memory allocation method and device, electronic equipment and storage medium
EP3046029B1 (en) Method and device for determining program performance interference model
CN115794396A (en) Resource allocation method, system and electronic equipment
CN112130974B (en) Cloud computing resource configuration method and device, electronic equipment and storage medium
US10601905B2 (en) Priority switching based on resource usage patterns
CN112114959A (en) Resource scheduling method, distributed platform, computer device, and storage medium
CN117640541B (en) Cloud server resource allocation method, device, equipment and medium

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