A kind of production method of cloud computing commodity and device, electronic equipment
Technical field
The present invention relates to field of cloud calculation more particularly to a kind of production method of cloud computing commodity and device, electronic equipments.
Background technology
In the marketing system of traditional commodities, stock is to show whether user can buy a water level line of commodity, such as
Fruit stock can be inaccurately to sell that certain risk, such as user is brought to find to be sold without commodity, it is necessary to cancel the order after paying.For
Traditional commodities, can shift to an earlier date the stockpile number of typing commodity, often sell a commodity and carry out subtracting one operation to stockpile number, if
Stockpile number does not allow then to sell for 0.
But the cloud computings commodity such as virtual machine (VM) sell that mode is again different, since VM relies on the resource of host
(resource includes network, server, storage, application software, service etc.), such as only remaining 2 hosts all 1 gigabytes of remaining 1 core
The memory of (giga binary byte, GiB), although total amount has the resource of 2 core 2GiB, due in different physical machines
On, therefore the resources such as 2 core 2GiB, 1 core 2GiB cannot be sold, so stock needs to consider the problems of fragmentation.
Current a solution is timing investigation fragment, calculates remaining resource, updates in inventory system.The solution
Certainly there are following defects for scheme:
(1) timing calculates has delay, when it is concurrent it is larger, resource is nervous when be present with and select cloud computing commodity when see
Stock and the stock after buying successfully are inconsistent, cause the actual situation without resource for production of bottom after buying successfully.
(2) since the cloud computing commodity of plurality of specifications, such as Cloud Server (Elastic can be produced above host
Compute Service, ECS), resource consumption during a kind of cloud computing commodity production of specification is it is possible that can be to other specifications
Cloud computing commodity generate interference, stock are caused to be not allowed, shown in following Tables 1 and 2, when user has purchased the ECS of a 1 core 2GiB
Afterwards, the stock of 1 core 1GiB becomes 1 from 2, and the stock of 2 core 2GiB becomes 0 from 1, and producing a kind of ECS of specification can be more to other
The stock of kind specification ECS has an impact.
Data before table 1, production ECS
Data after table 2, production ECS
(3) in order to reduce the resource fragmentation situation of VM, managing and control system can often mutually shape be shut down in migration between host
The VM of state, resource of transferring to other use, to realize the purpose for reducing fragment stock buildup, migrating has the stock calculated larger shadow
It rings, if migrated during place an order, it is likely that cause after placing an order successfully that bottom is actual not to have resource for production
Situation.
The content of the invention
The application provides a kind of production method and device, electronic equipment of cloud computing commodity, can ensure after buying successfully
Bottom centainly has resource that can produce.
The application adopts the following technical scheme that.
A kind of production method of cloud computing commodity, including:
The cloud computing commodity to be purchased that user confirms are detected, the money needed for the cloud computing commodity to be purchased will be produced
Source, labeled as the resource of preemption;
After detecting the cloud computing commodity purchasing success, the cloud computing commodity are produced using the resource of the preemption.
Optionally, it is described to produce resource needed for the cloud computing commodity to be purchased, labeled as the resource bag of preemption
It includes:
In host of the stockpile number of the cloud computing commodity to be purchased more than 0, treated described in distribution production
Resource needed for the cloud computing commodity of purchase;
It is the resource of preemption by the resource mark distributed.
Optionally, the cloud computing commodity to be purchased that the detection user confirms, will produce the cloud computing to be purchased
Resource needed for commodity includes labeled as the resource of preemption:
When detect user confirm cloud computing commodity to be purchased after, if surplus resources cannot produce it is described to be purchased
Cloud computing commodity, then the user is notified to confirm failure or notifies the user in the cloud computing commodity that can be produced at present
In redefine cloud computing commodity to be purchased;It, will if surplus resources can produce the cloud computing commodity to be purchased
The resource needed for the cloud computing commodity to be purchased is produced, labeled as the resource of preemption.
Optionally, if the surplus resources can produce the cloud computing commodity to be purchased, will be treated described in production
Resource needed for the cloud computing commodity of purchase, includes labeled as the resource of preemption:
If surplus resources can produce the cloud computing commodity to be purchased, but production can not be distributed in surplus resources
Resource needed for the cloud computing commodity to be purchased then notifies the user to confirm failure;It if can be in surplus resources
Distribution produces the resource needed for the cloud computing commodity to be purchased, then is the resource of preemption by the resource mark distributed.
Optionally, it is described to produce resource needed for the cloud computing commodity to be purchased, labeled as the resource bag of preemption
It includes:
The information of distributed resource is recorded in database is preempted, including at least the cloud corresponding to resource address, resource
Calculate commodity;The information for the resource that the preemption database preempts for preservation;
It is described by the status modifier for the resource distributed alternatively, for preserving in the database of the information of resource
Cloud computing commodity preemption to be purchased.
Optionally, the cloud computing commodity to be purchased that the detection user confirms refer to:During detection user confirms an order
The cloud computing commodity included;
It is described to detect that the cloud computing commodity purchasing successfully refers to:Detect the user to comprising described to be purchased
The order of cloud computing commodity is paid successfully.
Optionally, it is described to produce resource needed for the cloud computing commodity to be purchased, after the resource of preemption
It further includes:
If it exceeds the cloud computing commodity purchasing success is also not detected in predetermined time length, then the preemption is discharged
Resource.
Optionally, after the cloud computing commodity to be purchased that the detection user confirms, the cloud computing commodity purchase is detected
It is further included before buy work(:When detecting other cloud computing commodity to be purchased that the user confirms, prompt other described in user
Cloud computing commodity to be purchased confirm failure.
A kind of process units of cloud computing commodity, including:
Mark module for detecting the cloud computing commodity to be purchased of user's confirmation, will produce the cloud meter to be purchased
The resource needed for commodity is calculated, labeled as the resource of preemption;
Module is produced, for after the cloud computing commodity purchasing success is detected, being produced using the resource of the preemption
The cloud computing commodity.
Optionally, the mark module will produce resource needed for the cloud computing commodity to be purchased, labeled as preemption
Resource include:
The mark module divides in host of the stockpile number of the cloud computing commodity to be purchased more than 0
With the resource produced needed for the cloud computing commodity to be purchased;It is the resource of preemption by the resource mark distributed.
Optionally, the cloud computing commodity to be purchased that the mark module detection user confirms, will produce described to be purchased
Cloud computing commodity needed for resource, include labeled as the resource of preemption:
The cloud computing commodity to be purchased that user confirms are detected, if surplus resources cannot produce the cloud meter to be purchased
Commodity are calculated, then the user is notified to confirm failure or notify the user in the cloud computing commodity that can be produced at present again
Determine cloud computing commodity to be purchased;If surplus resources can produce the cloud computing commodity to be purchased, institute will be produced
The resource needed for cloud computing commodity to be purchased is stated, labeled as the resource of preemption.
Optionally, if the surplus resources can produce the cloud computing commodity to be purchased, will be treated described in production
Resource needed for the cloud computing commodity of purchase, includes labeled as the resource of preemption:
If surplus resources can produce the cloud computing commodity to be purchased, but production can not be distributed in surplus resources
Resource needed for the cloud computing commodity to be purchased then notifies the user to confirm failure;It if can be in surplus resources
Distribution produces the resource needed for the cloud computing commodity to be purchased, then is the resource of preemption by the resource mark distributed.
Optionally, the mark module will produce resource needed for the cloud computing commodity to be purchased, labeled as preemption
Resource include:
The mark module records the information of distributed resource in database is preempted, including at least resource address, money
Cloud computing commodity corresponding to source;The information for the resource that the preemption database preempts for preservation;
Alternatively, the mark module is for preserving in the database of the information of resource, by the state for the resource distributed
It is revised as being preempted by the cloud computing commodity to be purchased.
Optionally, the cloud computing commodity to be purchased that the detection user confirms refer to:The order that detection user is confirmed
In the cloud computing commodity that include;
It is described to detect that the cloud computing commodity purchasing successfully refers to:Detect the user to comprising described to be purchased
The order of cloud computing commodity is paid successfully.
Optionally, the process units further includes:
Judgment module, for resource needed for the cloud computing commodity to be purchased, mark will to be produced in the mark module
After being denoted as the resource of preemption, if it exceeds the cloud computing commodity purchasing success is also not detected in predetermined time length, then discharge
The resource of the preemption.
Optionally, the process units further includes:
Detection module, for detection user confirm cloud computing commodity to be purchased after, detect the cloud computing business
Before product are bought successfully, when detecting other cloud computing commodity to be purchased that the user confirms, other described in user treat is prompted
The cloud computing commodity of purchase confirm failure.
A kind of electronic equipment for being used to produce cloud computing commodity, including:Memory and processor;
The memory is used to preserve the program for producing cloud computing commodity;The journey for being used to generate cloud computing commodity
Sequence performs following operation when reading execution by the processor:
The cloud computing commodity to be purchased that user confirms are detected, the money needed for the cloud computing commodity to be purchased will be produced
Source, labeled as the resource of preemption;
After detecting the cloud computing commodity purchasing success, the cloud computing commodity are produced using the resource of the preemption.
The application includes advantages below:
At least one embodiment of the application passes through the cloud according to user's selection during user's purchase cloud computing commodity
It calculates commodity and carries out resource preemption, using the resource production cloud computing commodity of preemption after buying successfully, so in concurrent larger, money
Also it can guarantee that cloud computing commodity bottom after buying successfully centainly has resource that can produce in the case of the anxiety of source;Due to making during production
It is the resource of preemption, therefore produces the storehouse that a kind of cloud computing commodity of specification do not interfere with other specification cloud computing commodity
It deposits;Further, since being produced using the resource of preemption, therefore even if migrating in purchasing process, will not cause not having
There is the situation that resource can produce.
In a kind of realization method of the embodiment of the present application, remaining money is represented with the stockpile number of the cloud computing commodity of each specification
Source, it is only necessary to judge whether the stockpile number of cloud computing commodity to be purchased is more than 0, it is possible to learn whether surplus resources are enough
Cloud computing commodity to be purchased are produced, it is to be purchased whether the quantity without judging various surplus resources respectively is greater than or equal to
Cloud computing commodity needed for resource, it is very convenient.
In a kind of realization method of the embodiment of the present application, the malice to resource is prevented by timing or control quantity on order
Preemption.
Certainly, implementing any product of the application must be not necessarily required to reach all the above advantage simultaneously.
Description of the drawings
Fig. 1 is the flow chart of the production method of the cloud computing commodity of embodiment one;
Fig. 2 is the flow chart of the example of embodiment one;
Fig. 3 is the schematic diagram of the process units of the cloud computing commodity of embodiment two.
Specific embodiment
The technical solution of the application is described in detail below in conjunction with accompanying drawings and embodiments.
If it should be noted that not conflicting, each feature in the embodiment of the present application and embodiment can be tied mutually
It closes, within the protection domain of the application.In addition, though logical order is shown in flow charts, but in some situations
Under, it can be with the steps shown or described are performed in an order that is different from the one herein.
In one configuration, for produce the computing device of cloud computing commodity may include one or more processors (CPU),
Input/output interface, network interface and memory (memory).
Memory may include computer-readable medium in volatile memory, random access memory (RAM) and/or
The forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is computer-readable medium
Example.Memory may include module 1, module 2 ... ..., module N (N is the integer more than 2).
Computer-readable medium includes permanent and non-permanent, removable and non-movable storage medium, can be by appointing
What method or technique realizes that information stores.Information can be computer-readable instruction, data structure, the module of program or other
Data.The example of the storage medium of computer includes, but are not limited to phase transition internal memory (PRAM), static RAM
(SRAM), dynamic random access memory (DRAM), other kinds of random access memory (RAM), read-only memory
(ROM), electrically erasable programmable read-only memory (EEPROM), fast flash memory bank or other memory techniques, read-only optical disc are read-only
Memory (CD-ROM), digital versatile disc (DVD) or other optical storages, magnetic tape cassette, disk storage or other magnetic
Property storage device or any other non-transmission medium, the information that can be accessed by a computing device available for storage.According to herein
Define, computer-readable medium include non-temporary computer readable media (transitory media), such as modulation data
Signal and carrier wave.
Embodiment one, a kind of production method of cloud computing commodity, as shown in Figure 1, including step S110~S120:
The cloud computing commodity to be purchased that S110, detection user confirm, will produce the cloud computing commodity institute to be purchased
The resource needed, labeled as the resource of preemption;
S120, after cloud computing commodity purchasing success is detected, the resource of the preemption is used to produce the cloud meter
Calculate commodity.
The present embodiment by user buy cloud computing commodity during and according to user select cloud computing commodity into
Row resource preempts, using the resource production cloud computing commodity of preemption after buying successfully, so in concurrent feelings larger, resource is nervous
Also it can guarantee that cloud computing commodity bottom after buying successfully centainly has resource that can produce under condition;Due to using preemption during production
Resource, therefore produce the stockpile number that a kind of cloud computing commodity of specification do not interfere with other specification cloud computing commodity;In addition,
It is produced due to the use of the resource of preemption, therefore even if being migrated in purchasing process, will not cause no resource can
With the situation of production.
In the present embodiment, cloud computing commodity can be, but not limited to include virtual machine, for example cloud computing commodity to be purchased can
To be the virtual machine of certain specification (certain model in other words);Certainly, cloud computing commodity can also include it is other types of, can go out
Sell or be leased to the combination of the cloud computing resources or certain several cloud computing resources of user.Production cloud computing commodity can be, but not limited to
Refer to:Create virtual machine.Production is that actually resource is occupied in bottom, for example incorporates the resource on host into Mr. Yu
A virtual machine;And preempt and then simply resource is marked, there is no occupy resource on the host of bottom reality.
In the present embodiment, resource is marked as the resource of preemption, then means that the resource is preempted.The money marked
Source belongs to surplus resources, and surplus resources refer to the resource outside each cloud computing commodity resource occupied and the resource preempted, i.e.,:Not
Use resource.Here " unused ", which does not mean only that, is not produced as cloud computing commodity, and is not preempted.Also
It is to say, once resource indicates that the resource will be used to produce corresponding cloud computing commodity labeled as the resource preempted, and cannot be again
Surplus resources are treated as, the resource of preemption can be deducted when counting surplus resources.
In the present embodiment, surplus resources can be represented with the stockpile number of the cloud computing commodity of each specification, such as above
In the case of shown in table 1,1 core 1Gib of residue in the host that address is 10.1.1.1, and 1 core 1Gib, 1 core 2Gib, 2 cores
The stockpile number of the cloud computing commodity of 2Gib is respectively 1,0,0;Remaining 2 cores in the host that address is 10.1.1.2
2Gib, 1 core 1Gib, 1 core 2Gib, the stockpile number of cloud computing commodity of 2 core 2Gib are respectively 2,1,1.
When surplus resources are represented with the stockpile number of the cloud computing commodity of each specification, need to examine when counting stockpile number
Consider fragment;On single host remaining certain resource (such as CPU) sum divided by needed for the cloud computing commodity of certain specification should
Kind resource quantity, can obtain this kind of resource can produce the cloud computing commodity of several specifications, for example address is in table 1 above
10.1.1.2 remaining 2 cores in host, if the cloud computing commodity of some specification need 1 core, 2 divided by 1 obtains 2, shows
Check figure can produce the cloud computing commodity of 21 core.For each host, above-mentioned meter is carried out respectively to remaining various resources
It calculates, the number of cloud computing commodity of certain specification can be produced by obtaining the various surplus resources of the host, take minimum value conduct therein
The stockpile number of the specification cloud computing commodity on the host.Such as in table 1 above, for the cloud computing commodity of 1 core 2GiB, though
Surplus resources in the host that right address is 10.1.1.2 can produce the cloud computing business of 2 specifications according to check figure calculating
Product, but calculated according to memory, 2/2=1,1 can only be produced, because this address is 1 core 2GiB specifications in the host of 10.1.1.2
Cloud computing commodity stockpile number be 1.
, it is necessary to deduct dimension cloud computing business after part resource to be marked as to the resource of some cloud computing commodity preemption
The stockpile number of product;For example assume the situation of surplus resources as shown in Table 1;If user confirms the cloud of 1 core 2GiB of purchase
When calculating commodity, and being camped on the resource of 1 core 2Gib in the host that address is 10.1.1.2, the cloud meter of three kinds of specifications in table 1
Calculating the stockpile number of commodity will accordingly change.But when producing the cloud computing commodity of 1 core 2Gib, due to having been deducted during preemption
Stockpile number is crossed, so production can't cause the variation of stockpile number in itself.
In the present embodiment, it can be, but not limited to be stored in resource pool with the situation of timing acquiring surplus resources and preservation
In;When needing to mark the resource of preemption, directly from resource pool resource can be selected to be marked.For example every can be gathered
The stockpile number of each specification cloud computing commodity on host, by the summation of the stockpile number of each unit (ZONE) all hosts
As the corresponding stockpile number of the unit;Each unit can be with the corresponding collection result of periodic synchronous to resource pool.If point
Unit is bought (i.e. user is bought in some unit, and purchase does not allow across unit), then surplus resources refer to
Surplus resources in the unit that user is bought.
In the present embodiment, the situation for the cloud computing commodity to be purchased that detection user confirms can be, but not limited to refer to detect
User places an order but the cloud computing commodity in still unpaid order, that is, confirms the cloud meter in purchase but the order without completing to pay
Commodity are calculated, for example user chooses cloud computing commodity to be purchased and clicks on " clearing " or the buttons such as " definite " or " next step "
Expression places an order, and just means the success that places an order after preempting successfully, and preemption failure (inadequate resource or can not markup resources) is then meaned
It and places an order unsuccessfully.Pending payment order is generated after can placing an order or place an order in user successfully, pending payment order is generated if placing an order,
Pending payment order will be deleted or closed when then preempting unsuccessfully.The successful situation of cloud computing commodity purchasing, that is, user completes purchase
It buys, for example user completes to pay to pending payment order.If user deletes or close pending payment order, discharge what is accordingly preempted
Resource, the resource that will be preempted are classified as surplus resources again.
In the present embodiment, in the cloud platform that the step S110~S120 can be by selling cloud computing commodity some or certain
A little equipment perform;The step S110 and S120 can be performed in identical equipment, can also be performed on different devices;This reality
Applying the method for example can be performed by individual equipment, can also be performed by distributed apparatus.
In a kind of system using the present embodiment method, user can select by client or on webpage from cloud platform
Purchase cloud computing commodity;After user places an order, cloud platform can perform above-mentioned steps S110;After user completes payment, cloud platform
Above-mentioned steps S120 can be performed.It only needs to be extended on the basis of original scheme using the method for the present embodiment, it is compatible
Property is good.
In a kind of realization method, surplus resources are represented with the stockpile number of the cloud computing commodity of each specification;
It is described to produce resource needed for the cloud computing commodity to be purchased, it can include labeled as the resource of preemption:
In host of the stockpile number of the cloud computing commodity to be purchased more than 0, treated described in distribution production
Resource needed for the cloud computing commodity of purchase;
It is the resource of preemption by the resource mark distributed.
In this realization method, when surplus resources are represented with the stockpile number of the cloud computing commodity of each specification, it is only necessary to sentence
Whether the stockpile number of disconnected cloud computing commodity to be purchased is more than 0, and (for example cloud computing commodity to be purchased are specification A, then only
It need to judge 0) whether the cloud computing commodity stocks quantity of specification A is more than, it is possible to it is to be purchased to learn whether surplus resources are enough to produce
Whether the cloud computing commodity bought, the quantity without judging various surplus resources respectively are greater than or equal to cloud computing to be purchased
Resource needed for commodity is very convenient.
It, can be with when the stockpile number for having cloud computing commodity to be purchased in more hosts is more than 0 in this realization method
One is selected by pre-defined rule or at random in this more hosts, to provide resource for cloud computing commodity to be purchased.
It, can also be directly according to surplus resources to determine whether being enough to produce cloud computing to be purchased in other realization methods
Commodity, when there is an at least host, the wherein quantity of each surplus resources both greater than produces cloud computing commodity to be purchased
During required resource, it is believed that cloud computing commodity to be purchased can be produced.In addition, if produce the resource of some cloud computing commodity
It (can be provided across host by different hosts machine), then no longer host can be divided to be judged, as long as in cloud platform
When the quantity of each surplus resources both greater than produces the resource needed for cloud computing commodity to be purchased, it is considered as to produce to be purchased
The cloud computing commodity bought;It can not also require be allocated from a host when distributing resource.
In a kind of realization method, the cloud computing commodity to be purchased of detection user's confirmation will produce the cloud to be purchased
The resource needed for commodity is calculated, can be included labeled as the resource of preemption:
After detecting that user confirms cloud computing commodity to be purchased, if surplus resources cannot produce it is described to be purchased
Cloud computing commodity then notify the user cloud computing commodity to confirm failure or notify the user that can produce at present
Cloud computing commodity to be purchased are redefined in cloud computing commodity;If surplus resources can produce the cloud computing to be purchased
Commodity will then produce the resource needed for the cloud computing commodity to be purchased, labeled as the resource of preemption.
In this realization method, if it is confirmed that failure will not then generate pending payment order;If user has generated when confirming and has treated
Payment order, then close or delete the pending payment order when confirming unsuccessfully.If user redefines cloud computing business to be purchased
Product then return to step S110, if having generated pending payment order when user confirms before, user redefines cloud to be purchased
Former pending payment order is closed or deleted when calculating commodity.
When surplus resources are represented with the stockpile number of the cloud computing commodity of each specification, this realization method is:It is treated when described
When the stockpile number of the cloud computing commodity of purchase is 0, user can be notified separately to be selected in current stockpile number is not for 0 specification
Purchase cloud computing commodity can notify user to place an order unsuccessfully;The resource of preemption can be marked when not being 0.
In other realization methods, can also wait for a period of time or when detect resource be released (virtual machine close or
Cancel preemption) when rejudge surplus resources and can produce the cloud computing commodity to be purchased.It can in addition contain be selected in user
When purchasing cloud computing commodity, the specification that can be produced just only is listed.
It, will production if the surplus resources can produce the cloud computing commodity to be purchased in this realization method
Resource needed for the cloud computing commodity to be purchased, can include labeled as the resource of preemption:
If surplus resources can produce the cloud computing commodity to be purchased, but production can not be distributed in surplus resources
Resource (i.e. preemption failure) needed for the cloud computing commodity to be purchased, then notify the user cloud computing commodity confirm to lose
It loses;If the resource produced needed for the cloud computing commodity to be purchased can be distributed in surplus resources, by what is distributed
Resource mark for preemption resource (i.e.:It preempts successfully).
When surplus resources are represented with the stockpile number of the cloud computing commodity of each specification, this realization method is:It is if described
The stockpile number of cloud computing commodity to be purchased is not 0, but for some reason (such as the money originally distributed in preemption procedures
Source is preempted by other cloud computing commodity in advance) preemption is caused to fail, then user can be notified to place an order unsuccessfully;If preemption into
Work(can then prompt user to be paid.
In other realization methods, it can also judge whether stockpile number is 0 again after preemption fails, if being 0
User can then be notified to place an order unsuccessfully, retried if being not 0, retry and notify that user places an order mistake if still failing after pre-determined number
It loses.
It is described to produce resource needed for the cloud computing commodity to be purchased in a kind of realization method, labeled as preemption
Resource can include:
The information of distributed resource is recorded in database is preempted, including at least the cloud corresponding to resource address, resource
Calculate commodity;The information for the resource that the preemption database preempts for preservation;
It is described by the status modifier for the resource distributed alternatively, for preserving in the database of the information of resource
Cloud computing commodity preemption to be purchased.
In this realization method, the resource of preemption and cloud computing commodity to be purchased are corresponding.When using preemption database
During record, the information of corresponding resource can be deleted after production cloud computing commodity from preemption database;When using modification state
Mode when, producing can be by the status modifier of respective resources to have occupied after cloud computing commodity.
In other realization methods, can also beyond the database by the way of mark the resource of preemption;Such as specific
The address of the resource of preemption is recorded in continuum.
In a kind of realization method, the cloud computing commodity to be purchased that the detection user confirms can refer to:Detect user
The cloud computing commodity included in confirming an order
It is described to detect that the cloud computing commodity purchasing successfully refer to:Detect the user to comprising described to be purchased
The order for the cloud computing commodity bought is paid successfully.
In this realization method, under user confirms the order comprising the cloud computing commodity to be purchased and can be considered as
It is single.User's payment or the display payment page can be reresented after preempting successfully, if surplus resources or stockpile number cannot give birth to
It produces commodity to be purchased or preemption is unsuccessful, user can not be prompted to pay or do not show the payment page.
In other realization methods, can also set using it is other operation as preemption or produce trigger conditions, such as when with
When family credit grade reaches high or VIP user, just preempted when cloud computing commodity are put into shopping cart by user, after user places an order
With regard to production.
It is described to produce resource needed for the cloud computing commodity to be purchased in a kind of realization method, labeled as preemption
Resource after can also include:
If it exceeds the cloud computing commodity purchasing success is also not detected in predetermined time length, then the preemption is discharged
Resource.
This realization method, which is equivalent to after camp-on resource, starts timing, when user is also not detected more than predetermined time length
When paying successfully to the order comprising the cloud computing commodity to be purchased, the order is just deleted or closed, and is treated described in release
The resource of the cloud computing commodity preemption of purchase.
This realization method can prevent user's malice camp-on resource;Success is not paid in certain time after preempting successfully,
Do not allow then to continue camp-on resource;After the resource for discharging preemption, this part resource becomes surplus resources again, can also more cenotype
Answer the stockpile number of specification cloud computing commodity.
In this realization method, the resource of the release preemption preempts this means that cancelling, and can include in the following manner:
The address of the resource of the cloud computing commodity preemption to be purchased is deleted from preemption database;
Alternatively, for preserving in the database of the information of resource, will be distributed by the cloud computing commodity to be purchased
The status modifier of resource be unused.
Timing can be begun in other realization methods after user places an order.Alternatively, it is also possible to not distinguish each order
Timing is carried out, such as when the total number resource that can be preempted in entire cloud platform reaches predetermined threshold, for unpaid order,
It deletes or closes according to order of the generated time after arriving first, and discharge the resource of preemption, until the resource preempted in cloud platform
Sum is less than predetermined threshold.
In a kind of realization method, after the cloud computing commodity to be purchased that the detection user confirms, the cloud meter is detected
It can also include before calculating commodity purchasing success:When detecting other cloud computing commodity to be purchased that the user confirms, prompt
Other cloud computing commodity to be purchased confirm failure described in user.
This realization method be equivalent to user place an order after, pay successfully before the user is not allowed to confirm other cloud meters to be purchased
Commodity are calculated, user are not allowed to place an order again in other words;For example user thinks " clearing ", " confirmation " or " next step " during lower list again
Button for grey (can not click) or user confirmation after inform that user places an order unsuccessfully.
This realization method can prevent user by largely placing an order come malice camp-on resource;It can be, but not limited to pass through user
Account determines the identity of user;It can be considered same user using same user account.
In other realization methods, user can not be allowed to browse cloud computing business in the case where user is there are pending payment order
Product, until cancelling or closing pending payment order or pay successfully.Alternatively, it is also possible to provide that each user can generate waits to pay
Still allow to place an order during the upper limit of money order, the not up to upper limit, do not allow to place an order again if reaching.For different credit levels
User the different upper limits can also be set, such as higher grade user's upper limit it is bigger.
Illustrate the method for the present embodiment with an example below, in this example, cloud computing commodity are virtual machine.Such as Fig. 2
Shown, to any user, the production process of cloud computing commodity comprises the following steps 201~210:
201st, judge that user whether there is pending payment order;And if so, carry out step 208;If there is no then carrying out
Step 202.
202nd, there is the specification which can sell in the unit bought by the inventory data on basis, inquiry user (i.e.
Stockpile number is more than 0 specification), and it is supplied to user.
203rd, detect that user determines to select the virtual machine of some specification (to detect the cloud computing to be purchased that user determines
Commodity, can this step or resource preempt successfully after generate pending payment order).
204th, calculate whether the specification can use in stock in real time, if there is then carrying out step 205;If it can use without stock
Then prompt user resources insufficient, return to step 201.
205th, bottom is called to carry out resource preemption, i.e.,:Cloud computing commodity to be purchased are allocated resources to, by the resource of distribution
Labeled as the resource of preemption.
206th, judge whether to preempt successfully;If whether the reason for failing (i.e. mark failure), judging unsuccessfully is resource
Deficiency if inadequate resource then return to step 201, re-starts step 205, weight if being other reasons if the reason for failure
Examination is then determined as inadequate resource, return to step 201 more than pre-determined number;Step 207 is carried out if success (marking successfully).
207th, timing is started to the pending payment order of generation, the pending payment will be closed by prompting not paying the bill in user's specified time
Order.
208th, judge whether pending payment order is overtime;Step 209 is waited for if having not timed out;If time-out (is used
Family within a specified time arrearage), then pending payment order is closed, and the resource of preemption is given back.
209th, user pays the pending payment order, performs step 210.
210th, bottom is called to create corresponding resource on real host and start corresponding virtual machine, is virtual machine
The resources such as virtual machine nodes, disk, network interface card, IP, mac are distributed, and route distribution and secure group rule are carried out to the virtual machine
It authorizes, starts virtual machine after resource is ready, notify that corresponding virtual machine can be used user.
This example is by preempting mechanism, it is ensured that the locking of resource under high concurrent, guarantee place an order successfully and centainly have resource can
Virtual machine is created, can only be there are a pending payment order based on a user, and each pending payment order will be within a specified time
Payment, ensure that resource will not be preempted maliciously.
Embodiment two, a kind of process units of cloud computing commodity, as shown in figure 3, including:
Mark module 31 for detecting the cloud computing commodity to be purchased of user's confirmation, will produce the cloud to be purchased
The resource needed for commodity is calculated, labeled as the resource of preemption;
Module 32 is produced, for after the cloud computing commodity purchasing success is detected, being given birth to using the resource of the preemption
Produce the cloud computing commodity.
In the present embodiment, mark module 31 be in above device be responsible for mark preemption resource part, can be software,
The combination of hardware or both.
In the present embodiment, production module 32 is to be responsible for the portion of the resource production cloud computing commodity using preemption in above device
Divide, can be the combination of software, hardware or both.
In a kind of realization method, the mark module will produce resource needed for the cloud computing commodity to be purchased, mark
Being denoted as the resource of preemption can include:
The mark module divides in host of the stockpile number of the cloud computing commodity to be purchased more than 0
With the resource produced needed for the cloud computing commodity to be purchased;It is the resource of preemption by the resource mark distributed.
In a kind of realization method, the cloud computing commodity to be purchased of mark module detection user's confirmation, by producing
The resource needed for cloud computing commodity to be purchased is stated, can be included labeled as the resource of preemption:
The cloud computing commodity to be purchased that user confirms are detected, if surplus resources cannot produce the cloud meter to be purchased
Commodity are calculated, then the user is notified to confirm failure or notify the user in the cloud computing commodity that can be produced at present again
Determine cloud computing commodity to be purchased;If surplus resources can produce the cloud computing commodity to be purchased, institute will be produced
The resource needed for cloud computing commodity to be purchased is stated, labeled as the resource of preemption.
It, will production if the surplus resources can produce the cloud computing commodity to be purchased in this realization method
Resource needed for the cloud computing commodity to be purchased, can include labeled as the resource of preemption:
If surplus resources can produce the cloud computing commodity to be purchased, but production can not be distributed in surplus resources
Resource needed for the cloud computing commodity to be purchased then notifies the user to confirm failure;It if can be in surplus resources
Distribution produces the resource needed for the cloud computing commodity to be purchased, then is the resource of preemption by the resource mark distributed.
In a kind of realization method, the mark module will produce resource needed for the cloud computing commodity to be purchased, mark
Being denoted as the resource of preemption can include:
The mark module records the information of distributed resource in database is preempted, including at least resource address, money
Cloud computing commodity corresponding to source;The information for the resource that the preemption database preempts for preservation;
Alternatively, the mark module is for preserving in the database of the information of resource, by the state for the resource distributed
It is revised as being preempted by the cloud computing commodity to be purchased.
In a kind of realization method, the cloud computing commodity to be purchased that the detection user confirms can refer to:Detect user
The cloud computing commodity included in the order confirmed;
It is described to detect that the cloud computing commodity purchasing successfully refer to:Detect the user to comprising described to be purchased
The order for the cloud computing commodity bought is paid successfully.
In a kind of realization method, the process units can also include:
Judgment module, for resource needed for the cloud computing commodity to be purchased, mark will to be produced in the mark module
After being denoted as the resource of preemption, if it exceeds the cloud computing commodity purchasing success is also not detected in predetermined time length, then discharge
The resource of the preemption.
In a kind of realization method, the process units can also include:
Detection module, for detection user confirm cloud computing commodity to be purchased after, detect the cloud computing business
Before product are bought successfully, when detecting other cloud computing commodity to be purchased that the user confirms, other described in user treat is prompted
The cloud computing commodity of purchase confirm failure.
The operation of each module of the process units of the present embodiment corresponds respectively to step S110~S120 in embodiment one,
Other realization details of each module operation can be found in embodiment one.
Embodiment three, a kind of electronic equipment for being used to produce cloud computing commodity, including:Memory and processor;It is described to deposit
Reservoir is used to preserve the program for producing cloud computing commodity;The program for being used to generate cloud computing commodity is by the processing
When device reads execution, following operation is performed:
The cloud computing commodity to be purchased that user confirms are detected, the money needed for the cloud computing commodity to be purchased will be produced
Source, labeled as the resource of preemption;
After detecting the cloud computing commodity purchasing success, the cloud computing commodity are produced using the resource of the preemption.
In the present embodiment, for producing the program of cloud computing commodity when being read out by the processor execution, performed operation
Corresponding to step S110~S120 in embodiment one;Other details of operation performed by the program can be found in embodiment one.
One of ordinary skill in the art will appreciate that all or part of step in the above method can be instructed by program
Related hardware is completed, and described program can be stored in computer readable storage medium, such as read-only memory, disk or CD
Deng.Optionally, all or part of step of above-described embodiment can also be realized using one or more integrated circuits.Accordingly
Ground, the form that hardware may be employed in each module/unit in above-described embodiment are realized, can also use the shape of software function module
Formula is realized.The application is not restricted to the combination of the hardware and software of any particular form.
Certainly, the application can also have other various embodiments, ripe in the case of without departing substantially from the application spirit and its essence
Various corresponding changes and deformation, but these corresponding changes and change ought can be made according to the application by knowing those skilled in the art
Shape should all belong to the protection domain of claims hereof.