A method and device for allocating resources of a processing unit

By dynamically adjusting processing resources, the waste and competition problems caused by pre-allocating resources in high-pressure activities on the server are solved, and the rational allocation and utilization of resources are achieved, ensuring the balance of resource requirements for different activities.

CN112596906BActive Publication Date: 2024-12-31AGRICULTURAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011569216.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-26
Publication Date
2024-12-31
Estimated Expiration
2040-12-26

AI Technical Summary

Technical Problem

Running high-pressure and high-resource consumption activities on the server pre-allocated more processing resources, resulting in insufficient remaining processing resources, causing a fight for limited processing resources, causing resource waste and resource competition.

Method used

By dynamically adjusting the processing resources, the first resource utilization rate and resource idle rate are determined, and the activities are processed using the rated usage rate not exceeding the pre-set, and processing resources are allocated reasonably to avoid resource waste and competition.

Benefits of technology

It effectively reduces the waste of processing resources by high-stress activities, balances the resource requirements between different activities, avoids resource competition, and improves resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112596906B_ABST
    Figure CN112596906B_ABST
Patent Text Reader

Abstract

The present application discloses a method for allocating resources of a processing unit, comprising: determining a first resource utilization rate; obtaining a resource idle rate according to the difference between the total amount of processing resources and the first resource utilization rate; determining a second rated utilization rate according to the larger value of the resource idle rate and the first rated utilization rate; and processing at least one second activity in the second activity set using processing resources that do not exceed the second rated utilization rate. In this way, it is possible to overcome the waste of resources caused by a large number of pre-allocated processing resources and the competition for processing resources by other activities.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of resource allocation, and in particular to a method and device for resource allocation of a processing unit. Background Art

[0002] Based on the increasingly widespread application of shared resource architecture, when running high-stress, high-resource-consuming activities such as software system performance testing on a server, since the operation of the activity requires a large amount of processing resources, more processing unit resources will be pre-allocated, resulting in the remaining processing resources being unable to meet the needs of other activities for processing resources, causing competition for limited processing resources. Based on this, a method and device for allocating resources for processing units is needed to overcome the waste of resources caused by the large number of pre-allocated processing resources and the competition for processing resources by other activities. Summary of the invention

[0003] The embodiment of the present invention provides a method and device for allocating resources of a processing unit, which reduces the waste of pre-allocated processing resources by high-stress and high-resource consumption activities through dynamic adjustment of processing resources, and overcomes the competition for processing resources by other activities.

[0004] In a first aspect, a method for allocating resources of a processing unit is provided, comprising:

[0005] determining a first resource usage rate, the first resource usage rate being a ratio of a processing resource used by a first activity set, the first activity set including at least one first activity;

[0006] Obtaining a resource idle rate according to a difference between the total amount of processing resources and the first resource usage rate;

[0007] determining a second rated usage rate according to a larger value of the resource idle rate and the first rated usage rate, wherein the first rated usage rate is a preset maximum proportion of processing resources that can be used by a second activity set, and the second rated usage rate is a maximum proportion of processing resources that can actually be used by the second activity set, wherein the second activity set includes at least one second activity;

[0008] At least one second activity in the second activity set is processed using processing resources that do not exceed the second rated usage rate.

[0009] Optionally, the method further includes:

[0010] If the second rated usage rate is greater than the first rated usage rate, determining a second resource usage rate according to a difference between the total amount of processing resources and the second rated usage rate;

[0011] The first set of activities is processed using processing resources at the second resource usage rate.

[0012] Optionally, the using processing resources not exceeding the second rated usage rate to process at least one second activity in the second activity set includes:

[0013] Obtaining a third resource usage rate, where the third resource usage rate is the sum of third sub-resource usage rates corresponding to each second activity in the second activity set, where the third sub-resource usage rate is a proportion of processing resources required to be used by the second activity;

[0014] If the third resource usage rate is equal to the second rated usage rate, the third sub-resource usage rate of at least one second activity in the second activity set is lowered.

[0015] Optionally, the lowering of the third sub-resource usage rate of at least one second activity in the second activity set includes:

[0016] Determine a first number corresponding to the second activity, where the first number is the number of processing units corresponding to the second activity;

[0017] determining a target number according to the first number, the target number being smaller than the first number;

