CN108289086B - Request processing method and device and server - Google Patents

Request processing method and device and server Download PDF

Info

Publication number
CN108289086B
CN108289086B CN201710018769.XA CN201710018769A CN108289086B CN 108289086 B CN108289086 B CN 108289086B CN 201710018769 A CN201710018769 A CN 201710018769A CN 108289086 B CN108289086 B CN 108289086B
Authority
CN
China
Prior art keywords
resource
cluster
request
factor
tree structure
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
CN201710018769.XA
Other languages
Chinese (zh)
Other versions
CN108289086A (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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201710018769.XA priority Critical patent/CN108289086B/en
Publication of CN108289086A publication Critical patent/CN108289086A/en
Application granted granted Critical
Publication of CN108289086B publication Critical patent/CN108289086B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The embodiment of the scheme provides a request processing method and device and a server. On one hand, the embodiment of the scheme collects the resource information of the common attribute resources and the resource information of the non-common attribute resources of the designated cluster by responding to the designated request of the client; according to the acquired resource information, response information of a specified request is determined, when the server receives the request of the client, the server determines the response information of the request based on all attribute resources of each cluster, and other resources which are not common attribute resources are also used as factors for determining the response information, so that the processing accuracy of the server for the request is improved, the application range is expanded, the applicability is enhanced, and the problems of low processing accuracy, small application range and poor applicability of the server for the request in the prior art are solved.

Description

Request processing method and device and server
[ technical field ] A method for producing a semiconductor device
The scheme relates to the technical field of databases, in particular to a request processing method and device and a server.
[ background of the invention ]
With the continuous development of cloud computing, the production scheduling management of cloud servers (ECS) is gradually expanding from a single cluster to multiple clusters (cluster) and multiple regions (region). Because the set-up period, usage, and virtualization techniques of clusters differ, inherent differences in hardware and software resources between clusters are difficult to avoid.
Hardware differences: there are physical attribute differences in computing, storage and network aspects among clusters. The calculation difference comprises that the CPU main frequency and the chip architecture of the cluster entity machine are different. The storage difference comprises different cluster storage media and different transmission modes of the stored data. The network difference includes different network access modes, different transmission media, different processing capabilities of network cards, and the like.
Software differences: different computing virtualization technologies, memory virtualization technologies, network virtualization technologies, storage virtualization technologies and the like exist in cloud servers in a cluster. Different technologies have different performances in performance, stability and usability, so that the performance of the cloud server is different.
In addition, the remaining available resources of the cluster are changed dynamically with the production and resource release processes of the hardware resources of the cluster, and factor data for measuring the production capacity of the cluster are also changed dynamically.
In the process of realizing the scheme, a scheme person finds that at least the following problems exist in the prior art:
currently, in the prior art, when a server receives a request from a client, the server determines response information of the request based on common attribute resources (for example, Virtual CPU (VCPU) resources, memory resources, public network IP resources, and the like) between clusters, and does not serve as a factor for determining the response information for other resources that are not the common attribute resources, such as disk types and resources of network bandwidths. This results in low processing accuracy, small applicability, and poor applicability of the server to the request.
For example, the numbers of the memory, the virtual CPU, the public network IP, and the private network IP of the cluster a are shown in table 1.
TABLE 1 resource situation example Table for Cluster A
Figure BDA0001206762990000021
According to the prior art, if the residual resource of any one of the resources of the memory, the virtual CPU and the public network IP is smaller than the resource threshold value, the cluster is closed, and the cloud server selling cannot be carried out externally. As can be seen from table 1, it is,
in the cluster a, the number of the remaining resources of the public network IP of the cluster a is 80, which is smaller than the resource threshold value 100, so that the cluster a is closed, and the cluster management server does not schedule the cluster a to produce the cloud server.
Assuming that the resource combination of the production request is 5G memory, 8 computing cores and 2 private network IPs, the cluster a shown in table 1 is completely capable of producing the cloud server formed by such resource combination, because although the remaining resources of the public network IP in the cluster a are lower than the resource threshold value thereof, the produced cloud server does not need the resources of the public network IP, but the cluster a cannot be scheduled to produce the cloud server because the shortage of the public network IP is closed.
[ summary of the invention ]
In view of this, embodiments of the present disclosure provide a request processing method and apparatus, and a server, so as to solve the problems of low processing accuracy, small application range, and poor applicability of the server to a request in the prior art.
In a first aspect, an embodiment of the present disclosure provides a request processing method, which is applied to a server managing at least one cluster system, where the method includes:
responding to a specified request of a client, and collecting resource information of shared attribute resources and resource information of non-shared attribute resources of a specified cluster;
and determining response information of the specified request according to the collected resource information.
The foregoing aspect and any possible implementation manner further provide an implementation manner, where determining response information of the specific request according to the collected resource information includes:
determining available resources of each resource factor of the designated cluster according to the acquired resource information;
obtaining respective matching factors of each resource factor according to the available resources of each resource factor;
establishing a tree structure based on the respective matching factor of each resource factor;
determining response information of the specified request based on the tree structure.
The above-mentioned aspect and any possible implementation manner further provide an implementation manner, where obtaining the respective matching factor of each resource factor according to the available resource of each resource factor includes:
and obtaining the respective matching factor of each resource factor according to the available resource of each resource factor and the respective resource threshold of each resource factor.
As for the above-mentioned aspect and any possible implementation manner, further providing an implementation manner, where obtaining the respective matching factor of each resource factor according to the available resource of each resource factor and the respective resource threshold of each resource factor includes:
and obtaining the respective matching factor of each resource factor according to the difference value of the available resource of each resource factor and the respective resource threshold of each resource factor.
The above-mentioned aspects and any possible implementation manners further provide an implementation manner, and the building a tree structure based on the respective matching factor of each resource factor includes:
normalizing the matching factor of each resource factor;
and establishing the tree structure based on the normalization processing result.
The above aspects and any possible implementation manners further provide an implementation manner, where the specified request is a cloud server production scheduling request;
determining response information of the specified request based on the tree structure, including:
reading the business rules from a specified database through a specified interface;
extracting nodes of related resources from the tree structure according to the specified request and the read business rule;
establishing a new tree structure according to the extracted nodes and the quantity of the corresponding resources in the specified request;
and generating response information of the cloud server production scheduling request according to the new tree structure.
The above aspect and any possible implementation manner further provide an implementation manner, where generating response information of the cloud server production scheduling request according to the new tree structure includes: determining a scheduling cluster based on the new tree structure;
sending an instruction for creating a cloud server to the determined scheduling cluster, so that the scheduling cluster creates the cloud server according to the instruction and sends related information of the created cloud server;
receiving relevant information of the created cloud server returned by the scheduling cluster;
and generating response information, wherein the response information comprises the relevant information of the cloud server.
The above-described aspects and any possible implementation further provide an implementation, where the specified request is a cluster productivity query request; determining response information of the specified request based on the tree structure, including:
evaluating the production capacity of the cluster system based on the tree structure to obtain a second evaluation result;
and generating response information of the cluster production capacity query request according to the second evaluation result.
The above aspect and any possible implementation manner further provide an implementation manner, where the evaluating the production capacity of the cluster system based on the tree structure includes:
and determining the started cluster system according to the starting condition and the tree structure.
The above aspect and any possible implementation manner further provide an implementation manner, where the evaluating the production capacity of the cluster system based on the tree structure includes:
and evaluating the number of the servers which can be produced by the cluster system according to the resource combination required by producing one server and the tree structure.
The above-described aspects and any possible implementation further provide an implementation, where the specified request is a cluster inventory query request;
determining response information of the specified request based on the tree structure, including:
acquiring information of specified resources of the cluster system based on the tree structure;
and generating response information of the cluster inventory inquiry request according to the acquired information.
In a second aspect, an embodiment of the present disclosure provides a request processing apparatus, which is disposed in a server that manages at least one cluster system, and the apparatus includes:
the acquisition module is used for responding to the specified request of the client and acquiring the resource information of the shared attribute resources and the resource information of the non-shared attribute resources of the specified cluster;
and the determining module is used for determining the response information of the specified request according to the acquired resource information.
The above-mentioned aspect and any possible implementation manner further provide an implementation manner, where the determining module, when configured to determine the response information of the specific request according to the collected resource information, is specifically configured to:
determining available resources of each resource factor of the designated cluster according to the acquired resource information;
obtaining respective matching factors of each resource factor according to the available resources of each resource factor;
establishing a tree structure based on the respective matching factor of each resource factor;
determining response information of the specified request based on the tree structure.
The above-mentioned aspect and any possible implementation manner further provide an implementation manner, where the determining module, when configured to obtain, according to the available resource of each resource factor, a respective matching factor of each resource factor, is specifically configured to:
and obtaining the respective matching factor of each resource factor according to the available resource of each resource factor and the respective resource threshold of each resource factor.
As for the above-mentioned aspect and any possible implementation manner, an implementation manner is further provided, where the determining module is configured to, when configured to obtain the respective matching factor of each resource factor according to the available resource of each resource factor and the respective resource threshold of each resource factor, specifically:
and obtaining the respective matching factor of each resource factor according to the difference value of the available resource of each resource factor and the respective resource threshold of each resource factor.
The foregoing aspect and any possible implementation manner further provide an implementation manner, where the determining module, when configured to establish a tree structure based on respective matching factors of each resource factor, is specifically configured to:
normalizing the matching factor of each resource factor;
and establishing the tree structure based on the normalization processing result.
The above aspects and any possible implementation manners further provide an implementation manner, where the specified request is a cloud server production scheduling request; the determining module, when configured to determine the response information of the specific request based on the tree structure, is specifically configured to:
reading the business rules from a specified database through a specified interface;
extracting nodes of related resources from the tree structure according to the specified request and the read business rule;
establishing a new tree structure according to the extracted nodes and the quantity of the corresponding resources in the specified request;
and generating response information of the cloud server production scheduling request according to the new tree structure.
The above aspect and any possible implementation manner further provide an implementation manner, where the determining module, when configured to generate the response information of the cloud server production scheduling request according to the new tree structure, is specifically configured to:
determining a scheduling cluster based on the new tree structure;
sending an instruction for creating a cloud server to the determined scheduling cluster, so that the scheduling cluster creates the cloud server according to the instruction and sends related information of the created cloud server;
receiving relevant information of the created cloud server returned by the scheduling cluster;
and generating response information, wherein the response information comprises the relevant information of the cloud server.
The above-described aspects and any possible implementation further provide an implementation, where the specified request is a cluster productivity query request; the determining module, when configured to determine the response information of the specific request based on the tree structure, is specifically configured to:
evaluating the production capacity of the cluster system based on the tree structure to obtain a second evaluation result;
and generating response information of the cluster production capacity query request according to the second evaluation result.
The above-mentioned aspect and any possible implementation manner further provide an implementation manner, where the determining module, when configured to evaluate the production capacity of the cluster system based on the tree structure, is specifically configured to:
and determining the started cluster system according to the starting condition and the tree structure.
The above-mentioned aspect and any possible implementation manner further provide an implementation manner, where the determining module, when configured to evaluate the production capacity of the cluster system based on the tree structure, is specifically configured to:
and evaluating the number of the servers which can be produced by the cluster system according to the resource combination required by producing one server and the tree structure.
The above-described aspects and any possible implementation further provide an implementation, where the specified request is a cluster inventory query request; the determining module, when configured to determine the response information of the specific request based on the tree structure, is specifically configured to:
acquiring information of specified resources of the cluster system based on the tree structure;
and generating response information of the cluster inventory inquiry request according to the acquired information.
In a third aspect, an embodiment of the present disclosure provides a server including the request processing apparatus in the second aspect.
In a fourth aspect, the present embodiments provide a non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the following process:
responding to a specified request of a client, and collecting resource information of shared attribute resources and resource information of non-shared attribute resources of a specified cluster;
and determining response information of the specified request according to the collected resource information. The embodiment of the scheme has the following beneficial effects:
in the embodiment of the scheme, when the server receives the request of the client, the server determines the response information of the request based on all the attribute resources (including the shared attribute resources and the non-shared attribute resources) of each cluster, and the other resources which are not shared attribute resources are also used as factors for determining the response information, so that the processing accuracy of the server on the request is improved, the application range is expanded, and the applicability is enhanced.
[ description of the drawings ]
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive labor.
Fig. 1 is a schematic flowchart of an embodiment of a request processing method provided in an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of a cluster resource pool;
FIG. 3 is a schematic diagram of a red-black tree model;
FIG. 4 is an exemplary graph one of the red and black tree model for cluster X;
FIG. 5 is an example graph one of the red and black tree model for cluster Y;
FIG. 6 is a second example graph of the red-black tree model for cluster X obtained from FIG. 4;
FIG. 7 is a second example of the red-black tree model for cluster Y obtained from FIG. 5;
fig. 8 is a schematic diagram of a scenario in which the management platform server N1 requests the cluster management server M to schedule a cloud server for production;
FIG. 9 is a schematic diagram of a red-black tree of a cluster 1 established based on respective matching factors of each resource factor of the cluster 1 in application example one;
FIG. 10 is a schematic diagram of the creation of a new red-black tree after an extraction process based on the red-black tree of FIG. 9;
FIG. 11 is a schematic red-black tree diagram of cluster 1 after scheduling based on the red-black tree of FIG. 10;
FIG. 12 is a schematic diagram of a red-black tree of cluster 2 after scheduling;
FIG. 13 is a schematic diagram of a red-black tree of cluster 3 after scheduling;
fig. 14 is a schematic diagram of a scenario in which the 12306 platform server N2 queries the cluster management server M for resource usage;
fig. 15 is a schematic view of an application scenario in which an operation and maintenance person queries the inventory condition from the cluster management server M through a terminal;
FIG. 16 is a functional block diagram of an embodiment of a request processing device according to an embodiment of the present disclosure;
fig. 17 is a functional block diagram of an embodiment of a server provided by an embodiment of the present invention;
fig. 18 is a simplified block diagram of a server 1800.
[ detailed description ] embodiments
In order to better understand the technical solution of the present solution, the following describes an embodiment of the present solution in detail with reference to the accompanying drawings.
It should be clear that the described embodiments are only a part of the present solution, not all embodiments. All other embodiments, which can be obtained by a person skilled in the art without any inventive step based on the embodiments in the present solution, belong to the protection scope of the present solution.
The terminology used in the embodiments of the present solution is for the purpose of describing particular embodiments only and is not intended to be limiting of the present solution. As used in this specification and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be understood that the term "and/or" as used herein is merely one type of association that describes an associated object, meaning that three relationships may exist, e.g., a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination" or "in response to a detection", depending on the context. Similarly, the phrases "if determined" or "if detected (a stated condition or event)" may be interpreted as "when determined" or "in response to a determination" or "when detected (a stated condition or event)" or "in response to a detection (a stated condition or event)", depending on the context.
In the embodiment of the scheme, when the cluster management server receives the designated request sent by the client, the client is authenticated to determine whether the client has the corresponding request permission. After confirming that the client has the corresponding request authority, the cluster management server judges whether the specified request is in the processing range of the cluster management server according to the received specified request. If the received appointed request is determined to be in the processing range of the cluster management server, the cluster management server collects all resource information and service rules of each cluster from a database recording data information of all the clusters through a preset interface, and a first tree structure of each cluster is created according to the collected resource information. And extracting related resource information from the first tree structure by combining the specified request, the created tree structure and the business rule, and then creating a second tree structure of the corresponding cluster according to the extracted information. And according to the second tree structure, the cluster management server generates response information of the specified request and sends the response information to the client. And the client performs subsequent operation according to the response information.
Example one
The embodiment of the scheme provides a request processing method which is applied to a server for managing at least one cluster system.
Please refer to fig. 1, which is a flowchart illustrating an embodiment of a request processing method according to an embodiment of the present disclosure. As shown in fig. 1, in this embodiment, the request processing method may include the following steps:
s101, responding to a specified request of a client, and collecting resource information of shared attribute resources and resource information of non-shared attribute resources of a specified cluster;
s102, according to the collected resource information, determining response information of the appointed request.
Accordingly, when the server receives the request of the client, the server determines the response information of the request based on all the attribute resources (including the shared attribute resource and the non-shared attribute resource) of each cluster, and also serves as a factor for determining the response information for other resources which are not shared attribute resources, so that the processing accuracy of the server for the request is improved, the application range is expanded, and the applicability is enhanced.
In a specific implementation process, determining response information of the specific request according to the collected resource information may include: determining available resources of each resource factor of the designated cluster according to the acquired resource information; obtaining respective matching factors of each resource factor according to the available resources of each resource factor; establishing a tree structure based on the respective matching factor of each resource factor; based on the tree structure, response information specifying the request is determined.
Some terms related to the present embodiment are explained here.
The resource factor refers to a specific resource type, such as a memory, a virtual CPU, a public network IP, a private network IP, and the like shown in table 1.
The available resource of the resource factor is the remaining resource of the resource factor, for example, in table 1, the available resource of the resource factor of the memory is 110G.
Wherein the matching factor of the resource factor is an amount related to the available resources of the resource factor. The matching factor of the resource factor may also be referred to as a resource matching node.
The resource threshold of the resource factor refers to a lower limit value of available resources of the resource factor. The resource threshold may also be referred to as a resource water line. For example, in table 1, the resource threshold of the resource factor of the memory is 100G.
The resource threshold of the resource factor can be set according to actual requirements. In a specific application, some resource factors need to set a resource threshold, and some resource factors may or may not set a resource threshold. For example, when "unrestricted" is indicated at a resource threshold for a resource factor, this indicates that the resource factor has no set resource threshold.
All resource factors of a cluster may be represented by a cluster resource pool. Referring to fig. 2, a schematic diagram of a cluster resource pool is shown. In fig. 2, the cluster resource pool has 7 resource factors including a memory, a virtual CPU, a public network IP, a private network IP, a Mac (Media Access Control) address, a local disk capacity, and a cloud disk capacity, each resource factor is represented by a circle floating on water, an intersection line of the circle and the water surface represents a resource water level line, a portion of the circle below the resource water level line is a resource threshold amount corresponding to the resource factor, and a portion of the circle above the resource water level line is a matching node corresponding to the resource factor, that is, a matching factor.
Because all resource factors of the cluster to be evaluated are considered in the evaluation, the evaluation can be flexibly carried out according to specific application, so that the accuracy of resource evaluation is improved, accurate production scheduling can be supported, and the waste of cluster resources is avoided.
For example, the production request a and the production request b request different resources, the production request a requests three resources of a memory, a virtual CPU and a public network IP, and the production request b requests three resources of a virtual CPU, an MAC address and a local disk capacity.
When the production capacity of the cluster is evaluated according to the production request a, the nodes corresponding to the three resources, namely the memory, the virtual CPU and the public network IP, can be found out from the tree structure established by the matching factors of all the resource factors of the cluster to carry out specific judgment, so that the production capacity of the cluster for the specific production request a can be obtained very accurately, and the evaluation of the production capacity of the cluster for the production request a cannot be influenced due to the lack of other resources (which may cause the cluster to be closed and production scheduling cannot be carried out) except the three resources, namely the memory, the virtual CPU and the public network IP, in the cluster.
When the production capacity of the cluster is evaluated according to the production request b, the nodes corresponding to the three resources, namely the virtual CPU, the MAC address and the local disk capacity, can be found out from the tree structure established by the matching factors of all the resource factors of the cluster to carry out specific judgment, so that the production capacity of the cluster for the specific production request b can be obtained very accurately, and the evaluation of the production capacity of the cluster for the production request a cannot be influenced due to the lack of other resources (which may cause the cluster to be closed and production scheduling cannot be carried out) except the three resources, namely the virtual CPU, the MAC address and the local disk capacity, in the cluster.
With the tree structure built by the matching factors of all resource factors of the cluster, for any production request for the cluster, the production capacity of the cluster for the specific production request can be accurately obtained as with the production request a and the production request b as examples described above.
Therefore, for a specific production request, the tree structure of the cluster can be utilized to pertinently select related resources for resource evaluation, so that the evaluation has pertinence;
for all production requests, the tree structure of the cluster can be used for selecting related resources in a targeted manner to perform resource evaluation, so that the evaluation has general applicability.
It should be noted that the request processing method provided by the embodiment of the present invention is also applicable to different business rules. For different business rules, please refer to the turn-on conditions in examples 1 and 2 set forth later herein.
In a specific implementation process, the resource factor may include at least one of a memory, a virtual CPU, a public network IP, a private network IP, a MAC address, a local disk capacity, a cloud disk capacity, and a network bandwidth.
In a specific implementation process, the method for obtaining the respective matching factor of each resource factor according to the available resource of each resource factor may include, but is not limited to: and obtaining the respective matching factor of each resource factor according to the available resource of each resource factor and the respective resource threshold of each resource factor.
Further, in a specific implementation process, obtaining a respective matching factor of each resource factor according to the available resource of each resource factor and a respective resource threshold of each resource factor may include: and obtaining the respective matching factor of each resource factor according to the difference value of the available resource of each resource factor and the respective resource threshold of each resource factor.
For example. Take the memory, virtual CPU, public IP and private IP in table 1 as examples. The matching factors of the memories are equal to 110-100 to 10G, the matching factors of the virtual CPUs are equal to 120-100 to 20, the matching factors of the public network IPs are equal to 80-100 to-20, and the matching factors of the private network IPs and the public network IPs are equal to 130-100 to 30.
In a specific implementation process, establishing a tree structure based on respective matching factors of each resource factor may include: normalizing the matching factor of each resource factor; based on the normalization processing result, a tree structure is established.
Wherein, the normalization processing refers to a uniform unit standard. For example, the matching factor normalization processes of the memory, the virtual CPU, the public network IP, and the private network IP in table 1 are 10, 20, -20, and 30, respectively. The matching factor of the memory can be expressed as < memory, 10>, and after inversion, the matching factor is <10, memory >, and the matching factor is used as a node of the tree structure. The matching factor of the public network IP can be expressed as < public network IP, -20>, and is inverted to < -20>, and the matching factor is used as another node of the tree structure. The virtual CPU and the private network IP are processed in the same way and then are used as the other two nodes of the tree structure.
The tree structure may be a red-black tree, a binary tree, a multi-branch tree, or the like.
Assume that there are 8 resource factors: the memory, the virtual CPU, the public network IP, the private network IP, the MAC address, the local disk capacity, the cloud disk capacity, and the network bandwidth, and the blacktree model established by the 8 resource factors is shown in fig. 3.
Referring to fig. 3, fig. 3 is a schematic diagram of a red-black tree model. In fig. 3, white nodes represent red nodes in the red-black tree, and NIL is a leaf node of the red-black tree.
Assume that cluster X corresponds to the available resources and resource thresholds of the 8 resource factors in fig. 3 as shown in table 2.
TABLE 2 resource situation example Table for Cluster X
Figure BDA0001206762990000141
In table 2, the normalized matching factors of the resource factors are as follows:
memory: 110-100 ═ 10, denoted < memory, 10 >;
virtual CPU: 120-100 ═ 20, denoted < virtual CPU, 20 >;
public network IP: 130-100 ═ 30, denoted < public network IP, 30 >;
private network IP: 140-100 ═ 40, denoted as < private network IP, 40 >;
MAC address: 50-0 ═ 50, denoted < MAC address, 50 >;
local disk capacity: 160-100 ═ 60, denoted < local disk capacity, 60 >;
cloud disk capacity: 170-100 ═ 70, denoted < cloud disk capacity, 70 >;
network bandwidth: 90-10 ═ 80, denoted < network bandwidth, 80 >.
After reversing the matching factor, the method is divided into the following steps: <10, memory >, <20, virtual CPU >, <30, public network IP >, <40, private network IP >, <50, MAC address >, <60, local disk capacity >, <70, cloud disk capacity >, <80, network bandwidth >. The red and black tree model established based on these matching factors is shown in fig. 4.
Referring to fig. 4, it can be seen that the root node of the red and black tree is <10, memory >, so that it can be known that the bottleneck resource of the cluster X is memory, and the remaining amount is 10G.
Assume that cluster Y corresponds to the available resources and resource thresholds of the 8 resource factors in fig. 3 as shown in table 3.
TABLE 3 resource situation example Table for Cluster Y
Figure BDA0001206762990000151
In table 3, the normalized matching factors of the resource factors are as follows:
memory: 110-100 ═ 10, denoted < memory, 10 >;
virtual CPU: 120-100 ═ 20, denoted < virtual CPU, 20 >;
public network IP: 80-100 ═ 20, denoted < public network IP, -20 >;
private network IP: 90-100 ═ -10, denoted as < private network IP, -10 >;
MAC address: 50-0 ═ 50, denoted < MAC address, 50 >;
local disk capacity: 130-100 ═ 30, denoted < local disk capacity, 30 >;
cloud disk capacity: 170-100 ═ 70, denoted < cloud disk capacity, 70 >;
network bandwidth: 50-10 ═ 40, denoted < network bandwidth, 40 >.
After reversing the matching factor, the method is divided into the following steps: <10, memory >, <20, virtual CPU >, < -20, public network IP >, < -10, private network IP >, <50, MAC address >, <30, local disk capacity >, <70, cloud disk capacity >, <40, network bandwidth >. The red and black tree model established based on these matching factors is shown in fig. 5.
Referring to fig. 5, it can be seen that the root node of the red and black tree is < -20, the public network IP >, and thus it can be known that the bottleneck resource of the cluster Y is the public network IP, and 20 resources are lacked.
In a specific implementation process, the production capacity of the cluster system may include two aspects, on one hand, whether the cluster is capable of performing production scheduling or not, and if the cluster is capable of performing production scheduling, the cluster is turned on, and if the cluster is not capable of performing production scheduling, the cluster is turned off. Another aspect is what the number of servers a cluster can produce for a particular production server's request.
In a specific implementation process, evaluating the production capacity of the cluster system based on the tree structure may include: and determining the started cluster system according to the starting condition and the tree structure.
The following is explained by example 1 and example 2.
Example 1
Assume that the turn-on condition one is: either resource factor is greater than its resource threshold.
According to the first starting condition, the root node <10, the memory > is found from the red and black tree of the cluster X shown in fig. 4, and since the root node is the node with the smallest numerical value, if the numerical value of the root node is greater than 0, the numerical values of all the nodes in the red and black tree are greater than 0, so that the cluster X can be determined to be started, and the production scheduling can be performed.
According to the first starting condition, the root node < -20, the public network IP >, is found from the red and black tree of the cluster Y shown in fig. 5, which indicates that at least the resource factor of the public network IP is smaller than the resource threshold, so that it can be determined that the cluster Y is closed and production scheduling cannot be performed.
Note that here the shutdown of cluster Y is caused by the setting of the on condition one, for this particular case of the on condition, cluster Y needs to be shutdown, and not all cases, such as example 2 below, cluster Y needs to be shutdown.
Example 2
Assume the second turn-on condition is: the resource factor of the resource to which the production request relates is greater than its resource threshold. And, assume that the resources involved in the production request are memory, virtual CPU and local disk capacity.
According to the second starting condition, the nodes <10, the memories >, <20, the virtual CPUs >, <60, and the local disk capacities > corresponding to the memories, the virtual CPUs, and the local disk capacities are found from the red and black tree of the cluster X shown in fig. 4, and a new red and black tree is established by using the three nodes, as shown in fig. 6. In fig. 6, the root node is still <10, memory >, and since the value of the root node is greater than 0, the values of all nodes in the red and black tree of fig. 6 are greater than 0, so that it can be determined that the cluster X is turned on, and the production scheduling can be performed.
According to the second starting condition, the nodes <10, the memories >, <20, the virtual CPUs >, <30 and the local disk capacity > corresponding to the memory, the virtual CPUs and the local disk capacity are found from the red and black tree of the cluster Y shown in fig. 5, and a new red and black tree is established by using the three nodes, as shown in fig. 7. In fig. 7, the root node is still <10, memory >, and since the value of the root node is greater than 0, the values of all nodes in the red and black tree of fig. 7 are greater than 0, so that it can be determined that the cluster Y is turned on, and the production scheduling can be performed. It can be seen that cluster Y is not shut down due to lack of public network IP and private network IP.
For cluster X and cluster Y, if they are evaluated according to the fixed evaluation scheme in the background art (i.e. memory, virtual CPU and public network IP), then cluster Y is turned off and production scheduling cannot be performed, but in fact, for production requests involving resources of memory, virtual CPU and local disk capacity, cluster Y is production-schedulable.
Example 2 flexibly evaluates according to a specific application, so that a cluster Y that can perform production scheduling for a specific production request is turned on according to a fixed evaluation scheme being turned off, thereby improving the accuracy of resource evaluation, supporting accurate production scheduling, and avoiding the waste of cluster Y resources.
In a specific implementation process, the designated request is a cluster production capacity query request; determining response information specifying the request based on the tree structure may include: evaluating the production capacity of the cluster system based on the tree structure to obtain a second evaluation result; and generating response information of the cluster production capacity query request according to the second evaluation result.
In a specific implementation process, evaluating the production capacity of the cluster system based on the tree structure may include: and evaluating the number of the servers which can be produced by the cluster system according to the resource combination and the tree structure required by producing one server.
The foregoing description will be given by way of example 3, taking the cluster X and the cluster Y as examples.
Example 3
Assume that the resources required to produce a server are memory 2G, virtual CPUs 5, and local disk capacity 10G.
Finding out the nodes corresponding to the capacities of the memory, the virtual CPU, and the local disk from the red-black tree of the cluster X shown in fig. 4, and establishing a new red-black tree, as shown in fig. 6. From the red and black tree shown in fig. 6, it can be seen that the remaining capacities of the memory, the virtual CPU, and the local disk in the cluster X are 10G, 20, and 60G, respectively.
According to the memory amount (2G) required for producing one server, the memory of the cluster X can produce 10/2-5 servers;
according to the number (5) of virtual CPUs required for producing one server, the virtual CPU of the cluster X can produce 20/5-4 servers;
according to the local disk capacity (10G) required by producing one server, the local disk capacity of the cluster X can be 60/10-6 servers;
taking the minimum value of 4 out of 5, 4 and 6, the number of servers that cluster X can produce is 4.
Finding out the nodes corresponding to the capacities of the memory, the virtual CPU, and the local disk from the red-black tree of the cluster Y shown in fig. 5, and establishing a new red-black tree, as shown in fig. 7. From the red and black tree shown in fig. 7, it can be seen that the remaining capacities of the memory, the virtual CPU, and the local disk in the cluster Y are 10G, 20, and 30G, respectively.
According to the memory amount (2G) required for producing one server, the memory of the cluster Y can produce 10/2-5 servers;
according to the number (5) of virtual CPUs required for producing one server, the virtual CPUs of the cluster Y can produce 20/5-4 servers;
according to the local disk capacity (10G) required by producing one server, the local disk capacity of the cluster Y can be 30/10-3 servers;
taking the minimum value of 3 out of 5, 4 and 3, the number of servers that cluster Y can produce is 3.
It should be noted that, if a non-integer occurs in the process of calculating the number of servers, the non-integer needs to be rounded and then the minimum value needs to be taken. For example, if the local disk capacity of the cluster Y is 35, the local disk capacity of the cluster Y may produce 35/10 to 3.5 servers, rounded up to 3 servers, according to the local disk capacity (10G) required to produce one server.
In a specific implementation process, the specified request is a cloud server production scheduling request; determining response information specifying the request based on the tree structure may include: reading the business rules from a specified database through a specified interface; extracting nodes of related resources from the tree structure according to the specified request and the read business rule; establishing a new tree structure according to the extracted nodes and the quantity of corresponding resources in the appointed request; and generating response information of the cloud server production scheduling request according to the new tree structure.
In a specific implementation process, generating response information of a cloud server production scheduling request according to the new tree structure may include: determining a scheduling cluster based on the new tree structure; sending an instruction for creating a cloud server to the determined scheduling cluster, so that the scheduling cluster creates the cloud server according to the instruction and sends related information of the created cloud server; receiving relevant information of the created cloud server returned by the scheduling cluster; and generating response information, wherein the response information comprises the relevant information of the cloud server.
In a specific implementation process, the designated request is a cluster inventory query request; determining response information of the specified request based on the tree structure, including: acquiring information of specified resources of the cluster system based on the tree structure; and generating response information of the cluster inventory inquiry request according to the acquired information.
According to the request processing method provided by the embodiment of the scheme, when the server receives the request of the client, the server determines the response information of the request based on all the attribute resources (including the shared attribute resources and the non-shared attribute resources) of each cluster, and other resources which are not shared attribute resources are also used as factors for determining the response information, so that the accuracy of the server for processing the request is improved, the application range is expanded, and the applicability is enhanced.
Embodiments of the present solution are described in further detail below with specific application examples.
In the following three application examples, it is assumed that the cluster management server M manages 5 clusters in total, and the resource information of the 5 clusters is shown in table 4. Assuming that the real-time resource information of the 5 clusters is stored in the database L, the cluster management server M supervises the resource change condition of the 5 clusters in real time and updates the data in the database L. The cluster management server M may also store the business rules set by the operation and maintenance personnel in the database L, and may change the business rules stored in the database L according to the operation instructions of the operation and maintenance personnel.
The business rules may include two rules, one is a condition that the cluster starts selling, and the other is a selection rule for selecting a specific selling cluster from all started clusters. The condition that the cluster starts selling refers to the condition that the cluster can be scheduled, and the selection rule for selecting the specific selling cluster in all the started clusters refers to the specific selection of which cluster or clusters are sold when a plurality of selling clusters meeting the scheduling condition exist. Selling here refers to scheduling physical resources in the cluster to serve the requester.
Table 4 example table of available resources and resource threshold for cluster
Figure BDA0001206762990000201
TABLE 5 example table of cluster match factors
Figure BDA0001206762990000202
Figure BDA0001206762990000211
Application example 1
The application scenarios of this example are: in a busy trip season, the number of people who buy train tickets is increased, the customer visit volume of the train ticket selling website 12306 is continuously increased, and more cloud servers are needed for processing. Therefore, the management platform server N1 of the train ticket selling website 12306 (hereinafter, referred to as 12306 platform server N1) requests the cluster management server M to schedule production of one cloud server. The scene diagram is shown in fig. 8.
The process of the whole scene is as follows:
a1, 12306 platform server N1 sends a cloud server production scheduling request to cluster management server M, where the request carries a resource combination required for producing one cloud server: the system comprises 10M of internal memory, 10 of CPUs (central processing units), 10 of MAC (media access control) addresses and 50M of cloud disk capacity.
a2, the cluster management server M receives and processes the production scheduling request of 12306 platform server N1, and the processing of the cluster management server M includes the following sub-steps:
a21, the cluster management server M authenticates the 12306 platform server N1 to determine whether the 12306 platform server N1 has the authority to request production scheduling, if yes, the step a22 is executed, otherwise, the relevant prompt information is returned to the 12306 platform server N1 to notify the N1 that the server does not have the relevant authority;
a22, after the authentication is passed, the cluster management server M judges whether the request is in its own processing range according to the specific production scheduling request sent by the 12306 platform server N1, if so, the step a23 is continuously executed, otherwise, the 12306 platform server N1 returns the relevant prompt information to inform the N1 that the request is not in the M processing range;
a23, the cluster management server M collects real-time resource information and current business rules (including two rules, one is a condition for starting selling by the cluster, and the other is a selection rule for selecting a specific selling cluster from all started clusters) of all clusters (in this example, clusters 1 to 5) from the database L;
a24, for each cluster managed, the cluster management server processes in the same manner as cluster 1 is processed as follows.
Take cluster 1 in table 4 as an example.
Determining available resources of each resource factor of the cluster 1, as shown in the second row of table 4, in the cluster 1, the remaining memory is 110M, the number of virtual CPUs is 120, the number of public network IPs is 80, the number of MAC addresses is 50, the cloud disk capacity is 170M, and the network bandwidth is 50 bps.
And obtaining the matching factor of each resource factor according to the available resource of each resource factor, wherein the matching factor of each resource is equal to the difference value obtained by subtracting the resource threshold value from the residual quantity of the corresponding resource. Taking the memory of the cluster 1 as an example, the matching factor is equal to 110-100 to 10M. The matching factors corresponding to the resource factors of cluster 1 are shown in the second row of table 5.
Establishing a red-black tree of the cluster 1 based on the respective matching factor of each resource factor of the cluster 1, as shown in fig. 9;
based on the red and black trees shown in fig. 9 of each cluster, evaluating the production capacity of the cluster system corresponding to the production scheduling request in a1 specifically includes:
extracting the resources involved in the production scheduling request in a1, and creating a new red-black tree, as shown in fig. 10, comparing the number of the resources involved in the production scheduling request in a1, the cluster 1 in table 4 meets the requirement of the production scheduling request in a 1.
In the same way, it can be known that cluster 2 and cluster 3 in table 4 also satisfy the requirement of the production scheduling request in a 1. The cluster 4 in table 4 does not meet the requirement of the production scheduling request in a1 because the amount of the memory is not satisfactory, and the cluster 5 in table 4 does not meet the requirement of the production scheduling request in a1 because the amount of the CPU is not satisfactory.
Therefore, after step a2, the cluster management server may obtain the following evaluation results:
cluster 1, cluster 2, and cluster 3 in table 4 satisfy the requirements of the production scheduling request in a1, and cluster 4 and cluster 5 in table 4 do not satisfy the requirements of the production scheduling request in a 1.
a25, according to the evaluation result in a24, the cluster management server M selects a specific dispatching cluster according to the business rule obtained from the database L.
Since there are 3 clusters satisfying the requirement of the production scheduling request in a1, the cluster management server M may select one cluster according to a predetermined selection rule as a cluster specifically scheduled for the 12306 platform server N1.
Assuming that the selection rule is random selection, the cluster management server M randomly selects one, for example, the cluster 2 as the scheduled cluster.
Assuming that the selection rule is the optimal selection, the cluster management server M further processes the red and black trees of the cluster 1, the cluster 2, and the cluster 3, which takes the following processing of the cluster 1 as an example.
On the basis of fig. 10, the corresponding resource amount required for producing the scheduling request in a1 is removed, and a red-black tree of the cluster 1 after scheduling is obtained, as shown in fig. 11. The red and black trees of cluster 2 and cluster 3 are obtained in the same way as shown in fig. 12 and fig. 13, respectively. As can be seen from comparison of the root nodes of the red and black trees in fig. 11, 12, and 13, the cluster 3 having the largest root node is the cluster 3, which means that the cluster 3 has the most sufficient remaining resources after scheduling, and therefore the cluster management server M selects the cluster 3 as the scheduled cluster. Therefore, the dispatching of the cluster is most reasonable, more accurate dispatching is realized, and the accuracy of response is improved.
Thus, after step a25, cluster management server M selects cluster 3 as the dispatching cluster.
a3, the cluster management server M notifies the cluster 3 that it is scheduled, and notifies the cluster 3 of the specification of the cloud server that needs to be created (i.e. the resource combination for generating the scheduling request: 10M memory, 10 CPU, 10 MAC addresses, 50M cloud disk capacity), the cluster 3 assigns a specific physical host C to create the cloud server, the physical host C creates the cloud server according to the instruction of the cluster 3, and then the cluster 3 returns the information (e.g. IP address, number, etc.) of the cloud server created by the physical host C to the cluster management server M.
a4, the cluster management server M generates response information according to the information returned by the cluster 3, the response information includes the information of the cloud server created by the physical host C, and then sends the generated response information to the 12306 platform server N1.
a5, 12306 platform server N1 accesses the cloud server according to the IP address of the cloud server created by physical host C, and configures a relevant program for processing requests such as train ticket purchase, inquiry, etc. on the cloud server, after configuration, the cloud server created by physical host C is used as a part of the background operating system of 12306 platform, and can receive and process the access request of the client to 12306 website.
a6, 12306 platform server N1 provides the access interface of the cloud server to the client, and the client X accesses the cloud server according to the access interface. For example, the client X sends a request for purchasing a train ticket to the cloud server, and the cloud server receives and processes the request according to the configured processing program and returns a corresponding processing result to the client X.
Application example two
The application scenario of this example is that 12306 platform server N2 queries cluster management server M for resource usage, and the scenario diagram is shown in fig. 14.
In this example, it is assumed that the following premises exist: 12306 platform server N2 has requested, through the steps of application example one above, the scheduling of several cloud servers created by the physical hosts in cluster 1 and cluster 3 from cluster management server M, which has scheduled all the resources of cluster 1 and cluster 3 to 12306 platform server N2.
Referring to fig. 14, the process of the 12306 platform server N2 for querying the cluster management server M for resource usage may include the following steps:
b1, 12306 platform server N2 sends resource usage query request to cluster management server M to query the usage of cluster 1 and cluster 3 scheduled by cluster management server M for 12306 platform server N1.
b2, after receiving the resource use condition query request, the cluster management server M performs the following processing, and then the cluster management server M collects the real-time resource information of the cluster 1 and the cluster 3 from the database L:
b21, the cluster management server M authenticates the 12306 platform server N2 to judge whether the 12306 platform server N1 has the inquiry authority, if yes, the step b22 is executed, otherwise, the relevant prompt information is returned to the 12306 platform server N2 to inform the N2 that the server does not have the relevant authority;
b22, after the authentication is passed, the cluster management server M determines the inquiry authority range of the 12306 platform server N2, that is, which clusters are scheduled to be used by the 12306 platform server N2, or which clusters the 12306 platform server N2 has the authority to inquire, and after the step, the cluster management server M learns that the inquiry authority range of the 12306 platform server N2 is cluster 1 and cluster 3.
b23, the cluster management server M collects the real-time resource information of the cluster 1 and the cluster 3 from the database L;
b24, as with synchronization step a24, red and black trees as shown in FIG. 9 are created for clusters 1 and 3, respectively, in Table 4.
b25, generating response information to the resource usage query request in b1 according to the red and black trees of the clusters 1 and 3 established in b24, wherein the response information comprises the ordering results of the resource matching factors of the clusters 1 and 3 (represented by the red and black trees of the clusters 1 and 3 respectively).
b3, the cluster management server M sends the generated response information to the 12306 platform server N2.
The 12306 platform server N2 may determine the resource remaining conditions of the clusters 1 and 3 according to the query result, and may determine whether to request more cluster resources from the cluster management server M or release some clusters according to the access volume condition of the current period. For example, if the 12306 platform server N2 knows that the resources in cluster 1 and cluster 3 are few and the access amount in the current period is large and is always in a growing trend according to the query result, the 12306 platform server N2 will request more cluster resources from the cluster management server M. For another example, the 12306 platform server N2 learns that there are many resources left in the cluster 1 and the cluster 3 according to the query result, and the access amount in the current period is relatively small, and the access amount does not increase greatly in a certain period, and the resource of the cluster 1 can meet the access requirement in the current period, so that the 12306 platform server N2 requests the cluster management server M to release the resource of the cluster 3, so as to reduce the cost.
Application example three
The application scenario of this example is that operation and maintenance personnel query the cluster management server M for the inventory condition through a terminal, so as to provide a reference for performing inventory enrichment. The schematic view of this scenario is shown in fig. 15.
Referring to fig. 15, the process of the operation and maintenance personnel querying the inventory condition from the cluster management server M through the terminal is as follows:
c1, the terminal Y sends a cluster inventory query request to the cluster management server M to query the resource conditions of all the clusters managed by the cluster management server M.
c2, the processing procedure of the cluster management server M is as follows:
c21, the cluster management server M authenticates the terminal Y to judge whether the terminal Y has the inquiry authority, if yes, the step c22 is executed, otherwise, the relevant prompt information is returned to the terminal Y to inform N2 that the terminal Y does not have the relevant authority;
c22, after the authentication is passed, the cluster management server M determines the inquiry authority range of the terminal Y, namely the terminal Y has the authority to inquire which clusters, after the step, the cluster management server M knows that the terminal Y is a super user, and the inquiry authority range is all the clusters managed by the cluster management server M, namely the clusters 1-5.
c23, the cluster management server M collects the real-time resource information of the clusters 1-5 from the database L;
c24, as in step a24, a red-black tree as shown in FIG. 9 is established for each of clusters 1 to 5 in Table 4.
And c25, generating response information to the cluster inventory inquiry request in c1 according to the established red-black trees of the clusters 1-5 in c24, wherein the response information comprises the ordering results of the resource matching factors of the clusters 1-5 (respectively represented by the red-black trees of the clusters 1-5).
c3, the cluster management server M sends the generated response information to the terminal Y.
The red and black trees of the cluster give sequencing results of all resources in the cluster, and operation and maintenance personnel can conveniently know the inventory condition.
For example, through the root node of the red and black tree of each cluster, the operation and maintenance personnel can quickly know what the bottleneck resource of each cluster is and how the bottleneck resource is compared with the corresponding resource threshold, for example, through the red and black trees of the clusters 1 to 5, the operation and maintenance personnel can quickly know the following information:
cluster 1: the number of the residual public network IPs is 20 lower than the resource threshold;
cluster 3: the residual network bandwidth is lower than a resource threshold value of 5 bps;
and cluster 4: the remaining memory is equal to the resource threshold;
cluster 5: the remaining virtual CPUs are below the resource threshold of 10.
The operation and maintenance personnel can inquire the inventory condition of the cluster management server M regularly through a cluster inventory inquiry program arranged in the terminal Y, when the red and black trees of the cluster have nodes less than or equal to 0, the terminal Y can generate reminding information according to the nodes and display the reminding information to the operation and maintenance personnel, so that the operation and maintenance personnel can know the inventory condition more conveniently, and further supplement corresponding resources according to the inventory condition. For example, if the number of the remaining virtual CPUs in the cluster 5 is less than the resource threshold of 10, and the number of the virtual CPUs in the cluster is specified to be greater than the resource threshold of 20 in the business rule to start the sale, the operation and maintenance staff may determine that more than 30 virtual CPUs need to be added to the cluster 5.
The embodiment of the present invention further provides an embodiment of an apparatus for implementing each step and method in the above-mentioned request processing method embodiment.
Example two
The embodiment of the scheme provides a request processing device. The request processing apparatus provided in this embodiment may be disposed in a server that manages at least one cluster system.
Please refer to fig. 16, which is a functional block diagram of an embodiment of a request processing apparatus according to the present embodiment. As shown in fig. 16, the apparatus includes:
the collecting module 1610 is configured to collect, in response to a specified request from a client, resource information of shared attribute resources and resource information of non-shared attribute resources of a specified cluster;
the determining module 1620 is configured to determine response information of the specific request according to the collected resource information.
In a specific implementation process, the determining module 1620, when configured to determine the response information of the specific request according to the collected resource information, may specifically be configured to: determining available resources of each resource factor of the designated cluster according to the acquired resource information; obtaining respective matching factors of each resource factor according to the available resources of each resource factor; establishing a tree structure based on the respective matching factor of each resource factor; based on the tree structure, response information specifying the request is determined.
In a specific implementation process, when the determining module 1620 is configured to obtain the respective matching factor of each resource factor according to the available resource of each resource factor, it may specifically be configured to: and obtaining the respective matching factor of each resource factor according to the available resource of each resource factor and the respective resource threshold of each resource factor.
In a specific implementation process, when the determining module 1620 is configured to obtain the respective matching factor of each resource factor according to the available resource of each resource factor and the respective resource threshold of each resource factor, it may specifically be configured to: and obtaining the respective matching factor of each resource factor according to the difference value of the available resource of each resource factor and the respective resource threshold of each resource factor.
In a specific implementation process, the determining module 1620, when configured to establish the tree structure based on the respective matching factor of each resource factor, may specifically be configured to: normalizing the matching factor of each resource factor; and establishing the tree structure based on the normalization processing result.
In a specific implementation process, the specification request is a cloud server production scheduling request, and the determining module 1620, when configured to determine response information of the specification request based on the tree structure, may specifically be configured to: reading the business rules from a specified database through a specified interface; extracting nodes of related resources from the tree structure according to the specified request and the read business rule; establishing a new tree structure according to the extracted nodes and the quantity of corresponding resources in the appointed request; and generating response information of the cloud server production scheduling request according to the new tree structure.
In a specific implementation process, when the determining module 1620 is configured to generate the response information of the cloud server production scheduling request according to the new tree structure, it may specifically be configured to: determining a scheduling cluster based on the new tree structure; sending an instruction for creating a cloud server to the determined scheduling cluster, so that the scheduling cluster creates the cloud server according to the instruction and sends related information of the created cloud server; receiving relevant information of the created cloud server returned by the scheduling cluster; and generating response information, wherein the response information comprises the relevant information of the cloud server.
In a specific implementation process, the specific request is a cluster capacity query request, and the determining module 1620, when configured to determine response information of the specific request based on the tree structure, may specifically be configured to: evaluating the production capacity of the cluster system based on the tree structure to obtain a second evaluation result; and generating response information of the cluster production capacity query request according to the second evaluation result.
In a specific implementation, the determining module 1620, when configured to evaluate the production capacity of the cluster system based on the tree structure, may specifically be configured to: and determining the started cluster system according to the starting condition and the tree structure.
In a specific implementation, the determining module 1620, when configured to evaluate the production capacity of the cluster system based on the tree structure, may specifically be configured to: and evaluating the number of the servers which can be produced by the cluster system according to the resource combination and the tree structure required by producing one server.
In a specific implementation process, the specific request is a cluster inventory query request, and the determining module 1620, when configured to determine response information of the specific request based on the tree structure, may specifically be configured to: acquiring information of specified resources of the cluster system based on the tree structure; and generating response information of the cluster inventory inquiry request according to the acquired information.
In a specific implementation, the resource factors may include: at least one of a memory, a virtual CPU, a public network IP, a private network IP, a MAC address, a local disk capacity, a cloud disk capacity, and a network bandwidth.
Since the request processing device in this embodiment is capable of executing the request processing method in the first embodiment, reference may be made to the related description of the request processing method in the first embodiment for a part of this embodiment that is not described in detail.
According to the request processing device provided by the embodiment of the scheme, when the server receives the request of the client, the server determines the response information of the request based on all the attribute resources (including the shared attribute resources and the non-shared attribute resources) of each cluster, and the response information is determined by using other resources which are not shared attribute resources, so that the accuracy of the processing of the request by the server is improved, the application range is expanded, and the applicability is enhanced.
EXAMPLE III
The embodiment of the scheme provides a server. Please refer to fig. 17, which is a functional block diagram of an embodiment of a server according to the present invention. As shown in fig. 17, the server includes the request processing apparatus provided in the second embodiment.
Example four
Fig. 18 is a simplified block diagram of a server 1800. The server 1800 may include a processor 1801 coupled to one or more data storage facilities, which may include storage media 1806 and memory units 1804. The server 1800 can also include an input interface 1805 and an output interface 1807 for communicating with another device or system. Program code executed by the CPU of processor 1801 may be stored in memory unit 1804 or storage medium 1806.
The processor 1801 in the server 1800 invokes the program code stored in the memory unit 1804 or the storage medium 1806 to execute the following steps:
responding to a specified request of a client, and collecting resource information of shared attribute resources and resource information of non-shared attribute resources of a specified cluster;
and determining response information of the appointed request according to the collected resource information.
In a specific implementation, the processor 1801 is specifically configured to perform: determining available resources of each resource factor of the cluster system; obtaining respective matching factors of each resource factor according to the available resources of each resource factor; establishing a tree structure based on the respective matching factor of each resource factor; and evaluating the production capacity of the cluster system based on the tree structure.
In a specific implementation, the processor 1801 is further configured to perform: and obtaining the respective matching factor of each resource factor according to the available resource of each resource factor and the respective resource threshold of each resource factor.
In a specific implementation, the processor 1801 is further configured to perform: and obtaining the respective matching factor of each resource factor according to the difference value of the available resource of each resource factor and the respective resource threshold of each resource factor.
In a specific implementation scheme, the processor 1801 is further configured to perform normalization processing on respective matching factors of each resource factor; and establishing the tree structure based on the normalization processing result.
In a particular implementation, the resource factors may include: at least one of a memory, a virtual CPU, a public network IP, a private network IP, a MAC address, a local disk capacity, a cloud disk capacity, and a network bandwidth.
In a specific implementation, the specification request is a cloud server production scheduling request, and the processor 1801 is further configured to execute: reading the business rules from a specified database through a specified interface; extracting nodes of related resources from the tree structure according to the specified request and the read business rule; establishing a new tree structure according to the extracted nodes and the quantity of corresponding resources in the appointed request; and generating response information of the cloud server production scheduling request according to the new tree structure.
In a specific implementation, the processor 1801 is further configured to perform: determining a scheduling cluster based on the new tree structure; sending an instruction for creating a cloud server to the determined scheduling cluster, so that the scheduling cluster creates the cloud server according to the instruction and sends related information of the created cloud server; receiving relevant information of the created cloud server returned by the scheduling cluster; and generating response information, wherein the response information comprises the relevant information of the cloud server.
In a specific implementation, the request is designated as a cluster throughput capability query request, and the processor 1801 is further configured to execute: evaluating the production capacity of the cluster system based on the tree structure to obtain a second evaluation result; and generating response information of the cluster production capacity query request according to the second evaluation result.
In a specific implementation, the processor 101 is further configured to perform: and determining the started cluster system according to the starting condition and the tree structure.
In a specific implementation, the processor 101 is further configured to perform: and evaluating the number of the servers which can be produced by the cluster system according to the resource combination required by producing one server and the tree structure.
In the above embodiments, the storage medium may be a Read-Only Memory (ROM), or may be a Read-write medium, such as a hard disk or a flash Memory. The Memory unit may be a Random Access Memory (RAM). The memory unit may be physically integrated with the processor or integrated in the memory or implemented as a separate unit.
The processor is a control center of the above-mentioned device (the above-mentioned device is the above-mentioned server or the above-mentioned client), and provides a processing device for executing instructions, performing interrupt operation, providing a timing function and various other functions. Optionally, the processor includes one or more Central Processing Units (CPUs), such as CPU 0 and CPU1 shown in fig. 11. The apparatus may include one or more processors. The processor may be a single core (single CPU) processor or a multi-core (multi-CPU) processor. Unless otherwise stated, a component such as a processor or a memory described as performing a task may be implemented as a general component, which is temporarily used to perform the task at a given time, or as a specific component specially manufactured to perform the task. The term "processor" as used herein refers to one or more devices, circuits and/or processing cores that process data, such as computer program instructions.
The program code executed by the CPU of the processor may be stored in a memory unit or a storage medium. Alternatively, the program code stored in the storage medium may be copied into the memory unit for execution by the CPU of the processor. The processor may execute at least one kernel (e.g., LINUX)TM、UNIXTM、WINDOWSTM、ANDROIDTM、IOSTM) It is well known for such cores to control the operation of such devices by controlling the execution of other programs or processes, controlling communication with peripheral devices, and controlling the use of computer device resources.
The above elements in the above devices may be connected to each other by a bus, such as one of a data bus, an address bus, a control bus, an expansion bus, and a local bus, or any combination thereof.
EXAMPLE five
The present embodiments provide a non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the following process:
responding to a specified request of a client, and collecting resource information of shared attribute resources and resource information of non-shared attribute resources of a specified cluster;
and determining response information of the appointed request according to the collected resource information.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments provided in the present disclosure, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions in actual implementation, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The above description is only a preferred embodiment of the present disclosure, and should not be taken as limiting the present disclosure, and any modifications, equivalents, improvements, etc. made within the spirit and principle of the present disclosure should be included in the scope of the present disclosure.

