Detailed Description
In order to describe the technical contents, the achieved objects and effects of the present invention in detail, the following description will be made with reference to the embodiments in conjunction with the accompanying drawings.
Referring to fig. 1, a method for intelligently sensing cloud resource instance allocation management includes the steps of:
acquiring a first instance demand request of a first user, and inquiring whether a second instance demand request of a matched second user exists in a user information pool according to the first instance demand request;
if yes, associating the first user with the second user to generate an association user relationship; and applying for a common instance according to the first instance demand request and the second instance demand request.
From the above description, the beneficial effects of the invention are as follows: by acquiring a first instance demand request of a first user, inquiring whether a second instance demand request of a second user matched with the first instance demand request exists in a user information pool according to the first instance demand request, when the matched second instance demand request exists, correlating the first user with the second user to generate an association user relation, and applying for a shared instance according to the first instance demand request and the second instance demand request, the correlated first user and the second user share one instance, so that the cost of the first user and the second user for using the instance can be reduced under the condition that the normal use of the users is not influenced, namely the cost of using the instance by a user for a bill user is reduced, more instances can be vacated in a system for other users, and the use requirement of the other users for the instance is met.
Further, the associating the first user with the second user, after generating the association user relationship, includes:
removing the first instance demand request and the second instance demand request from the user information pool;
generating an associated instance request according to the associated user relationship, the first instance demand request and the second instance demand request, and throwing the updated associated instance request into the user information pool.
As can be seen from the above description, by associating the first user with the second user and generating the association user relationship, and rejecting the old first instance demand request and the second instance demand request in the user information pool, the new association instance request with the association relationship is put into the user information pool, so as to avoid the situation that the old second instance demand request matches with the first instance demand request again, and the matching is abnormal.
Further, the first instance demand request and the second instance demand request include instance capacity;
querying a user information pool for a second instance demand request of a matching second user according to the first instance demand request comprises:
an instance capacity according to the first instance demand request matches all of the second instance demand requests of the appropriate instance capacity in the user information pool.
As can be seen from the above description, the first instance demand request and the second instance demand request are matched according to the instance capacity in the instance demand requests of the users, so that the first user and the second user with similar instance capacities for demand use can be associated.
Further, the first instance demand request and the second instance demand request include an instance type and an instance usage period;
querying a user information pool for a second instance demand request of a matching second user according to the first instance demand request comprises:
matching all second instance demand requests with the same instance type in the user information pool according to the instance type of the first instance demand request to obtain a first matching set;
matching all second instance demand requests with different instance use time periods in the first matching set according to the instance use time periods of the first instance demand requests to obtain a second matching set;
and selecting a group of second users matched with the first user from the second matching set.
As can be seen from the above description, the first instance demand request and the second instance demand request are first matched through the instance type, so as to obtain a first matching set with the same instance type, and then a second user with a complementary instance use time period is matched in the first matching set through the instance use time period, so as to obtain a second matching set, and the best second user is selected in the second matching set, so that not only is the matching efficiency of the first user and the second user improved, but also the matching effect is improved.
Further, before the updated association instance request is put into the user information pool, the method includes:
judging whether the instance using time period of the associated instance request is smaller than a time period threshold value, if yes, putting the associated instance request into the user information pool.
As can be seen from the above description, by determining whether the use time period of the instance of the second user is less than the time period threshold, that is, when the use time period is less than the time period threshold, the system will identify that the corresponding second user does not have a sufficient available time period, so that the request of the associated instance is not matched any more, the system matching energy consumption is reduced, and the matching efficiency is also improved.
Further, the method further comprises the following steps:
generating mounting information according to the first instance demand request and the second instance demand request;
and mounting the corresponding instance in an instance resource pool according to the mounting information.
As can be seen from the above description, when the first instance demand request and the second instance demand request include mounting information, the system mounts the corresponding instances of the first user and the second user in the instance resource pool, that is, the instances are still in the period of time available to the user and the current user does not need to use, the user can mount the instances for other users to use, thereby improving the utilization rate of the instances;
further, the mounting information includes a mounting time period;
the step of mounting the corresponding instance in the instance resource pool according to the mounting information comprises the following steps:
generating a temporary mounting mark according to the instance type corresponding to the instance to be mounted;
acquiring current system time, judging whether the system time is in the range of the mounting time period, if so, continuing mounting; if not, finishing the mounting and destroying the mounting mark.
According to the description, the temporary mounting mark is generated according to the instance type corresponding to the mounting instance, so that the temporarily mounted instance and the non-temporarily mounted instance can be distinguished, and when the mounting time is not in the mounting time period, the mounting mark is immediately destroyed, the instance is prevented from being used by other users outside the mounting time period, and the system stability is improved.
Further, before the obtaining the first instance requirement request of the first user, the method includes:
and acquiring user login information, judging whether the user login information is temporary login or not according to the user login information, and if so, generating a temporary account and storing the temporary account.
According to the description, when the user login information is the temporary login account, namely, after the user logs in a guest state, the system generates the temporary account for the currently logged-in user for temporary use by the user, so that the trouble that the temporary user needs to register the account is avoided, and the user experience is improved.
Further, the temporary account includes storing a threshold time;
judging whether a user is in a login state or not according to the temporary account, if so, updating the storage threshold time; if not, judging whether the storage time of the temporary account number reaches the storage threshold time, and if so, destroying the temporary account number.
As can be seen from the above description, by setting the storage threshold time, and destroying the temporary account after the storage time of the temporary account reaches the storage threshold time, that is, after the storage time of the temporary account reaches the storage threshold time, it is indicated that the user has not used the account for a long time, the storage energy consumption of the system is reduced by destroying the temporary account.
Referring to fig. 2, another embodiment of the present invention provides an intelligent cloud resource instance allocation management system, which includes a memory, a processor, and a computer program stored on the memory and capable of running on the processor, wherein the steps in the intelligent cloud resource instance allocation management method are implemented when the processor executes the computer program.
The service instance distribution method and the service instance distribution system can provide the instance in the form of the spelling list for the user according to the requirement of the user for using the instance, so that the user experience is improved, and the following description is provided by a specific embodiment:
example 1
Referring to fig. 1, a method for intelligently sensing cloud resource instance allocation management includes the steps of:
s1, acquiring a first instance demand request of a first user, and inquiring whether a second instance demand request of a matched second user exists in a user information pool according to the first instance demand request; wherein the first instance demand request and the second instance demand request include an instance capacity, an instance type, and an instance usage period; the first user and the second user are users selecting examples to be used in a prepayment mode such as year around, month around and the like;
the specific query mode comprises the following steps:
s11, matching all second instance demand requests of the appropriate instance capacity in the user information pool according to the instance capacity of the first instance demand request; if the memory capacity required in the instance capacity of the first instance demand request is 2GB, all second instance demand requests with the memory capacity required for matching the instance capacity in the user information pool being 2GB are matched; if the cloud disk capacity required in the instance capacity of the first instance demand request is 20GB, all second instance demand requests with the cloud disk capacity required by the instance capacity of 20GB are matched in the user information pool;
in another alternative embodiment, if the memory capacity required in the instance capacity of the first user is 3GB, all the second instance requirement requests with the memory capacity required for matching the instance capacity in the user information pool being 1GB, that is, implementing complementary matching of the memory capacities; if the required cloud disk capacity in the instance capacity of the first instance demand request is 30GB, all second instance demand requests with the required cloud disk capacity of 10GB are matched in the user information pool, namely complementary matching of the cloud disk capacity is realized; and the first user and the second user can use an instance simultaneously;
in another alternative embodiment the method comprises the steps of:
s12, matching all second instance demand requests with the same instance type in the user information pool according to the instance type of the first instance demand request to obtain a first matching set; if the instance type of the first instance demand request is a general computing type instance, then all second instance demand requests of which the matching instance types are computing type instances in the user information pool; in another example, if the instance type of the first instance requirement request is a network enhanced instance, then all the second instance requirement requests in the user information pool whose matching instance types are network enhanced instances;
s13, matching all second instance demand requests with different instance use time periods in the first matching set according to the instance use time periods of the first instance demand requests to obtain a second matching set; if the usage time period of the first user is 8:30-12:00, matching the time period complementary to the usage time period 8:30-12:00 in the user information pool, if the usage time period is 13:00-18:00, or if the usage time period cannot be matched to the time period for completing complementation in the user information pool, performing complementation matching in an acceptable crossing range, if the matched usage time period is 11:30-16:30, and the like, wherein the complementation time period with the crossed usage time period but the smaller crossing range exists; when the first user and the second user are capacity complementary spelling sheets, the instance can be used at the same time;
s14, selecting a group of second users matched with the first user from the second matching set; the optimal second user can be matched according to the instance capacity, the instance type and the instance use time period; if a plurality of adaptive second users exist, ordering according to the time of the second instance demand request input into the user information pool, and selecting the second users with the earlier input time;
when the second user is not matched with the first user, converting the first instance demand request into a second instance demand request, and storing the second instance demand request into the user information pool;
s2, if the user exists, associating the first user with the second user to generate an association user relationship; requesting to apply for a shared instance according to the first instance demand request and the second instance demand request; specific:
s21, eliminating the first instance demand request and the second instance demand request from the user information pool; deleting the first instance demand request and the second instance demand request which are paired, if in the subsequent use process, the first user or the second user has a situation that the use of the instance is not needed, then generating an instance demand request from the newly generated instance demand request according to the rest of the first instance demand request or the second instance demand request, and matching in the user information pool;
s22, generating an associated instance request according to the associated user relationship, the first instance demand request and the second instance demand request, and throwing the updated associated instance request into the user information pool; integrating the instance capacity, the instance type and the instance use time period corresponding to the first user and the second user, for example, the instance capacity of the first user is 1GB, the instance type is a computing type instance and the instance use time period is 6:00-12:00, the instance capacity of the second user is 3GB, the instance type is a computing type instance and the instance use time period is 13:30-18:00, the instance capacity corresponding to the integrated account number is 4GB, the instance type is a computing type instance and the instance use time period is 6:00-18:00, and a shared account number is generated and provided for the first user and the second user, wherein the user can use the shared account number arbitrarily in a non-instance use time period; the first user and the second user log in a use instance according to the shared account; namely, the steps are realized according to the instance use information such as the instance capacity, the instance type, the instance use time period and the like of different users; then carrying out complementary matching or type collocation of the examples according to the example use information of different users; then, notifying different users to carry out associated spelling according to the matching result; carrying out association management on the account numbers of the users selecting the spelling list and providing corresponding spelling list preferential;
wherein in an optional implementation manner, before the updated association instance request is put into the user information pool, the method further comprises the steps of:
s22a, judging whether the instance using time period of the associated instance request is smaller than a time period threshold value, if yes, putting the associated instance request into the user information pool; the second user comprises an independent user corresponding to the second instance demand request and also comprises a single user corresponding to the associated instance request; if the continuously usable time is less than 3 hours, the association instance request is not put into the user information pool, if the association instance request time period is 00:00-3:00 and 6:00-24:00, namely the remaining usable time period in the second user is 3:00-6:00, the shorter time period is only 3 hours, and the time period is also not a normal use time period, so that the corresponding association instance request is not put into the user information pool; if the usage time period of the second user is 6:00-22:00, the remaining available time period further includes 0:00-6:00 and 22:00-24:00, that is, 8 hours remain and is a continuous time period, and the usage requirements of part of the users can be met, so that the associated instance request is continuously put into the user information pool.
Example two
The present embodiment is different from the first embodiment in that it further includes;
a1, generating mounting information according to the first instance demand request and the second instance demand request; the mounting information comprises a mounting time period; namely, a user can mount the purchased instance on the system according to the self demand in a time period without using the instance;
a2, mounting the corresponding instance in an instance resource pool according to the mounting information;
a21, generating a temporary mounting mark according to the instance type corresponding to the instance to be mounted;
a22, acquiring current system time, judging whether the system time is in the range of the mounting time period, and if so, continuing mounting; if not, finishing mounting and destroying the mounting mark; if the prepaid subscriber does not need to use the instance, the instance used by the prepaid subscriber is mounted; meanwhile, compensating the amount obtained by the example mounting to a mounting user in a preset share; the mounting price of the mounting example floats along with the market price; meanwhile, the association instance request is also applicable to the mounting method; when the first user is to temporarily use the instance outside the applied time period, the first user can coordinate with the second user to use the instance; or a new instance is called, and after the first user uses the new instance, the first user can carry out compensation by mounting own instance in the using time period later; that is, the first user or the second user mounts the own instance for compensating the time of temporarily calling the instance or obtaining price compensation;
the method for optimizing the login mode of the user login further comprises the following steps:
b1, acquiring user login information, judging whether the user login information is temporary login or not according to the user login information, if yes, generating a temporary account and storing the temporary account;
specifically, the temporary account number includes a storage threshold time;
judging whether a user is in a login state or not according to the temporary account, if so, updating the storage threshold time; if not, judging whether the storage time of the temporary account reaches the storage threshold time, and if so, destroying the temporary account; the user can purchase the cloud host without registering the cloud manufacturer account, so that the trouble of registering the user to the cloud platform is avoided; and if the user needs to use the cloud server for a long time, generating the temporary account into a formal account.
Example III
Referring to fig. 2, an intelligent cloud resource instance allocation management system includes a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the intelligent cloud resource instance allocation management method according to any one of the first or second embodiments when executing the computer program.
In summary, according to the method and the system for intelligent perception cloud resource instance allocation management provided by the invention, by acquiring the first instance demand request of the first user, inquiring whether the second instance demand request of the second user matched with the first instance demand request exists in the user information pool according to the first instance demand request, when the matched second instance demand request exists, associating the first user with the second user to generate an associated user relationship, and applying for a shared instance according to the first instance demand request and the second instance demand request, so that the associated first user and the second user share one instance, under the condition that the normal use of the users is not affected, the cost of using the instance by the first user and the second user can be reduced, namely the cost of using the instance by the user can be reduced by realizing the role of using the list by the user, and meanwhile, more instances can be vacated for other users in the system, and the use demands of the instance by other users are met; when the matched second instance demand request does not exist, generating a new second instance demand request according to the first instance demand request and putting the new second instance demand request into a user information pool to wait for subsequent matching; in addition, in the process of logging in by the user, the user is provided to log in the cloud server in an account-free mode, so that the user can purchase the cloud host without registering the account of a cloud manufacturer, and the trouble of registering the user to the cloud platform is avoided.
The foregoing description is only illustrative of the present invention and is not intended to limit the scope of the invention, and all equivalent changes made by the specification and drawings of the present invention, or direct or indirect application in the relevant art, are included in the scope of the present invention.