[0018] The second activity is processed by using the target number of processing units and a fourth sub-resource usage rate of the second activity is determined, wherein the fourth sub-resource usage rate of the second activity is lower than the third sub-resource usage rate.

[0019] Optionally, determining the target number according to the first number includes:

[0020] Let the undetermined number be the value of the first number minus 1;

[0021] Processing the second activity with the to-be-determined number of processing units, and determining an actual sub-resource usage rate of the second activity;

[0022] Determine whether the actual sub-resource usage rate of the second activity is lower than the third sub-resource usage rate. If so, use the actual sub-resource usage rate as the fourth sub-resource usage rate; if not, use the value of the first number minus 2 as the pending number, and execute subsequent steps until the actual sub-resource usage rate of the second activity is lower than the third sub-resource usage rate.

[0023] In a second aspect, a resource allocation device for a processing unit is also provided, characterized in that it includes:

[0024] A first determining unit, configured to determine a first resource usage rate, wherein the first resource usage rate is a ratio of a processing resource used by a first activity set, wherein the first activity set includes at least one first activity;

[0025] a first calculation unit, configured to obtain a resource idle rate according to a difference between a total amount of processing resources and a usage rate of the first resource;

[0026] a second determining unit, configured to determine a second rated usage rate according to a larger value of the resource idle rate and a first rated usage rate, wherein the first rated usage rate is a preset maximum proportion of processing resources that can be used by a second activity set, and the second rated usage rate is a maximum proportion of processing resources that can actually be used by the second activity set, wherein the second activity set includes at least one second activity;

[0027] The first processing unit is configured to process at least one second activity in the second activity set by using processing resources that do not exceed the second rated usage rate.

[0028] Optionally, the device further comprises:

[0029] a third determining unit, configured to determine a second resource usage rate according to a difference between the total amount of processing resources and the second rated usage rate if the second rated usage rate is greater than the first rated usage rate;

[0030] The second processing unit is configured to process the first activity set using processing resources at the second resource usage rate.

[0031] Optionally, the third determining unit further includes:

[0032] An acquiring unit, configured to acquire a third resource usage rate, wherein the third resource usage rate is the sum of third sub-resource usage rates respectively corresponding to each second activity in the second activity set, and the third sub-resource usage rate is a proportion of processing resources required to be used by the second activity;

[0033] An adjusting unit is configured to, if the third resource usage rate is equal to the second rated usage rate, lower the third sub-resource usage rate of at least one second activity in the second activity set.

[0034] Optionally, the adjustment unit includes:

[0035] a fourth determining unit, configured to determine a first number corresponding to the second activity, where the first number is the number of processing units corresponding to the second activity;

[0036] a fifth determining unit, configured to determine a target number according to the first number, wherein the target number is smaller than the first number;

[0037] A sixth determining unit is configured to determine a fourth sub-resource usage rate of the second activity based on processing the second activity with the target number of processing units, wherein the fourth sub-resource usage rate of the second activity is lower than the third sub-resource usage rate.

[0038] Optionally, the fifth determining unit includes:

[0039] An assignment unit, used for setting the to-be-determined number to be a value of the first number minus 1;

[0040] a seventh determining unit, configured to process the second activity with the to-be-determined number of processing units, and determine an actual sub-resource usage rate of the second activity;

[0041] A judging unit is used to judge whether the actual sub-resource usage rate of the second activity is lower than the third sub-resource usage rate. If so, the actual sub-resource usage rate is used as the fourth sub-resource usage rate; if not, the value of the first number minus 2 is used as the pending number, and subsequent steps are executed until the actual sub-resource usage rate of the second activity is lower than the third sub-resource usage rate.

[0042] It can be seen that through the method and device for resource allocation of the processing unit provided in the embodiment of the present application, when it is necessary to ensure the operation of the first activity in the first activity set while taking into account the resource allocation of the second activity set, the first resource utilization rate is first determined to ensure the operation of the first activity in the first activity set, the resource idle rate is determined according to the total amount of processing resources and the first resource utilization rate, the second rated utilization rate is determined according to the larger value of the resource idle rate and the pre-set first rated utilization rate, the second rated utilization rate is the maximum proportion of processing resources that can actually be used by the second activity set, and finally, processing resources that do not exceed the second rated utilization rate are used to process at least one second activity in the second activity set. It can be seen that by using the solution of the embodiment of the present application, the server can reduce the waste of resources for pre-allocation and overcome the competition for processing resources by the second activity set while ensuring the use of resources by the first activity. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0044] Figure 1 This is a flow chart of the resource allocation method in an embodiment of the present application;

