Specific embodiment
Exemplary embodiments of the present disclosure are described in more detail below with reference to accompanying drawings.Although showing the disclosure in attached drawing
Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here
It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure
It is fully disclosed to those skilled in the art.
Fig. 1 shows the flow chart of the method for processing auction user data according to an embodiment of the invention.This method
Applied to Redis system, the Redis system is for storing auction data.Redis system is that a key-value (key assignments) is deposited
Storage system is non-relational database, has amount of storage big, and performance is good, and all operations are all atomicity, single thread processing
The advantages that affairs and support multilingual.Wherein, the atomicity of operation means that operation can not divide again, that is, operates or execute and want
It does not execute.As shown in Figure 1, method includes the following steps:
Step S100 bids the incipient stage when previous auction, the flowing water marker of last successful bid is distributed to
Multiple while bid and the consistent user of bid data.
In auction business, generally auction time, such as half an hour can be limited for each commodity, reach the above-mentioned time
Afterwards, completion of an auction.Auction referred within the auction time, to user success since any user triggers auction operation button
Until bid.Refer to multiple users when the previous auction bid incipient stage while triggering auction operation button, beginning auction commodity.Stream
Water marker can be flowing water ID, and flowing water ID is distributed to auction user, so that user carries out auction, flowing water using flowing water ID
Marker is continually changing, the modification flowing water marker after each auction success.
The flowing water marker of last successful bid referred within the auction time, after any user successful bid, obtained stream
Water marker.
Step S110, for a user in multiple users, compare distribute to the flowing water marker of the user with it is newest competing
Whether the flowing water marker of bat is consistent;If consistent, the bid data of user is written in Redis system, and is modified newest
The flowing water marker of auction.
For a user in multiple users, multiple while bid will be distributed in step S100 and bid data is consistent
The flowing water marker of the last successful bid of user is compared with the flowing water marker of newest auction, judge its whether one
It causes, under unanimous circumstances, illustrates that the flowing water marker for distributing to the user is the flowing water marker of newest auction, which can
With execute bid operation, bid, after user bids successfully, by the bid data of user be written in Redis system into
Row storage, and the flowing water marker of newest auction is modified accordingly, for judging the bid operation of the other users in multiple users
Whether succeed.
The flowing water marker of newest auction is recorded as when previous by step S120 when previous auction bid ending phase
The flowing water marker of successful bid.
After step S110, it can be determined that go out multiple while bid and whether the consistent user of bid data successfully goes out
The flowing water marker of newest auction is recorded as the flowing water when previous successful bid when previous auction bid ending phase by valence
Marker is assigned them to bidding the incipient stage in auction next time to multiple while bid and the consistent use of bid data
Family, for judging whether user can be with successful bid.
The above-mentioned method that offer is provided according to the present invention, by for it is multiple and meanwhile bid and the consistent user of bid data
The flowing water marker for distributing last successful bid compares the flowing water mark of the flowing water marker and newest auction of distributing to the user
Whether consistent know position, under unanimous circumstances, the bid data of user is written in Redis system, and modify newest auction
Flowing water marker, bid ending phase when previous auction, the flowing water marker of newest auction be recorded as when previous success
The flowing water marker of bid avoids the competition of multiple processes while operation by Redis system in conjunction with auction business, solves
The problem of data consistency, improves whole access speed, increases the amount of access of user.
Fig. 2 shows the flow charts of the method for processing auction user data in accordance with another embodiment of the present invention.Such as Fig. 2
It is shown, method includes the following steps:
Step S200 sets for multiple users number in advance.
It bids and bids in identical situation simultaneously in multiple users, use can be determined by setting number in advance for multiple users
Family executes the sequence of bid operation, wherein user's volume can be set by the way of 1,2,3,4 ... or A, B, C, D ...
Number, it is merely illustrative here, those skilled in the art can set according to actual needs, not do specific limit here
It is fixed.
Step S210 bids the incipient stage when previous auction, the flowing water marker of last successful bid is distributed to
Multiple while bid and the consistent user of bid data.
Specifically, in the present embodiment, flowing water marker is flowing water ID, is bid the incipient stage when previous auction, will be upper
The flowing water marker of successful bid, for example, flowing water ID:1 perhaps 100 by flowing water ID:1 or 100 distribute to it is multiple simultaneously
Bid and the consistent user of bid data.
Step S220 successively compares the flowing water marker and newest auction for distributing to the user according to the sequence of Customs Assigned Number
Flowing water marker it is whether consistent, if unanimously, thening follow the steps S230;If inconsistent, user bids to fail.
In order to guarantee the consistency of data and the correctness of service logic, therefore only allow a user in multiple users
It bids successfully, and only the bid data for the successful user that bids is written in Redis system.It is implemented as follows: according to step
It is the flowing water that number order set by user successively compares the flowing water marker and newest auction of distributing to the user in rapid S200
Whether marker is consistent, if unanimously, illustrating that the flowing water marker for distributing to the user is the flowing water marker of newest auction, uses
Family can execute bid operation, bid;If inconsistent, illustrate that distributing to user's flowing water marker is not newest auction
Flowing water marker, user can not execute bid operation, user bid failure.
The bid data of user is written in Redis system by step S230, and is modified in a manner of increasing or decreasing newest
The flowing water marker of auction.
The bid data of the user of successful bid is written in Redis system and is stored, and with increasing or decreasing side
Formula modifies the flowing water marker of newest auction.Specifically, can be by way of increasing predetermined value every time, such as increase by 1 every time
Mode modify the flowing water marker of newest auction, to distribute to the multiple while last time of bid and the consistent user of bid data
Successful flowing water marker is 1 explanation, and after user's successful bid, the flowing water marker of newest auction is revised as 2;Or it is logical
The mode for reducing predetermined value every time is crossed, such as the mode of reduction 1 modifies the flowing water marker of newest auction every time, it is more to distribute to
The last time of a while bid and the consistent user of bid data, successfully flowing water marker was 100 explanations, in user's successful bid
Afterwards, the flowing water marker of newest auction is revised as 99.
The flowing water marker of newest auction is recorded as when previous by step S240 when previous auction bid ending phase
The flowing water marker of successful bid.
Step S250 deducts the scheduled integral of the user of successful bid after previous auction bid.
User can earn integral by participating in some activities, then can be from the product of user after user's successful bid
Scheduled integral is deducted in point account, for example, deducting user 10 integrals after user's successful bid, can be increased using integral mechanism
User is added to access.
It is discussed in detail below with specific example:
Step S200 sets number, user 1 and user 2 in advance for two users, changes number order and two users have been determined
At the same time bid and bid data unanimous circumstances under, execute bid operation sequence.
Step S210 bids the incipient stage when previous auction, and user 1 and user 2 bid simultaneously and bid data
Unanimously, for example, bid 100, by the flowing water marker of last successful bid, for example, flowing water ID:1, flowing water ID:1 is distributed to
User 1 and user 2.
Step S220- step S230 here will be according to Customs Assigned Number due to being in step s 200 that user sets number
Sequence whether successively compare the flowing water marker for distributing to the user consistent with the flowing water marker of newest auction, compare first
Whether the flowing water marker for distributing to user 1 is consistent with the flowing water marker of newest auction, learns distribute to user 1 by comparing
Flowing water marker and the flowing water marker of newest auction be all 1, i.e., both consistent, user 1 can execute bid operation, user
1 bid 100, by the bid data of user 1: 100 are written in Redis system, and are modified in a manner of increasing by 1 every time newest competing
The flowing water marker of bat, the flowing water marker of newest auction after modification are 2;Then, compare the flowing water marker for distributing to user 2
It is whether consistent with the flowing water marker of newest auction, learn that the flowing water marker for distributing to user is 1 by comparing, and it is newest competing
The flowing water marker of bat is 2, i.e. the two is inconsistent, then user 2 bids to fail.
Step S240,1 successful bid of user, user 2 bid failure, when previous auction bid terminate, by newest auction
Flowing water marker: 2 are recorded as the flowing water marker when previous successful bid, to bid the incipient stage in auction next time, by it
Distribute to multiple while bid and the consistent user of bid data, for judging whether user can be with successful bid.
Step S250, in user 10 integrals for after previous auction bid, deducting successful bid.
Optionally, the bid data of user can be also written in Redis system by running Lua script.Redis system
System supports Lua script, and Lua is write with standard C language, code precision and elegance, almost in all operating systems and platform
Can compilation run, its advantages are small and exquisite and flexible, and be dynamic language and be explain execute, so be suitble to use
In embedded environment;Since the interpreter of Lua is precompile property, so obviously many faster than other scripting languages,
This is also that the present embodiment selects one of the reason of Lua is as preferred scripting language;Since Lua is easy to be called by C/C++ code,
The function of C/C++ can also be called in turn, so Lua can be widely used in the application, and be readily appreciated that and
Maintenance;In addition, instant compiler (JIT) project that Lua has one while carrying out, provides the Just-In-Time function on particular platform
Can, this will bring more outstanding process performance to Lua.
Present inventor utilizes the characteristic of Redis system, by Lua script by Redis system and auction business knot
It closes, ensure that the atomicity of operation, avoid the competition of multiple processes while operation, solve the problems, such as data consistency.
The above-mentioned method for implementing offer according to the present invention sets for multiple users in advance and numbers, can determine that user holds
The sequence of row bid operation avoids the user for executing bid during operation of bidding unordered in a jumble, leads to operating mistake;By for
Multiple while bid and the consistent user of bid data distribute the flowing water marker of last successful bid, compare and distribute to the use
Whether the flowing water marker at family and the flowing water marker of newest auction are consistent, under unanimous circumstances, by the bid data of user
It is written in Redis system, and modifies the flowing water marker of newest auction, working as previous auction bid ending phase, it will be newest
The flowing water marker of auction is recorded as keeping away by Redis system in conjunction with auction business when the flowing water marker of previous successful bid
The competition for having exempted from multiple processes while operation, solves the problems, such as data consistency, improves whole access speed, increases user
Amount of access;User can be increased using integral mechanism to access.
Fig. 3 shows the structural block diagram of the device of processing auction user data according to an embodiment of the invention.The dress
It sets and is applied to Redis system, wherein Redis system is for storing auction data, as shown in figure 3, the device includes: distribution module
310, comparison module 320, processing module 330, logging modle 340.
Distribution module 310 is suitable for working as the previous auction bid incipient stage, by the flowing water marker of last successful bid
Distribute to multiple while bid and the consistent user of bid data.
Comparison module 320, be suitable for comparing for a user in multiple users distribute to the flowing water marker of the user with
Whether the flowing water marker of newest auction is consistent.
Processing module 330, suitable for consistent with the flowing water marker of newest auction in the flowing water marker for distributing to the user
In the case where, the bid data of user is written in Redis system, and modify the flowing water marker of newest auction.
Logging modle 340 is suitable for being recorded as the flowing water marker of newest auction when previous auction bid ending phase
When the flowing water marker of previous successful bid.
The above-mentioned device that offer is provided according to the present invention, by for it is multiple and meanwhile bid and the consistent user of bid data
The flowing water marker for distributing last successful bid compares the flowing water mark of the flowing water marker and newest auction of distributing to the user
Whether consistent know position, under unanimous circumstances, the bid data of user is written in Redis system, and modify newest auction
Flowing water marker, bid ending phase when previous auction, the flowing water marker of newest auction be recorded as when previous success
The flowing water marker of bid, by Lua script by Redis system in conjunction with auction business, avoid multiple processes while operating
Competition, solve the problems, such as data consistency, improve whole access speed, increase the amount of access of user.
Fig. 4 shows the structural block diagram of the device of processing auction user data in accordance with another embodiment of the present invention.It should
Device is applied to Redis system, and wherein Redis system is for storing auction data, as shown in figure 3, the device includes: distribution mould
Block 410, comparison module 420, processing module 430, logging modle 440.
Distribution module 410 is suitable for working as the previous auction bid incipient stage, by the flowing water marker of last successful bid
Distribute to multiple while bid and the consistent user of bid data.
Comparison module 420, be suitable for comparing for a user in multiple users distribute to the flowing water marker of the user with
Whether the flowing water marker of newest auction is consistent.
Processing module 430, suitable for consistent with the flowing water marker of newest auction in the flowing water marker for distributing to the user
In the case where, the bid data of user is written in Redis system, and modify the flowing water marker of newest auction.
Logging modle 440 is suitable for being recorded as the flowing water marker of newest auction when previous auction bid ending phase
When the flowing water marker of previous successful bid.
Processing module 430 is further adapted for: being identified in the flowing water of the flowing water marker and newest auction of distributing to the user
In the case that position is inconsistent, judge that user bids to fail.
Processing module 430 is further adapted for: the flowing water marker of newest auction is modified in a manner of increasing or decreasing.
The device further include: setting module 450 is suitable for setting number in advance for multiple users.
Comparison module 420 is further adapted for: successively comparing the flowing water mark for distributing to the user according to the sequence of Customs Assigned Number
It is whether consistent with the flowing water marker of newest auction to know position.
The device further include: deduct module 460, be suitable for deducting the use of successful bid after previous auction bid
The scheduled integral at family.
The above-mentioned device for implementing offer according to the present invention sets for multiple users in advance and numbers, can determine that user holds
The sequence of row bid operation avoids the user for executing bid during operation of bidding unordered in a jumble, leads to operating mistake;By for
Multiple while bid and the consistent user of bid data distribute the flowing water marker of last successful bid, compare and distribute to the use
Whether the flowing water marker at family and the flowing water marker of newest auction are consistent, under unanimous circumstances, by the bid data of user
It is written in Redis system, and modifies the flowing water marker of newest auction, working as previous auction bid ending phase, it will be newest
The flowing water marker of auction is recorded as keeping away by Redis system in conjunction with auction business when the flowing water marker of previous successful bid
The competition for having exempted from multiple processes while operation, solves the problems, such as data consistency, improves whole access speed, increases user
Amount of access;User can be increased using integral mechanism to access.
Algorithm and display are not inherently related to any particular computer, virtual system, or other device provided herein.
Various general-purpose systems can also be used together with teachings based herein.As described above, it constructs required by this kind of system
Structure be obvious.In addition, the present invention is also not directed to any particular programming language.It should be understood that can use various
Programming language realizes summary of the invention described herein, and the description done above to language-specific is to disclose this hair
Bright preferred forms.
In the instructions provided here, numerous specific details are set forth.It is to be appreciated, however, that implementation of the invention
Example can be practiced without these specific details.In some instances, well known method, structure is not been shown in detail
And technology, so as not to obscure the understanding of this specification.
Similarly, it should be understood that in order to simplify the disclosure and help to understand one or more of the various inventive aspects,
Above in the description of exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes
In example, figure or descriptions thereof.However, the disclosed method should not be interpreted as reflecting the following intention: i.e. required to protect
Shield the present invention claims features more more than feature expressly recited in each claim.More precisely, as following
Claims reflect as, inventive aspect is all features less than single embodiment disclosed above.Therefore,
Thus the claims for following specific embodiment are expressly incorporated in the specific embodiment, wherein each claim itself
All as a separate embodiment of the present invention.
Those skilled in the art will understand that can be carried out adaptively to the module in the equipment in embodiment
Change and they are arranged in one or more devices different from this embodiment.It can be the module or list in embodiment
Member or component are combined into a module or unit or component, and furthermore they can be divided into multiple submodule or subelement or
Sub-component.Other than such feature and/or at least some of process or unit exclude each other, it can use any
Combination is to all features disclosed in this specification (including adjoint claim, abstract and attached drawing) and so disclosed
All process or units of what method or apparatus are combined.Unless expressly stated otherwise, this specification is (including adjoint power
Benefit require, abstract and attached drawing) disclosed in each feature can carry out generation with an alternative feature that provides the same, equivalent, or similar purpose
It replaces.
In addition, it will be appreciated by those of skill in the art that although some embodiments described herein include other embodiments
In included certain features rather than other feature, but the combination of the feature of different embodiments mean it is of the invention
Within the scope of and form different embodiments.For example, in the following claims, embodiment claimed is appointed
Meaning one of can in any combination mode come using.
Various component embodiments of the invention can be implemented in hardware, or to run on one or more processors
Software module realize, or be implemented in a combination thereof.It will be understood by those of skill in the art that can be used in practice
Microprocessor or digital signal processor (DSP) realize the device of processing auction user data according to an embodiment of the present invention
In some or all components some or all functions.The present invention is also implemented as described herein for executing
Some or all device or device programs (for example, computer program and computer program product) of method.In this way
Realization program of the invention can store on a computer-readable medium, or can have the shape of one or more signal
Formula.Such signal can be downloaded from an internet website to obtain, and perhaps be provided on the carrier signal or with any other shape
Formula provides.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and ability
Field technique personnel can be designed alternative embodiment without departing from the scope of the appended claims.In the claims,
Any reference symbol between parentheses should not be configured to limitations on claims.Word "comprising" does not exclude the presence of not
Element or step listed in the claims.Word "a" or "an" located in front of the element does not exclude the presence of multiple such
Element.The present invention can be by means of including the hardware of several different elements and being come by means of properly programmed computer real
It is existing.In the unit claims listing several devices, several in these devices can be through the same hardware branch
To embody.The use of word first, second, and third does not indicate any sequence.These words can be explained and be run after fame
Claim.