CN106959894B - Resource allocation method and device - Google Patents

Resource allocation method and device Download PDF

Info

Publication number
CN106959894B
CN106959894B CN201610016268.3A CN201610016268A CN106959894B CN 106959894 B CN106959894 B CN 106959894B CN 201610016268 A CN201610016268 A CN 201610016268A CN 106959894 B CN106959894 B CN 106959894B
Authority
CN
China
Prior art keywords
server cluster
parameter
resource allocation
servers
denotes
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610016268.3A
Other languages
Chinese (zh)
Other versions
CN106959894A (en
Inventor
白贤锋
葛胜利
赵鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201610016268.3A priority Critical patent/CN106959894B/en
Publication of CN106959894A publication Critical patent/CN106959894A/en
Application granted granted Critical
Publication of CN106959894B publication Critical patent/CN106959894B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

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

Abstract

The application discloses a resource allocation method and device. One embodiment of the method comprises: receiving a resource allocation request, wherein the resource allocation request comprises an application quantity parameter indicating the number of servers applied by a server cluster; respectively acquiring the utilization rate parameter of the hardware resource of each server cluster; and determining the number of the servers to be allocated to each server cluster based on the application quantity parameters and the score parameters corresponding to the utilization rate parameters, and allocating the determined number of the servers to each server cluster respectively. The method and the device realize that the number of the servers allocated to the server cluster is determined by combining the number of the servers applied by the server cluster with the actual situation of the hardware resources of the server cluster in the process of allocating the servers to the server cluster. On one hand, flexibility of distributing the servers to the server cluster is enhanced, and on the other hand, distribution accuracy is improved.

Description

Resource allocation method and device
Technical Field
The present application relates to the field of computers, and in particular, to the field of big data processing technologies, and in particular, to a method and an apparatus for resource allocation.
Background
Data marts are storage solutions that are widely used in big data processing technology. A data mart may be utilized to store a large amount of historical data for analysis of the historical data. With the increase of data to be stored, the data mart needs to be expanded, and accordingly, a server needs to be allocated to a server cluster running the data mart to ensure that the server cluster has enough resources to run the expanded data mart. At present, the commonly adopted allocation method is as follows: the number of servers currently allocated to each server cluster is predicted from the number of servers allocated to each server cluster in the past.
The disadvantages of the prior art are shown in: on the one hand, the number of servers assigned to the respective server cluster cannot be adjusted in real time, resulting in poor flexibility. On the other hand, only the number of servers that have been allocated to each server cluster in the past is considered in the allocation, and the actual use of hardware resources of the servers in each server cluster is not considered, so that the allocation accuracy is low.
Disclosure of Invention
The present application provides a resource allocation method and apparatus, which are used to solve the technical problems in the background art section.
In a first aspect, the present application provides a resource allocation method, including: receiving a resource allocation request, wherein the resource allocation request is generated based on capacity expansion of a data mart running on a server cluster, and the resource allocation request comprises an application quantity parameter indicating the number of servers applied by the server cluster; respectively acquiring a utilization rate parameter of the hardware resource of each server cluster, wherein the utilization rate parameter is the ratio of the hardware resource used by the server cluster to the hardware resource allocated to the server cluster; and determining the number of servers to be allocated to each server cluster based on the application quantity parameter and the score parameter corresponding to the utilization rate parameter, and allocating the determined number of servers to each server cluster respectively, wherein the score parameter indicates the emergency degree of the server cluster needing to be allocated to a new server to operate the expanded data mart.
In a second aspect, the present application provides an apparatus for resource allocation, the apparatus comprising: the system comprises a receiving unit and a processing unit, wherein the receiving unit is configured to receive a resource allocation request, the resource allocation request is generated based on capacity expansion of a data mart running on a server cluster, and the resource allocation request comprises an application quantity parameter indicating the number of servers applied by the server cluster; the acquisition unit is configured to respectively acquire a utilization rate parameter of the hardware resource of each server cluster, wherein the utilization rate parameter is the ratio of the hardware resource used by the server cluster to the hardware resource allocated to the server cluster; and the determining unit is configured to determine the number of servers to be allocated to each server cluster based on the application quantity parameter and the score parameter corresponding to the utilization rate parameter, and allocate the determined number of servers to each server cluster respectively, wherein the score parameter indicates the emergency degree of the server cluster needing to be allocated to a new server to operate the expanded data mart.
According to the resource allocation method and device, the resource allocation request is received, and the resource allocation request comprises an application amount parameter indicating the number of the servers applied by the server cluster; respectively acquiring the utilization rate parameter of the hardware resource of each server cluster; and determining the number of the servers to be allocated to each server cluster based on the application quantity parameters and the score parameters corresponding to the utilization rate parameters, and allocating the determined number of the servers to each server cluster respectively. The method and the device realize that the number of the servers allocated to the server cluster is determined by combining the number of the servers applied by the server cluster with the actual situation of the hardware resources of the server cluster in the process of allocating the servers to the server cluster. On one hand, flexibility of distributing the servers to the server cluster is enhanced, and on the other hand, distribution accuracy is improved.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 shows a flow diagram of one embodiment of a resource allocation method according to the present application;
FIG. 3 shows a schematic diagram of a resource allocation rule;
FIG. 4 shows a schematic of a score parameter;
FIG. 5 illustrates an exemplary architecture diagram suitable for use with the resource allocation method of the present application;
FIG. 6 illustrates an exemplary flow chart of a resource allocation method of the present application;
FIG. 7 shows a schematic structural diagram of an embodiment of a resource allocation apparatus according to the present application;
fig. 8 is a schematic structural diagram of a computer system suitable for implementing the terminal device or the server according to the embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 shows an exemplary system architecture 100 to which embodiments of the resource allocation method or resource allocation apparatus of the present application may be applied.
As shown in fig. 1, system architecture 100 includes server clusters 101, 102, 103, network 104 and central server 105. The network 104 serves to provide the medium of transmission links between the server clusters 101, 102, 103 and the central server 105. Network 104 may include various connection types, such as wired, wireless transmission links, or fiber optic cables, among others. The server clusters 101, 102, 103 run different types of data marts. The central server 105 may be used to allocate servers to each server cluster to ensure that the server clusters 101, 102, 103 have sufficient resources to run the expanded data marts.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring to fig. 2, a flow 200 of one embodiment of a resource allocation method according to the present application is shown. It should be noted that the resource allocation method provided in the embodiment of the present application is generally executed by the central server 105 in fig. 1, and accordingly, the resource allocation apparatus is generally disposed in the central server 105. The method comprises the following steps:
step 201, a resource allocation request is received.
In this embodiment, the resource allocation request is generated based on capacity expansion of a data mart running on the server cluster, and the resource allocation request includes an application amount parameter indicating the number of servers (which may also be referred to as machine resources) applied by the server cluster. In this embodiment, each server cluster may run a different type of data mart. When a data mart running on a server cluster is expanded, that is, data in the data mart is increased, the server cluster running the data mart needs more servers to run the expanded data mart. At this point, a resource allocation request may be generated to request allocation of a new server thereto. In addition, in this embodiment, servers may also be allocated to each server cluster in an active manner, that is, servers may be allocated to each server cluster at preset time intervals, and accordingly, an application amount parameter of each server may be first obtained, where the application amount parameter may be set in advance by an operation and maintenance engineer of the server cluster.
Step 202, respectively obtaining the utilization rate parameter of the hardware resource of each server cluster.
In this embodiment, when the number of databases to be allocated to each database cluster needs to be calculated and determined, a usage rate parameter of hardware resources of each server cluster may be first obtained, where the usage rate parameter is a ratio of the hardware resources used by the server cluster to the hardware resources already allocated to the server cluster. Hardware resources may include, but are not limited to: CPU, internal memory, hard disk.
In some optional implementations of this embodiment, after receiving the resource allocation request, the method further includes: judging whether a resource allocation rule exists or not, wherein the resource allocation rule is used for defining the type of hardware resources and preset weighted values corresponding to the application quantity parameters and the utilization rate parameters; if so, analyzing the resource allocation rule to obtain the type and the preset weighted value of the hardware resource; if not, receiving an input configuration instruction, wherein the configuration instruction comprises an identifier of the type of the hardware resource and a preset weighted value; and constructing a resource allocation rule based on the identifier of the type of the hardware resource and a preset weighted value.
In this embodiment, the resource allocation rule is used to define the type of the hardware resource and the preset weighted value corresponding to each of the application quantity parameter and the usage rate parameter. The resource allocation rule may be expressed in the form of: index 1+ index 2+ weight 2+.. + index n. The application amount parameter indicating the number of servers applied by the server cluster and the usage rate parameter of the hardware resource may be referred to as an index. Each index may correspond to a weight, i.e. a weighted value. Taking hardware resources as the memory as an example, the resource allocation rule may include two indexes, one of which is an application amount parameter and the other of which is a usage rate parameter of the memory. Correspondingly, the application quantity parameter and the utilization rate parameter of the memory correspond to a weighted value respectively.
Step 203, determining the number of servers to be allocated to each server cluster based on the application quantity parameter and the score parameter corresponding to the utilization rate parameter, and allocating the determined number of servers to each server cluster respectively.
In this embodiment, the score parameter indicates how urgent a cluster of servers needs to be allocated to a new server to run the expanded data mart. The number of servers to be allocated to each server cluster may be determined based on the application amount parameter and the score parameter corresponding to the usage parameter (e.g., the usage parameter of the memory, the CPU, and the hard disk). Taking a server cluster as an example, when a hardware resource is a memory and a usage parameter is a usage parameter of the memory, an application quantity ratio of a sum of an application quantity parameter and the application quantity parameter of each server cluster and a usage ratio of a sum of a fraction parameter corresponding to the usage parameter of the memory and a fraction parameter corresponding to the usage parameter of the memory of each server cluster can be calculated respectively, then, a quantity value of a half of the quantity of all the server clusters to be allocated is multiplied by the application quantity ratio and the usage ratio respectively to obtain an application quantity and a usage quantity, and the application quantity and the usage quantity are added to obtain a quantity of servers allocated to the server cluster.
In some optional implementations of this embodiment, the hardware resource is a memory; and determining the number of servers to be allocated to each server cluster based on the application quantity parameter and the score parameter corresponding to the utilization rate parameter comprises: respectively determining the score parameters corresponding to the utilization rate parameters of the memories of each server cluster according to the corresponding relation table of the utilization rate parameters and the score parameters of the preset memories; the number of servers to be assigned to each server cluster is calculated separately using the following formula:
MacN ═ MacTotal × C1 × MAn/MAs + MacTotal × C2 × musec N/MUs, where MacN denotes the number of servers to be assigned to the nth server cluster, MacTotal denotes the total number of servers to be assigned to each server cluster, C1 denotes a preset weighting value corresponding to the application amount parameter, MAn denotes the application amount parameter of the nth server cluster, MAs denotes the sum of the application amount parameters of each server cluster, C2 denotes a preset weighting value corresponding to the usage rate parameter of the memory, musec denotes the score parameter of the nth server cluster, and MUs denotes the sum of the score parameters of each server cluster.
In this embodiment, when the two indexes included in the resource allocation rule are usage parameters of the application amount parameter memory, in this embodiment, the application amount parameter of the number of servers applied by the server cluster may be used to indicate a situation of the server applied by the server cluster, and the usage parameter of the memory may be used to indicate an actual usage situation of the memory of the server cluster. Therefore, the number of the servers applied by the server clusters can be combined with the actual situation of the memory resources of the server clusters, and the number of the servers distributed to each server cluster can be determined. For example, in the above formula of calculating the number of servers MacN to be allocated to the nth server cluster, C1 × MAn/MAs may be used to indicate the influence of the number of servers applied by the server cluster during the allocation process on the allocation result, and C2 × musec/MUs may be used to indicate the influence of the use of the memory of the server cluster during the allocation process on the allocation result. In this embodiment, the values of C1 and C2 may be both 0.5.
In this embodiment, the score parameter corresponding to the usage parameter of the memory of each server cluster may be determined according to the correspondence table between the usage parameter of the preset memory and the score parameter. The score parameter may be equivalent to a preset weighted value corresponding to the usage rate parameter of the memory, and a weight is given to the usage condition of the memory again, so that the score parameter may be used to indicate how close the server cluster needs the server, i.e., the machine resource.
In some optional implementations of the present embodiment, a value of C2 is 0.5 × C3, where C3 is a preset weighted value corresponding to a time period in which the resource allocation request is received.
In this embodiment, the weight of the usage parameter of the memory of the server cluster may be 0.5 × C3. C3 may represent a preset weight value corresponding to a time period during which the resource allocation request is received. For example, C3 may be set to 1.2 when the time period in which the resource allocation request is received is a time period in which the frequency of access to the data marts on the server cluster is high. C3 may be set to 1 when the time period in which the resource allocation request is received is a time period in which the frequency of access to the data marts on the server cluster is normal. C3 may be set to 0.8 when the time period in which the resource allocation request is received is a period in which the frequency of access to the data marts on the server cluster is low.
In this embodiment, the number of servers allocated to each server cluster is determined by combining the number of servers applied by the server cluster with the actual situation of the memory resource of the server cluster, and the determined number of servers may be allocated to each server cluster.
Referring to fig. 3, a schematic diagram of a resource allocation rule is shown.
Fig. 3 shows two indexes of the resource allocation rule, one of the indexes is an application amount parameter indicating the number of servers, i.e., machine resources, applied by the server cluster, and the other index is a memory usage rate parameter indicating the usage of the memory of the server cluster. The weight of the application quantity parameter and the weight of the memory usage rate parameter, namely the weighted value, are both 0.5. For the memory usage parameter, the weight of the memory usage parameter may be weighted again, and accordingly, a weighted value may be set again. For example, when the time period in which the resource allocation request is received is a busy period, the weight value weighted again may be set to 1.2. When the time period in which the resource allocation request is received is idle, the re-weighted weight value may be set to 0.8.
Referring to fig. 4, a diagram of a score parameter is shown.
In fig. 4, the memory usage parameter of each cluster corresponds to a score parameter, where the score parameter is 7 when the memory usage parameter is greater than 80%, the score parameter is 2 when the memory usage parameter is 50% to 80%, the score parameter is 1 when the memory usage parameter is 30% to 50%, and the score parameter is 0 when the memory usage parameter is less than 30%.
Referring to fig. 5, an exemplary architecture diagram of a resource allocation method suitable for use in the present application is shown. In fig. 5, the view layer, the logic layer, and the model layer are shown. The view layer comprises a query page and a rule distribution page. The logic layer comprises a user control interface, a data loading interface and a resource allocation rule interface. The model layer comprises a data warehouse EDW, a distributed computing framework Hadoop and a relational database.
And (3) inquiring a page: the method is used for resource allocation rule selection, allocation result display and allocation result derivation.
Resource rule allocation page: the index is used for displaying the index and the weight in the resource allocation rule, and the index may include an application quantity parameter indicating the application quantity of the server, i.e. the machine resource, and a weighted value of the usage rate parameter of the memory, the CPU, and the hard disk hardware resource, for example, the weight of the application quantity parameter is 0.5, the weight of the usage rate parameter of the memory is 0.2, and the usage rate parameter of the CPU is 0.1. Meanwhile, the method also comprises a score parameter corresponding to the memory utilization rate parameter and a reweighed weight value of the actual use condition of the hardware resource. The indexes and weights can be flexibly adjusted through the resource rule allocation page.
A user control interface: for controlling whether to perform data loading or to generate resource allocation rules. The user may be an operation and maintenance engineer. A console may be provided to receive instructions entered by the operation and maintenance engineer.
A data loading interface: for completing the data loading.
Resource allocation rule interface: and the data distribution module is used for combining the resource use data according to the resource distribution rule to finish distributing the data.
EDW, Hadoop, relational database: providing source data and saving the resource allocation rules and allocation results for subsequent reference.
Referring to fig. 6, an exemplary flowchart of a resource allocation method of the present application is shown. Comprises the following steps:
step 601, obtaining parameters associated with allocating machine resources. The application amount parameter indicating the number of servers, i.e., machine resources, applied by each server cluster and the usage rate parameter of hardware resources (e.g., the usage rate parameter of memory) may be obtained. Then, the obtained parameters are recorded in a data table, which may be referred to as a resource basic information table.
And step 602, configuring indexes and weights. The metrics (e.g., application amount parameters, memory usage parameters) and the weights of the metrics applied during the process of allocating servers may be configured. Can be flexibly adjusted according to the actual situation indexes and the weights.
Step 603, judging whether a resource allocation rule exists. That is, it is determined whether a resource allocation rule defining the index and the weight of the index exists. If no resource allocation rule exists, step 604 is performed, and if a resource allocation rule already exists, step 605 is performed.
Step 604: a new resource allocation rule is generated.
Step 605: the machine resource is invoked for allocation.
Step 606: and generating a machine resource allocation result.
The following describes the differences between the resource allocation method of the present application and the prior art:
in the prior art, the manner of allocating servers is as follows: the number of servers currently allocated to each server cluster is predicted from the number of servers allocated to each server cluster in the past. On the one hand, the number of servers allocated to each server cluster cannot be adjusted in real time, resulting in poor flexibility. On the other hand, only the number of servers that have been allocated to each server cluster in the past is considered in the allocation, and the actual use of hardware resources of the servers in each server cluster is not considered, so that the allocation accuracy is low.
In the application, the number of the servers to be allocated to the server cluster is determined according to the indexes, the weights and the score parameters in the resource allocation rule, namely the number of the servers applied by the server cluster is combined with the actual situation of the memory resources of the server cluster, the number of the servers allocated to each server cluster is determined, and the accuracy of allocation of the server, namely the machine resources, is improved. Meanwhile, parameters and weights in the resource allocation rule can be adjusted in real time, so that the flexibility of machine resource allocation is enhanced. In addition, the current resource allocation rule and the allocation result can be checked in real time, so that maintenance and subsequent rule expansion can be checked conveniently, and convenience is further improved.
With further reference to fig. 7, as an implementation of the method shown in the above figures, the present application provides an embodiment of a resource allocation apparatus, which corresponds to the embodiment of the method shown in fig. 2, and which can be applied in various electronic devices.
As shown in fig. 7, the resource allocation apparatus 700 of the present embodiment includes: a receiving unit 701, an acquiring unit 702, and a determining unit 703. The receiving unit 701 is configured to receive a resource allocation request, where the resource allocation request is generated based on capacity expansion of a data mart running on a server cluster, and the resource allocation request includes an application amount parameter indicating the number of servers applied by the server cluster; the obtaining unit 702 is configured to obtain a usage rate parameter of the hardware resource of each server cluster, where the usage rate parameter is a ratio of the hardware resource used by the server cluster to the hardware resource allocated to the server cluster; the determining unit 703 is configured to determine, based on the application amount parameter and the score parameter corresponding to the usage rate parameter, the number of servers to be allocated to each server cluster, and allocate the determined number of servers to each server cluster respectively, where the score parameter indicates the emergency degree of the server cluster that needs to be allocated to a new server to operate the expanded data mart.
In this embodiment, the receiving unit 701 may receive a resource allocation request. The resource allocation request is generated based on capacity expansion of a data mart running on the server cluster, and the resource allocation request comprises an application quantity parameter indicating the number of servers (also called machine resources) applied by the server cluster. In this embodiment, each server cluster may run a different type of data mart. When a data mart running on a server cluster is expanded, that is, data in the data mart is increased, the server cluster running the data mart needs more servers to run the expanded data mart. At this point, a resource allocation request may be generated to request allocation of a new server thereto.
In this embodiment, the obtaining unit 702 may first obtain a utilization rate parameter of the hardware resource of each server cluster when it is required to calculate and determine the number of databases to be allocated to each database cluster, where the utilization rate parameter is a ratio of the hardware resource used by the server cluster to the hardware resource already allocated to the server cluster. Hardware resources may include, but are not limited to: CPU, internal memory, hard disk.
In this embodiment, the determining unit 703 may determine the number of servers to be allocated to each server cluster based on a score parameter corresponding to the application amount parameter and the usage rate parameter (e.g., a usage rate parameter of a memory, a CPU, or a hard disk).
In some optional implementations of this embodiment, the determining unit 703 includes: a score parameter determining subunit (not shown) configured to, when the hardware resource is a memory, respectively determine, according to a correspondence table between a preset usage rate parameter of the memory and a score parameter, a score parameter corresponding to the usage rate parameter of the memory of each server cluster; a computing subunit (not shown) configured to calculate the number of servers to be allocated to each server cluster, respectively, using the following formula: MacN ═ MacTotal × C1 × MAn/MAs + MacTotal × C2 × musec N/MUs, where MacN denotes the number of servers to be assigned to the nth server cluster, MacTotal denotes the total number of servers to be assigned to each server cluster, C1 denotes a preset weighting value corresponding to the application amount parameter, MAn denotes the application amount parameter of the nth server cluster, MAs denotes the sum of the application amount parameters of each server cluster, C2 denotes a preset weighting value corresponding to the usage rate parameter of the memory, musec denotes the score parameter of the nth server cluster, and MUs denotes the sum of the score parameters of each server cluster.
In some optional implementations of this embodiment, the values of C1 and C2 are both 0.5.
In some optional implementations of the embodiment, a value of C1 is 0.5, and a value of C2 is 0.5 × C3, where C3 is a preset weighting value corresponding to a time period in which the resource allocation request is received.
In some optional implementations of this embodiment, the apparatus 700 further includes: a determining unit (not shown) configured to determine whether a resource allocation rule exists after receiving the resource allocation request, where the resource allocation rule is used to define a type of the hardware resource and preset weighted values corresponding to the application quantity parameter and the usage rate parameter; an analyzing unit (not shown) configured to analyze the resource allocation rule to obtain a type and a preset weighted value of the hardware resource when the resource allocation rule exists; an instruction receiving unit (not shown) configured to receive an input configuration instruction when there is no resource allocation rule, where the configuration instruction includes an identifier of a type of the hardware resource and a preset weight value; and a construction unit (not shown) configured to construct the resource allocation rule based on the identification of the type of the hardware resource and the preset weighting value.
Those skilled in the art will appreciate that the apparatus 700 described above also includes some other well-known structures, such as processors, memories, etc., which are not shown in fig. 7 in order to not unnecessarily obscure embodiments of the present disclosure.
Fig. 8 shows a schematic structural diagram of a computer system suitable for implementing the terminal device or the server according to the embodiment of the present application.
As shown in fig. 8, the computer system 800 includes a Central Processing Unit (CPU)801 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)802 or a program loaded from a storage section 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data necessary for the operation of the system 800 are also stored. The CPU 801, ROM 802, and RAM 803 are connected to each other via a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
The following components are connected to the I/O interface 805: an input portion 806 including a keyboard, a mouse, and the like; an output section 807 including a signal such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 808 including a hard disk and the like; and a communication section 809 including a network interface card such as a LAN card, a modem, or the like. The communication section 809 performs communication processing via a network such as the internet. A drive 810 is also connected to the I/O interface 805 as necessary. A removable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 810 as necessary, so that a computer program read out therefrom is mounted on the storage section 808 as necessary.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 809 and/or installed from the removable medium 811.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
As another aspect, the present application also provides a non-volatile computer storage medium, which may be the non-volatile computer storage medium included in the apparatus in the above-described embodiments; or it may be a non-volatile computer storage medium that exists separately and is not incorporated into the terminal. The non-transitory computer storage medium stores one or more programs that, when executed by a device, cause the device to: receiving a resource allocation request, wherein the resource allocation request is generated based on capacity expansion of a data mart running on a server cluster, and the resource allocation request comprises an application quantity parameter indicating the number of servers applied by the server cluster; respectively acquiring a utilization rate parameter of the hardware resource of each server cluster, wherein the utilization rate parameter is the ratio of the hardware resource used by the server cluster to the hardware resource allocated to the server cluster; and determining the number of the servers to be distributed to each server cluster based on the application quantity parameter and the score parameter corresponding to the utilization rate parameter, and distributing the determined number of the servers to each server cluster respectively, wherein the score parameter indicates the emergency degree of the server cluster needing to be distributed to a new server to operate the expanded data mart.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by a person skilled in the art that the scope of the invention as referred to in the present application is not limited to the embodiments with a specific combination of the above-mentioned features, but also covers other embodiments with any combination of the above-mentioned features or their equivalents without departing from the inventive concept. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (10)

