WO2023065882A1 - Method and apparatus for resource allocation, and computer-readable storage medium - Google Patents

Method and apparatus for resource allocation, and computer-readable storage medium Download PDF

Info

Publication number
WO2023065882A1
WO2023065882A1 PCT/CN2022/118108 CN2022118108W WO2023065882A1 WO 2023065882 A1 WO2023065882 A1 WO 2023065882A1 CN 2022118108 W CN2022118108 W CN 2022118108W WO 2023065882 A1 WO2023065882 A1 WO 2023065882A1
Authority
WO
WIPO (PCT)
Prior art keywords
resource
value
resources
gravitational
allocation
Prior art date
Application number
PCT/CN2022/118108
Other languages
French (fr)
Chinese (zh)
Other versions
WO2023065882A9 (en
Inventor
丁前进
赵炎
Original Assignee
中移(苏州)软件技术有限公司
中国移动通信集团有限公司
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 中移(苏州)软件技术有限公司, 中国移动通信集团有限公司 filed Critical 中移(苏州)软件技术有限公司
Publication of WO2023065882A1 publication Critical patent/WO2023065882A1/en
Publication of WO2023065882A9 publication Critical patent/WO2023065882A9/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/18Complex mathematical operations for evaluating statistical data, e.g. average values, frequency distributions, probability functions, regression analysis
    • 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]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present invention relates to the field of recommendation application systems and algorithms, in particular to a resource allocation method and device, and a computer-readable storage medium.
  • cloud computing has become one of the research hotspots of the Internet.
  • the simplest definition of "cloud” is to convert various resources into services for Internet users.
  • the dynamic resource allocation system is mainly used to allocate resources. This allocation method not only helps service providers to achieve reasonable resource allocation and integration, but also satisfies the user's experience quality of resources on the platform.
  • resource allocation is carried out by focusing on certain characteristics of resources, performance index analysis, and user evaluation models, which to a certain extent leads to the problem of low overall resource utilization.
  • Embodiments of the present invention provide a resource allocation method and device, and a computer-readable storage medium, which can improve the overall utilization rate of resources when allocating resources.
  • An embodiment of the present invention provides a resource allocation method, the method comprising:
  • the resource popularity value represents the degree of resource consumption
  • each resource determine the resource gravitational value and gravitational direction value between any two resources
  • Resource dynamic allocation is performed according to the resource popularity value of each resource, the resource gravity value and the gravity direction value between the two resources.
  • the determination of the resource popularity value of each resource through the consumption value of each resource in the at least one resource includes:
  • the resource popularity value of each resource is determined according to the total consumption value of each resource and the consumption value of each resource used by each usage object.
  • the determination of the resource gravitational value and gravitational direction value between two resources according to the resource heat value of each resource includes:
  • a gravitational direction value between the two resources is determined according to the resource popularity value of each of the two resources and the gravitational force value between the two resources.
  • the determination of the gravitational value between the two resources according to the joint result and the resource popularity value of each resource in the two resources includes:
  • the difference between the total resource heat value of the two resources and the joint result is determined to determine the gravitational force between the two resources.
  • the determination of the gravitational direction value between the two resources according to the resource heat value of each of the two resources and the gravitational force value between the two resources includes:
  • a gravitational direction value between the two resources is determined according to the total resource heat value of the two resources and the gravitational force value between the two resources.
  • the dynamic allocation of resources is performed according to the resource popularity value of each resource, the resource gravity value and the gravity direction value between the two resources, including:
  • the sorting result determine the first resource; wherein, the first resource is the resource with the largest resource popularity value among the resources;
  • Dynamic resource allocation is performed based on the first resource and the comparison result.
  • the determination of the comparison result by comparing the gravitational force value and the gravitational force direction value between the second resource and the first resource includes:
  • resource allocation of any two resources in the second resources is determined.
  • the resource allocation of any two resources in the second resource is determined according to the positive gravity or negative gravity, including:
  • the allocation amount allocated to at least one of the any two resources is proportional to the allocation amount of the first resource
  • the allocation amount allocated to at least one of the arbitrary resources is inversely proportional to the allocation amount of the first resource
  • resource allocation is performed according to the difference between the first value of the gravity direction and the second value of the previous time period.
  • the allocation amount allocated to at least one of the any two resources is proportional to the difference
  • the allocation amount allocated to at least one of the any two resources is inversely proportional to the difference.
  • An embodiment of the present invention provides a resource allocation device, the resource allocation device includes a statistical part, a determination part and an allocation part; wherein,
  • the statistical part is configured to count the consumption value of at least one resource used by the usage object
  • the determining part is configured to determine the resource heat value of each resource through the consumption value of each resource in the at least one resource; wherein, the resource heat value represents the degree of resource consumption;
  • the determination part is further configured to determine the resource gravity value and the gravity direction value between any two resources according to the resource heat value of each resource;
  • the allocation part is configured to dynamically allocate resources according to the resource popularity value of each resource, the resource gravity value and the gravity direction value between the two resources.
  • An embodiment of the present invention provides a resource allocation device, and the resource allocation device includes:
  • the processor When the processor is configured to execute the executable instructions stored in the memory, implement the resource allocation method according to the embodiment of the present invention.
  • This embodiment provides a computer-readable storage medium, which is characterized in that executable instructions are stored for causing a processor to implement the resource allocation method as described in the embodiment of the present invention.
  • An embodiment of the present invention provides a resource allocation method and device, and a computer-readable storage medium.
  • the method includes: collecting the dependence or consumption value of each resource within a period of time; determining the heat value of each resource based on the dependence or consumption value of each resource; Among them, the heat value of resources is the characteristic value of the dependence or consumption degree of each resource; when the heat value of each resource is determined, the gravitational force and direction between each resource are determined according to the heat value of each resource.
  • objective parameter indicators such as resource heat, gravitational value, and gravitational direction are proposed from an objective point of view, avoiding certain characteristics of resources or performance indicators of resources as dynamic allocation algorithm parameters, so that the platform can dynamically allocate resources according to its own characteristics.
  • a gravity model is introduced in the scheme to establish a relationship between resources, so that when a single resource is allocated, its related resources can be allocated together, which improves the overall resource utilization.
  • FIG. 1 is a first schematic flow diagram of a resource allocation method provided by an embodiment of the present invention
  • FIG. 2 is a second schematic flow diagram of a resource allocation method provided by an embodiment of the present invention.
  • FIG. 3 is a third schematic flowchart of a resource allocation method provided by an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of vector sum operation of two resources provided by an embodiment of the present invention.
  • FIG. 5 is a fourth schematic flowchart of a resource allocation method provided by an embodiment of the present invention.
  • FIG. 6 is a schematic flow diagram V of a resource allocation method provided by an embodiment of the present invention.
  • FIG. 7 is a sixth schematic flow diagram of a resource allocation method provided by an embodiment of the present invention.
  • FIG. 8 is a schematic flow diagram VII of a resource allocation method provided by an embodiment of the present invention.
  • FIG. 9 is a schematic flowchart eighth of a resource allocation method provided by an embodiment of the present invention.
  • FIG. 10 is a first structural schematic diagram of a resource allocation device provided by an embodiment of the present invention.
  • FIG. 11 is a second schematic structural diagram of a resource allocation device provided by an embodiment of the present invention.
  • FIG. 1 is a first schematic flowchart of a resource allocation method provided by an embodiment of the present invention, which will be described in conjunction with the steps shown in FIG. 1 .
  • the resource allocation device determines the amount of resource consumption by using objects.
  • the consumption value of each resource can be determined by using objects. Specifically, when calculating the consumption value of resources, first clarify the number of objects used, and filter out the objects that use resources. The amount consumed by each object is summed to calculate the total amount of the resource consumed.
  • the data is obtained by monitoring the flow, and the background analyzes the visitor information in the data, and determines through the resource application record of the visitor.
  • the resource may be provided by a device that basically provides the resource.
  • resources can be hardware resources such as server equipment (CUP, memory, disk), storage equipment (disk array), network equipment (router, switch, load balancing) and (operating system, integrated development environment IDE, database, web server, middleware, cache) and other software resources.
  • CUP server equipment
  • disk array storage equipment
  • network equipment Router, switch, load balancing
  • operating system integrated development environment IDE, database, web server, middleware, cache
  • the user may be a user of a public cloud management platform.
  • the background records are used to count the consumption of all resources used by the object, and the total consumption of all resources is further calculated, and the total consumption of resources can be used to clarify the current period of time for each resource.
  • Demand provides prerequisites for the allocation of resources in the future.
  • the resource allocation device determines the resource popularity value of each resource after obtaining the consumed value of each resource.
  • the consumption value of each resource and the value of using the resource by any one of all usage objects are obtained first, and then the resource popularity value of each resource is calculated based on the above two values.
  • the heat value of a resource indicates the degree of consumption of the resource.
  • the heat of the resource is relatively high, it is necessary to properly allocate more resources of this type.
  • the resource popularity value of each resource is calculated according to the consumption value of each resource, and the resource popularity value of each resource determines which type of resource needs to be allocated more, which improves the The dynamic allocation efficiency of the resource allocation device.
  • the resource allocation device determines the gravitational force value and the gravitational force direction value between any two resources among all resources after obtaining the resource heat value of each resource.
  • the gravitational force represents the size of the area covered by the resource popularity values of the two resources.
  • the gravitational direction value can be used to represent the correlation between resources, and it can be judged whether the heat value between resources tends to be the same or opposite by the gravitational direction value of the resource.
  • the allocation relationship between resources is restricted by whether the resources are of the same sex or different sex.
  • the resource gravity value and the gravity direction value between any two resources are calculated according to the resource heat value of each resource, and the gravity value and the gravity direction value of the resources can be used to judge the resource The correlation among them makes it possible to allocate related resources together when allocating a single resource, thereby improving the overall resource utilization rate of the resource allocating device.
  • S104 Perform resource dynamic allocation according to the resource heat value of each resource, the resource gravity value and the gravity direction value between two resources.
  • each resource is dynamically allocated after the resource heat value of each resource is determined and the interrelationships between resources are obtained.
  • the The dynamic allocation of resources makes it possible to allocate related resources together when allocating a single resource, thereby improving the overall resource utilization rate of the resource allocation device.
  • FIG. 2 is a second schematic flowchart of a resource allocation method provided by an embodiment of the present invention.
  • S102 shown in FIG. 2 can be implemented through S1021 to S1022, which will be described in conjunction with each step.
  • S1021. Determine the total consumption value of each resource by using the consumption value of each resource in the at least one resource used by the at least one usage object.
  • the present invention is applicable to a scenario in which the total consumption value of each resource is obtained based on the amount of each resource consumed by each user object after determining that each resource is used by each user object.
  • the background records of the resource allocation device can be used to obtain the information that each user has applied for resources, and through these records, the value of each resource consumed by any user can be obtained.
  • the amount of a certain resource consumed by the object can be added to determine the total value of the resource consumed.
  • the number of users remains unchanged at 8, and the statistical usage of users is (200, 1000, 0, 0, 500, 4000, 0, 2492).
  • the specific vector It means that the memory consumed by the first user is 200MB, the memory consumed by the second user is 1000MB, the memory consumed by the third user is 0MB, and so on. Finally, it can be calculated that within a period of time, the total amount of memory consumed is Consumed 2 3 G.
  • the total consumption of resources is calculated by using the amount of resources consumed by the object, and the total consumption of resources can determine the demand of each resource in the current period of time, which can be used for future resource consumption.
  • the assignment of provides prerequisites.
  • S1022. Determine the resource popularity value of each resource according to the total consumption value of each resource and the consumption value of each resource used by each usage object.
  • the resource allocation device determines the resource popularity value based on the resource consumption value after determining the resource consumption value.
  • the resource heat value of a certain resource when calculating the resource heat value of a certain resource, it is first clear which users of the resource are applied for and used, and the amount of the resource consumed by each user is counted. After the total consumption, divide any usage object by the total consumption value of the resource to calculate the ratio of the usage object to the total consumption value of the resource, and finally calculate the ratio of each usage object to the total consumption value of the resource The proportions of the resources are summed to calculate the resource heat value of the resource.
  • the popularity value of each resource can be obtained by the following formula (1).
  • X represents a certain resource
  • Nu represents the value of the resource consumed by one of the users
  • CA(X) represents the resource heat value of the resource
  • N represents the total value of the resource consumed.
  • S1021 when calculating the resource heat value of a virtual machine of a certain specification in a certain period of time in the platform, first, S1021 obtains that the amount consumed by each user of the virtual machine within the time period is (2, 2, 0, 0,2,0,0,2), and the total consumption of the virtual machine is 8, and then substituted into the formula (1) to obtain the resource heat value of the virtual machine, specifically:
  • X represents a virtual machine. From the above calculation, it can be concluded that the resource heat value of the virtual machine is 0.602.
  • the heat value of a resource indicates the degree of consumption of the resource.
  • the heat of the resource is relatively high, more resources of this type need to be properly allocated.
  • the resource popularity value of each resource is calculated according to the consumption value of each resource, and the resource popularity value of the resource can determine which type of resource needs to be allocated more, which improves the dynamic allocation efficiency.
  • FIG. 3 is a third flowchart of a resource allocation method provided by an embodiment of the present invention.
  • S103 shown in FIG. 3 can be implemented through S1031 to S1033 , which will be described in conjunction with each step.
  • the resource allocation device determines a joint result between the two resources after obtaining the resource popularity values of any two resources among the resources.
  • the present invention after acquiring the resource popularity values of any two resources, perform a vector sum operation on the resource popularity values of the two resources to determine the combined result after the operation, and based on the combined result, calculate two The gravitational force value and gravitational direction value between resources provide prerequisites.
  • the consumption amount of each user virtual machine as: (2,2,0,0,2,0,0,2)
  • the amount of memory consumed is: (200, 1000, 0, 0, 500, 4000, 0, 2492)
  • the resource heat values of these two resources are vectored and operated, the corresponding digits of the two vectors are taken to the maximum value to determine
  • the combined result after the operation is (200,1000,0,0,500,4000,0,2492), and then substituted into the formula to obtain the result.
  • the resource allocation device determines the gravitational value between the resources after obtaining the popularity values of the two resources.
  • the resource heat value of the two resources is added to determine the operation result, and the operation result and the joint result are subtracted to determine the relationship between the two resources. gravitational value between.
  • the gravitational force value between the virtual machine and the memory can be obtained through the following formula (2).
  • G(XY) is the gravitational value between any two resources
  • C(Y) represents the resource heat value of resource Y
  • CA(XY) represents the statistical vector of resource X Statistics vector with resource Y Perform vector sum operation to get joint result
  • CA(XY) can be obtained by formula (1), which is 0.376, and the value calculated by S1022 and S1031 is substituted into the following formula (3):
  • G(XY) means that the gravitational force between the virtual machine and the memory is 0.602.
  • the result of the calculation indicates the total area size covered by the two resources.
  • the difference between the operation result and the joint result can be expressed as removing the area where two resources overlap in the total area size, as shown in FIG. 4 .
  • CA(X) represents the heat value of resource X
  • CA(Y) represents the heat value of resource Y
  • the total heat value of resource X and resource Y is expressed as the total area covered by the two circles in Figure 4
  • CA(XY) is the joint result of the vector sum operation of the statistical vector of resource X and the statistical vector of resource Y, as shown in the shaded part in Figure 4; because the shaded part is repeatedly calculated, the actual relationship between resource X and resource Y
  • the gravity value between should be the total area CA(X)+CA(Y) covered by the two circles minus the shaded area CA(XY).
  • the gravitational value of two resources is determined through the resource heat value of each resource and the joint result between the two resources, and the interconnection between resources is determined based on the gravitational value.
  • the gravitational value of two resources is determined through the resource heat value of each resource and the joint result between the two resources, and the interconnection between resources is determined based on the gravitational value.
  • the resource allocation device determines the value of the direction of gravity after obtaining the resource heat value and the value of gravity of each resource.
  • the gravitational direction value between two resources when calculating the gravitational direction value between two resources, first obtain the resource heat value of the two resources, and sum the two resource heat values to obtain the total resource heat value of the two resources; based on The determined gravitational value between the two resources is divided by the total resource heat value between the two resources to determine the gravitational direction value between the two resources.
  • the gravitational direction value between the virtual machine and the memory can be calculated by the following formula (3).
  • the gravitational direction value of two resources is determined by the resource popularity value of each resource and the gravitational force value between the two resources, and the mutual relationship between resources is determined based on the gravitational direction value. Contact, so that when resources are allocated, related resources are allocated together, which improves the overall resource utilization.
  • FIG. 5 is a fourth schematic flowchart of a resource allocation method provided by an embodiment of the present invention.
  • S104 shown in FIG. 5 can be implemented through S1041 to S1044 , which will be described in conjunction with each step.
  • S1041. Sort at least one resource according to the resource popularity value of each resource, and determine the sorting result.
  • the resource allocation device determines the magnitude relationship of each resource's popularity value after obtaining the resource popularity value of each resource.
  • each resource is sorted according to the resource popularity value in descending order.
  • the data may be sorted according to sorting algorithms such as quick sort, insertion sort, merge sort, and bubble sort, which are not limited in the embodiments of the present invention.
  • the resources are sorted according to the heat value of the resources, and the allocation amount of each resource is determined according to the sorting result, which improves the dynamic allocation efficiency of the resources.
  • S1042. Determine the first resource according to the sorting result; wherein, the first resource is the resource with the largest resource popularity among the resources.
  • the resource allocation device obtains the resource with the largest allocation amount based on the sorting result after obtaining the sorting result of each resource.
  • the resource with the largest resource popularity value among the resources is determined.
  • the resources that need to be allocated on the platform are virtual machines, memory, and hard disks.
  • the thermal values of the virtual machines and memory are obtained by S1022, which are 0.602 and 0.376 respectively.
  • the thermal values of the hard disks are calculated as 0.301 through formula (1).
  • the popularity values of the three resources are sorted from largest to smallest, with the virtual machine being the largest and the hard disk being the smallest, so the first resource is the virtual machine.
  • the resource with the highest resource popularity value may indicate that the allocation amount of this resource is higher than that of other resources.
  • the resource allocation device selects the resource with the largest resource popularity value among the resources according to the resource popularity value, and the resource popularity value of the resource indicates that the demand for the resource is the largest, so it is allocated to the resource.
  • the allocation amount is the largest, which improves the dynamic allocation efficiency of resources.
  • S1043. Determine a comparison result by comparing the gravitational force value and the gravitational direction value between the second resource and the first resource; wherein, the second resource is a resource in which the first resource is removed from the at least one resource.
  • the resource allocation device feeds back the comparison result after obtaining the gravitational force value and the gravitational force direction value between the second resource and the first resource.
  • the resource with the highest resource heat value has been identified, and the allocation amount of the second resource is sorted by comparing the gravitational value and gravitational direction value between the second resource and the first resource . It can be understood that, in the embodiment of the present invention, after obtaining the resource with the largest resource heat value, the correlation between the second resource and the resource with the largest heat value is determined through the gravitational force value and the gravitational direction value, so that when assigning the heat value When the largest resource is allocated, its related resources are allocated together, which improves the overall resource utilization.
  • the resource allocation device dynamically allocates resources based on the first resource and the final comparison result after acquiring the first resource and the final comparison result.
  • the allocation amount of the first resource is determined first, and then according to the final comparison result, the correlation between the resources in the second resource and the first resource is determined, and then each resource in the second resource resources are allocated.
  • dynamic resource allocation is performed, so that when the resource with the highest popularity value is allocated, its related resources are allocated together to improve the overall resource utilization rate.
  • FIG. 6 is a schematic flowchart of a resource allocation method provided by an embodiment of the present invention. As shown in FIG. 6, the gravitational force value and the gravitational force Direction values are compared to obtain comparison results, mainly including the following steps:
  • the resource allocation device allocates each resource after obtaining the gravitational force value between each resource in the second resource and the first resource.
  • the resource gravity value between each of the second resources and the first resource after comparing the resource gravity value between each of the second resources and the first resource, if the resource gravity value between each of the second resources and the first resource are not equal, which proves that the allocation amount of each resource in the second resource is different, and the resources are allocated according to the gravity value.
  • the resource allocation device allocates each resource after obtaining the gravitational force value between each resource in the second resource and the first resource.
  • the resource gravity values between each resource in the second resources and the first resource after comparing the resource gravity values between each resource in the second resources and the first resource, if the resource gravity values between any two resources in the second resources and the first resource If the values are equal, it is necessary to determine the resource gravitational direction value between any two resources in the second resource and the first resource, and determine the allocation amount allocated to each resource in the second resource based on the gravitational direction value.
  • the gravitational value between the virtual machine and the memory obtained from S1032 is 0.602
  • the gravitational value between the virtual machine and the hard disk is also calculated by formula (2), which is 0.602
  • the gravitational force value is equal to the gravitational force value between the hard disk and the virtual machine, so it is necessary to compare the gravitational force direction values between resources for resource allocation.
  • FIG. 7 is a sixth flowchart of a resource allocation method provided by an embodiment of the present invention. As shown in FIG. 7, between any two resources in the second resource and the first resource When the resource gravity values of resources are equal, resource allocation is performed according to the resource gravity direction value between any two resources in the second resource and the first resource, which mainly includes the following steps:
  • the resource allocation device determines that the resource gravitational value between any two resources in the second resources and the first resource is equal, based on any two resources in the second resources and the first resource Scenarios in which resources are allocated between resource gravitational direction values.
  • a gravitational direction value determines the allocation amount assigned to the resource.
  • the statistics may be performed on the gravitational direction value calculated in S1033.
  • the resource allocation amount allocated to the resource with the same gravitational value among the second resources is judged .
  • the resources are compared through the gravitational direction value of the resource, and the allocation amount of each resource is clarified, which improves the overall resource utilization rate.
  • the resource allocation device determines a difference result based on the gravitational direction values in different time periods after acquiring the gravitational direction values in different time periods.
  • the first gravitational force value and the second gravitational force value are subtracted, and the dynamic allocation of resources is performed through the difference result obtained after the subtraction.
  • Table 1 is a relationship mapping table of resource gravity direction values:
  • the second gravitational direction value is the gravitational direction value obtained through the calculation method of S1033 in the previous cycle.
  • the difference results are calculated according to the gravitational direction values in different time periods, the resources are compared through the difference results between the gravitational direction values, and the allocation amount of each resource is clarified, which improves the overall resource utilization.
  • the resource allocation device determines the gravitational direction between the resource with the same gravitational value and the first resource based on the difference result after obtaining the difference result.
  • the gravitational direction between at least one of any two resources and the first resource is negative Towards.
  • the difference between the hard disk and the virtual machine is -0.056, which indicates that the gravitational direction between the hard disk and the virtual machine is negative.
  • the negative gravitational force may be expressed as that the resource popularity values of two resources tend to be opposite.
  • the gravitational direction between any two resources in the second resource and the first resource is determined, and the The direction of gravitational force between resources can be determined, and the correlation between resources can be judged, which improves the overall resource utilization.
  • the resource allocation device determines the gravitational direction between the resource with the same gravitational value and the first resource based on the difference result after obtaining the difference result.
  • the gravitational direction between resources is judged according to the difference result, if the gravitational direction is positive, it proves that the gravitational direction between resources is positive Towards.
  • the difference between the virtual machine and the memory is 0.115, which indicates that the gravitational direction between the virtual machine and the memory is positive.
  • positive gravity can be expressed as that the resource popularity values of two resources tend to be the same.
  • the gravitational direction between any two resources in the second resource and the first resource is determined.
  • the direction of gravitational force between resources can be judged, and the correlation between resources can be judged, which improves the overall resource utilization rate.
  • the resource allocation device allocates resources after acquiring the gravitational direction between the resource in the second resource and the first resource.
  • any two resources in the second resource are compared according to whether the gravitational direction is positive or negative. Resources are allocated.
  • the correlation between resources is determined according to the gravitational direction between any two resources in the second resources and the first resource, which improves the utilization rate of the overall resources.
  • FIG. 8 is a schematic flow diagram VII of a resource allocation method provided by an embodiment of the present invention. As shown in FIG. 8 , according to positive gravity or negative gravity, determine any The resource allocation of two resources mainly includes the following steps:
  • the allocation amount allocated to at least one of any two resources is proportional to the allocation amount of the first resource
  • the resource allocation device allocates resources after determining the direction of gravity.
  • the allocation amount of is proportional to the allocation amount of the first resource.
  • the allocation amount of the resource proportional to the first resource also needs to be dynamically increased.
  • the allocation amount allocated to at least one resource among any resources is inversely proportional to the allocation amount of the first resource
  • the resource allocation device allocates resources after determining the direction of gravity.
  • the allocation amount of is inversely proportional to the allocation amount of the first resource.
  • the allocation amount also needs to be dynamically reduced for resources that are inversely proportional to the first resource.
  • resource allocation is performed according to the difference between the first gravitational direction value and the second gravitational direction value in the previous time period. In some embodiments of the present invention, it is applicable to a scenario where the resource allocation device allocates resources after determining the direction of gravity.
  • S403 can be obtained through S4031 to S4032, and the specific steps are as follows:
  • the allocation amount allocated to at least one of the any two resources is inversely proportional to the difference.
  • the gravitational direction values between any two resources with equal gravitational values and the first resource are both positive or negative, it indicates that when the first resource is allocated, the same
  • the allocation amount of resources whose gravitational direction is positive/negative among the first resources should be appropriately increased/decreased, and the specific increase/decrease range of each resource should be based on the value of the first gravitational direction and the previous time
  • the difference between the second gravitational direction values for the segments is determined. If the gravitational direction is positive, the greater the resource difference, the more resources will be allocated. If the gravitational direction is negative, the larger the resource difference, the smaller the resource allocation.
  • FIG. 9 is an eighth schematic flowchart of a resource allocation method provided by an embodiment of the present invention.
  • the consumption value of each resource can be determined by using objects. First, the number of used objects is specified, and the objects that use resources are selected, and the amount of the resource is consumed for each selected used object. Sum up to calculate the total amount of resources consumed.
  • the consumption value of the resource changes, that is, the consumption value of the resource is updated.
  • the resource popularity value of each resource for each usage object is determined through the consumption value of each resource in the at least one resource.
  • determining the resource popularity value of each resource for each use object includes:
  • S4.1 Determine the total consumption value of each resource by using the consumption value of each resource in the at least one resource used by the at least one usage object.
  • S4.2 Determine the resource popularity value of each resource according to the total consumption value of each resource and the consumption value of each resource used by each user.
  • the heat value of the resource when calculating the heat value of the resource, it is necessary to clarify the value consumed by each user and the total value consumed; the heat value of the resource is determined by the value consumed by each user and the total value consumed .
  • each resource heat value of each resource determine the resource gravity value and gravity direction value between two resources, including:
  • resources are dynamically allocated, including:
  • S6.2 Determine the first resource according to the sorting result; wherein, the first resource is the resource with the largest resource popularity value among the resources.
  • resource allocation device After the resource allocation device completes the original data work of each resource, it needs to sort according to the heat value, and dynamically allocate resources in sequence according to the heat value.
  • resource allocation needs to be dynamically adjusted according to the gravitational force value and the gravitational direction value. If resource Y’s gravitational value is greater than resource Z’s gravitational value when dynamically allocating resource X, resource Y must be greater than Allocate resource Z; if the gravity value of resource Y is equal to the gravity value of resource Z, but the gravity direction values of resource X and resource Y increase and the gravity direction values of resource X and resource Y become smaller, then when resources are allocated, resource Y must Relatively speaking, the allocation of resources should be reduced.
  • the cloud management platform when allocating resources, the cloud management platform first calculates the resource popularity value of each resource, and selects the resource with the highest resource popularity value to give more allocation amount. Then calculate the gravitational force value and gravitational direction value between the remaining resources and the resource with the largest resource heat value, determine the correlation between the remaining resources and the resource with the largest resource heat value according to the gravitational force value and the gravitational direction value, and finally transform the single dynamic resource allocation into When resources are allocated dynamically, related resources are allocated together, which improves the overall resource utilization.
  • the embodiment of the present invention also provides a resource allocation device, as shown in FIG. 10 , which is a schematic structural diagram of a resource allocation device provided by the embodiment of the present invention.
  • the device 10 includes: Part 1001, determination part 1002 and allocation part 1003; wherein;
  • the statistical part 1001 is configured to count the consumption value of at least one resource used by the usage object
  • the determining part 1002 is configured to determine the resource popularity value of each resource through the consumption value of each resource in the at least one resource; wherein, the resource popularity value represents the degree of resource consumption;
  • the determination part 1002 is further configured to determine the resource gravity value and the gravity direction value between any two resources according to the resource heat value of each resource;
  • the allocation part 1003 is configured to dynamically allocate resources according to the resource popularity value of each resource, the resource gravity value and the gravity direction value between the two resources.
  • the embodiment of the present invention also provides a resource allocation device, as shown in FIG. 11 , which is a schematic structural diagram of a resource allocation device provided by the embodiment of the present invention.
  • the device 11 includes: a processor 1101 and memory 1102; the memory 1101 stores one or more programs executable by the processor, and when the one or more programs are executed, the processor 1102 executes any resource allocation method in the above-mentioned embodiments.
  • the embodiment of the present invention also provides a computer-readable storage medium, the computer-readable storage medium stores one or more programs, and one or more programs can be used by one or more processors Execute, when the program is executed by the processor, the resource allocation method disclosed in this embodiment is implemented.
  • the embodiments of the present invention may be provided as methods, systems, or computer program products. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) having computer-usable program code embodied therein.
  • a computer-usable storage media including but not limited to disk storage and optical storage, etc.
  • These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions
  • the device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
  • An embodiment of the present invention provides a resource allocation method and device, and a storage medium.
  • the method includes: collecting the dependence or consumption value of each resource within a period of time; determining the heat value of each resource according to the dependence or consumption value of each resource; wherein, the resource The heat value is a characteristic value of the degree of dependence or consumption of each resource; when the heat value of each resource is determined, the gravity and direction between each resource are determined according to the heat value of each resource.
  • objective parameter indicators such as resource heat, gravitational value, and gravitational direction are proposed from an objective point of view, and certain characteristics of resources themselves or resource performance indicators are not used as dynamic allocation algorithm parameters, so that the platform can dynamically allocate resources according to its own characteristics.
  • a gravity model is introduced to establish a relationship between resources, so that when a single resource is allocated, its related resources can be allocated together, which improves the overall resource utilization.

