Disclosure of Invention
The embodiment of the invention provides a method and a device for realizing resource reservation, which can reduce the rejection rate of reservation requests.
The embodiment of the invention provides a method for realizing resource reservation, which comprises the following steps:
the method comprises the steps that a combined server receives a reservation request from a user and obtains available resources in a plurality of data centers;
the combined server judges that no data center meeting preset conditions exists, and decomposes the reservation request into simple reservation requests corresponding to a plurality of data centers according to the obtained available resources in the plurality of data centers; the preset condition comprises that available resources of the data center comprise all resources in the reservation request;
the combined server sends each simple reservation request to a server of a corresponding data center;
the federated server returns the received allocated resources from the servers of the multiple data centers to the user.
Optionally, the method further includes:
when the combined server judges that one or more data centers meeting the preset conditions exist, the combined server sends a reservation request to a server of one of the data centers meeting the preset conditions;
the federated server returns to the user the allocated resources received from the server of one of the data centers that satisfies the preset condition.
Optionally, the sending, by the federated server, the reservation request to a server in one of the data centers that satisfies the preset condition includes:
the federated server follows a formula
Calculating the deviation degree of each data center, and sending the reservation request to a server of the data center with the minimum calculated deviation degree;
wherein ε 1 is the deviation degree, m1 is the number of demand parameters contained in the resource in the reservation request, q1i1The i1 th demand parameter, r1, for a resource in the data centeri1The i1 th demand parameter for the resource in the reservation request.
Optionally, the method further includes:
and the joint server changes the advance reservation state of the user into a preset state.
Optionally, the method further includes:
after the combined server returns the allocated resources to the user, a reservation message is generated and put into a reservation queue;
when the reservation starting time in the reservation message is reached, the combined server judges that the resources allocated in the reservation message are all available, changes the advanced reservation state of the user into an active state, informs the user that the required resources are bound, and informs a data center for allocating the resources to set the resources allocated to the user as unavailable.
Optionally, the method further includes:
when the joint server judges that part or all of the resources allocated in the reservation message are unavailable, the joint server continues to perform the step of acquiring available resources in one or more data centers.
Optionally, the method further includes:
when the reservation ending time in the reservation message is reached, the combined server changes the advanced reservation state of the user into a completion state, and informs a data center for distributing resources to release the resources distributed to the user;
or, when the combined server judges that a preset termination condition is met, the combined server changes the advance reservation state of the user into a termination state, and notifies a data center for allocating resources to release the resources allocated to the user.
Optionally, the method further includes:
the federated server receives a modified reservation request from the user and proceeds to the step of acquiring available resources in one or more data centers.
Optionally, the method further includes:
after receiving a reservation modification request from the user, the combined server changes the advance reservation state of the user into a predetermined renegotiation state or an active renegotiation state;
and after the joint server returns the resources allocated after renegotiation to the user, the advanced reservation state of the user is changed into a preset state or an active state.
Optionally, the method further includes:
and the combined server receives a revocation request from the user, changes the advance reservation state of the user into a revocation state, and informs a data center for distributing resources to release the resources distributed to the user.
The embodiment of the present invention further provides a device for implementing resource reservation, including:
the system comprises an acquisition module, a reservation module and a resource allocation module, wherein the acquisition module is used for receiving a reservation request from a user and acquiring available resources in a plurality of data centers; receiving allocated resources from servers of a plurality of data centers;
the processing module is used for judging that no data center meeting the preset condition exists, and decomposing the reservation request into simple reservation requests corresponding to a plurality of data centers according to the obtained available resources in the plurality of data centers; the preset condition comprises that available resources of the data center comprise all resources in the reservation request; sending each simple reservation request to a server of a corresponding data center;
a return module to return the received allocated resources from the servers of the plurality of data centers to the user.
Optionally, the processing module is further configured to:
when judging that one or more data centers meeting the preset conditions exist, the combined server sends a reservation request to a server of one of the data centers meeting the preset conditions;
the acquisition module is further configured to:
receiving an allocated resource from a server of one of the data centers that satisfies a preset condition;
the return module is further to:
returning to the user the received allocated resources from the server of one of the data centers that satisfies the preset condition.
Optionally, the processing module is further configured to:
and changing the advance reservation state of the user into a preset state.
Optionally, the return module is further configured to:
after the allocated resources are returned to the user, a first notification message is sent to the processing module;
the processing module is further configured to:
receiving a first notification message, generating a reservation message and putting the reservation message into a reservation queue; when the reservation starting time in the reservation message is reached, judging that all the resources allocated in the reservation message are available, changing the advance reservation state of the user into an active state to inform the user that the required resources are bound, and informing a data center for allocating the resources to set the resources allocated to the user as unavailable.
Optionally, the processing module is further configured to:
when judging that part or all of the resources allocated in the reservation message are unavailable, sending a second notification message to the acquisition module;
the acquisition module is further configured to:
and receiving the second notification message, and continuing to execute the step of acquiring available resources in one or more data centers.
Optionally, the processing module is further configured to:
when the reservation ending time in the reservation message is reached, changing the advanced reservation state of the user into a completion state, and informing a data center for distributing resources to release the resources distributed to the user;
or, when the combined server judges that a preset termination condition is met, changing the advance reservation state of the user into a termination state, and informing the data center for allocating resources to release the resources allocated to the user.
Optionally, the obtaining module is further configured to:
receiving a request for a modified reservation from the user, and continuing with the step of acquiring available resources in one or more data centers.
Optionally, the obtaining module is further configured to:
after receiving a modification reservation request from the user, sending a third notification message to the processing module;
the return module is further to:
after the resources distributed after renegotiation are returned to the user, a fourth notification message is sent to the processing module;
the processing module is further configured to:
receiving the third notification message, and changing the advance reservation state of the user into a predetermined renegotiation state or an active renegotiation state; and receiving the fourth notification message, and changing the advance reservation state of the user into a preset state or an active state.
Optionally, the obtaining module is further configured to:
receiving a revocation request from the user, and sending a fifth notification message to the processing module;
the processing module is further configured to:
and receiving the fifth notification message, changing the advance reservation state of the user into a revocation state, and notifying a data center for allocating resources to release the resources allocated to the user.
Compared with the related art, the technical scheme of the embodiment of the invention comprises the following steps: the method comprises the steps that a combined server receives a reservation request from a user and obtains available resources in a plurality of data centers; the combined server judges that no data center meeting preset conditions exists, and decomposes the reservation request into simple reservation requests corresponding to a plurality of data centers according to the obtained available resources in the plurality of data centers; the preset condition comprises that available resources of the data center comprise all resources in the reservation request; the combined server sends each simple reservation request to a server of a corresponding data center; the federated server returns the received allocated resources from the servers of the multiple data centers to the user. According to the scheme of the embodiment of the invention, the request of available resources of a plurality of data centers is realized through the combined server, and when the resource of one data center is insufficient, the resources are distributed for the users from the plurality of data centers, so that the rejection rate of the reservation request is reduced.
Detailed Description
The following further description of the present invention, in order to facilitate understanding of those skilled in the art, is provided in conjunction with the accompanying drawings and is not intended to limit the scope of the present invention. In the present application, the embodiments and various aspects of the embodiments may be combined with each other without conflict.
Referring to fig. 1, an embodiment of the present invention provides a method for implementing resource reservation, including:
step 100, the combined server receives a reservation request from a user, and acquires available resources in a plurality of data centers.
In this step, the reservation request includes: reservation start time, reservation end time, QoS requirement parameters, resources requested for reservation.
The QoS requirement parameters include the service level that the user wants to achieve, i.e. the requirement parameter corresponding to each resource. For example, the number of virtual CPU cores, the size of a memory, the disk space, the number of network cards, the number of ports, a network bandwidth, an Internet Protocol (IP) address, a Media Access Control (MAC) address, and the like.
Wherein the resource requesting reservation includes any one or more of the following: computing resources, storage resources, network resources, and the like.
The computing resources include Central Processing Unit (CPU) resources and memory resources, and the network resources include network bandwidth resources and the like.
In this step, fig. 2 is a schematic structural composition diagram of a system for implementing resource reservation according to an embodiment of the present invention. As shown in fig. 2, the federated server may obtain available resources in one or more data centers from the global information center, and may specifically obtain the available resources by sending an instruction to query the global information center for the available resources. The global information center may be a server.
The federated server may also obtain the available resources in the data centers from each data center. Specifically, the available resources may be obtained by sending an instruction for querying the available resources to each data center, and the available resources of each data center may be integrated.
Each data center includes a server and a device on which one or more resources reside. In each data center, the same kind of resources may be categorized in the servers of the data center by using Virtual Resource Containers (VRCs) to form a Virtual Resource list, and each entry in the Virtual Resource list includes an available state of each kind of Resource, that is, whether the kind of Resource is currently available.
Each data center can automatically detect the dynamic joining and exiting of resources, such as the starting and closing of the equipment where the resources are located. When dynamic joining and exiting of resources is detected, a server of the data center automatically updates a virtual resource list in the VRC.
The VRC receives an instruction for inquiring available resources from the joint server through the advance reservation interface and returns the available resources of the VRC to the joint server through the advance reservation interface.
Step 101, the combined server judges that no data center meeting preset conditions exists, and decomposes the reservation request into simple reservation requests corresponding to a plurality of data centers according to the obtained available resources in the plurality of data centers.
In this step, the preset condition includes that the available resources of the data center include all resources in the reservation request.
In this step, the simple reservation request includes: reservation start time, reservation end time, QoS requirement parameters, resources requested for reservation.
Wherein the resource requested to be reserved in the simple reservation request is a part of the resource requested to be reserved in the reservation request.
In this step, when the reservation request is decomposed into simple reservation requests corresponding to the multiple data centers according to the obtained available resources in the multiple data centers, whether available resources exist in each data center can be respectively checked according to the types of the resources in the reservation request. For example, if the reservation request includes a computing resource, a storage resource, and a network resource, the reservation request may be decomposed into a plurality of three simple reservation requests, which are a simple reservation request corresponding to the computing resource, a simple reservation request corresponding to the storage resource, and a simple reservation request corresponding to the network resource, and then whether each data center has an available requested computing resource, an available requested storage resource, and an available requested network resource is determined according to available resources in each data center, and if so, the decomposed simple reservation request is sent to the corresponding data center.
For the requested resource in each simple reservation request, if there are multiple data centers that have the requested resource available, the formula can be followed
Calculating the deviation degree of one resource of each data center; and sending the simple reservation request to the data center with the minimum deviation degree obtained by calculation.
Wherein ε 2 is the deviation degree, m2 is the number of demand parameters contained in one resource in the reservation request, q2i2The i2 th demand parameter, r2, for a resource in the data centeri2The i2 th requirement parameter for a resource in the reservation request.
For example, if the demand parameters of the computing resources include the number of CPU cores and the size of the memory, m is 2, and if the demand parameters of the storage resources include the size of the storage space, m is 1.
And 102, the combined server sends each simple reservation request to a server of the corresponding data center.
In this step, after the server of each data center receives the simple reservation request, the server allocates the resource requested to be reserved in the simple reservation request to the user, and returns the allocated resource to the combined server.
Step 103, the federated server returns the received allocated resources from the servers of the plurality of data centers to the user.
According to the scheme of the embodiment of the invention, the request of available resources of a plurality of data centers is realized through the combined server, and when the resource of one data center is insufficient, the resources are distributed for the users from the plurality of data centers, so that the rejection rate of the reservation request is reduced.
Optionally, the method further includes:
when the combined server judges that one or more data centers meeting preset conditions exist, the combined server sends a reservation request to a server of one of the data centers meeting the preset conditions; the federated server returns to the user the allocated resources received from the server of one of the data centers that satisfies the preset condition.
The reservation request can be sent to any server in the data center meeting the preset condition, or the reservation request can be sent to the data center with the most idle resources in the data center meeting the preset condition.
Alternatively, the federated server follows a formula
Calculating the deviation degree of each data center, and sending the reservation request to a server of the data center with the minimum calculated deviation degree;
wherein ε 1 is the deviation degree, m1 is the number of demand parameters contained in the resource in the reservation request, q1i1The i1 th demand parameter, r1, for a resource in the data centeri1The i1 th demand parameter for the resource in the reservation request.
Optionally, the method further includes:
when the combined server receives a reservation request from a user, setting the advance reservation state of the user as a request reservation negotiation state; and after the joint server returns the allocated resources to the user, the pre-reserved state of the user is changed into a preset state.
Fig. 3 is a schematic diagram illustrating a change of an advance reservation state of a user according to an embodiment of the present invention. As shown in fig. 3, when the federated server receives a reservation request from a user, the advance reservation state of the user is a request reservation negotiation state; after the combined server returns the allocated resources to the user, successful negotiation is carried out, and the advance reservation state of the user is changed into a preset state.
Optionally, the method further includes:
after the joint server returns the allocated resources to the user, a reservation message is generated and put into a reservation queue; when the reservation starting time in the reservation message is reached, the combined server judges that the resources allocated in the reservation message are all available, changes the advanced reservation state of the user into an active state, informs the user that the required resources are bound, and informs the server for allocating the resources to set the resources allocated to the user as unavailable.
Optionally, when the reservation starting time in the reservation message reaches, if it is determined that the current advance reservation state of the user is the predetermined state, it is determined whether the resource allocated in the reservation message is available, and the subsequent process is continuously executed.
If the current advance reservation state of the user is judged to be a termination state or a revocation state, the process is ended.
As shown in fig. 3, when the reservation start time arrives, the advance reservation state of the user changes to the active state.
The reservation message comprises reservation starting time, reservation ending time, QoS requirement parameters, reservation types, reservation identifications and resources allocated to each data center.
The reservation type specifies whether the reservation message is a simple reservation message or a combined reservation message, the simple reservation message can be completed only by the resources of one data center, and the combined reservation message can be completed by the cooperation of the resources of a plurality of data centers.
The reserved identifier is an identifier allocated to the user after the joint server returns the allocated resources to the user.
When the reservation starting time in the reservation message is reached, the joint server reacquires the available resources of each data center, and judges whether the allocated resources are available according to the reacquired available resources, namely, whether the allocated resources exist in the reacquired available resources is searched.
After the method is adopted, the combined server can adopt a parallel method to process the reservation request, so that the processing speed is increased, and the user experience is improved.
Optionally, the method further includes:
when the federated server determines that some or all of the resources allocated in the reservation message are unavailable, the federated server proceeds to perform the step of acquiring available resources in one or more data centers.
Optionally, the method further includes:
when the reservation ending time in the reservation message is reached, the combined server changes the extraction reservation state of the user into a completion state and informs the data center for distributing the resources to release the resources distributed to the user;
or when the combined server judges that the preset termination condition is met, the combined server changes the advance reservation state of the user into a termination state, and informs the data center for distributing the resources to release the resources distributed to the user.
Wherein, the joint server judges that the preset termination condition is met, and the judgment comprises the following steps:
the federated server receives a termination request from the user.
Alternatively, a termination condition may be set in the federated server in advance, and when satisfied, the advance reservation state of the user is changed to a termination state. The termination condition may be any condition.
Optionally, the method further includes:
the federated server receives a modified reservation request from the user and proceeds to the step of acquiring available resources in one or more data centers.
When judging whether the data center meeting the preset condition exists, judging whether available resources of the data center comprise all resources in the modification reservation request.
Optionally, the method further includes:
after receiving a reservation modification request from a user, the combined server changes the advance reservation state of the user into a predetermined renegotiation state or an active renegotiation state; and after the joint server returns the resources allocated after renegotiation to the user, the advance reservation state of the user is changed into a preset state or an active state.
Specifically, when the advance reservation state of the user is a predetermined state before the combined server receives the modification reservation request from the user, the combined server changes the advance reservation state of the user into a predetermined renegotiation state after receiving the modification reservation request from the user; and after the joint server returns the resources allocated after renegotiation to the user, the advance reservation state of the user is changed into a preset state.
When the advance reservation state of the user is in an active state before the combined server receives a modification reservation request from the user, the combined server changes the advance reservation state of the user into an active renegotiation state after receiving the modification reservation request from the user; and after the joint server returns the resources allocated after renegotiation to the user, the pre-reserved state of the user is changed into an active state.
Optionally, the method further includes:
the combined server receives a revocation request from a user, changes the advance reservation state of the user into a revocation state, and notifies a data center which allocates resources to release the resources allocated to the user.
Optionally, the method further includes:
and when the joint server judges that the available resources of all the data centers do not comprise all the resources in the reservation request, the joint server returns a rejection message to the user.
Optionally, the federated server changes the advance reservation state of the user to a refusal state.
Referring to fig. 4, an embodiment of the present invention further provides a device for implementing resource reservation, including:
the system comprises an acquisition module, a reservation module and a resource allocation module, wherein the acquisition module is used for receiving a reservation request from a user and acquiring available resources in a plurality of data centers; receiving allocated resources from servers of a plurality of data centers;
the processing module is used for judging that no data center meeting the preset condition exists, and decomposing the reservation request into simple reservation requests corresponding to a plurality of data centers according to the obtained available resources in the plurality of data centers; the preset condition comprises that available resources of the data center comprise all resources in the reservation request; sending each simple reservation request to a server of a corresponding data center;
a return module to return the received allocated resources from the servers of the plurality of data centers to the user.
In the apparatus of the embodiment of the present invention, the processing module is further configured to:
when judging that one or more data centers meeting preset conditions exist, the combined server sends a reservation request to a server of one of the data centers meeting the preset conditions;
the acquisition module is further configured to:
receiving an allocated resource from a server of one of the data centers that satisfies a preset condition;
the return module is further to:
the allocated resources received from the server of one of the data centers that satisfies the preset condition are returned to the user.
In the apparatus of the embodiment of the present invention, the processing module is further configured to:
the advance reservation state of the user is changed to a predetermined state.
In the apparatus of the embodiment of the present invention, the return module is further configured to:
after the allocated resources are returned to the user, a first notification message is sent to the processing module;
the processing module is further configured to:
receiving a first notification message, generating a reservation message and putting the reservation message into a reservation queue; when the reservation starting time in the reservation message is reached, judging that all the resources allocated in the reservation message are available, changing the advance reservation state of the user into an active state, informing the user that the required resources are bound, and informing the data center for allocating the resources to set the resources allocated to the user as unavailable.
In the apparatus of the embodiment of the present invention, the processing module is further configured to:
when judging that part or all of the resources allocated in the reservation message are unavailable, sending a second notification message to the acquisition module;
the acquisition module is further configured to:
and receiving the second notification message, and continuing to execute the step of acquiring available resources in one or more data centers.
In the apparatus of the embodiment of the present invention, the processing module is further configured to:
when the reservation ending time in the reservation message is reached, changing the advance reservation state of the user into a completion state, and informing a data center for distributing resources to release the resources distributed to the user;
or when the combined server judges that the preset termination condition is met, changing the advance reservation state of the user into a termination state, and informing the data center for distributing the resources to release the resources distributed to the user.
In the apparatus of the embodiment of the present invention, the obtaining module is further configured to:
a modified reservation request is received from a user and the step of acquiring available resources in one or more data centers is continued.
In the apparatus of the embodiment of the present invention, the obtaining module is further configured to:
after receiving a request for modifying the reservation from a user, sending a third notification message to the processing module;
the return module is further to:
after the resources distributed after renegotiation are returned to the user, a fourth notification message is sent to the processing module;
the processing module is further configured to:
receiving a third notification message, and changing the advance reservation state of the user into a predetermined renegotiation state or an active renegotiation state; and receiving a fourth notification message, and changing the advance reservation state of the user into a preset state or an active state.
In the apparatus of the embodiment of the present invention, the obtaining module is further configured to:
receiving a revocation request from a user, and sending a fifth notification message to the processing module;
the processing module is further configured to:
and receiving a fifth notification message, changing the advance reservation state of the user into a revocation state, and notifying the data center for allocating resources to release the resources allocated to the user.
It should be noted that the above-mentioned embodiments are only for facilitating the understanding of those skilled in the art, and are not intended to limit the scope of the present invention, and any obvious substitutions, modifications, etc. made by those skilled in the art without departing from the inventive concept of the present invention are within the scope of the present invention.