[0045] Figure 2This is a processing method in the embodiment of the present application when the second rated usage rate is the first rated usage rate;

[0046] Figure 3 A schematic diagram of a queue used to adjust the resource usage rate of a second activity in a second activity set in an embodiment of the present application;

[0047] Figure 4 Schematic diagram of a resource allocation device in an embodiment of the present application. DETAILED DESCRIPTION

[0048] At present, when it is necessary to ensure the operation of the first activity in the first activity set, more processing unit resources are usually pre-allocated to ensure the operation of the first activity, resulting in the remaining processing resources being unable to meet the demand for processing resources of the second activity, causing the second activity to compete for limited processing resources. Therefore, it is necessary to design a resource allocation method for the processing unit to reasonably balance the contradiction between the resource requirements of the first activity and the second activity and eliminate the resource competition between the second activities.

[0049] To this end, an embodiment of the present application provides a method for allocating resources of a processing unit, which can be applied to a server. The processing unit can be a CP (central processor), and the first activity can be a high-pressure activity that requires more processing resources.

[0050] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0051] See also Figure 1 , which is a flow chart of a resource allocation method provided in an embodiment of the present application.

[0052] S101: Determine a first resource usage rate. The first resource usage rate is a ratio of a processing resource used by a first activity set, where the first activity set includes at least one first activity.

[0053] In one embodiment of the present application, it can be applied to a server. The first resource utilization rate can be determined by calling the RMFⅢ interface of the server, obtaining an XML format file containing processing resource utilization data of the first activity set, reading the file to obtain the number of processing resources used by the first activity set, and determining the proportion of processing resources used by the first activity set based on the total amount of processing resources, that is, the first resource utilization rate.

[0054] In one embodiment of the present application, the total amount of processing resources may be pre-set according to the operating environment of the activity.

[0055] In one embodiment of the present application, the first activity may be a high-stress activity that requires more processing resources.

[0056] S102: Obtain a resource idle rate according to a difference between the total amount of processing resources and the first resource usage rate.

[0057] In one embodiment of the present application, the resource idle rate may be:

[0058] %s=1-%u f

[0059] Among them, %s is the resource idle rate, %u f is the first resource utilization rate.

[0060] In another embodiment of the present application, a portion of idle processing resources may be reserved. If the utilization rate of the reserved idle processing resources is Δu=5%, the resource idle rate may be:

[0061] %s=1-%u f -△u

[0062] Among them, %s is the resource idle rate, %u f is the first resource utilization rate.

[0063] S103: Determine a second rated usage rate based on a larger value between a resource idle rate and a first rated usage rate, wherein the first rated usage rate is a maximum proportion of processing resources that can be used by a preset second activity set, and the second rated usage rate is a maximum proportion of processing resources that can actually be used by the second activity set, and the second activity set includes at least one second activity.

[0064] In an embodiment of the present application, the second rated usage rate may be a larger value between the resource idle rate and the first rated usage rate.

[0065] When the resource idle rate is greater than the first rated usage rate, it indicates that the processing resources allocated to the first activity will be wasted according to the preset threshold, and therefore the maximum threshold of the processing resources actually usable by the second activity set needs to be changed.

[0066] When the resource idle rate is less than the first rated usage rate, it means that the ratio of the maximum processing resources that can be used by the second activity set is reached according to the preset threshold, and therefore the processing resources occupied by the first activity need to be processed.

[0067] Among them, an optional embodiment can be seen in Figure 2 As shown:

[0068] S201: Determine a second resource usage rate according to a difference between the total amount of processing resources and the second rated usage rate.

[0069] In one embodiment, the second resource usage rate is:

[0070] %u s =1-%r2

[0071] Among them, %u s is the second resource utilization rate, and %r2 is the second rated utilization rate.