Abstract

Disclosed in embodiments of the present invention are a method and apparatus for resource allocation, and a computer-readable storage medium. The method comprises: calculating a consumption value of at least one resource each used by at least one usage object; according to the consumption value of each resource of the at least one resource, determining a resource heat value of each usage object for each resource, the resource heat value representing the degree to which the resource is consumed; according to the resource heat value of each resource, determining a resource gravity value and a gravity direction value between a pair of resources; and performing resource dynamic allocation according to the resource heat value of each resource as well as the resource gravity value and the gravity direction value between a pair of resources.

Description

一种资源分配方法及装置、计算机可读存储介质Resource allocation method and device, and computer-readable storage medium
相关申请的交叉引用Cross References to Related Applications
本发明要求在2021年10月22日提交中国专利局、申请号为202111235925.0、申请名称为“一种资源分配方法及装置、计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本发明中。The present invention claims the priority of the Chinese patent application submitted to the China Patent Office on October 22, 2021, with the application number 202111235925.0 and the application name "A resource allocation method and device, and a computer-readable storage medium", the entire content of which is passed References are incorporated herein.
技术领域technical field
本发明涉及推荐应用系统及算法领域,尤其涉及一种资源分配方法及装置、计算机可读存储介质。The present invention relates to the field of recommendation application systems and algorithms, in particular to a resource allocation method and device, and a computer-readable storage medium.
背景技术Background technique
随着互联网和信息技术发展,云计算成了互联网的研究热点之一,关于“云”最简单的定义就是将各类资源转化成服务提供给互联网用户使用。目前主要采用动态资源分配系统对资源进行分配,通过该分配方法不仅帮助服务提供商实现合理资源分配及整合,也满足了用户在平台上资源的体验质量。With the development of the Internet and information technology, cloud computing has become one of the research hotspots of the Internet. The simplest definition of "cloud" is to convert various resources into services for Internet users. At present, the dynamic resource allocation system is mainly used to allocate resources. This allocation method not only helps service providers to achieve reasonable resource allocation and integration, but also satisfies the user's experience quality of resources on the platform.
相关技术中,重于资源某种特性、性能指标分析及用户评价模型等方式进行资源分配,在一定程度上导致了整体资源利用率低的问题。In related technologies, resource allocation is carried out by focusing on certain characteristics of resources, performance index analysis, and user evaluation models, which to a certain extent leads to the problem of low overall resource utilization.
发明内容Contents of the invention
本发明实施例提供一种资源分配方法及装置、计算机可读存储介质,能够在分配资源时,提高资源的整体利用率。Embodiments of the present invention provide a resource allocation method and device, and a computer-readable storage medium, which can improve the overall utilization rate of resources when allocating resources.
本发明的技术方案是这样实现的:Technical scheme of the present invention is realized like this:
本发明实施例提供了一种资源分配方法,所述方法包括:An embodiment of the present invention provides a resource allocation method, the method comprising:
统计至少一个使用对象各自使用的至少一个资源的消耗值;Counting the consumption value of at least one resource used by each of the at least one usage object;
通过所述至少一个资源中每个资源的消耗值,确定每个使用对象对于每个资源的资源热度值;其中,资源热度值表征资源被依消耗的程度;Through the consumption value of each resource in the at least one resource, determine the resource popularity value of each resource for each use object; wherein, the resource popularity value represents the degree of resource consumption;
根据所述每个资源的资源热度值,确定两两资源之间的资源引力值和引力方向值;According to the resource popularity value of each resource, determine the resource gravitational value and gravitational direction value between any two resources;
根据所述每个资源的资源热度值、所述两两资源之间的资源引力值和引力方向值进行资源动态分配。Resource dynamic allocation is performed according to the resource popularity value of each resource, the resource gravity value and the gravity direction value between the two resources.
上述方案中,所述通过所述至少一个资源中每个资源的消耗值,确定每个资源的资源热度值,包括:In the above solution, the determination of the resource popularity value of each resource through the consumption value of each resource in the at least one resource includes:
通过所述至少一个使用对象使用的至少一个资源中的每个资源的消耗值,确定每个资源消耗总值;Determine the total consumption value of each resource by using the consumption value of each resource in the at least one resource used by the at least one usage object;
根据所述每个资源消耗总值、所述每个使用对象使用的所述每个资源的消耗值,确定所述每个资源的资源热度值。The resource popularity value of each resource is determined according to the total consumption value of each resource and the consumption value of each resource used by each usage object.
上述方案中,所述根据所述每个资源的资源热度值,确定两两资源之间的资源引力值和引力方向值,包括:In the above solution, the determination of the resource gravitational value and gravitational direction value between two resources according to the resource heat value of each resource includes:
通过将所述资源中的任意两个资源的资源热度值进行向量和操作,确定操作后的联合结果;Determining the joint result after the operation by performing a vector sum operation on the resource popularity values of any two resources among the resources;
根据所述联合结果和所述两个资源中的每个资源的资源热度值,确定所述两个资源之间的引力值;determining a gravitational force value between the two resources according to the joint result and the resource heat value of each of the two resources;
根据所述两个资源中的每个资源的资源热度值和所述两个资源之间的引力值,确定所述两个资源之间的引力方向值。A gravitational direction value between the two resources is determined according to the resource popularity value of each of the two resources and the gravitational force value between the two resources.
上述方案中,所述根据所述联合结果和所述两个资源中的每个资源的资源热度值,确定所述两个资源之间的引力值,包括:In the above solution, the determination of the gravitational value between the two resources according to the joint result and the resource popularity value of each resource in the two resources includes:
根据所述两个资源中的每个资源的资源热度值,确定所述两个资源的总资源热度值;determining the total resource popularity value of the two resources according to the resource popularity value of each resource in the two resources;
将所述两个资源的总资源热度值与所述联合结果做差,确定所述两个资源之间的引力值。The difference between the total resource heat value of the two resources and the joint result is determined to determine the gravitational force between the two resources.
上述方案中,所述根据所述两个资源中的每个资源的资源热度值和所述两个资源之间的引力值,确定所述两个资源之间的引力方向值,包括:In the above solution, the determination of the gravitational direction value between the two resources according to the resource heat value of each of the two resources and the gravitational force value between the two resources includes:
根据所述两个资源的总资源热度值与所述两个资源之间的引力值,确定所述两个资源之间的引力方向值。A gravitational direction value between the two resources is determined according to the total resource heat value of the two resources and the gravitational force value between the two resources.
上述方案中,所述根据所述每个资源的资源热度值、所述两两资源之间的资源引力值和引力方向值进行资源动态分配,包括:In the above solution, the dynamic allocation of resources is performed according to the resource popularity value of each resource, the resource gravity value and the gravity direction value between the two resources, including:
根据所述每个资源的资源热度值对所述至少一个资源进行排序,确定排序结果;sorting the at least one resource according to the resource popularity value of each resource, and determining the sorting result;
根据所述排序结果,确定第一资源;其中,所述第一资源为资源中资源热度值最大的资源;According to the sorting result, determine the first resource; wherein, the first resource is the resource with the largest resource popularity value among the resources;
通过将第二资源与所述第一资源之间的引力值和引力方向值进行比较,确定比较结果;其中,所述第二资源为所述至少一个资源中去掉第一资源后的资源;Determine the comparison result by comparing the gravitational force value and the gravitational direction value between the second resource and the first resource; wherein the second resource is a resource after the first resource is removed from the at least one resource;
基于所述第一资源和所述比较结果,进行资源动态分配。Dynamic resource allocation is performed based on the first resource and the comparison result.
上述方案中,所述通过将第二资源与所述第一资源之间的引力值和引力方向值进行比较, 确定比较结果,包括:In the above solution, the determination of the comparison result by comparing the gravitational force value and the gravitational force direction value between the second resource and the first resource includes:
若所述第二资源中的每个资源与所述第一资源之间的资源引力值不相等时,则根据所述第二资源中的每个资源的资源引力值,对所述第二资源中的每个资源进行分配;If the resource gravitational value between each of the second resources and the first resource is not equal, according to the resource gravitational value of each of the second resources, for the second resource Each resource in is allocated;
若所述第二资源中任意两个资源与所述第一资源之间的资源引力值相等,则根据所述第二资源中任意两个资源与所述第一资源之间的资源引力方向值进行资源分配。If the resource gravitational value between any two resources in the second resource and the first resource is equal, according to the resource gravitational direction value between any two resources in the second resource and the first resource Make resource allocation.
上述方案中,所述若所述第二资源中任意两个资源与所述第一资源之间的资源引力值相等,则根据所述第二资源中任意两个资源与所述第一资源之间的资源引力方向值进行资源分配,包括:In the above solution, if the resource gravitational value between any two resources in the second resource and the first resource is equal, then according to the relationship between any two resources in the second resource and the first resource resource allocation between resource gravitational direction values, including:
统计所述第二资源中的任意两个资源与所述第一资源之间的第一引力方向值;Counting the first gravitational direction value between any two resources in the second resource and the first resource;
将所述第一引力方向值与上一时间段的第二引力方向值做差值,确定差异结果;Making a difference between the first gravitational direction value and the second gravitational direction value of the previous time period to determine the difference result;
若所述差异结果为负,则所述任意两个资源中的至少一个资源与所述第一资源之间的引力方向为负向;If the difference result is negative, the gravitational direction between at least one of the any two resources and the first resource is negative;
若所述差异结果为正,则所述任意两个资源中的至少一个资源与所述第一资源之间的引力方向为正向;If the difference result is positive, the gravitational direction between at least one of the two resources and the first resource is positive;
根据所述正向引力或负向引力,确定所述第二资源中任意两个资源的资源分配。According to the positive gravitational force or the negative gravitational force, resource allocation of any two resources in the second resources is determined.
上述方案中,所述根据所述正向引力或负向引力,确定所述第二资源中任意两个资源的资源分配,包括:In the above solution, the resource allocation of any two resources in the second resource is determined according to the positive gravity or negative gravity, including:
若所述引力方向为正向,则分配给所述任意两个资源中至少一个资源的分配量与所述第一资源的分配量成正比;If the gravitational direction is positive, the allocation amount allocated to at least one of the any two resources is proportional to the allocation amount of the first resource;
若所述引力方向为负向引力,则分配给所述任意资源中至少一个资源的分配量与所述第一资源的分配量成反比;If the direction of gravitational force is negative gravitational force, the allocation amount allocated to at least one of the arbitrary resources is inversely proportional to the allocation amount of the first resource;
若所述任意两个资源的引力方向均为正向引力或负向引力,则根据所述第一引力方向值与上一时间段的第二引力方向值之间的差值进行资源分配。If the gravity directions of any two resources are both positive gravity or negative gravity, resource allocation is performed according to the difference between the first value of the gravity direction and the second value of the previous time period.
上述方案中,所述若所述任意两个资源的引力方向都为正向引力或负向引力,则根据所述第一引力方向值与上一时间段的第二引力方向值之间的差值进行资源分配,包括:In the above solution, if the gravitational directions of any two resources are positive or negative, according to the difference between the first gravitational direction value and the second gravitational direction value of the previous time period Values are allocated for resources, including:
若所述任意两个资源的引力方向为正向引力,则分配给所述任意两个资源中的至少一个资源的分配量与所述差值成正比;If the gravitational direction of the any two resources is positive gravitational force, the allocation amount allocated to at least one of the any two resources is proportional to the difference;
若所述任意两个资源的引力方向为负向引力,则分配给所述任意两个资源中的至少一个资源的分配量与所述差值成反比。If the gravitational direction of any two resources is negative gravitational force, the allocation amount allocated to at least one of the any two resources is inversely proportional to the difference.
本发明实施例提供一种资源分配装置,所述资源分配装置包括统计部分、确定部分和分配部分;其中,An embodiment of the present invention provides a resource allocation device, the resource allocation device includes a statistical part, a determination part and an allocation part; wherein,
所述统计部分,被配置为统计使用对象使用的至少一个资源的消耗值;The statistical part is configured to count the consumption value of at least one resource used by the usage object;
所述确定部分,被配置为通过所述至少一个资源中每个资源的消耗值,确定每个资源的资源热度值;其中,资源热度值表征资源被依消耗的程度;The determining part is configured to determine the resource heat value of each resource through the consumption value of each resource in the at least one resource; wherein, the resource heat value represents the degree of resource consumption;
所述确定部分,还被配置为根据所述每个资源的资源热度值,确定两两资源之间的资源引力值和引力方向值;The determination part is further configured to determine the resource gravity value and the gravity direction value between any two resources according to the resource heat value of each resource;
所述分配部分,被配置为根据所述每个资源的资源热度值、所述两两资源之间的资源引力值和引力方向值进行资源动态分配。The allocation part is configured to dynamically allocate resources according to the resource popularity value of each resource, the resource gravity value and the gravity direction value between the two resources.
本发明实施例提供一种资源分配装置,所述资源分配装置包括:An embodiment of the present invention provides a resource allocation device, and the resource allocation device includes:
存储器,被配置为存储可执行数据指令;memory configured to store executable data instructions;
处理器,被配置为执行所述存储器中存储的可执行指令时,实现如本发明实施例所述的资源分配方法。When the processor is configured to execute the executable instructions stored in the memory, implement the resource allocation method according to the embodiment of the present invention.
本实施例提供一种计算机可读存储介质,其特征在于,存储有可执行指令,用于引起处理器执行时,实现如本发明实施例所述的资源分配方法。This embodiment provides a computer-readable storage medium, which is characterized in that executable instructions are stored for causing a processor to implement the resource allocation method as described in the embodiment of the present invention.
本发明实施例提供了一种资源分配方法及装置、计算机可读存储介质,该方法包括:收集一段时间内各资源被依赖或消耗值;通过各资源被依赖或消耗值确定各资源热度值;其中,资源热度值是各资源被依赖或消耗程度表征值;当各资源热度值确定后,根据各资源热度值确定各资源间引力和方向。采用上述实现方案,从客观角度提出资源热度、引力值及引力方向等客观参数指标,避免根据资源本身某种特性或者资源的性能指标作为动态分配算法参数,使得平台根据自身特性进行资源动态分配。进一步的,在方案中引入了引力模型,将各资源之间建立关联关系,使得在将单一的资源分配时,可以将其相关的资源一同分配,提高了整体的资源利用率。An embodiment of the present invention provides a resource allocation method and device, and a computer-readable storage medium. The method includes: collecting the dependence or consumption value of each resource within a period of time; determining the heat value of each resource based on the dependence or consumption value of each resource; Among them, the heat value of resources is the characteristic value of the dependence or consumption degree of each resource; when the heat value of each resource is determined, the gravitational force and direction between each resource are determined according to the heat value of each resource. Using the above implementation plan, objective parameter indicators such as resource heat, gravitational value, and gravitational direction are proposed from an objective point of view, avoiding certain characteristics of resources or performance indicators of resources as dynamic allocation algorithm parameters, so that the platform can dynamically allocate resources according to its own characteristics. Furthermore, a gravity model is introduced in the scheme to establish a relationship between resources, so that when a single resource is allocated, its related resources can be allocated together, which improves the overall resource utilization.
附图说明Description of drawings
图1为本发明实施例提供的一种资源分配方法的流程示意图一;FIG. 1 is a first schematic flow diagram of a resource allocation method provided by an embodiment of the present invention;
图2为本发明实施例提供的一种资源分配方法的流程示意图二;FIG. 2 is a second schematic flow diagram of a resource allocation method provided by an embodiment of the present invention;
图3为本发明实施例提供的一种资源分配方法的流程示意图三;FIG. 3 is a third schematic flowchart of a resource allocation method provided by an embodiment of the present invention;
图4为本发明实施例提供的两种资源进行向量和操作示意图;FIG. 4 is a schematic diagram of vector sum operation of two resources provided by an embodiment of the present invention;
图5为本发明实施例提供的一种资源分配方法的流程示意图四;FIG. 5 is a fourth schematic flowchart of a resource allocation method provided by an embodiment of the present invention;
图6为本发明实施例提供的一种资源分配方法的流程示意图五;FIG. 6 is a schematic flow diagram V of a resource allocation method provided by an embodiment of the present invention;
图7为本发明实施例提供的一种资源分配方法的流程示意图六;FIG. 7 is a sixth schematic flow diagram of a resource allocation method provided by an embodiment of the present invention;
图8为本发明实施例提供的一种资源分配方法的流程示意图七;FIG. 8 is a schematic flow diagram VII of a resource allocation method provided by an embodiment of the present invention;
图9为本发明实施例提供的一种资源分配方法的流程示意图八;FIG. 9 is a schematic flowchart eighth of a resource allocation method provided by an embodiment of the present invention;
图10为本发明实施例提供的一种资源分配装置的结构示意图一;FIG. 10 is a first structural schematic diagram of a resource allocation device provided by an embodiment of the present invention;
图11为本发明实施例提供的一种资源分配装置的结构示意图二。FIG. 11 is a second schematic structural diagram of a resource allocation device provided by an embodiment of the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部实施例。基于本发明的实施例,本领域普通技术人员在没有做出创造性劳动前提下,所获得的所有其他实施例,都属于本发明保护范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.
为了使本技术领域的人员更好地理解本发明方案,下面结合附图和具体实施方式对本发明作进一步的详细说明。图1为本发明实施例提供的一种资源分配方法的流程示意图一,将结合图1示出的步骤进行说明。In order to enable those skilled in the art to better understand the solution of the present invention, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. FIG. 1 is a first schematic flowchart of a resource allocation method provided by an embodiment of the present invention, which will be described in conjunction with the steps shown in FIG. 1 .
S101、统计至少一个使用对象各自使用的至少一个资源的消耗值。S101. Count the consumption value of at least one resource used by at least one usage object.
本发明实施例中,适用于资源分配装置通过使用对象来确定资源被消耗的量的场景。In the embodiment of the present invention, it is applicable to a scenario where the resource allocation device determines the amount of resource consumption by using objects.
在本发明实施例中,统计每一个资源的消耗值可以通过使用对象进行确定,具体为在计算资源的消耗值时,先明确使用对象的数量,筛选出使用了资源的对象,对筛选出的每一个使用对象消耗该资源的量进行求和,来计算该资源被消耗的总量。In the embodiment of the present invention, the consumption value of each resource can be determined by using objects. Specifically, when calculating the consumption value of resources, first clarify the number of objects used, and filter out the objects that use resources. The amount consumed by each object is summed to calculate the total amount of the resource consumed.
在本发明实施例中,通过对流量进行监测来获取数据,后台对数据中的访问者信息进行分析,通过访问者申请资源的记录进行确定。In the embodiment of the present invention, the data is obtained by monitoring the flow, and the background analyzes the visitor information in the data, and determines through the resource application record of the visitor.
在本发明实施例中,资源可以由基础提供资源的设备进行提供。In the embodiment of the present invention, the resource may be provided by a device that basically provides the resource.
在本发明实施例中,资源可以为服务器设备(CUP、内存、磁盘)、存储设备(磁盘阵列)、网络设备(路由器、交换机、负载均衡)等硬件资源和(操作系统、集成开发环境IDE、数据库、web服务器、中间件、缓存)等软件资源。In the embodiment of the present invention, resources can be hardware resources such as server equipment (CUP, memory, disk), storage equipment (disk array), network equipment (router, switch, load balancing) and (operating system, integrated development environment IDE, database, web server, middleware, cache) and other software resources.
在本发明实施例中,使用对象可以为公有的云管理平台的用户。In the embodiment of the present invention, the user may be a user of a public cloud management platform.
可以理解的是,本发明实施例中,通过后台记录来统计使用对象使用所有资源的消耗量,进一步计算出所有资源总的消耗量,由资源的总消耗量可以明确目前一段时间内各个资源的需求量,为以后资源的分配提供前提条件。It can be understood that in the embodiment of the present invention, the background records are used to count the consumption of all resources used by the object, and the total consumption of all resources is further calculated, and the total consumption of resources can be used to clarify the current period of time for each resource. Demand provides prerequisites for the allocation of resources in the future.
S102、通过至少一个资源中每个资源的消耗值,确定每个使用对象对于每个资源的资源热度值。S102. Based on the consumption value of each resource in the at least one resource, determine the resource popularity value of each resource for each usage object.
本发明实施例中,适用于资源分配装置获得每个资源被消耗的值后,对每个资源的资源热度值进行确定的场景。In the embodiment of the present invention, it is applicable to a scenario where the resource allocation device determines the resource popularity value of each resource after obtaining the consumed value of each resource.
在本发明实施例中,先获得每个资源的消耗值和所有的使用对象中任意一个使用对象使用该资源的值,然后基于上述两个值计算出每个资源的资源热度值。In the embodiment of the present invention, the consumption value of each resource and the value of using the resource by any one of all usage objects are obtained first, and then the resource popularity value of each resource is calculated based on the above two values.
在本发明实施例中,资源热度值表征资源被依消耗的程度,当资源热度比较高时,即需要适当分配更多该类资源。In the embodiment of the present invention, the heat value of a resource indicates the degree of consumption of the resource. When the heat of the resource is relatively high, it is necessary to properly allocate more resources of this type.
可以理解的是,在本发明实施例中,根据每个资源的消耗值来计算每个资源的资源热度值,由各资源的资源热度值确定需要给哪类资源进行更多的分配,提高了资源分配装置的动态分配效率。It can be understood that, in the embodiment of the present invention, the resource popularity value of each resource is calculated according to the consumption value of each resource, and the resource popularity value of each resource determines which type of resource needs to be allocated more, which improves the The dynamic allocation efficiency of the resource allocation device.
S103、根据每个资源的资源热度值,确定两两资源之间的资源引力值和引力方向值。S103. According to the resource heat value of each resource, determine the resource gravitational force value and the gravitational force direction value between any two resources.
本发明实施例中,适用于资源分配装置通过获得每个资源的资源热度值后,对所有资源中任意两两资源之间的引力值和引力方向值进行确定的场景。In the embodiment of the present invention, it is applicable to a scenario where the resource allocation device determines the gravitational force value and the gravitational force direction value between any two resources among all resources after obtaining the resource heat value of each resource.
在本发明实施例中,在获得每个资源的资源热度值后,为了避免将各资源之间进行孤立考虑,通过获得的每个资源热度值,确定任意两个资源之间的资源引力值和引力方向值,使得可以从整体角度进行各资源动态分配。In the embodiment of the present invention, after obtaining the resource heat value of each resource, in order to avoid considering each resource in isolation, determine the resource gravity value and The gravitational direction value enables dynamic allocation of resources from an overall perspective.
在本发明实施例中,引力值表征两种资源的资源热度值所覆盖的区域大小。In the embodiment of the present invention, the gravitational force represents the size of the area covered by the resource popularity values of the two resources.
在本发明实施例中,引力方向值可以用来表征各资源之间的相关性,通过资源的引力方向值判断资源之间的热度值趋于同性还是异性。在资源分配时,资源之间分配的关系受到各资源之间是同性还是异性的制约。In the embodiment of the present invention, the gravitational direction value can be used to represent the correlation between resources, and it can be judged whether the heat value between resources tends to be the same or opposite by the gravitational direction value of the resource. During resource allocation, the allocation relationship between resources is restricted by whether the resources are of the same sex or different sex.
可以理解的是,在本发明实施例中,根据每个资源的资源热度值来计算任意两个资源之间的资源引力值和引力方向值,由资源的引力值和引力方向值可以判断各个资源之间的相关联系,使得在将单一的资源分配时,可以将其相关的资源一同分配,提高了资源分配装置整体资源的利用率。It can be understood that, in the embodiment of the present invention, the resource gravity value and the gravity direction value between any two resources are calculated according to the resource heat value of each resource, and the gravity value and the gravity direction value of the resources can be used to judge the resource The correlation among them makes it possible to allocate related resources together when allocating a single resource, thereby improving the overall resource utilization rate of the resource allocating device.
S104、根据每个资源的资源热度值、两两资源之间的资源引力值和引力方向值进行资源动态分配。S104. Perform resource dynamic allocation according to the resource heat value of each resource, the resource gravity value and the gravity direction value between two resources.
本发明实施例中,适用于确定了每个资源的资源热度值、获得了各个资源之间的相互联系以后,对每个资源进行动态分配的场景。In the embodiment of the present invention, it is applicable to a scenario where each resource is dynamically allocated after the resource heat value of each resource is determined and the interrelationships between resources are obtained.
在本发明实施例中,在获得每个资源的资源热度值以及任意两个资源的资源引力值和引力方向值后,依据各个资源的热度值和彼此之间的相关性进行资源动态分配。In the embodiment of the present invention, after obtaining the resource popularity value of each resource and the resource gravity value and gravitational direction value of any two resources, dynamically allocate resources according to the popularity value of each resource and the correlation between each other.
可以理解的是,在本发明实施例中,在获得每个资源的资源热度值以及任意两个资源的资源引力值和引力方向值后,依据各资源的热度值和彼此之间的相关性进行资源动态分配,使得在将单一的资源分配时,可以将其相关的资源一同分配,提高了资源分配装置整体资源的利用率。It can be understood that, in the embodiment of the present invention, after obtaining the resource popularity value of each resource and the resource gravity value and gravitational direction value of any two resources, the The dynamic allocation of resources makes it possible to allocate related resources together when allocating a single resource, thereby improving the overall resource utilization rate of the resource allocation device.
在一些实施例中,参见图2,图2为本发明实施例提供的一种资源分配方法的流程示意图二,图2示出的S102可以通过S1021至S1022实现,将结合各步骤进行说明。In some embodiments, referring to FIG. 2, FIG. 2 is a second schematic flowchart of a resource allocation method provided by an embodiment of the present invention. S102 shown in FIG. 2 can be implemented through S1021 to S1022, which will be described in conjunction with each step.
S1021、通过至少一个使用对象使用的至少一个资源中的每个资源的消耗值,确定每个资源消耗总值。S1021. Determine the total consumption value of each resource by using the consumption value of each resource in the at least one resource used by the at least one usage object.
在本发明的一些实施例中,适用于确定了每个资源被每个使用对象使用的情况后,基于每个资源被每个使用对象消耗的量来获取每个资源消耗总值的场景。In some embodiments of the present invention, it is applicable to a scenario in which the total consumption value of each resource is obtained based on the amount of each resource consumed by each user object after determining that each resource is used by each user object.
在本发明的一些实施例中,通过资源分配装置的后台记录可以获得每个使用对象申请使用过资源的情况,通过这些记录可以得到每个资源被任意一个使用对象消耗的值,将某一使用对象消耗的某一资源的量进行相加,可以确定该资源被消耗的总值。In some embodiments of the present invention, the background records of the resource allocation device can be used to obtain the information that each user has applied for resources, and through these records, the value of each resource consumed by any user can be obtained. The amount of a certain resource consumed by the object can be added to determine the total value of the resource consumed.
示例性的,假设在计算公有平台中某规格虚拟机在一定时间内被消耗的台数的时候,先确定平台的用户数U,设U为8人,则用户统计使用量为向量(2,2,0,0,2,0,0,2),该向量具体表示为第1个用户消耗的虚拟机为2台,第二个用户消耗的虚拟机为2台,第3个用户消耗的虚拟机为0台等等以此类推,则最后可以计算出在一段时间内,虚拟机总共被消耗了N=8台。As an example, suppose that when calculating the number of virtual machines of a certain specification consumed in a certain period of time in the public platform, first determine the number of users U of the platform, and set U to be 8 people, then the statistical usage of users is a vector (2,2 ,0,0,2,0,0,2), this vector specifically expresses that the first user consumes 2 virtual machines, the second user consumes 2 virtual machines, and the third user consumes 2 virtual machines Machine is 0 and so on, and finally it can be calculated that within a period of time, a total of N=8 virtual machines are consumed.
示例性的,在计算平台中内存在一定时间内被消耗的值时,用户人数不变为8,用户统计使用量为(200,1000,0,0,500,4000,0,2492),该向量具体表示为第1个用户消耗的内存为200MB,第二个用户消耗的内存为1000MB,第3个用户消耗的内存为0MB等等以此类推,则最后可以计算出在一段时间内,内存总共被消耗了2 3G。 Exemplarily, when calculating the value of memory consumed within a certain period of time in the platform, the number of users remains unchanged at 8, and the statistical usage of users is (200, 1000, 0, 0, 500, 4000, 0, 2492). The specific vector It means that the memory consumed by the first user is 200MB, the memory consumed by the second user is 1000MB, the memory consumed by the third user is 0MB, and so on. Finally, it can be calculated that within a period of time, the total amount of memory consumed is Consumed 2 3 G.
可以理解的是,在本发明的一些实施例中,通过使用对象消耗的资源量来计算资源的总消耗量,由资源的总消耗量可以明确目前一段时间内各个资源的需求量,为以后资源的分配提供前提条件。It can be understood that, in some embodiments of the present invention, the total consumption of resources is calculated by using the amount of resources consumed by the object, and the total consumption of resources can determine the demand of each resource in the current period of time, which can be used for future resource consumption. The assignment of provides prerequisites.
S1022、根据每个资源消耗总值、每个使用对象使用的每个资源的消耗值,确定每个资源的资源热度值。S1022. Determine the resource popularity value of each resource according to the total consumption value of each resource and the consumption value of each resource used by each usage object.
在本发明的一些实施例中,适用于资源分配装置确定了资源的消耗值后,基于资源消耗值确定资源热度值的场景。In some embodiments of the present invention, it is applicable to a scenario where the resource allocation device determines the resource popularity value based on the resource consumption value after determining the resource consumption value.
在本发明的一些实施例中,如在计算某一资源的资源热度值时,先明确该资源被哪些使用对象进行申请使用,统计出每个使用对象消耗该资源的量,在确定该资源的总消耗量后,将任意一个使用对象和该资源总的消耗值进行除法运算,计算出该使用对象占该资源总的消耗值的比例,最后通过将每个使用对象占该资源总的消耗值的比例进行求和,计算出该资源的资源热度值。In some embodiments of the present invention, for example, when calculating the resource heat value of a certain resource, it is first clear which users of the resource are applied for and used, and the amount of the resource consumed by each user is counted. After the total consumption, divide any usage object by the total consumption value of the resource to calculate the ratio of the usage object to the total consumption value of the resource, and finally calculate the ratio of each usage object to the total consumption value of the resource The proportions of the resources are summed to calculate the resource heat value of the resource.
示例性的,各资源热度值可以通过以下公式(1)得出。Exemplarily, the popularity value of each resource can be obtained by the following formula (1).
Figure PCTCN2022118108-appb-000001
Figure PCTCN2022118108-appb-000001
其中,X表示某一资源;N u表示用户中的某一用户消耗该资源的值;CA(X)表示该资源的资源热度值;N表示该资源被消耗的总值。 Among them, X represents a certain resource; Nu represents the value of the resource consumed by one of the users; CA(X) represents the resource heat value of the resource; N represents the total value of the resource consumed.
示例性的,在计算平台中某规格虚拟机在某一段时间内的的资源热度值时,首先由S1021获取到在该时间内每个用户消耗该虚拟机的量为(2,2,0,0,2,0,0,2),以及该虚拟机被消耗的总量为8台,然后代入到公式(1)中,求得虚拟机的资源热度值,具体为:Exemplarily, when calculating the resource heat value of a virtual machine of a certain specification in a certain period of time in the platform, first, S1021 obtains that the amount consumed by each user of the virtual machine within the time period is (2, 2, 0, 0,2,0,0,2), and the total consumption of the virtual machine is 8, and then substituted into the formula (1) to obtain the resource heat value of the virtual machine, specifically:
Figure PCTCN2022118108-appb-000002
Figure PCTCN2022118108-appb-000002
X表示虚拟机,由上式计算可以得出,虚拟机的资源热度值为0.602。X represents a virtual machine. From the above calculation, it can be concluded that the resource heat value of the virtual machine is 0.602.
当X表示内存时,由上式计算可以得出,内存的资源热度值为0.376。When X represents memory, it can be concluded from the above calculation that the resource heat value of memory is 0.376.
在本发明的一些实施例中,资源热度值表征资源被依消耗的程度,当资源热度比较高时,即需要适当分配更多该类资源。In some embodiments of the present invention, the heat value of a resource indicates the degree of consumption of the resource. When the heat of the resource is relatively high, more resources of this type need to be properly allocated.
可以理解的是,在本发明实施例中,根据每个资源的消耗值来计算每一个资源的资源热度值,由资源的资源热度值可以确定需要给哪类资源进行更多的分配,提高了的动态分配效率。It can be understood that, in the embodiment of the present invention, the resource popularity value of each resource is calculated according to the consumption value of each resource, and the resource popularity value of the resource can determine which type of resource needs to be allocated more, which improves the dynamic allocation efficiency.
在一些实施例中,参见图3,图3为本发明实施例提供的一种资源分配方法的流程示意图三,图3示出的S103可以通过S1031至S1033实现,将结合各步骤进行说明。In some embodiments, refer to FIG. 3 . FIG. 3 is a third flowchart of a resource allocation method provided by an embodiment of the present invention. S103 shown in FIG. 3 can be implemented through S1031 to S1033 , which will be described in conjunction with each step.
S1031、通过将资源中的任意两个资源的资源热度值进行向量和操作,确定操作后的联合结果。S1031. Perform a vector sum operation on the resource heat values of any two resources among the resources to determine a joint result after the operation.
在本发明的一些实施例中,适用于资源分配装置获得资源中的任意两个资源的资源热度值后,确定两个资源之间的联合结果的场景。In some embodiments of the present invention, it is applicable to a scenario where the resource allocation device determines a joint result between the two resources after obtaining the resource popularity values of any two resources among the resources.
在本发明的一些实施例,获取到任意两个资源的资源热度值后,将两个资源的资源热度值进行向量和操作,确定操作后的联合结果,基于该联合结果,为之后计算两个资源之间的引力值和引力方向值提供前提条件。In some embodiments of the present invention, after acquiring the resource popularity values of any two resources, perform a vector sum operation on the resource popularity values of the two resources to determine the combined result after the operation, and based on the combined result, calculate two The gravitational force value and gravitational direction value between resources provide prerequisites.
示例性的,在计算虚拟机和内存之间的热度值的联合结果时,先获取每个用户消耗虚拟机的量为:(2,2,0,0,2,0,0,2),消耗内存的量为:(200,1000,0,0,500,4000,0,2492),则这两个资源的资源热度值进行向量和操作时,将两个向量的对应位数取最大值,确定操作后的联合结果为(200,1000,0,0,500,4000,0,2492),再代入公式求取结果。Exemplarily, when calculating the joint result of the thermal value between the virtual machine and the memory, first obtain the consumption amount of each user virtual machine as: (2,2,0,0,2,0,0,2), The amount of memory consumed is: (200, 1000, 0, 0, 500, 4000, 0, 2492), then when the resource heat values of these two resources are vectored and operated, the corresponding digits of the two vectors are taken to the maximum value to determine The combined result after the operation is (200,1000,0,0,500,4000,0,2492), and then substituted into the formula to obtain the result.
S1032、根据联合结果和两个资源中的每个资源的资源热度值,确定两个资源之间的引力值。S1032. Determine the gravitational force between the two resources according to the joint result and the resource heat value of each of the two resources.
在本发明的一些实施例中,适用于资源分配装置获取两个资源的热度值后,确定资源之 间引力值的场景。In some embodiments of the present invention, it is applicable to the scenario where the resource allocation device determines the gravitational value between the resources after obtaining the popularity values of the two resources.
在一些实施例中,获取两个资源的资源热度值和联合结果后,将两个资源的资源热度值进行加法运算,确定运算结果,将运算结果和联合结果做减法运算,确定两个资源之间的引力值。In some embodiments, after acquiring the resource heat value and the joint result of the two resources, the resource heat value of the two resources is added to determine the operation result, and the operation result and the joint result are subtracted to determine the relationship between the two resources. gravitational value between.
示例性的,在计算两个资源之间的引力值时,可以通过以下公式(2)得出虚拟机和内存之间的引力值。Exemplarily, when calculating the gravitational force value between two resources, the gravitational force value between the virtual machine and the memory can be obtained through the following formula (2).
G(XY)=CA(X)+CA(Y)-CA(XY)    (2)G(XY)=CA(X)+CA(Y)-CA(XY) (2)
其中,G(XY)为任意两个资源之间的引力值,C(Y)表示资源Y的资源热度值;CA(XY)表示资源X统计向量
Figure PCTCN2022118108-appb-000003
与资源Y的统计向量
Figure PCTCN2022118108-appb-000004
进行向量和操作得到联合结果
Figure PCTCN2022118108-appb-000005
Among them, G(XY) is the gravitational value between any two resources, C(Y) represents the resource heat value of resource Y; CA(XY) represents the statistical vector of resource X
Figure PCTCN2022118108-appb-000003
Statistics vector with resource Y
Figure PCTCN2022118108-appb-000004
Perform vector sum operation to get joint result
Figure PCTCN2022118108-appb-000005
示例性的,CA(XY)可以由公式(1)进行得出,为0.376,由S1022和S1031计算得出的值代入以下公式(3)得出:Exemplarily, CA(XY) can be obtained by formula (1), which is 0.376, and the value calculated by S1022 and S1031 is substituted into the following formula (3):
G(XY)=0.602+0.376-0.376=0.602G(XY)=0.602+0.376-0.376=0.602
G(XY)表示虚拟机和内存之间的引力值为0.602。G(XY) means that the gravitational force between the virtual machine and the memory is 0.602.
在一些实施例中,运算结果表明两个资源所覆盖的总的区域大小。In some embodiments, the result of the calculation indicates the total area size covered by the two resources.
在一些实施例中,利用运算结果和联合结果做差值可以表示为在总的区域大小中去掉两个资源重合的区域,如图4所示。在图4中,CA(X)表示资源X的热度值,CA(Y)表示资源Y的热度值,资源X和资源Y的总热度值表示为图4中两个圆所覆盖的总区域,CA(XY)为资源X统计向量和资源Y统计向量进行向量和操作得到的联合结果,如图4中的阴影部分所示;因为阴影部分被重复进行计算,所以实际上资源X与资源Y之间的引力值应为两个圆所覆盖的总的区域CA(X)+CA(Y)减去阴影部分的区域CA(XY)。In some embodiments, the difference between the operation result and the joint result can be expressed as removing the area where two resources overlap in the total area size, as shown in FIG. 4 . In Figure 4, CA(X) represents the heat value of resource X, CA(Y) represents the heat value of resource Y, and the total heat value of resource X and resource Y is expressed as the total area covered by the two circles in Figure 4, CA(XY) is the joint result of the vector sum operation of the statistical vector of resource X and the statistical vector of resource Y, as shown in the shaded part in Figure 4; because the shaded part is repeatedly calculated, the actual relationship between resource X and resource Y The gravity value between should be the total area CA(X)+CA(Y) covered by the two circles minus the shaded area CA(XY).
可以理解的是,在本发明的一些实施例中,通过每个资源的资源热度值和两个资源之间的联合结果确定两个资源的引力值,基于引力值确定资源之间的相互联系,使得在分配资源的时候,将相关资源一同分配,提高了整体资源利用率。It can be understood that, in some embodiments of the present invention, the gravitational value of two resources is determined through the resource heat value of each resource and the joint result between the two resources, and the interconnection between resources is determined based on the gravitational value. When allocating resources, related resources are allocated together, which improves the overall resource utilization.
S1033、根据两个资源中的每个资源的资源热度值和两个资源之间的引力值,确定两个资源之间的引力方向值。S1033. Determine the gravitational direction value between the two resources according to the resource heat value of each of the two resources and the gravitational force value between the two resources.
在本发明的一些实施例中,适用于资源分配装置获得各资源的资源热度值和引力值后,确定引力方向值的场景。In some embodiments of the present invention, it is applicable to a scenario where the resource allocation device determines the value of the direction of gravity after obtaining the resource heat value and the value of gravity of each resource.
在一些实施例中,在计算两个资源之间的引力方向值时,首先获取两个资源的资源热度值,将的两个资源热度值求和,获得两个资源的总资源热度值;基于确定的两个资源之间的引力值和两个资源之间的总资源热度值做除法运算,确定两个资源之间的引力方向值。In some embodiments, when calculating the gravitational direction value between two resources, first obtain the resource heat value of the two resources, and sum the two resource heat values to obtain the total resource heat value of the two resources; based on The determined gravitational value between the two resources is divided by the total resource heat value between the two resources to determine the gravitational direction value between the two resources.
示例性的,可以通过以下公式(3)计算虚拟机和内存之间的引力方向值。Exemplarily, the gravitational direction value between the virtual machine and the memory can be calculated by the following formula (3).
Figure PCTCN2022118108-appb-000006
Figure PCTCN2022118108-appb-000006
其中,
Figure PCTCN2022118108-appb-000007
为任意两个资源之间的引力方向值,G(XY)为任意两个资源之间的引力值。
in,
Figure PCTCN2022118108-appb-000007
is the gravitational direction value between any two resources, and G(XY) is the gravitational value between any two resources.
示例性的,在计算虚拟机和内存之间的引力方向值时,将由S1032和S1022获得的值代入公式(3)中得出:Exemplarily, when calculating the gravitational direction value between the virtual machine and the memory, the values obtained by S1032 and S1022 are substituted into formula (3) to obtain:
Figure PCTCN2022118108-appb-000008
Figure PCTCN2022118108-appb-000008
由上式计算结果可知,虚拟机和内存之间的引力方向值为0.616。From the calculation result of the above formula, it can be seen that the value of the gravitational direction between the virtual machine and the memory is 0.616.
可以理解的是,在本发明的一些实施例中,通过每个资源的资源热度值和两个资源之间的引力值确定两个资源的引力方向值,基于引力方向值确定资源之间的相互联系,使得在分配资源的时候,将相关资源一同分配,提高了整体资源利用率。It can be understood that, in some embodiments of the present invention, the gravitational direction value of two resources is determined by the resource popularity value of each resource and the gravitational force value between the two resources, and the mutual relationship between resources is determined based on the gravitational direction value. Contact, so that when resources are allocated, related resources are allocated together, which improves the overall resource utilization.
在一些实施例中,参见图5,图5为本发明实施例提供的一种资源分配方法的流程示意图四,图5示出的S104可以通过S1041至S1044实现,将结合各步骤进行说明。In some embodiments, referring to FIG. 5 , FIG. 5 is a fourth schematic flowchart of a resource allocation method provided by an embodiment of the present invention. S104 shown in FIG. 5 can be implemented through S1041 to S1044 , which will be described in conjunction with each step.
S1041、根据每个资源的资源热度值对至少一个资源进行排序,确定排序结果。S1041. Sort at least one resource according to the resource popularity value of each resource, and determine the sorting result.
在本发明的一些实施例中,适用于资源分配装置获得每个资源的资源热度值后,确定每个资源热度值大小关系的场景。In some embodiments of the present invention, it is applicable to a scenario where the resource allocation device determines the magnitude relationship of each resource's popularity value after obtaining the resource popularity value of each resource.
在本发明的一些实施例中,在确定了每个资源的资源热度值后,根据的资源热度值按照从大到小将每个资源进行排序。In some embodiments of the present invention, after the resource popularity value of each resource is determined, each resource is sorted according to the resource popularity value in descending order.
在本发明的一些实施例中,可以根据快速排序、插入排序、归并排序以及冒泡排序等排序算法对数据进行排序,本发明实施例不作限制。In some embodiments of the present invention, the data may be sorted according to sorting algorithms such as quick sort, insertion sort, merge sort, and bubble sort, which are not limited in the embodiments of the present invention.
可以理解的是,在本发明实施例中,根据资源热度值对资源进行排序,由排序结果确定每个资源的分配量,提高了资源的动态分配效率。It can be understood that, in the embodiment of the present invention, the resources are sorted according to the heat value of the resources, and the allocation amount of each resource is determined according to the sorting result, which improves the dynamic allocation efficiency of the resources.
S1042、根据排序结果,确定第一资源;其中,第一资源为资源中资源热度值最大的资源。S1042. Determine the first resource according to the sorting result; wherein, the first resource is the resource with the largest resource popularity among the resources.
在本发明的一些实施例中,适用于资源分配装置在获得了每个资源的排序结果以后,基于排序结果获得分配量最大的资源的场景。In some embodiments of the present invention, it is applicable to a scenario where the resource allocation device obtains the resource with the largest allocation amount based on the sorting result after obtaining the sorting result of each resource.
在本发明的一些实施例中,获得排序结果以后,确定资源中资源热度值最大的资源。In some embodiments of the present invention, after the sorting result is obtained, the resource with the largest resource popularity value among the resources is determined.
示例性的,在平台需要分配的资源为虚拟机、内存和硬盘,虚拟机和内存的热度值由S1022获得,分别为0.602和0.376,硬盘的热度值通过公式(1)计算出0.301,将这三个资源的热度值按照从大到小进行排序,为虚拟机最大,硬盘最小,所以第一资源为虚拟机。Exemplarily, the resources that need to be allocated on the platform are virtual machines, memory, and hard disks. The thermal values of the virtual machines and memory are obtained by S1022, which are 0.602 and 0.376 respectively. The thermal values of the hard disks are calculated as 0.301 through formula (1). The popularity values of the three resources are sorted from largest to smallest, with the virtual machine being the largest and the hard disk being the smallest, so the first resource is the virtual machine.
在本发明的一些实施例中,资源中资源热度值最大的资源可以表示该资源的分配量高 于其他资源。In some embodiments of the present invention, among the resources, the resource with the highest resource popularity value may indicate that the allocation amount of this resource is higher than that of other resources.
可以理解的是,在本发明实施例中,资源分配装置根据资源热度值选出资源中资源热度值最大的资源,由该资源的资源热度值明确该资源的需求量最多,所以分配给该资源的分配量最多,提高了资源的动态分配效率。It can be understood that, in the embodiment of the present invention, the resource allocation device selects the resource with the largest resource popularity value among the resources according to the resource popularity value, and the resource popularity value of the resource indicates that the demand for the resource is the largest, so it is allocated to the resource. The allocation amount is the largest, which improves the dynamic allocation efficiency of resources.
S1043、通过将第二资源与第一资源之间的引力值和引力方向值进行比较,确定比较结果;其中,第二资源为至少一个资源中去掉第一资源后的资源。S1043. Determine a comparison result by comparing the gravitational force value and the gravitational direction value between the second resource and the first resource; wherein, the second resource is a resource in which the first resource is removed from the at least one resource.
在本发明的一些实施例中,适用于资源分配装置获取第二资源与第一资源之间的引力值和引力方向值后,反馈比较结果的场景。In some embodiments of the present invention, it is applicable to the scene where the resource allocation device feeds back the comparison result after obtaining the gravitational force value and the gravitational force direction value between the second resource and the first resource.
在本发明的一些实施例中,已经明确了资源热度值最大的资源,通过将第二资源与第一资源之间的引力值和引力方向值进行比较,来对第二资源的分配量进行排序。可以理解的是,在本发明实施例中,在获取资源热度值最大的资源后,通过引力值和引力方向值确定第二资源与热度值最大的资源之间的相关性,使得在分配热度值最大的资源时,将其相关资源一同分配,提高了整体的资源利用率。In some embodiments of the present invention, the resource with the highest resource heat value has been identified, and the allocation amount of the second resource is sorted by comparing the gravitational value and gravitational direction value between the second resource and the first resource . It can be understood that, in the embodiment of the present invention, after obtaining the resource with the largest resource heat value, the correlation between the second resource and the resource with the largest heat value is determined through the gravitational force value and the gravitational direction value, so that when assigning the heat value When the largest resource is allocated, its related resources are allocated together, which improves the overall resource utilization.
S1044、基于第一资源和比较结果,进行资源动态分配。S1044. Dynamically allocate resources based on the first resource and the comparison result.
在本发明的一些实施例中,适用于资源分配装置获取了第一资源和最终的比较结果后,基于第一资源和最终的比较结果对资源进行动态分配的场景。In some embodiments of the present invention, it is applicable to a scenario where the resource allocation device dynamically allocates resources based on the first resource and the final comparison result after acquiring the first resource and the final comparison result.
在本发明的一些实施例中,先确定第一资源的分配量,然后根据最终的比较结果,确定第二资源中的资源与第一资源之间的相关性,然后对第二资源中的每个资源进行分配。In some embodiments of the present invention, the allocation amount of the first resource is determined first, and then according to the final comparison result, the correlation between the resources in the second resource and the first resource is determined, and then each resource in the second resource resources are allocated.
可以理解的是,在本发明实施例中,基于第一资源和比较结果,进行资源动态分配,使得在分配热度值最大的资源时,将其相关资源一同分配,提高整体的资源利用率。It can be understood that, in the embodiment of the present invention, based on the first resource and the comparison result, dynamic resource allocation is performed, so that when the resource with the highest popularity value is allocated, its related resources are allocated together to improve the overall resource utilization rate.
在一些实施例中,参见图6,图6为本发明实施例提供的一种资源分配方法的流程示意图五,如图6所示,将第二资源与第一资源之间的引力值和引力方向值进行比较,获得比较结果,主要包括以下步骤:In some embodiments, referring to FIG. 6, FIG. 6 is a schematic flowchart of a resource allocation method provided by an embodiment of the present invention. As shown in FIG. 6, the gravitational force value and the gravitational force Direction values are compared to obtain comparison results, mainly including the following steps:
S201、若第二资源中的每个资源与第一资源之间的资源引力值不相等时,则根据第二资源中的每个资源的资源引力值,对第二资源中的每个资源进行分配。S201. If the resource gravity value between each resource in the second resources and the first resource is not equal, perform an operation on each resource in the second resources according to the resource gravity value of each resource in the second resources. distribute.
在本发明的一些实施例中,适用于资源分配装置获取到第二资源中的各个资源与第一资源之间的引力值后,对每个资源进行分配的场景。In some embodiments of the present invention, it is applicable to a scenario where the resource allocation device allocates each resource after obtaining the gravitational force value between each resource in the second resource and the first resource.
在本发明一些实施例中,将第二资源中的每个资源与第一资源之间的资源引力值进行比较后,如果第二资源中的每个资源与第一资源之间的资源引力值都不相等,证明第二资源中的每个资源的分配量均不一样,则按照引力值大小对资源进行分配。In some embodiments of the present invention, after comparing the resource gravity value between each of the second resources and the first resource, if the resource gravity value between each of the second resources and the first resource are not equal, which proves that the allocation amount of each resource in the second resource is different, and the resources are allocated according to the gravity value.
可以理解的是,在本发明的一些实施例中,通过计算获取到第二资源中的每个资源与 第一资源之间的资源引力值不相等时,按照第二资源中每个资源的引力值大小进行资源分配。通过这种分配方式,使得在分配热度值最大的资源时,将其相关资源一同分配,提高了整体的资源利用率。It can be understood that, in some embodiments of the present invention, when the resource gravitational value between each resource in the second resource and the first resource obtained through calculation is not equal, according to the gravitational force of each resource in the second resource Value size for resource allocation. Through this allocation method, when allocating the resource with the highest popularity value, its related resources are allocated together, which improves the overall resource utilization rate.
S202、若第二资源中任意两个资源与第一资源之间的资源引力值相等,则根据第二资源中任意两个资源与第一资源之间的资源引力方向值进行资源分配。S202. If the resource gravity values between any two resources in the second resources and the first resource are equal, perform resource allocation according to the resource gravity direction value between any two resources in the second resources and the first resource.
在本发明的一些实施例中,适用于资源分配装置获取到第二资源中的各个资源与第一资源之间的引力值后,对每个资源进行分配的场景。In some embodiments of the present invention, it is applicable to a scenario where the resource allocation device allocates each resource after obtaining the gravitational force value between each resource in the second resource and the first resource.
在本发明的一些实施例中,将第二资源中的每个资源与第一资源之间的资源引力值进行比较后,如果第二资源中任意两个资源与第一资源之间的资源引力值相等,则需要判断第二资源中任意两个资源与第一资源之间的资源引力方向值,通过引力方向值判断分配给第二资源中每个资源的分配量。In some embodiments of the present invention, after comparing the resource gravity values between each resource in the second resources and the first resource, if the resource gravity values between any two resources in the second resources and the first resource If the values are equal, it is necessary to determine the resource gravitational direction value between any two resources in the second resource and the first resource, and determine the allocation amount allocated to each resource in the second resource based on the gravitational direction value.
示例性的,由S1032得出虚拟机和内存之间的引力值为0.602,虚拟机和硬盘之间的引力值也通过公式(2)进行计算得出,为0.602;虚拟机和内存之间的引力值等于硬盘和虚拟机之间的引力值,所以需要比较各资源之间的引力方向值进行资源分配。Exemplarily, the gravitational value between the virtual machine and the memory obtained from S1032 is 0.602, and the gravitational value between the virtual machine and the hard disk is also calculated by formula (2), which is 0.602; The gravitational force value is equal to the gravitational force value between the hard disk and the virtual machine, so it is necessary to compare the gravitational force direction values between resources for resource allocation.
可以理解的是,在本发明的一些实施例中,在获取到第二资源中存在至少两个资源与第一资源之间的引力值相等以后,通过计算第二资源中引力值相等的资源与第一资源之间的引力方向值判断分配给引力值相等的资源的分配量。通过这种分配方式,使得在分配热度值最大的资源时,将其相关资源一同分配,提高了整体的资源利用率。It can be understood that, in some embodiments of the present invention, after acquiring at least two resources in the second resource that have the same gravitational value as the first resource, by calculating the resources with equal gravitational value among the second resources and The gravitational direction value between the first resources determines the allocation amount allocated to resources with the same gravitational value. Through this allocation method, when allocating the resource with the highest popularity value, its related resources are allocated together, which improves the overall resource utilization rate.
在一些实施例中,参见图7,图7为本发明实施例提供的一种资源分配方法的流程示意图六,如图7所示,在第二资源中任意两个资源与第一资源之间的资源引力值相等时,根据第二资源中任意两个资源与第一资源之间的资源引力方向值进行资源分配,主要包括以下步骤:In some embodiments, refer to FIG. 7. FIG. 7 is a sixth flowchart of a resource allocation method provided by an embodiment of the present invention. As shown in FIG. 7, between any two resources in the second resource and the first resource When the resource gravity values of resources are equal, resource allocation is performed according to the resource gravity direction value between any two resources in the second resource and the first resource, which mainly includes the following steps:
S301、统计第二资源中的任意两个资源与第一资源之间的第一引力方向值。S301. Count the first gravitational direction value between any two resources in the second resource and the first resource.
在本发明的一些实施例中,适用于资源分配装置确定了第二资源中任意两个资源与第一资源之间的资源引力值相等后,基于第二资源中任意两个资源与第一资源之间的资源引力方向值对资源进行分配的场景。In some embodiments of the present invention, after the resource allocation device determines that the resource gravitational value between any two resources in the second resources and the first resource is equal, based on any two resources in the second resources and the first resource Scenarios in which resources are allocated between resource gravitational direction values.
在本发明一些实施例中,在获取第二资源中存在至少两个资源与第一资源之间的引力值相等后,需要统计第二资源中的至少两个资源与第一资源之间的第一引力方向值判断分配给资源的分配量。In some embodiments of the present invention, after obtaining the same gravitational value between at least two resources among the second resources and the first resource, it is necessary to count the first resource between at least two resources among the second resources. A gravitational direction value determines the allocation amount assigned to the resource.
在本发明的一些实施例中,统计可以是通过S1033计算出的引力方向值进行统计。In some embodiments of the present invention, the statistics may be performed on the gravitational direction value calculated in S1033.
可以理解的是,在本发明的一些实施例中,根据第二资源中任意两个资源与第一资源 之间的资源引力方向值判断分配给第二资源中引力值相等的资源的资源分配量。在资源引力值相等时,通过资源的引力方向值将资源进行对比,明确每个资源的分配量,提高了整体的资源利用率。It can be understood that, in some embodiments of the present invention, according to the resource gravitational direction value between any two resources in the second resource and the first resource, the resource allocation amount allocated to the resource with the same gravitational value among the second resources is judged . When the resource gravitational value is equal, the resources are compared through the gravitational direction value of the resource, and the allocation amount of each resource is clarified, which improves the overall resource utilization rate.
S302、将第一引力方向值与上一时间段的第二引力方向值做差值,确定差异结果。S302. Make a difference between the first gravitational direction value and the second gravitational direction value in the previous time period, and determine the difference result.
在本发明的一些实施例中,适用于资源分配装置获取到不同时间段的引力方向值后,基于不同时间段的引力方向值确定差异结果的场景。In some embodiments of the present invention, it is applicable to a scenario where the resource allocation device determines a difference result based on the gravitational direction values in different time periods after acquiring the gravitational direction values in different time periods.
在本发明一些实施例中,将第一引力值和第二引力值进行减法运算,通过减法运算之后得到的差异结果进行资源的动态分配。In some embodiments of the present invention, the first gravitational force value and the second gravitational force value are subtracted, and the dynamic allocation of resources is performed through the difference result obtained after the subtraction.
表1资源引力方向值关系映射表Table 1 Resource gravity direction value relationship mapping table
示例性的,表1为资源引力方向值的关系映射表:Exemplarily, Table 1 is a relationship mapping table of resource gravity direction values:
引力值gravitational value 第一引力方向值The value of the first direction of gravity 第二引力方向值Second gravitational direction value 差值difference
硬盘和虚拟机Hard disk and virtual machine 0.6670.667 0.7330.733 -0.056-0.056
虚拟机和内存Virtual Machines and Memory 0.6160.616 0.5010.501 0.1150.115
从上表1可以看出硬盘和虚拟机之间的引力方向差值为-0.056,虚拟机和内存之间的引力方向差值为0.115。From Table 1 above, it can be seen that the gravitational direction difference between the hard disk and the virtual machine is -0.056, and the gravitational direction difference between the virtual machine and the memory is 0.115.
在本发明一些实施例中,第二引力方向值为上一周期内通过S1033的计算方法所得到的引力方向值。In some embodiments of the present invention, the second gravitational direction value is the gravitational direction value obtained through the calculation method of S1033 in the previous cycle.
可以理解的是,在本发明一些实施例中,根据不同时间段的引力方向值计算差异结果,通过引力方向值之间的差异结果将资源进行对比,明确每个资源的分配量,提高了整体的资源利用率。It can be understood that, in some embodiments of the present invention, the difference results are calculated according to the gravitational direction values in different time periods, the resources are compared through the difference results between the gravitational direction values, and the allocation amount of each resource is clarified, which improves the overall resource utilization.
S303、若差异结果为负,则任意两个资源中的至少一个资源与第一资源之间的引力方向为负向。S303. If the result of the difference is negative, the gravitational direction between at least one of any two resources and the first resource is negative.
在本发明的一些实施例中,适用于资源分配装置在获取差异结果后,基于差异结果确定引力值相等的资源与第一资源之间的引力方向的场景。In some embodiments of the present invention, it is applicable to a scenario where the resource allocation device determines the gravitational direction between the resource with the same gravitational value and the first resource based on the difference result after obtaining the difference result.
在本发明一些实施例中,在获取到不同时间段的引力方向值的差异结果后,如果差异结果为负,则任意两个资源中至少存在一个资源与第一资源之间的引力方向为负向。In some embodiments of the present invention, after obtaining the difference result of the gravitational direction value in different time periods, if the difference result is negative, the gravitational direction between at least one of any two resources and the first resource is negative Towards.
示例性的,如上表表1所示,硬盘和虚拟机之间的差值为-0.056,则表明硬盘和虚拟机之间的引力方向为负向。Exemplarily, as shown in Table 1 above, the difference between the hard disk and the virtual machine is -0.056, which indicates that the gravitational direction between the hard disk and the virtual machine is negative.
在本发明一些实施例中,负向引力可以表示为两个资源的资源热度值趋于异性。In some embodiments of the present invention, the negative gravitational force may be expressed as that the resource popularity values of two resources tend to be opposite.
可以理解的是,在本发明一些实施例中,通过获取不同时间段的资源的引力方向值为负,确定第二资源中任意的两个资源和第一资源之间的引力方向,通过资源之间引力方向, 判断出资源之间的相关性,提高了整体资源利用率。It can be understood that, in some embodiments of the present invention, by obtaining negative gravitational direction values of resources in different time periods, the gravitational direction between any two resources in the second resource and the first resource is determined, and the The direction of gravitational force between resources can be determined, and the correlation between resources can be judged, which improves the overall resource utilization.
S304、若差异结果为正,则任意两个资源中的至少一个资源与第一资源之间的引力方向为正向。S304. If the result of the difference is positive, the gravitational direction between at least one of any two resources and the first resource is positive.
在本发明的一些实施例中,适用于资源分配装置在获取差异结果后,基于差异结果确定引力值相等的资源与第一资源之间的引力方向的场景。In some embodiments of the present invention, it is applicable to a scenario where the resource allocation device determines the gravitational direction between the resource with the same gravitational value and the first resource based on the difference result after obtaining the difference result.
在本发明一些实施例中,获取到不同时间段的引力方向值的差异结果后,根据差异结果判断资源之间的引力方向,如果引力方向为正向,则证明资源之间的引力方向为正向。In some embodiments of the present invention, after obtaining the difference results of the gravitational direction values in different time periods, the gravitational direction between resources is judged according to the difference result, if the gravitational direction is positive, it proves that the gravitational direction between resources is positive Towards.
示例性的,如上表表1所示,虚拟机和内存之间的差值为0.115,则表明虚拟机和内存之间的引力方向为正向。Exemplarily, as shown in Table 1 above, the difference between the virtual machine and the memory is 0.115, which indicates that the gravitational direction between the virtual machine and the memory is positive.
在本发明一些实施例中,正向引力可以表示为两个资源的资源热度值趋于同性。In some embodiments of the present invention, positive gravity can be expressed as that the resource popularity values of two resources tend to be the same.
可以理解的是,在本发明一些实施例中,通过获取不同时间段的资源的引力方向值为正,确定第二资源中任意的两个资源和第一资源之间的引力方向,通过资源之间引力方向,判断出资源之间的相关性,提高了整体资源利用率。It can be understood that, in some embodiments of the present invention, by obtaining positive gravitational direction values of resources in different time periods, the gravitational direction between any two resources in the second resource and the first resource is determined. The direction of gravitational force between resources can be judged, and the correlation between resources can be judged, which improves the overall resource utilization rate.
S305、根据正向引力或负向引力,确定第二资源中任意两个资源的资源分配。S305. Determine the resource allocation of any two resources in the second resources according to the positive gravitational force or the negative gravitational force.
在本发明的一些实施例中,适用于资源分配装置获取到第二资源中的资源与第一资源之间的引力方向后,对资源进行分配的场景。In some embodiments of the present invention, it is applicable to a scenario where the resource allocation device allocates resources after acquiring the gravitational direction between the resource in the second resource and the first resource.
在本发明一些实施例中,获取到第二资源中任意两个引力值相等的资源与第一资源之间的引力方向后,根据引力方向是正向还是负向对第二资源中的任意两个资源进行分配。In some embodiments of the present invention, after obtaining the gravitational direction between any two resources with the same gravitational force value in the second resource and the first resource, any two resources in the second resource are compared according to whether the gravitational direction is positive or negative. Resources are allocated.
可以理解的是,在本发明一些实施例中,根据第二资源中的任意两个资源与第一资源之间的引力方向判断出资源之间的相关性,提高了整体资源利用率。It can be understood that, in some embodiments of the present invention, the correlation between resources is determined according to the gravitational direction between any two resources in the second resources and the first resource, which improves the utilization rate of the overall resources.
在一些实施例中,参见图8,图8为本发明实施例提供的一种资源分配方法的流程示意图七,如图8所示,根据正向引力或负向引力,确定第二资源中任意两个资源的资源分配,主要包括以下步骤:In some embodiments, refer to FIG. 8 . FIG. 8 is a schematic flow diagram VII of a resource allocation method provided by an embodiment of the present invention. As shown in FIG. 8 , according to positive gravity or negative gravity, determine any The resource allocation of two resources mainly includes the following steps:
S401、若引力方向为正向,则分配给任意两个资源中至少一个资源的分配量与第一资源的分配量成正比;S401. If the gravitational direction is positive, the allocation amount allocated to at least one of any two resources is proportional to the allocation amount of the first resource;
在本发明的一些实施例中,适用于资源分配装置明确了引力方向后,对资源进行分配的场景。In some embodiments of the present invention, it is applicable to a scenario where the resource allocation device allocates resources after determining the direction of gravity.
在本发明的一些实施例中,在获取了第二资源中的任意两个资源与第一资源之间的引力方向后,如果引力方向为正,则表明在第二资源中,至少有一个资源的分配量与第一资源的分配量成正比,在分配第一资源的时候,对与第一资源成正比的资源也需要动态增加分配量。In some embodiments of the present invention, after obtaining the gravitational direction between any two resources in the second resource and the first resource, if the gravitational direction is positive, it indicates that in the second resource, there is at least one resource The allocation amount of is proportional to the allocation amount of the first resource. When allocating the first resource, the allocation amount of the resource proportional to the first resource also needs to be dynamically increased.
示例性的,如上表表1所示,虚拟机和内存之间的引力方向为正向,则在分配内存时,相应增加内存的分配量。可以理解的是,在本发明一些实施例中,根据第二资源中的任意两个资源与第一资源之间的引力方向来对资源进行分配,使得单一资源分配的时候,将其相关资源一起分配,提高了了整体的资源利用率。Exemplarily, as shown in Table 1 above, if the gravitational direction between the virtual machine and the memory is positive, then when allocating memory, increase the amount of memory allocated accordingly. It can be understood that, in some embodiments of the present invention, resources are allocated according to the gravitational direction between any two resources in the second resources and the first resource, so that when a single resource is allocated, its related resources are Allocation improves the overall resource utilization.
S402、若引力方向为负向引力,则分配给任意资源中至少一个资源的分配量与第一资源的分配量成反比;S402. If the gravitational direction is negative gravitational force, the allocation amount allocated to at least one resource among any resources is inversely proportional to the allocation amount of the first resource;
在本发明的一些实施例中,适用于资源分配装置明确了引力方向后,对资源进行分配的场景。In some embodiments of the present invention, it is applicable to a scenario where the resource allocation device allocates resources after determining the direction of gravity.
在本发明的一些实施例中,在获取了第二资源中的任意两个资源与第一资源之间的引力方向后,如果引力方向为负,则表明在第二资源中,至少有一个资源的分配量与第一资源的分配量成反比,在分配第一资源的时候,对与第一资源成反比的资源也需要动态减小分配量。In some embodiments of the present invention, after obtaining the gravitational direction between any two resources in the second resource and the first resource, if the gravitational direction is negative, it indicates that in the second resource, at least one resource The allocation amount of is inversely proportional to the allocation amount of the first resource. When allocating the first resource, the allocation amount also needs to be dynamically reduced for resources that are inversely proportional to the first resource.
示例性的,如上表表1所示,硬盘和虚拟机之间的引力方向为负向,则在分配虚拟机时,相应减小硬盘的分配量。可以理解的是,,在本发明一些实施例中,根据第二资源中的任意两个资源与第一资源之间的引力方向来对资源进行分配,使得单一资源分配的时候,将其相关资源一起分配,提高了整体资源利用率。Exemplarily, as shown in Table 1 above, if the gravitational direction between the hard disk and the virtual machine is negative, then when allocating the virtual machine, the allocation amount of the hard disk is correspondingly reduced. It can be understood that, in some embodiments of the present invention, resources are allocated according to the gravitational direction between any two resources in the second resources and the first resource, so that when a single resource is allocated, its related resources Allocating together improves overall resource utilization.
S403、若任意两个资源的引力方向均为正向引力或负向引力,则根据第一引力方向值与上一时间段的第二引力方向值之间的差值进行资源分配。在本发明的一些实施例中,适用于资源分配装置明确了引力方向后,对资源进行分配的场景。S403. If the gravitational directions of any two resources are positive or negative, resource allocation is performed according to the difference between the first gravitational direction value and the second gravitational direction value in the previous time period. In some embodiments of the present invention, it is applicable to a scenario where the resource allocation device allocates resources after determining the direction of gravity.
在一些实施例中,S403可以通过S4031至S4032得出,具体步骤如下:In some embodiments, S403 can be obtained through S4031 to S4032, and the specific steps are as follows:
S4031、若所述任意两个资源的引力方向为正向引力,则分配给所述任意两个资源中的至少一个资源的分配量与所述差值大小成正比;S4031. If the gravitational direction of the any two resources is positive gravitational force, the allocation amount allocated to at least one of the any two resources is proportional to the difference;
S4032、若所述任意两个资源的引力方向为负向引力,则分配给所述任意两个资源中的至少一个资源的分配量与所述差值大小成反比。S4032. If the gravitational direction of the any two resources is negative gravitational force, the allocation amount allocated to at least one of the any two resources is inversely proportional to the difference.
在本发明的一些实施例中,获取到任意两个引力值相等的资源与第一资源之间的引力方向值都为正向或者都为负向,则表明在分配第一资源的时候,与第一资源之间的引力方向为正向/负向的资源的分配量都应适当的增加/减小,具体的每个资源的增加/减小范围应根据第一引力方向值与上一时间段的第二引力方向值之间的差值进行确定。如果引力方向都为正向,资源的差值越大,分配的资源相对来说越多,如果引力方向都为负向,资源的差值越大,资源的分配量越小。In some embodiments of the present invention, if it is obtained that the gravitational direction values between any two resources with equal gravitational values and the first resource are both positive or negative, it indicates that when the first resource is allocated, the same The allocation amount of resources whose gravitational direction is positive/negative among the first resources should be appropriately increased/decreased, and the specific increase/decrease range of each resource should be based on the value of the first gravitational direction and the previous time The difference between the second gravitational direction values for the segments is determined. If the gravitational direction is positive, the greater the resource difference, the more resources will be allocated. If the gravitational direction is negative, the larger the resource difference, the smaller the resource allocation.
可以理解的是,在本发明一些实施例中,获取到第二资源中的任意两个资源与第一资 源之间的引力方向相同时,需要进一步计算出差值,根据差值对资源进行分配使得单一资源分配的时候,将其相关资源一起分配,提高了整体资源利用率。It can be understood that, in some embodiments of the present invention, when the gravitational direction between any two resources obtained from the second resource is the same as that of the first resource, it is necessary to further calculate the difference, and allocate resources according to the difference When a single resource is allocated, its related resources are allocated together, which improves the overall resource utilization.
为了能更加体现本发明的目的,下面,将说明本发明实施例在一个实际的应用场景中的示例性应用。In order to better reflect the purpose of the present invention, an exemplary application of the embodiment of the present invention in an actual application scenario will be described below.
图9为本发明实施例提供的一种资源分配方法的流程示意图八。FIG. 9 is an eighth schematic flowchart of a resource allocation method provided by an embodiment of the present invention.
示例性的,以公有的云管理平台分配资源为例,主要包括以下步骤:Exemplarily, taking a public cloud management platform as an example to allocate resources, it mainly includes the following steps:
S1、统计各资源消耗值。S1. Count the consumption values of each resource.
在本发明的实施例中,统计每一个资源的消耗值可以通过使用对象进行确定,先明确使用对象的数量,筛选出使用了资源的对象,对筛选出的每一个使用对象消耗该资源的量进行求和,来计算该资源被消耗的总量。In the embodiment of the present invention, the consumption value of each resource can be determined by using objects. First, the number of used objects is specified, and the objects that use resources are selected, and the amount of the resource is consumed for each selected used object. Sum up to calculate the total amount of resources consumed.
S2、判断是否新增使用对象;若是,则执行S3;若不是,则执行S4。S2. Determine whether to add an object to be used; if yes, execute S3; if not, execute S4.
在本发明的实施例中,判断资源的消耗值是否发生变化,资源的消耗值随着用户的变化而变化。In the embodiment of the present invention, it is judged whether the consumption value of the resource changes, and the consumption value of the resource changes with the change of the user.
S3、更新各资源消耗值。S3. Update each resource consumption value.
在本发明的实施例中,当平台获取到资源被已有的用户或者新用户申请使用时,资源的消耗值发生变化,即更新资源的消耗值。In the embodiment of the present invention, when the platform obtains that the resource is applied for by an existing user or a new user, the consumption value of the resource changes, that is, the consumption value of the resource is updated.
S4、计算各资源的资源热度值。S4. Calculate the resource popularity value of each resource.
在本发明的实施例中,通过至少一个资源中每个资源的消耗值,确定每个使用对象对于每个资源的资源热度值。In the embodiment of the present invention, the resource popularity value of each resource for each usage object is determined through the consumption value of each resource in the at least one resource.
在本发明的实施例中,通过至少一个资源中每个资源的消耗值,确定每个使用对象对于每个资源的资源热度值包括:In an embodiment of the present invention, using the consumption value of each resource in at least one resource, determining the resource popularity value of each resource for each use object includes:
S4.1、通过至少一个使用对象使用的至少一个资源中的每个资源的消耗值,确定每个资源消耗总值。S4.1. Determine the total consumption value of each resource by using the consumption value of each resource in the at least one resource used by the at least one usage object.
S4.2、根据每个资源消耗总值、每个使用对象使用的每个资源的消耗值,确定每个资源的资源热度值。S4.2. Determine the resource popularity value of each resource according to the total consumption value of each resource and the consumption value of each resource used by each user.
在本发明的实施例中,计算该资源的热度值时,需要明确每个用户消耗的值和被消耗的总值;通过每个用户消耗的值和被消耗的总值确定该资源的热度值。In the embodiment of the present invention, when calculating the heat value of the resource, it is necessary to clarify the value consumed by each user and the total value consumed; the heat value of the resource is determined by the value consumed by each user and the total value consumed .
S5、计算各资源引力值及引力方向值。S5. Calculate the gravitational force value and the gravitational direction value of each resource.
根据每个资源的资源热度值,确定两两资源之间的资源引力值和引力方向值,包括:According to the resource heat value of each resource, determine the resource gravity value and gravity direction value between two resources, including:
S5.1、通过将资源中的任意两个资源的资源热度值进行向量和操作,确定操作后的联合结果。S5.1. Perform a vector sum operation on the resource popularity values of any two resources in the resource to determine a joint result after the operation.
S5.2、根据联合结果和两个资源中的每个资源的资源热度值,确定两个资源之间的引力值。S5.2. Determine the gravitational force between the two resources according to the joint result and the resource heat value of each of the two resources.
S5.3、根据两个资源中的每个资源的资源热度值和两个资源之间的引力值,确定两个资源之间的引力方向值。S5.3. Determine the gravitational direction value between the two resources according to the resource heat value of each of the two resources and the gravitational force value between the two resources.
S6、根据资源热度值、引力值和引力方向值动态分配资源。S6. Dynamically allocate resources according to the resource heat value, gravity value, and gravity direction value.
根据每个资源的资源热度值、两两资源之间的资源引力值和引力方向值进行资源动态分配,包括:According to the resource popularity value of each resource, resource gravity value and gravity direction value between two resources, resources are dynamically allocated, including:
S6.1、根据每个资源的资源热度值对至少一个资源进行排序,确定排序结果。S6.1. Sort at least one resource according to the resource popularity value of each resource, and determine the sorting result.
S6.2、根据排序结果,确定第一资源;其中,第一资源为资源中资源热度值最大的资源。S6.2. Determine the first resource according to the sorting result; wherein, the first resource is the resource with the largest resource popularity value among the resources.
S6.3、根据排序结果,确定第一资源;其中,第一资源为资源中资源热度值最大的资源。S6.3. Determine the first resource according to the sorting result; wherein, the first resource is the resource with the largest resource popularity value among the resources.
S6.4、通过将第二资源与第一资源之间的引力值和引力方向值进行比较,确定比较结果;其中,第二资源为至少一个资源中去掉第一资源后的资源。S6.4. Determine the comparison result by comparing the gravitational force value and the gravitational force direction value between the second resource and the first resource; wherein, the second resource is a resource in which the first resource is removed from the at least one resource.
当资源分配装置完成各资源原始数据工作后,需要根据热度值进行排序,按照热度值大小进行按序动态分配资源。在动态分配资源时,需要根据引力值及引力方向值进行资源分配的动态调整,若在动态分配资源X时,资源Y的引力值大于资源Z的引力值,则在分配资源时资源Y要大于分配资源Z;若资源Y的引力值等于资源Z的引力值,但是资源X和资源Y的引力方向值增大且资源X和资源Y引力方向值变小,则在分配资源时,资源Y要增多,相对而言分配资源Z要减少。After the resource allocation device completes the original data work of each resource, it needs to sort according to the heat value, and dynamically allocate resources in sequence according to the heat value. When dynamically allocating resources, resource allocation needs to be dynamically adjusted according to the gravitational force value and the gravitational direction value. If resource Y’s gravitational value is greater than resource Z’s gravitational value when dynamically allocating resource X, resource Y must be greater than Allocate resource Z; if the gravity value of resource Y is equal to the gravity value of resource Z, but the gravity direction values of resource X and resource Y increase and the gravity direction values of resource X and resource Y become smaller, then when resources are allocated, resource Y must Relatively speaking, the allocation of resources should be reduced.
可以理解的是,在本发明的实施例中,云管理平台在分配资源的时候,首先计算出每个资源的资源热度值,选出资源热度值最大资源给予更多的分配量。然后计算剩余资源与资源热度值最大资源之间的引力值和引力方向值,根据引力值和引力方向值确定剩余资源与资源热度值最大资源之间的相关性,最后将单一动态资源分配转变成在动态分配资源时,将其相关资源一同分配,提高了整体的资源利用率。It can be understood that, in the embodiment of the present invention, when allocating resources, the cloud management platform first calculates the resource popularity value of each resource, and selects the resource with the highest resource popularity value to give more allocation amount. Then calculate the gravitational force value and gravitational direction value between the remaining resources and the resource with the largest resource heat value, determine the correlation between the remaining resources and the resource with the largest resource heat value according to the gravitational force value and the gravitational direction value, and finally transform the single dynamic resource allocation into When resources are allocated dynamically, related resources are allocated together, which improves the overall resource utilization.
基于上述实施例的方法,本发明实施例还提供了一种资源分配装置,如图10所述,图10为本发明实施例提供的一种资源分配装置的结构示意图,该装置10包括:统计部分1001、确定部分1002和分配部分1003;其中;Based on the methods of the above embodiments, the embodiment of the present invention also provides a resource allocation device, as shown in FIG. 10 , which is a schematic structural diagram of a resource allocation device provided by the embodiment of the present invention. The device 10 includes: Part 1001, determination part 1002 and allocation part 1003; wherein;
所述统计部分1001,被配置为统计使用对象使用的至少一个资源的消耗值;The statistical part 1001 is configured to count the consumption value of at least one resource used by the usage object;
所述确定部分1002,被配置为通过所述至少一个资源中每个资源的消耗值,确定每个资源的资源热度值;其中,资源热度值表征资源被依消耗的程度;The determining part 1002 is configured to determine the resource popularity value of each resource through the consumption value of each resource in the at least one resource; wherein, the resource popularity value represents the degree of resource consumption;
所述确定部分1002,还被配置为根据所述每个资源的资源热度值,确定两两资源之间的资源引力值和引力方向值;The determination part 1002 is further configured to determine the resource gravity value and the gravity direction value between any two resources according to the resource heat value of each resource;
所述分配部分1003,被配置为根据所述每个资源的资源热度值、所述两两资源之间的资源引力值和引力方向值进行资源动态分配。The allocation part 1003 is configured to dynamically allocate resources according to the resource popularity value of each resource, the resource gravity value and the gravity direction value between the two resources.
基于上述实施例的方法,本发明实施例还提供一种资源分配装置,如图11所示,图11为本发明实施例提供的一种资源分配装置的结构示意图,该装置11包括:处理器1101和存储器1102;存储器1101存储处理器可执行的一个或者多个程序,当一个或者多个程序被执行时,通过处理器1102执行如前所述实施例的任意一种资源的分配方法。Based on the method of the above-mentioned embodiment, the embodiment of the present invention also provides a resource allocation device, as shown in FIG. 11 , which is a schematic structural diagram of a resource allocation device provided by the embodiment of the present invention. The device 11 includes: a processor 1101 and memory 1102; the memory 1101 stores one or more programs executable by the processor, and when the one or more programs are executed, the processor 1102 executes any resource allocation method in the above-mentioned embodiments.
基于上述实施例的资源分配方法,本发明实施例还提供了一种计算机可读存储介质,计算机可读存储介质存储有一个或者多个程序,一个或者多个程序可被一个或者多个处理器执行,程序被处理器执行时实现如本实施例公开的资源分配方法。Based on the resource allocation method of the above-mentioned embodiment, the embodiment of the present invention also provides a computer-readable storage medium, the computer-readable storage medium stores one or more programs, and one or more programs can be used by one or more processors Execute, when the program is executed by the processor, the resource allocation method disclosed in this embodiment is implemented.
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present invention may be provided as methods, systems, or computer program products. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) having computer-usable program code embodied therein.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each procedure and/or block in the flowchart and/or block diagram, and a combination of procedures and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions may be provided to a general purpose computer, special purpose computer, embedded processor, or processor of other programmable data processing equipment to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing equipment produce a An apparatus for realizing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions The device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby The instructions provide steps for implementing the functions specified in the flow chart or blocks of the flowchart and/or the block or blocks of the block diagrams.
以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention.
工业实用性Industrial Applicability
本发明实施例提供了一种资源分配方法及装置、存储介质,该方法包括:收集一段时间内各资源被依赖或消耗值;通过各资源被依赖或消耗值确定各资源热度值;其中,资源热度值是各资源被依赖或消耗程度表征值;当各资源热度值确定后,根据各资源热度值确定各资源间引力和方向。在该方法中,从客观角度提出资源热度、引力值及引力方向等客观参数指标,避免根据资源本身某种特性或者资源的性能指标作为动态分配算法参数,使得平台根据自身特性进行资源动态分配。进一步的,引入了引力模型,将各资源之间建立关联关系,使得在将单一的资源分配时,可以将其相关的资源一同分配,提高了整体的资源利用率。An embodiment of the present invention provides a resource allocation method and device, and a storage medium. The method includes: collecting the dependence or consumption value of each resource within a period of time; determining the heat value of each resource according to the dependence or consumption value of each resource; wherein, the resource The heat value is a characteristic value of the degree of dependence or consumption of each resource; when the heat value of each resource is determined, the gravity and direction between each resource are determined according to the heat value of each resource. In this method, objective parameter indicators such as resource heat, gravitational value, and gravitational direction are proposed from an objective point of view, and certain characteristics of resources themselves or resource performance indicators are not used as dynamic allocation algorithm parameters, so that the platform can dynamically allocate resources according to its own characteristics. Furthermore, a gravity model is introduced to establish a relationship between resources, so that when a single resource is allocated, its related resources can be allocated together, which improves the overall resource utilization.