Claims (22)

1. A request processing method applied to a server managing at least one cluster system, the method comprising:
responding to a specified request of a client, and collecting resource information of shared attribute resources and resource information of non-shared attribute resources of a specified cluster;
determining response information of the specified request according to the acquired resource information;
according to the collected resource information, determining response information of the specified request, wherein the response information comprises:
determining available resources of each resource factor of the designated cluster according to the acquired resource information;
obtaining respective matching factors of each resource factor according to the available resources of each resource factor;
establishing a tree structure based on the respective matching factor of each resource factor;
determining response information of the specified request based on the tree structure.
2. The method of claim 1, wherein obtaining a respective matching factor for each resource factor according to the available resources of each resource factor comprises:
and obtaining the respective matching factor of each resource factor according to the available resource of each resource factor and the respective resource threshold of each resource factor.
3. The method of claim 2, wherein obtaining the respective matching factor for each resource factor according to the available resource of each resource factor and the respective resource threshold of each resource factor comprises:
and obtaining the respective matching factor of each resource factor according to the difference value of the available resource of each resource factor and the respective resource threshold of each resource factor.
4. The method of claim 1, wherein building a tree structure based on the respective matching factor for each resource factor comprises:
normalizing the matching factor of each resource factor;
and establishing the tree structure based on the normalization processing result.
5. The method of claim 1, wherein the specified request is a cloud server production scheduling request;
determining response information of the specified request based on the tree structure, including:
reading the business rules from a specified database through a specified interface;
extracting nodes of related resources from the tree structure according to the specified request and the read business rule;
establishing a new tree structure according to the extracted nodes and the quantity of the corresponding resources in the specified request;
and generating response information of the cloud server production scheduling request according to the new tree structure.
6. The method of claim 5, wherein generating response information for the cloud server production scheduling request according to the new tree structure comprises: determining a scheduling cluster based on the new tree structure;
sending an instruction for creating a cloud server to the determined scheduling cluster, so that the scheduling cluster creates the cloud server according to the instruction and sends related information of the created cloud server;
receiving relevant information of the created cloud server returned by the scheduling cluster;
and generating response information, wherein the response information comprises the relevant information of the cloud server.
7. The method of claim 1, wherein the specified request is a cluster capacity query request; determining response information of the specified request based on the tree structure, including:
evaluating the production capacity of the cluster system based on the tree structure to obtain a second evaluation result;
and generating response information of the cluster production capacity query request according to the second evaluation result.
8. The method of claim 7, wherein said evaluating the productivity of said cluster system based on said tree structure comprises:
and determining the started cluster system according to the starting condition and the tree structure.
9. The method of claim 7, wherein said evaluating the productivity of said cluster system based on said tree structure comprises:
and evaluating the number of the servers which can be produced by the cluster system according to the resource combination required by producing one server and the tree structure.
10. The method of claim 1, wherein the specified request is a clustered inventory query request;
determining response information of the specified request based on the tree structure, including:
acquiring information of specified resources of the cluster system based on the tree structure;
and generating response information of the cluster inventory inquiry request according to the acquired information.
11. A request processing apparatus provided in a server that manages at least one cluster system, the apparatus comprising:
the acquisition module is used for responding to the specified request of the client and acquiring the resource information of the shared attribute resources and the resource information of the non-shared attribute resources of the specified cluster;
the determining module is used for determining the response information of the specified request according to the acquired resource information;
the determining module, when configured to determine the response information of the specific request according to the collected resource information, is specifically configured to:
determining available resources of each resource factor of the designated cluster according to the acquired resource information;
obtaining respective matching factors of each resource factor according to the available resources of each resource factor;
establishing a tree structure based on the respective matching factor of each resource factor;
determining response information of the specified request based on the tree structure.
12. The apparatus according to claim 11, wherein the determining module, when configured to obtain the respective matching factor of each resource factor according to the available resource of each resource factor, is specifically configured to:
and obtaining the respective matching factor of each resource factor according to the available resource of each resource factor and the respective resource threshold of each resource factor.
13. The apparatus of claim 12, wherein the determining module, when configured to obtain the respective matching factor of each resource factor according to the available resource of each resource factor and the respective resource threshold of each resource factor, is specifically configured to:
and obtaining the respective matching factor of each resource factor according to the difference value of the available resource of each resource factor and the respective resource threshold of each resource factor.
14. The apparatus according to claim 11, wherein the determining module, when configured to establish the tree structure based on the respective matching factor of each resource factor, is specifically configured to:
normalizing the matching factor of each resource factor;
and establishing the tree structure based on the normalization processing result.
15. The apparatus of claim 11, wherein the specified request is a cloud server production scheduling request; the determining module, when configured to determine the response information of the specific request based on the tree structure, is specifically configured to:
reading the business rules from a specified database through a specified interface;
extracting nodes of related resources from the tree structure according to the specified request and the read business rule;
establishing a new tree structure according to the extracted nodes and the quantity of the corresponding resources in the specified request;
and generating response information of the cloud server production scheduling request according to the new tree structure.
16. The apparatus according to claim 15, wherein the determining module, when configured to generate the response information of the cloud server production scheduling request according to the new tree structure, is specifically configured to:
determining a scheduling cluster based on the new tree structure;
sending an instruction for creating a cloud server to the determined scheduling cluster, so that the scheduling cluster creates the cloud server according to the instruction and sends related information of the created cloud server;
receiving relevant information of the created cloud server returned by the scheduling cluster;
and generating response information, wherein the response information comprises the relevant information of the cloud server.
17. The apparatus of claim 11, wherein the specified request is a cluster capacity query request; the determining module, when configured to determine the response information of the specific request based on the tree structure, is specifically configured to:
evaluating the production capacity of the cluster system based on the tree structure to obtain a second evaluation result;
and generating response information of the cluster production capacity query request according to the second evaluation result.
18. The apparatus of claim 17, wherein the determining module, when configured to evaluate the production capacity of the cluster system based on the tree structure, is specifically configured to:
and determining the started cluster system according to the starting condition and the tree structure.
19. The apparatus of claim 17, wherein the determining module, when configured to evaluate the production capacity of the cluster system based on the tree structure, is specifically configured to:
and evaluating the number of the servers which can be produced by the cluster system according to the resource combination required by producing one server and the tree structure.
20. The apparatus of claim 11, wherein the specified request is a clustered inventory query request; the determining module, when configured to determine the response information of the specific request based on the tree structure, is specifically configured to:
acquiring information of specified resources of the cluster system based on the tree structure;
and generating response information of the cluster inventory inquiry request according to the acquired information.
21. A server comprising the request processing apparatus according to any one of claims 11 to 20.
22. A non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the following process:
responding to a specified request of a client, and collecting resource information of shared attribute resources and resource information of non-shared attribute resources of a specified cluster;
determining response information of the specified request according to the acquired resource information;
according to the collected resource information, determining response information of the specified request, wherein the response information comprises:
determining available resources of each resource factor of the designated cluster according to the acquired resource information;
obtaining respective matching factors of each resource factor according to the available resources of each resource factor;
establishing a tree structure based on the respective matching factor of each resource factor;
determining response information of the specified request based on the tree structure.
CN201710018769.XA 2017-01-10 2017-01-10 Request processing method and device and server Active CN108289086B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710018769.XA CN108289086B (en) 2017-01-10 2017-01-10 Request processing method and device and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710018769.XA CN108289086B (en) 2017-01-10 2017-01-10 Request processing method and device and server