[0072] In another embodiment, a portion of idle processing resources may be reserved. If the utilization rate of the reserved idle processing resources is Δu=5%, the second resource utilization rate is:

[0073] %u s =1-%r2-△u

[0074] Among them, %u s is the second resource utilization rate, and %r2 is the second rated utilization rate.

[0075] S202: Process the first activity set using processing resources at a second resource usage rate.

[0076] In one embodiment, all first activities in the first activity set are processed according to the processing resource amount corresponding to the processing resource of the second resource usage rate.

[0077] S104: Process at least one second activity in the second activity set using processing resources that do not exceed the second rated usage rate.

[0078] In one embodiment of the present application, using processing resources that do not exceed the second rated usage rate to process at least one second activity in the second activity set may be:

[0079] A third resource usage rate is obtained, where the third resource usage rate is the sum of third sub-resource usage rates corresponding to each second activity in the second activity set, and the third sub-resource usage rate is a proportion of processing resources required to be used by the second activity.

[0080] In one embodiment, the execution entity may be a server, and obtaining the third resource utilization rate may be: calling the RMFⅢ interface of the server, obtaining an XML format file containing processing resource utilization rate data of the second activity set, reading the file to obtain the processing resources corresponding to each second activity in the second activity set, determining the corresponding resource utilization rates according to the total amount of processing resources, recording the resource utilization rate corresponding to each second activity as the third sub-resource utilization rate, and the sum of all third sub-resource utilization rates as the third resource utilization rate.

[0081] If the third resource usage rate is equal to the second rated usage rate, the third sub-resource usage rate of at least one second activity in the second activity set is lowered.

[0082] In one embodiment, when the third resource usage rate is less than the second rated usage rate, it can be considered that no resource contention occurs, and there is no need to process the second activity in the second activity set; when the third resource usage rate is equal to the second rated usage rate, it is considered that resource contention occurs, and the third sub-resource usage rate of at least one second activity in the second activity set is lowered.

[0083] In one embodiment, lowering the third sub-resource usage rate of at least one second activity in the second activity set may be:

[0084] A first number corresponding to the second activity is determined, where the first number is the number of processing units corresponding to the second activity.

[0085] determining a target number according to the first number, the target number being smaller than the first number;

[0086] The second activity is processed according to the target number of processing units, and a fourth sub-resource usage rate of the second activity is determined, wherein the fourth sub-resource usage rate of the second activity is lower than the third sub-resource usage rate.

[0087] In one embodiment, determining the target number according to the first number may be:

[0088] Let the undetermined number be the value of the first number minus 1;

[0089] Processing the second activity with the to-be-determined number of processing units, and determining an actual sub-resource usage rate of the second activity;

[0090] Determine whether the actual sub-resource usage rate of the second activity is lower than the third sub-resource usage rate. If so, use the actual sub-resource usage rate as the fourth sub-resource usage rate; if not, use the value of the first number minus 2 as the pending number, and execute subsequent steps until the actual sub-resource usage rate of the second activity is lower than the third sub-resource usage rate.

[0091] In another embodiment, lowering the third sub-resource usage rate of at least one second activity in the second activity set may be:

[0092] Use the server program to define a first-in-first-out queue q, denoted as q=(), which is used to increase or decrease the number of processing resources configured for the second activity set. When the second activity enters the queue, the server MVS interface is called to reduce the number of processing resources for the second activity by 1. When the second activity leaves the queue, the number of processing resources for the second activity is increased by 1.

[0093] Figure 3 A schematic diagram of a queue used to adjust resource usage of a second activity in a second activity set.

[0094] The N second activities included in the second activity set are denoted as P1, P2, P3...P N-1 ,P N , obtain the processing resource utilization data of these second activities in real time, which are recorded as %u1, %u2, %u3...%u N-1 ,%u N , calculate the difference △ug between the processing resource utilization rate of the second activity set and the second rated utilization rate %r2, the formula is:

[0095] △ug=%r2-∑%u i

[0096] When ∆ug=0, it indicates that there is resource contention in the second activity set, and the queue operation should be executed to process the second activity with the highest resource utilization rate Max(%u i ) corresponds to the second activity P i Perform the queue operation, and reduce the number of processing resources of the second activity in the queue by 1. At this time, the queue is q = (P i ).