Claims (13)

  1. 一种资源分配方法,包括:A resource allocation method comprising:
    统计至少一个使用对象各自使用的至少一个资源的消耗值;Counting the consumption value of at least one resource used by each of the at least one usage object;
    通过所述至少一个资源中每个资源的消耗值,确定每个使用对象对于每个资源的资源热度值;其中,资源热度值表征资源被依消耗的程度;Through the consumption value of each resource in the at least one resource, determine the resource popularity value of each resource for each use object; wherein, the resource popularity value represents the degree of resource consumption;
    根据所述每个资源的资源热度值,确定两两资源之间的资源引力值和引力方向值;According to the resource popularity value of each resource, determine the resource gravitational value and gravitational direction value between any two resources;
    根据所述每个资源的资源热度值、所述两两资源之间的资源引力值和引力方向值进行资源动态分配。Resource dynamic allocation is performed according to the resource popularity value of each resource, the resource gravity value and the gravity direction value between the two resources.
  2. 根据权利要求1中所述的方法,其中,所述通过所述至少一个资源中每个资源的消耗值,确定每个资源的资源热度值,包括:The method according to claim 1, wherein said determining the resource popularity value of each resource through the consumption value of each resource in the at least one resource comprises:
    通过所述至少一个使用对象使用的至少一个资源中的每个资源的消耗值,确定每个资源消耗总值;Determine the total consumption value of each resource by using the consumption value of each resource in the at least one resource used by the at least one usage object;
    根据所述每个资源消耗总值、所述每个使用对象使用的所述每个资源的消耗值,确定所述每个资源的资源热度值。The resource popularity value of each resource is determined according to the total consumption value of each resource and the consumption value of each resource used by each usage object.
  3. 根据权利要求1中所述的方法,其中,所述根据所述每个资源的资源热度值,确定两两资源之间的资源引力值和引力方向值,包括:The method according to claim 1, wherein, according to the resource heat value of each resource, determining the resource gravitational value and the gravitational direction value between two resources includes:
    通过将所述资源中的任意两个资源的资源热度值进行向量和操作,确定操作后的联合结果;Determining the joint result after the operation by performing a vector sum operation on the resource popularity values of any two resources among the resources;
    根据所述联合结果和所述两个资源中的每个资源的资源热度值,确定所述两个资源之间的引力值;determining a gravitational force value between the two resources according to the joint result and the resource heat value of each of the two resources;
    根据所述两个资源中的每个资源的资源热度值和所述两个资源之间的引力值,确定所述两个资源之间的引力方向值。A gravitational direction value between the two resources is determined according to the resource popularity value of each of the two resources and the gravitational force value between the two resources.
  4. 根据权利要求3中所述的方法,其中,所述根据所述联合结果和所述两个资源中的每个资源的资源热度值,确定所述两个资源之间的引力值,包括:The method according to claim 3, wherein said determining the gravitational force value between the two resources according to the joint result and the resource heat value of each resource in the two resources comprises:
    根据所述两个资源中的每个资源的资源热度值,确定所述两个资源的总资源热度值;determining the total resource popularity value of the two resources according to the resource popularity value of each resource in the two resources;
    将所述两个资源的总资源热度值与所述联合结果做差,确定所述两个资源之间的引力值。The difference between the total resource heat value of the two resources and the joint result is determined to determine the gravitational force between the two resources.
  5. 根据权利要求3所述的方法,其中,所述根据所述两个资源中的每个资源的资源热度值和所述两个资源之间的引力值,确定所述两个资源之间的引力方向值,包括:The method according to claim 3, wherein, according to the resource popularity value of each resource in the two resources and the gravitational force value between the two resources, the gravitational force between the two resources is determined Orientation values, including:
    根据所述两个资源的总资源热度值与所述两个资源之间的引力值,确定所述两个资源之间的引力方向值。A gravitational direction value between the two resources is determined according to the total resource heat value of the two resources and the gravitational force value between the two resources.
  6. 根据权利要求1至3任一项中所述的方法,其中,所述根据所述每个资源的资源热 度值、所述两两资源之间的资源引力值和引力方向值进行资源动态分配,包括:The method according to any one of claims 1 to 3, wherein the dynamic allocation of resources is performed according to the resource popularity value of each resource, the resource gravity value and the gravity direction value between the two resources, include:
    根据所述每个资源的资源热度值对所述至少一个资源进行排序,确定排序结果;sorting the at least one resource according to the resource popularity value of each resource, and determining the sorting result;
    根据所述排序结果,确定第一资源;其中,所述第一资源为资源中资源热度值最大的资源;According to the sorting result, determine the first resource; wherein, the first resource is the resource with the largest resource popularity value among the resources;
    通过将第二资源与所述第一资源之间的引力值和引力方向值进行比较,确定比较结果;其中,所述第二资源为所述至少一个资源中去掉第一资源后的资源;Determine the comparison result by comparing the gravitational force value and the gravitational direction value between the second resource and the first resource; wherein the second resource is a resource after the first resource is removed from the at least one resource;
    基于所述第一资源和所述比较结果,进行资源动态分配。Dynamic resource allocation is performed based on the first resource and the comparison result.
  7. 根据权利要求6所述的方法,其中,所述通过将第二资源与所述第一资源之间的引力值和引力方向值进行比较,确定比较结果,包括:The method according to claim 6, wherein said determining the comparison result by comparing the gravitational force value and the gravitational force direction value between the second resource and the first resource comprises:
    若所述第二资源中的每个资源与所述第一资源之间的资源引力值不相等时,则根据所述第二资源中的每个资源的资源引力值,对所述第二资源中的每个资源进行分配;If the resource gravitational value between each of the second resources and the first resource is not equal, according to the resource gravitational value of each of the second resources, for the second resource Each resource in is allocated;
    若所述第二资源中任意两个资源与所述第一资源之间的资源引力值相等,则根据所述第二资源中任意两个资源与所述第一资源之间的资源引力方向值进行资源分配。If the resource gravitational value between any two resources in the second resource and the first resource is equal, according to the resource gravitational direction value between any two resources in the second resource and the first resource Make resource allocation.
  8. 根据权利要求7所述的方法,其中,所述若所述第二资源中任意两个资源与所述第一资源之间的资源引力值相等,则根据所述第二资源中任意两个资源与所述第一资源之间的资源引力方向值进行资源分配,包括:The method according to claim 7, wherein, if the resource gravitational value between any two resources in the second resources and the first resource is equal, then according to any two resources in the second resources Perform resource allocation with the resource gravitational direction value between the first resource, including:
    统计所述第二资源中的任意两个资源与所述第一资源之间的第一引力方向值;Counting the first gravitational direction value between any two resources in the second resource and the first resource;
    将所述第一引力方向值与上一时间段的第二引力方向值做差值,确定差异结果;Making a difference between the first gravitational direction value and the second gravitational direction value of the previous time period to determine the difference result;
    若所述差异结果为负,则所述任意两个资源中的至少一个资源与所述第一资源之间的引力方向为负向;If the difference result is negative, the gravitational direction between at least one of the any two resources and the first resource is negative;
    若所述差异结果为正,则所述任意两个资源中的至少一个资源与所述第一资源之间的引力方向为正向;If the difference result is positive, the gravitational direction between at least one of the two resources and the first resource is positive;
    根据所述正向引力或负向引力,确定所述第二资源中任意两个资源的资源分配。According to the positive gravitational force or the negative gravitational force, resource allocation of any two resources in the second resources is determined.
  9. 根据权利要求8所述的方法,其中,所述根据所述正向引力或负向引力,确定所述第二资源中任意两个资源的资源分配,包括:The method according to claim 8, wherein said determining the resource allocation of any two resources in the second resources according to the positive gravitational force or the negative gravitational force comprises:
    若所述引力方向为正向,则分配给所述任意两个资源中至少一个资源的分配量与所述第一资源的分配量成正比;If the gravitational direction is positive, the allocation amount allocated to at least one of the any two resources is proportional to the allocation amount of the first resource;
    若所述引力方向为负向引力,则分配给所述任意资源中至少一个资源的分配量与所述第一资源的分配量成反比;If the direction of gravitational force is negative gravitational force, the allocation amount allocated to at least one of the arbitrary resources is inversely proportional to the allocation amount of the first resource;
    若所述任意两个资源的引力方向均为正向引力或负向引力,则根据所述第一引力方向值与上一时间段的第二引力方向值之间的差值进行资源分配。If the gravity directions of any two resources are both positive gravity or negative gravity, resource allocation is performed according to the difference between the first value of the gravity direction and the second value of the previous time period.
  10. 根据权利要求9所述的方法,其中,所述若所述任意两个资源的引力方向都为正向引力或负向引力,则根据所述第一引力方向值与上一时间段的第二引力方向值之间的差值进行资源分配,包括:The method according to claim 9, wherein if the gravitational directions of any two resources are positive or negative, then according to the value of the first gravitational direction and the second value of the previous time period The difference between the gravitational direction values is used for resource allocation, including:
    若所述任意两个资源的引力方向为正向引力,则分配给所述任意两个资源中的至少一个资源的分配量与所述差值成正比;If the gravitational direction of the any two resources is positive gravitational force, the allocation amount allocated to at least one of the any two resources is proportional to the difference;
    若所述任意两个资源的引力方向为负向引力,则分配给所述任意两个资源中的至少一个资源的分配量与所述差值成反比。If the gravitational direction of any two resources is negative gravitational force, the allocation amount allocated to at least one of the any two resources is inversely proportional to the difference.
  11. 一种资源分配装置,其中,所述资源分配装置包括统计部分、确定部分和分配部分;其中,A resource allocation device, wherein the resource allocation device includes a statistics part, a determination part and an allocation part; wherein,
    所述统计部分,被配置为统计使用对象使用的至少一个资源的消耗值;The statistical part is configured to count the consumption value of at least one resource used by the usage object;
    所述确定部分,被配置为通过所述至少一个资源中每个资源的消耗值,确定每个资源的资源热度值;其中,资源热度值表征资源被依消耗的程度;The determining part is configured to determine the resource heat value of each resource through the consumption value of each resource in the at least one resource; wherein, the resource heat value represents the degree of resource consumption;
    所述确定部分,还被配置为根据所述每个资源的资源热度值,确定两两资源之间的资源引力值和引力方向值;The determination part is further configured to determine the resource gravity value and the gravity direction value between any two resources according to the resource heat value of each resource;
    所述分配部分,被配置为根据所述每个资源的资源热度值、所述两两资源之间的资源引力值和引力方向值进行资源动态分配。The allocation part is configured to dynamically allocate resources according to the resource popularity value of each resource, the resource gravity value and the gravity direction value between the two resources.
  12. 一种资源分配装置,其中,所述资源分配装置包括:A resource allocation device, wherein the resource allocation device includes:
    存储器,被配置为存储可执行数据指令;memory configured to store executable data instructions;
    处理器,被配置为执行所述存储器中存储的可执行指令时,实现权利要求1至10任一项所述的方法。The processor is configured to implement the method according to any one of claims 1 to 10 when executing the executable instructions stored in the memory.
  13. 一种计算机可读存储介质,其中,存储有可执行指令,用于引起处理器执行时,实现权利要求1至10任一项所述的方法。A computer-readable storage medium, wherein executable instructions are stored for causing a processor to implement the method according to any one of claims 1 to 10.