Publications (2)

Publication Number Publication Date
CN108289086A CN108289086A (en) 2018-07-17
CN108289086B true CN108289086B (en) 2020-11-24

Family

ID=62831303

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710018769.XA Active CN108289086B (en) 2017-01-10 2017-01-10 Request processing method and device and server

Country Status (1)

Country Link
CN (1) CN108289086B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109862131B (en) * 2019-02-20 2022-03-04 北京奇艺世纪科技有限公司 Server access address allocation method and device and computer readable storage medium
CN111190722A (en) * 2019-05-17 2020-05-22 延安大学 Processing unit special and preference using method
CN113553166A (en) * 2020-04-26 2021-10-26 广州汽车集团股份有限公司 Cross-platform high-performance computing integration method and system
CN111949473B (en) * 2020-07-01 2024-07-12 北京思特奇信息技术股份有限公司 Cluster resource capacity prediction method and device

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101340423A (en) * 2008-08-13 2009-01-07 北京航空航天大学 Multi-cluster job scheduling method based on element scheduling ring
CN101599026A (en) * 2009-07-09 2009-12-09 浪潮电子信息产业股份有限公司 A kind of cluster job scheduling system with resilient infrastructure
CN101645022A (en) * 2009-08-28 2010-02-10 曙光信息产业(北京)有限公司 Work scheduling management system and method for a plurality of colonies
CN101719082A (en) * 2009-12-24 2010-06-02 中国科学院计算技术研究所 Method and system for dispatching application requests in virtual calculation platform
CN101819540A (en) * 2009-02-27 2010-09-01 国际商业机器公司 Method and system for scheduling task in cluster
CN102567112A (en) * 2010-12-09 2012-07-11 上海杉达学院 Matching device for services and computing equipment in cluster system
CN103023802A (en) * 2012-12-05 2013-04-03 暨南大学 Web-cluster-oriented low energy consumption scheduling system and method
CN104601664A (en) * 2014-12-22 2015-05-06 西安电子科技大学 Cloud computing platform resource management and virtual machine dispatching control system
CN104778080A (en) * 2014-01-14 2015-07-15 中兴通讯股份有限公司 Job scheduling processing method and device based on coprocessor
CN105335219A (en) * 2014-07-08 2016-02-17 阿里巴巴集团控股有限公司 Distribution-based task scheduling method and system
US9389924B2 (en) * 2014-01-30 2016-07-12 Vmware, Inc. System and method for performing resource allocation for a host computer cluster
CN106293952A (en) * 2016-07-11 2017-01-04 河南大学 The remote sensing method for scheduling task that a kind of task based access control demand is mated with service ability
CN107169727A (en) * 2017-04-20 2017-09-15 青岛科技大学 Towards the cloud service combined method and platform of Making mold

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101340423A (en) * 2008-08-13 2009-01-07 北京航空航天大学 Multi-cluster job scheduling method based on element scheduling ring
CN101819540A (en) * 2009-02-27 2010-09-01 国际商业机器公司 Method and system for scheduling task in cluster
CN101599026A (en) * 2009-07-09 2009-12-09 浪潮电子信息产业股份有限公司 A kind of cluster job scheduling system with resilient infrastructure
CN101645022A (en) * 2009-08-28 2010-02-10 曙光信息产业(北京)有限公司 Work scheduling management system and method for a plurality of colonies
CN101719082A (en) * 2009-12-24 2010-06-02 中国科学院计算技术研究所 Method and system for dispatching application requests in virtual calculation platform
CN102567112A (en) * 2010-12-09 2012-07-11 上海杉达学院 Matching device for services and computing equipment in cluster system
CN103023802A (en) * 2012-12-05 2013-04-03 暨南大学 Web-cluster-oriented low energy consumption scheduling system and method
CN104778080A (en) * 2014-01-14 2015-07-15 中兴通讯股份有限公司 Job scheduling processing method and device based on coprocessor
US9389924B2 (en) * 2014-01-30 2016-07-12 Vmware, Inc. System and method for performing resource allocation for a host computer cluster
CN105335219A (en) * 2014-07-08 2016-02-17 阿里巴巴集团控股有限公司 Distribution-based task scheduling method and system
CN104601664A (en) * 2014-12-22 2015-05-06 西安电子科技大学 Cloud computing platform resource management and virtual machine dispatching control system
CN106293952A (en) * 2016-07-11 2017-01-04 河南大学 The remote sensing method for scheduling task that a kind of task based access control demand is mated with service ability
CN107169727A (en) * 2017-04-20 2017-09-15 青岛科技大学 Towards the cloud service combined method and platform of Making mold

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
异构集群环境下作业调度算法研究;葛铮铮;《中国优秀硕士学位论文全文数据库》;20141115;第I138-9页 *