[0097] When △ug>0, it means that there is no resource contention in the second activity set, and the dequeue operation should be executed to dequeue the queue q once. At this time, the length of the queue q is reduced by 1, and the number of second activity processing resources popped out is increased by 1.

[0098] The above process is automatically controlled by the server program without human intervention and can be cycled during the activity. The cycle time interval can be set to △t=20s.

[0099] Corresponding to the above method embodiment, the present application also provides a resource allocation device for a processing unit, see Figure 4 ,include:

[0100] The resource allocation device 400 of the processing unit provided in the embodiment of the present application may include, for example, a first determination unit 401, a first calculation unit 402, a second determination unit 403 and a first processing unit 404.

[0101] A first determining unit 401 is configured to determine a first resource usage rate, where the first resource usage rate is a ratio of a processing resource used by a first activity set, where the first activity set includes at least one first activity;

[0102] A first calculation unit 402, configured to obtain a resource idle rate according to a difference between the total amount of processing resources and the first resource usage rate;

[0103] A second determining unit 403 is configured to determine a second rated usage rate according to a larger value of the resource idle rate and the first rated usage rate, wherein the first rated usage rate is a preset maximum proportion of processing resources that can be used by a second activity set, and the second rated usage rate is a maximum proportion of processing resources that can actually be used by the second activity set, and the second activity set includes at least one second activity;

[0104] The first processing unit 404 is configured to process at least one second activity in the second activity set by using processing resources that do not exceed the second rated usage rate.

[0105] Optionally, the device further comprises:

[0106] a third determining unit, configured to determine a second resource usage rate according to a difference between the total amount of processing resources and the second rated usage rate if the second rated usage rate is greater than the first rated usage rate;

[0107] The second processing unit is configured to process the first activity set using processing resources at the second resource usage rate.

[0108] Optionally, the third determining unit further includes:

[0109] An acquiring unit, configured to acquire a third resource usage rate, wherein the third resource usage rate is the sum of third sub-resource usage rates respectively corresponding to each second activity in the second activity set, and the third sub-resource usage rate is a proportion of processing resources required to be used by the second activity;

[0110] An adjusting unit is configured to, if the third resource usage rate is equal to the second rated usage rate, lower the third sub-resource usage rate of at least one second activity in the second activity set.

[0111] Optionally, the adjustment unit includes:

[0112] a fourth determining unit, configured to determine a first number corresponding to the second activity, where the first number is the number of processing units corresponding to the second activity;

[0113] a fifth determining unit, configured to determine a target number according to the first number, wherein the target number is smaller than the first number;

[0114] A sixth determining unit is configured to determine a fourth sub-resource usage rate of the second activity based on processing the second activity with the target number of processing units, wherein the fourth sub-resource usage rate of the second activity is lower than the third sub-resource usage rate.

[0115] Optionally, the fifth determining unit includes:

[0116] An assignment unit, used for setting the to-be-determined number to be a value of the first number minus 1;

[0117] a seventh determining unit, configured to process the second activity with the to-be-determined number of processing units, and determine an actual sub-resource usage rate of the second activity;

[0118] A judging unit is used to judge whether the actual sub-resource usage rate of the second activity is lower than the third sub-resource usage rate. If so, the actual sub-resource usage rate is used as the fourth sub-resource usage rate; if not, the value of the first number minus 2 is used as the pending number, and subsequent steps are executed until the actual sub-resource usage rate of the second activity is lower than the third sub-resource usage rate.

[0119] The "first" in the names such as "first activity set" mentioned in the embodiments of the present invention is only used as a name identifier and does not mean the first in order. The same rule applies to "second" and so on.