PCT/CN2022/118108 2021-10-22 2022-09-09 Method and apparatus for resource allocation, and computer-readable storage medium WO2023065882A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111235925.0 2021-10-22
CN202111235925.0A CN116010075A (en) 2021-10-22 2021-10-22 Resource allocation method and device and computer readable storage medium

Publications (2)

Publication Number Publication Date
WO2023065882A1 true WO2023065882A1 (en) 2023-04-27
WO2023065882A9 WO2023065882A9 (en) 2023-06-01

Family

ID=86017924

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/118108 WO2023065882A1 (en) 2021-10-22 2022-09-09 Method and apparatus for resource allocation, and computer-readable storage medium

Country Status (2)

Country Link
CN (1) CN116010075A (en)
WO (1) WO2023065882A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9367355B1 (en) * 2015-01-28 2016-06-14 Yahoo!, Inc. Resource utilization by one or more tasks
US20180097702A1 (en) * 2016-09-30 2018-04-05 Salesforce.Com, Inc. Techniques and architectures for efficient allocation of under-utilized resources
CN110362400A (en) * 2019-06-17 2019-10-22 中国平安人寿保险股份有限公司 Distribution method, device, equipment and the storage medium of caching resource
CN111435317A (en) * 2019-01-14 2020-07-21 阿里巴巴集团控股有限公司 Data processing method, computing device and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9367355B1 (en) * 2015-01-28 2016-06-14 Yahoo!, Inc. Resource utilization by one or more tasks
US20180097702A1 (en) * 2016-09-30 2018-04-05 Salesforce.Com, Inc. Techniques and architectures for efficient allocation of under-utilized resources
CN111435317A (en) * 2019-01-14 2020-07-21 阿里巴巴集团控股有限公司 Data processing method, computing device and storage medium
CN110362400A (en) * 2019-06-17 2019-10-22 中国平安人寿保险股份有限公司 Distribution method, device, equipment and the storage medium of caching resource