Also Published As

Publication number Publication date
CN108289086A (en) 2018-07-17

Similar Documents

Publication Publication Date Title
CN108289086B (en) Request processing method and device and server
CN107548549B (en) Resource balancing in a distributed computing environment
US10789085B2 (en) Selectively providing virtual machine through actual measurement of efficiency of power usage
WO2018036103A1 (en) Virtual machine creation method and system, and host computer
CN104618693B (en) A kind of monitor video based on cloud computing handles task management method and system online
WO2019179453A1 (en) Virtual machine creation method and apparatus
CN109660367B (en) Consensus achieving method and device based on improved Raft algorithm and electronic equipment
CN108595619A (en) A kind of answering method and equipment
WO2018176998A1 (en) Data storage method and device
CN112789607A (en) Method for automatically selecting parallelization degree to efficiently execute query in database system
US20220229701A1 (en) Dynamic allocation of computing resources
CN113342477A (en) Container group deployment method, device, equipment and storage medium
Yousif et al. Clustering cloud workload traces to improve the performance of cloud data centers
WO2015057214A1 (en) Regulating enterprise database warehouse resource usage
CN113010315A (en) Resource allocation method, resource allocation device and computer-readable storage medium
CN111901405A (en) Multi-node monitoring method and device, electronic equipment and storage medium
CN107544845B (en) GPU resource scheduling method and device
WO2022267769A1 (en) Method and apparatus for generating graph data
US10031777B2 (en) Method and system for scheduling virtual machines in integrated virtual machine clusters
CN111858014A (en) Resource allocation method and device
US10516756B1 (en) Selection of a distributed network service
CN111290858A (en) Input/output resource management method, device, computer equipment and storage medium
CN111475251A (en) Cluster container scheduling method, system, terminal and storage medium
CN109871260B (en) Multi-dimensional service current limiting method and system based on shared memory between containers
CN110032441A (en) The method and device and electronic equipment of improving performance of server

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