Specific embodiment
With the continuous development of computer and internet, resource becomes extremely to enrich in account, for example, resource can be void
Quasi- resource, such as can be discount coupon, integral etc., in addition resource can also be the physical resources such as fund, gold, resource it is specific
The form of expression is more and more diversified with the continuous development of computer and internet.
As described in the background art, similar enterprises provide discount coupon scene in (or similar enterprises provide it is red
In the scene of packet, this is no longer going to repeat them for such scene this specification embodiment), it is excellent that a large number of users participates in enterprise's granting
The activity of favour certificate needs the discount coupon for obtaining the corresponding amount of money from business account to be delivered to this for obtaining the user of discount coupon
In the user account of user.At the same time, (overdraw refers to the discount coupon that enterprise provides for discount coupon overdraw in business account in order to prevent
Quantity is greater than discount coupon quantity in business account) and so on, the discount coupon of the corresponding amount of money is obtained from business account
In the process, need to lock business account, thus result in handling any one discount coupon acquisition request be required to competition should
The locking right of business account.
During discount coupon due to obtaining the corresponding amount of money from business account, need to lock business account, processing is appointed
Discount coupon acquisition request of anticipating is required to the locking right of competitive enterprise's account, especially obtains in processing high-volume discount coupon
In the case where request, this warfare is more prominent (this warfare is known as account hot spot), causes from business account
The efficiency for obtaining the discount coupon of the corresponding amount of money reduces, and can not cope with the impact of high-volume discount coupon acquisition request.
In view of the above technical problems, this specification embodiment provides a kind of resource acquisition technical solution, by tearing account open
It is divided into multiple sub- accounts, resource in account is distributed at most a sub- account according to preset allocation rule, by multiple sub- accounts
Form account pool, it is subsequent when a resource acquisition request is received, corresponding with resource acquisition request account pool is determined, from account pool
It is middle to obtain the unlocked sub- account of target, resource corresponding with resource acquisition request is obtained from the sub- account of target.Thus
Dilatation is carried out to account, improves the efficiency for obtaining resource from account, high-volume resource acquisition request can be effectively coped with
Impact.
Specifically, the technical solution that this specification embodiment provides is as follows:
When a resource acquisition request is received, account pool corresponding with resource acquisition request is determined;From with the money
In the corresponding account pool of source acquisition request, unlocked sub- account is obtained;The sub- account of target is determined from acquired sub- account;
The sub- account of the target is locked;In the case where the target sub- account locking, obtained from the sub- account of the target
Resource corresponding with resource acquisition request.
In order to make those skilled in the art more fully understand the technical solution in this specification embodiment, below in conjunction with this
Attached drawing in specification embodiment is described in detail the technical solution in this specification embodiment, it is clear that described
Embodiment is only a part of the embodiment of this specification, instead of all the embodiments.The embodiment of base in this manual,
Those of ordinary skill in the art's every other embodiment obtained, all should belong to the range of protection.
As shown in Figure 1, a kind of implementation process diagram of the resource acquiring method provided for this specification embodiment, the party
Method can specifically include following steps:
S101 determines account pool corresponding with resource acquisition request when a resource acquisition request is received;
In this specification embodiment, in order to cope with the impact of high-volume resource acquisition request, therefore account is split as
Multiple sub- accounts, the account are properly termed as main account.Such as account A, sub- account A1, sub- account A2, son can be split as
Account A3 ... can carry out lateral dilatation for account A, be split as multiple sub- accounts, wherein the sub- account number split can
To be determined according to actual state.
On the other hand, it for the resource in account, can be distributed at most a sub- account according to preset allocation rule, this
Specification embodiment carries out apart from explanation wherein three kinds of allocation rules:
One of allocation rule may is that mean allocation.It, can be with mean allocation extremely such as the resource in account A
Sub- account A1, sub- account A2, sub- account A3 ....
Another allocation rule may is that distribution according to need, carry out resource allocation according to every sub- preset weight of account.
Such as the resource in account A, respective weight can be waited to carry out according to sub- account A1, sub- account A2, sub- account A3 ...
Distribution, such as by 1/10th resource allocations in account A to sub- account A1, by 1/10th resource allocations in account A to sub- account
Family A2.
Another allocation rule may is that dynamic allocation, by most a sub- account of part resource allocation in account, after
It is continuous whether to be less than preset threshold according to resource quantity in every sub- account of preset monitoring cycle monitoring, if number of resources in sub- account
Amount is less than preset threshold, and certain resource allocation is obtained from account surplus resources to the sub- account.
Such as the part resource in account A, can distribute to sub- account A1, sub- account A2, sub- account A3 ..., after
It is continuous whether to be less than some preset threshold according to resource in every sub- account of preset monitoring cycle monitoring, if number of resources in sub- account
Amount is less than preset threshold, then certain resource allocation is obtained from the surplus resources in account A to the sub- account, until the sub- account
Middle resource is more than some preset threshold.
It is worth noting that, above-mentioned allocation rule is the exemplary illustration of this specification embodiment, it can also be other points
With rule, this specification embodiment is not construed as limiting allocation rule.
After being split as account in multiple sub- accounts, account pool can be formed by this multiple sub- account, wherein the account
Family pond is externally or the account, actual treatment resource acquisition can be handled when request in any sub- account.
Such as account A, it can be split as sub- account A1, sub- account A2, sub- account A3 ..., by sub- account A1, son
Account A2, sub- account A3 ... form account pool, the account pond externally or account A, actual treatment resource acquisition request when
Time can be waited in any sub- account and be handled in sub- account A1, sub- account A2, sub- account A3 ....
It is subsequent when a resource acquisition request is received, determine corresponding with resource acquisition request account pool, wherein resource
Account identification is carried in acquisition request, is requested according to the account identification carried in resource acquisition request is determining with the resource acquisition
Corresponding account pool.Such as it for the account identification A that resource acquisition request carries, can determine corresponding with resource acquisition request
Account pool A, wherein account pool A is externally account A.
S102 obtains unlocked sub- account from account pool corresponding with resource acquisition request;
It is available from account pond for account pool corresponding with resource acquisition request determined by step S101
Unlocked sub- account, wherein the unlocked sub- account is the unlocked sub- account of sub- account status.Such as in account pond
Including 10 sub- accounts, wherein 4 sub- accounts are currently in lock state, then available remaining 6 are in unlocked state
Sub- account.
S103 determines the sub- account of target from acquired sub- account;
For sub- account acquired in step S102, the sub- account of target, the sub- account shape of the target can be therefrom determined
State is unlocked.Wherein before determining the sub- account of target, the sub- account of backlog demand, specific implementation can be preferentially rejected
It is as follows:
From acquired sub- account, rejects resource and be less than the sub- account that corresponding resource is requested in the resource acquisition, from
The sub- account of target is determined in the acquired sub- account of residue.Mean for acquired sub- account, such as resource in fruit account
It is less than the resource acquisition and requests corresponding resource, rejected, determine the sub- account of target in remaining sub- account.Wherein at this
In specification embodiment, the implementation for determining the sub- account of target is illustrated:
One of which determines the implementation of the sub- account of target are as follows: determines target at random from the acquired sub- account of residue
Sub- account.For the sub- account by rejecting, can determine a sub- account at random for the sub- account of target, such as from sub- account
A1, sub- account A2, in sub- account A3 these three sub- accounts, determine that sub- account A1 is the sub- account of target, the sub- account of the target at random
State is unlocked.
Another determines the implementation of the sub- account of target are as follows: from the acquired sub- account of residue, determines sub- account
The default maximum sub- account of weight is the sub- account of target.Default for sub- account weight or pre-set priority etc. can be considered as pre-
If ordering rule, the sub- account of target, this explanation can be determined from the acquired sub- account of residue according to preset ordering rule
Book embodiment illustrates one of ordering rule, can also be other ordering rules, this specification embodiment
This is not construed as limiting.
Another determines the implementation of the sub- account of target are as follows: from the acquired sub- account of residue, determines sub- account
The most sub- account of resource quantity is the sub- account of target.For the sub- account by rejecting, number of resources in every sub- account is determined
Amount determines that the maximum sub- account of resource data is the sub- account of target, such as determines that sub- account A1 is the sub- account of target.
It is worth noting that, implementation above mode is exemplary theory of this specification embodiment to wherein several implementations
It is bright, it can also be other implementations, this specification embodiment is not construed as limiting this.
S104 locks the sub- account of the target;
For the sub- account of target identified in S103, the sub- account of the target can be locked, the mesh can be specifically locked out
Mark resource in sub- account.For locking the implementation of resource in the target account, current any implementation, this theory can be
Bright book embodiment is not construed as limiting this.
S105 is obtained from the sub- account of the target and is obtained with the resource in the case where target sub- account locking
Take the corresponding resource of request.
The sub- account of target is locked, resource in the sub- account of lock onto target, prevents from concurrently locating in the sub- account of the target
Manage multiple resource acquisition requests.
In the sub- account of target in the case where resource lock, it can obtain from the sub- account of target and be requested with the resource acquisition
Corresponding resource discharges the sub- account of the target after obtaining resource corresponding with resource acquisition request in the sub- account of target
Family, so that the sub- account of the target returns account pool.
By the description of the above-mentioned technical solution provided this specification embodiment, by the way that account is split as multiple sub- accounts
Resource in account is distributed at most a sub- account according to preset allocation rule, forms account pool by multiple sub- accounts by family, after
Continue when a resource acquisition request is received, determines account pool corresponding with resource acquisition request, obtained from account pool unlocked
The sub- account of target, corresponding with resource acquisition request resource is obtained from the sub- account of target.Thus account is expanded
Hold, improves the efficiency for obtaining resource from account, the impact of high-volume resource acquisition request can be effectively coped with.
Corresponding to above method embodiment, this specification embodiment also provides a kind of resource acquisition device, referring to fig. 2 institute
Show, the apparatus may include: it is true that account splits module 210, resource distribution module 220, account pool comprising modules 230, account pool
Cover half block 240, sub- account obtain module 250, sub- account determining module 260, sub- account locking module 270, source obtaining module
280。
Account splits module 210, for account to be split as multiple sub- accounts;
Resource distribution module 220 is distributed according to preset allocation rule to the multiple sub- account for resource in account
In;
Account pool comprising modules 230, for forming account pool by the multiple sub- account;
Account pool determining module 240 is used for when a resource acquisition request is received, determining and resource acquisition request pair
The account pool answered;
Sub- account obtains module 250, for obtaining unlocked from account pool corresponding with resource acquisition request
Sub- account;
Sub- account determining module 260, for determining the sub- account of target from acquired sub- account;
Sub- account locking module 270, for being locked to the sub- account of the target;
Source obtaining module 280, for being obtained from the sub- account of the target in the case where target sub- account locking
Take resource corresponding with resource acquisition request.
In a kind of specific embodiment of this specification embodiment, the sub- account determining module 260 includes:
Sub- account rejects module 261, and being less than the resource acquisition for from acquired sub- account, rejecting resource asks
Seek the sub- account of corresponding resource;
Sub- account determines submodule 262, for determining the sub- account of target from the acquired sub- account of residue.
In a kind of specific embodiment of this specification embodiment, the sub- account determines that submodule 262 is specifically used for:
The sub- account of target is determined at random from the acquired sub- account of residue.
In a kind of specific embodiment of this specification embodiment, the sub- account determines that submodule 262 is specifically used for:
From the acquired sub- account of residue, determining that sub- account presets the maximum sub- account of weight is the sub- account of target.
In a kind of specific embodiment of this specification embodiment, the sub- account determines that submodule 262 is specifically used for:
From the acquired sub- account of residue, determine that the most sub- account of sub- account resource quantity is the sub- account of target.
In a kind of specific embodiment of this specification embodiment, described device further include:
Sub- account release module 290, it is corresponding with resource acquisition request for being obtained from the sub- account of the target
After resource, the sub- account of the target is discharged, so that the sub- account of the target returns the account pool.
The function of modules and the realization process of effect are specifically detailed in the above method and correspond to step in above-mentioned apparatus
Realization process, details are not described herein.
By the description of the above-mentioned technical solution provided this specification embodiment, by the way that account is split as multiple sub- accounts
Resource in account is distributed at most a sub- account according to preset allocation rule, forms account pool by multiple sub- accounts by family, after
Continue when a resource acquisition request is received, determines account pool corresponding with resource acquisition request, obtained from account pool unlocked
The sub- account of target, corresponding with resource acquisition request resource is obtained from the sub- account of target.Thus account is expanded
Hold, improves the efficiency for obtaining resource from account, the impact of high-volume resource acquisition request can be effectively coped with.
This specification embodiment also provides a kind of computer equipment, includes at least memory, processor and is stored in
On reservoir and the computer program that can run on a processor, wherein processor realizes resource above-mentioned when executing described program
Acquisition methods, this method include at least:
Account is split as multiple sub- accounts, resource is distributed according to preset allocation rule to the multiple sub- account in account
In family, account pool is formed by the multiple sub- account;
When a resource acquisition request is received, account pool corresponding with resource acquisition request is determined;
From account pool corresponding with resource acquisition request, unlocked sub- account is obtained;
The sub- account of target is determined from acquired sub- account;
The sub- account of the target is locked;
In the case where the target sub- account locking, obtains from the sub- account of the target and requested with the resource acquisition
Corresponding resource.
Fig. 3 shows one kind provided by this specification embodiment and more specifically calculates device hardware structural schematic diagram,
The equipment may include: processor 310, memory 320, input/output interface 330, communication interface 340 and bus 350.Wherein
Processor 310, memory 320, input/output interface 330 and communication interface 340 between the realization of bus 350 by setting
Standby internal communication connection.
Processor 310 can use general CPU (Central Processing Unit, central processing unit), micro process
Device, application specific integrated circuit (Application Specific Integrated Circuit, ASIC) or one or
The modes such as multiple integrated circuits are realized, for executing relative program, to realize technical solution provided by this specification embodiment.
Memory 320 can use ROM (Read Only Memory, read-only memory), RAM (Random Access
Memory, random access memory), static storage device, the forms such as dynamic memory realize.Memory 320 can store
Operating system and other applications are realizing technical solution provided by this specification embodiment by software or firmware
When, relevant program code is stored in memory 320, and execution is called by processor 310.
Input/output interface 330 is for connecting input/output module, to realize information input and output.Input and output/
Module can be used as component Configuration (not shown) in a device, can also be external in equipment to provide corresponding function.Wherein
Input equipment may include keyboard, mouse, touch screen, microphone, various kinds of sensors etc., output equipment may include display,
Loudspeaker, vibrator, indicator light etc..
Communication interface 340 is used for connection communication module (not shown), to realize the communication of this equipment and other equipment
Interaction.Wherein communication module can be realized by wired mode (such as USB, cable etc.) and be communicated, can also be wirelessly
(such as mobile network, WIFI, bluetooth etc.) realizes communication.
Bus 350 includes an access, in various components (such as the processor 310, memory 320, input/output of equipment
Interface 330 and communication interface 340) between transmit information.
It should be noted that although above equipment illustrates only processor 310, memory 320, input/output interface
330, communication interface 340 and bus 350, but in the specific implementation process, which can also include realizing to operate normally
Necessary other assemblies.In addition, it will be appreciated by those skilled in the art that, it can also be only comprising realizing in above equipment
Component necessary to this specification example scheme, without including all components shown in figure.
This specification embodiment also provides a kind of computer readable storage medium, is stored thereon with computer program, the journey
Resource acquiring method above-mentioned is realized when sequence is executed by processor, this method includes at least:
Account is split as multiple sub- accounts, resource is distributed according to preset allocation rule to the multiple sub- account in account
In family, account pool is formed by the multiple sub- account;
When a resource acquisition request is received, account pool corresponding with resource acquisition request is determined;
From account pool corresponding with resource acquisition request, unlocked sub- account is obtained;
The sub- account of target is determined from acquired sub- account;
The sub- account of the target is locked;
In the case where the target sub- account locking, obtains from the sub- account of the target and requested with the resource acquisition
Corresponding resource.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method
Or technology come realize information store.Information can be computer readable instructions, data structure, the module of program or other data.
The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory (SRAM), moves
State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable
Programmable read only memory (EEPROM), flash memory or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM),
Digital versatile disc (DVD) or other optical storage, magnetic cassettes, tape magnetic disk storage or other magnetic storage devices
Or any other non-transmission medium, can be used for storage can be accessed by a computing device information.As defined in this article, it calculates
Machine readable medium does not include temporary computer readable media (transitory media), such as the data-signal and carrier wave of modulation.
As seen through the above description of the embodiments, those skilled in the art can be understood that this specification
Embodiment can be realized by means of software and necessary general hardware platform.Based on this understanding, this specification is implemented
Substantially the part that contributes to existing technology can be embodied in the form of software products the technical solution of example in other words,
The computer software product can store in storage medium, such as ROM/RAM, magnetic disk, CD, including some instructions are to make
It is each to obtain computer equipment (can be personal computer, server or the network equipment etc.) execution this specification embodiment
Method described in certain parts of a embodiment or embodiment.
System, device, module or the unit that above-described embodiment illustrates can specifically realize by computer chip or entity,
Or it is realized by the product with certain function.A kind of typically to realize that equipment is computer, the concrete form of computer can
To be personal computer, laptop computer, cellular phone, camera phone, smart phone, personal digital assistant, media play
In device, navigation equipment, E-mail receiver/send equipment, game console, tablet computer, wearable device or these equipment
The combination of any several equipment.
All the embodiments in this specification are described in a progressive manner, same and similar portion between each embodiment
Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for device reality
For applying example, since it is substantially similar to the method embodiment, so describing fairly simple, related place is referring to embodiment of the method
Part explanation.The apparatus embodiments described above are merely exemplary, wherein described be used as separate part description
Module may or may not be physically separated, can be each module when implementing this specification example scheme
Function realize in the same or multiple software and or hardware.Can also select according to the actual needs part therein or
Person's whole module achieves the purpose of the solution of this embodiment.Those of ordinary skill in the art are not the case where making the creative labor
Under, it can it understands and implements.
The above is only the specific embodiment of this specification embodiment, it is noted that for the general of the art
For logical technical staff, under the premise of not departing from this specification embodiment principle, several improvements and modifications can also be made, this
A little improvements and modifications also should be regarded as the protection scope of this specification embodiment.