Also Published As

Publication number Publication date
CN116010075A (en) 2023-04-25
WO2023065882A9 (en) 2023-06-01

Similar Documents

Publication Publication Date Title
CN109783224B (en) Task allocation method and device based on load allocation and terminal equipment
CN104038540B (en) Method and system for automatically selecting application proxy server
US20150381453A1 (en) Integrated global resource allocation and load balancing
US8024737B2 (en) Method and a system that enables the calculation of resource requirements for a composite application
WO2021136137A1 (en) Resource scheduling method and apparatus, and related device
US20120158858A1 (en) Resource Optimization for Online Services
CN110365765A (en) A kind of bandwidth scheduling method and device of cache server
KR101471749B1 (en) Virtual machine allcoation of cloud service for fuzzy logic driven virtual machine resource evaluation apparatus and method
CN104954277A (en) Load balancing method, gateway server and related system
Zaheilas et al. {Real-Time} Scheduling of Skewed {MapReduce} Jobs in Heterogeneous Environments
US20070162629A1 (en) Method of assigning objects to processing units
CN113157443A (en) Resource balanced scheduling method based on edge computing environment
US20130166751A1 (en) Distributed resource management systems and methods for resource management thereof
WO2023065882A1 (en) Method and apparatus for resource allocation, and computer-readable storage medium
CN109062683A (en) The method, apparatus and computer readable storage medium of host resource distribution
CN110069319B (en) Multi-target virtual machine scheduling method and system for cloud resource management
CN108200185B (en) Method and device for realizing load balance
US11442632B2 (en) Rebalancing of user accounts among partitions of a storage service
CN116546028A (en) Service request processing method and device, storage medium and electronic equipment
CN115842828A (en) Gateway load balancing control method, device, equipment and readable storage medium
CN114330879B (en) Order distribution method and system of multi-dimensional constraint
CN112866358B (en) Method, system and device for rescheduling service of Internet of things
CN111796934B (en) Task issuing method and device, storage medium and electronic equipment
Lu et al. NPIY: A novel partitioner for improving mapreduce performance
CN108650121B (en) Comprehensive scoring and distributing method for multiple attribute Web service demand and provider

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22882496

Country of ref document: EP

Kind code of ref document: A1