[0120] The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for a person skilled in the art, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for allocating resources of a processing unit, characterized in that: include: determining a first resource usage rate, the first resource usage rate being a ratio of a processing resource used by a first activity set, the first activity set including at least one first activity; Obtaining a resource idle rate according to a difference between the total amount of processing resources and the first resource usage rate; determining a second rated usage rate according to a larger value of the resource idle rate and the first rated usage rate, wherein the first rated usage rate is a preset maximum proportion of processing resources that can be used by a second activity set, and the second rated usage rate is a maximum proportion of processing resources that can actually be used by the second activity set, wherein the second activity set includes at least one second activity; Processing at least one second activity in the second activity set using processing resources that do not exceed the second rated usage rate; The using the processing resources not exceeding the second rated usage rate to process at least one second activity in the second activity set comprises: Obtain a third resource usage rate, where the third resource usage rate is the sum of the third sub-resource usage rates corresponding to each second activity in the second activity set, and the third sub-resource usage rate is the proportion of processing resources required for the second activity; if the third resource usage rate is equal to the second rated usage rate, then lower the third sub-resource usage rate of at least one second activity in the second activity set; wherein lowering the third sub-resource usage rate of at least one second activity in the second activity set comprises: determining a first number corresponding to the second activity, where the first number is the number of processing units corresponding to the second activity; determining a target number based on the first number, where the target number is less than the first number; processing the second activity based on the processing units of the target number, and determining a fourth sub-resource usage rate of the second activity, where the fourth sub-resource usage rate of the second activity is lower than the third sub-resource usage rate; If the second rated usage rate is equal to the first rated usage rate, determining a second resource usage rate according to a difference between the total amount of processing resources and the second rated usage rate; The first set of activities is processed using processing resources at the second resource usage rate.

2. The method according to claim 1, characterized in that: Determining the target number according to the first number includes: Let the undetermined number be the value of the first number minus 1; Processing the second activity with the to-be-determined number of processing units, and determining an actual sub-resource usage rate of the second activity; Determine whether the actual sub-resource usage rate of the second activity is lower than the third sub-resource usage rate. If so, use the actual sub-resource usage rate as the fourth sub-resource usage rate; if not, use the value of the first number minus 2 as the pending number, and execute subsequent steps until the actual sub-resource usage rate of the second activity is lower than the third sub-resource usage rate.

3. A resource allocation device for a processing unit, characterized in that: include: A first determining unit, configured to determine a first resource usage rate, wherein the first resource usage rate is a ratio of a processing resource used by a first activity set, wherein the first activity set includes at least one first activity; a first calculation unit, configured to obtain a resource idle rate according to a difference between a total amount of processing resources and a usage rate of the first resource; a second determining unit, configured to determine a second rated usage rate according to a larger value of the resource idle rate and a first rated usage rate, wherein the first rated usage rate is a preset maximum proportion of processing resources that can be used by a second activity set, and the second rated usage rate is a maximum proportion of processing resources that can actually be used by the second activity set, wherein the second activity set includes at least one second activity; a first processing unit, configured to process at least one second activity in the second activity set using processing resources not exceeding the second rated usage rate; a third determining unit, configured to determine a second resource usage rate according to a difference between the total amount of processing resources and the second rated usage rate if the second rated usage rate is equal to the first rated usage rate; The third determination unit includes: an acquisition unit, configured to acquire a third resource usage rate, wherein the third resource usage rate is the sum of the third sub-resource usage rates corresponding to each second activity in the second activity set, and the third sub-resource usage rate is the proportion of processing resources required to be used by the second activity; an adjustment unit, configured to lower the third sub-resource usage rate of at least one second activity in the second activity set if the third resource usage rate is equal to the second rated usage rate; The adjustment unit includes: a fourth determining unit, configured to determine a first number corresponding to the second activity, the first number being the number of processing units corresponding to the second activity; a fifth determining unit, configured to determine a target number according to the first number, the target number being less than the first number; a sixth determining unit, configured to process the second activity according to the target number of processing units, and determine a fourth sub-resource usage rate of the second activity, the fourth sub-resource usage rate of the second activity being lower than the third sub-resource usage rate; The second processing unit is configured to process the first activity set using processing resources at the second resource usage rate.

4. The device according to claim 3, characterized in that The fifth determining unit includes: An assignment unit, used for setting the to-be-determined number to be a value of the first number minus 1; a seventh determining unit, configured to process the second activity with the to-be-determined number of processing units, and determine an actual sub-resource usage rate of the second activity; A judging unit is used to judge whether the actual sub-resource usage rate of the second activity is lower than the third sub-resource usage rate. If so, the actual sub-resource usage rate is used as the fourth sub-resource usage rate; if not, the value of the first number minus 2 is used as the pending number, and subsequent steps are executed until the actual sub-resource usage rate of the second activity is lower than the third sub-resource usage rate.