1. A method for resource allocation, the method comprising:
receiving a resource allocation request, wherein the resource allocation request is generated based on capacity expansion of a data mart running on a server cluster, and the resource allocation request comprises an application quantity parameter indicating the number of servers applied by the server cluster;
respectively acquiring a utilization rate parameter of the hardware resource of each server cluster, wherein the utilization rate parameter is the ratio of the hardware resource used by the server cluster to the hardware resource allocated to the server cluster;
respectively determining a score parameter corresponding to the utilization rate parameter of the hardware resource of each server cluster according to a preset corresponding relation table of the utilization rate parameter and the score parameter, wherein the score parameter indicates the emergency degree of the server cluster needing to be distributed to a new server to operate the expanded data mart;
based on the application quantity parameter and the score parameter corresponding to the utilization rate parameter, respectively calculating the number of the servers to be allocated to each server cluster by adopting the following formula, and respectively allocating the determined number of the servers to each server cluster: MacN ═ MacTotal × C1 × MAn/MAs + MacTotal × C2 × musec/MUs, where MacN denotes the number of servers to be assigned to the nth server cluster, MacTotal denotes the total number of servers to be assigned to each server cluster, C1 denotes a preset weighting value corresponding to the application quantity parameter, MAn denotes the application quantity parameter of the nth server cluster, MAs denotes the sum of the application quantity parameters of each server cluster, C2 denotes a preset weighting value corresponding to the usage rate parameter, musec denotes the score parameter of the nth server cluster, and MUs denotes the sum of the score parameters of each server cluster.
2. The method of claim 1, wherein the hardware resource is a memory.
3. The method of claim 2, wherein the values of C1 and C2 are both 0.5.
4. The method of claim 2, wherein the value of C1 is 0.5, and the value of C2 is 0.5 × C3, wherein C3 is a preset weighting value corresponding to a time period in which the resource allocation request is received.
5. The method according to one of claims 1 to 4, wherein after receiving a resource allocation request, the method further comprises:
judging whether a resource allocation rule exists or not, wherein the resource allocation rule is used for defining the type of hardware resources and preset weighted values corresponding to the application quantity parameters and the utilization rate parameters;
if so, analyzing a resource allocation rule to obtain the type of the hardware resource and the preset weighted value;
if not, receiving an input configuration instruction, wherein the configuration instruction comprises an identifier of the type of the hardware resource and the preset weighted value;
and constructing a resource allocation rule based on the identifier of the type of the hardware resource and the preset weighted value.
6. An apparatus for resource allocation, the apparatus comprising:
the system comprises a receiving unit and a processing unit, wherein the receiving unit is configured to receive a resource allocation request, the resource allocation request is generated based on capacity expansion of a data mart running on a server cluster, and the resource allocation request comprises an application quantity parameter indicating the number of servers applied by the server cluster;
the acquisition unit is configured to respectively acquire a utilization rate parameter of the hardware resource of each server cluster, wherein the utilization rate parameter is the ratio of the hardware resource used by the server cluster to the hardware resource allocated to the server cluster;
respectively determining a score parameter corresponding to the utilization rate parameter of the hardware resource of each server cluster according to a preset corresponding relation table of the utilization rate parameter and the score parameter, wherein the score parameter indicates the emergency degree of the server cluster needing to be distributed to a new server to operate the expanded data mart;
the determining unit is configured to calculate the number of servers to be allocated to each server cluster by adopting the following formula based on the application quantity parameter and the score parameter corresponding to the utilization rate parameter, and allocate the determined number of servers to each server cluster respectively:
MacN ═ MacTotal × C1 × MAn/MAs + MacTotal × C2 × musec/MUs, where MacN denotes the number of servers to be assigned to the nth server cluster, MacTotal denotes the total number of servers to be assigned to each server cluster, C1 denotes a preset weighting value corresponding to the application quantity parameter, MAn denotes the application quantity parameter of the nth server cluster, MAs denotes the sum of the application quantity parameters of each server cluster, C2 denotes a preset weighting value corresponding to the usage rate parameter, musec denotes the score parameter of the nth server cluster, and MUs denotes the sum of the score parameters of each server cluster.
7. The apparatus of claim 6, wherein the hardware resource is a memory.
8. The device of claim 7, wherein the values of C1 and C2 are both 0.5.
9. The apparatus of claim 7, wherein the value of C1 is 0.5, and the value of C2 is 0.5 × C3, wherein C3 is a preset weighting value corresponding to a time period in which the resource allocation request is received.
10. The apparatus according to any one of claims 6-9, wherein the apparatus further comprises:
the device comprises a judging unit and a judging unit, wherein the judging unit is configured to judge whether a resource allocation rule exists after receiving a resource allocation request, and the resource allocation rule is used for defining the type of hardware resources and preset weighted values corresponding to an application quantity parameter and a utilization rate parameter;
the analysis unit is configured to analyze the resource allocation rule to obtain the type of the hardware resource and the preset weighted value when the resource allocation rule exists;
the instruction receiving unit is configured to receive an input configuration instruction when no resource allocation rule exists, wherein the configuration instruction comprises an identifier of a type of a hardware resource and the preset weighted value;
and the construction unit is configured to construct a resource allocation rule based on the identifier of the type of the hardware resource and the preset weighted value.
CN201610016268.3A 2016-01-11 2016-01-11 Resource allocation method and device Active CN106959894B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610016268.3A CN106959894B (en) 2016-01-11 2016-01-11 Resource allocation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610016268.3A CN106959894B (en) 2016-01-11 2016-01-11 Resource allocation method and device

Publications (2)

Publication Number Publication Date
CN106959894A CN106959894A (en) 2017-07-18
CN106959894B true CN106959894B (en) 2020-11-24

Family

ID=59480636

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610016268.3A Active CN106959894B (en) 2016-01-11 2016-01-11 Resource allocation method and device

Country Status (1)

Country Link
CN (1) CN106959894B (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107707612B (en) * 2017-08-10 2020-11-13 北京奇艺世纪科技有限公司 Method and device for evaluating resource utilization rate of load balancing cluster
CN109981699A (en) * 2017-12-27 2019-07-05 中国移动通信集团云南有限公司 A kind of resource allocation methods of cloud computing system, device and cloud computing system
CN109324802B (en) * 2018-09-29 2022-11-01 北京百度网讯科技有限公司 Method and device for configuring server
CN109617738B (en) * 2018-12-28 2022-05-31 优刻得科技股份有限公司 Method, system and non-volatile storage medium for user service scaling
CN110138732B (en) * 2019-04-03 2022-03-29 平安科技(深圳)有限公司 Access request response method, device, equipment and storage medium
CN111090516B (en) * 2019-11-25 2023-03-31 支付宝(杭州)信息技术有限公司 Request distribution method, device and equipment
CN110932935A (en) * 2019-11-26 2020-03-27 深圳前海微众银行股份有限公司 Resource control method, device, equipment and computer storage medium
CN111431996B (en) * 2020-03-20 2022-08-09 北京百度网讯科技有限公司 Method, apparatus, device and medium for resource configuration
CN111597036A (en) * 2020-04-15 2020-08-28 中国人民财产保险股份有限公司 Server resource configuration method and device
CN111669294B (en) * 2020-06-22 2023-06-30 南方电网数字电网研究院有限公司 Monitoring system configuration method, device, monitoring system and storage medium
CN113010315A (en) * 2021-03-18 2021-06-22 中国邮政储蓄银行股份有限公司 Resource allocation method, resource allocation device and computer-readable storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US280441A (en) * 1883-07-03 bennett
CN103117959A (en) * 2013-01-17 2013-05-22 中国联合网络通信集团有限公司 Resource redistribution method and information collection device and resource management device
CN103248659A (en) * 2012-02-13 2013-08-14 北京华胜天成科技股份有限公司 Method and system for dispatching cloud computed resources
CN104063265A (en) * 2014-07-04 2014-09-24 云南电网公司 Method for comprehensively evaluating virtual resources
WO2015101419A1 (en) * 2014-01-02 2015-07-09 Sky Atlas Iletisim Sanayi Ve Ticaret Anonim Sirketi Method and system for allocating resources to resource consumers in a cloud computing environment
CN104836850A (en) * 2015-04-16 2015-08-12 华为技术有限公司 Instance node management method and management equipment
CN104834569A (en) * 2015-05-11 2015-08-12 北京京东尚科信息技术有限公司 Cluster resource scheduling method and cluster resource scheduling system based on application types

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9401835B2 (en) * 2013-03-15 2016-07-26 International Business Machines Corporation Data integration on retargetable engines in a networked environment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US280441A (en) * 1883-07-03 bennett
CN103248659A (en) * 2012-02-13 2013-08-14 北京华胜天成科技股份有限公司 Method and system for dispatching cloud computed resources
CN103117959A (en) * 2013-01-17 2013-05-22 中国联合网络通信集团有限公司 Resource redistribution method and information collection device and resource management device
WO2015101419A1 (en) * 2014-01-02 2015-07-09 Sky Atlas Iletisim Sanayi Ve Ticaret Anonim Sirketi Method and system for allocating resources to resource consumers in a cloud computing environment
CN104063265A (en) * 2014-07-04 2014-09-24 云南电网公司 Method for comprehensively evaluating virtual resources
CN104836850A (en) * 2015-04-16 2015-08-12 华为技术有限公司 Instance node management method and management equipment
CN104834569A (en) * 2015-05-11 2015-08-12 北京京东尚科信息技术有限公司 Cluster resource scheduling method and cluster resource scheduling system based on application types

Also Published As

Publication number Publication date
CN106959894A (en) 2017-07-18

Similar Documents

Publication Publication Date Title
CN106959894B (en) Resource allocation method and device
CN109408205B (en) Task scheduling method and device based on hadoop cluster
US10783002B1 (en) Cost determination of a service call
US20190155655A1 (en) Resource allocation method and resource manager
US20070250629A1 (en) Method and a system that enables the calculation of resource requirements for a composite application
CN110321214A (en) A kind of data query method, device and equipment
CN111143143B (en) Performance test method and device
CN108804383B (en) Support point parallel enumeration method and device based on measurement space
CN111143039B (en) Scheduling method and device of virtual machine and computer storage medium
CN115033340A (en) Host selection method and related device
CN109144846B (en) Test method and device for testing server
CN105511914B (en) Using update method, device and system
CN110245014B (en) Data processing method and device
CN111008767B (en) Internet financial technology architecture evaluation method, device, electronic equipment and medium
US9501321B1 (en) Weighted service requests throttling
CN109347982A (en) A kind of dispatching method and device of data center
JP2009037369A (en) Resource assignment method to database server
US20140214826A1 (en) Ranking method and system
CN109842665B (en) Task processing method and device for task allocation server
CN109783236A (en) Method and apparatus for output information
CN111694670B (en) Resource allocation method, apparatus, device and computer readable medium
CN111694672B (en) Resource allocation method, task submission method, device, electronic equipment and medium
CN114676272A (en) Information processing method, device and equipment of multimedia resource and storage medium
CN114090247A (en) Method, device, equipment and storage medium for processing data
CN115344359A (en) Computing power resource allocation method, device, computer readable storage medium and equipment

Legal Events

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