Specific embodiment
Generally in user account, existing assets can be various forms of assets, such as can be integral, can be with
It is public transport monthly card, can be flow packet, can be fund etc..But some assets often have service life, such as above-mentioned institute
Integral, public transport monthly card, flow packet for saying etc. often have service life, such as relatively conventional flow packet validity period be one week or
One calendar month of person.For these assets with service life, generally requires periodically to clear, be removed from user account assets
Available assets in user account are calculated in expired assets.
The method cleared currently for assets in user account are as follows: periodically inquired more than user account by timed task
Volume determines the expired assets of user account, and triggers the operation of a user account assets settlement.But existing this assets are clear
Calculation mode exists at the time of changing request due to the assets that user account receives user and at the time of reality carries out remaining sum change
Regular hour is poor (time delay), caused by the factor which is designed by user account itself, in order to reduce
The pressure of user account business processing is provided with certain time delay between operating procedure, and another part may be due to network
Time delay caused by the factors such as fluctuation, due to the presence of above-mentioned time delay, and above-mentioned time delay not can avoid, it is meant that when user account connects
When receiving the assets change request of user, remaining sum change need to can be just carried out by certain time.In this way, certain special
Scene under, assets settlement operation implementation procedure in, may cause assets settlement failure, as mentioned in the background art, use
20 integrals have been consumed in 2017-09-30 23:59:59 in family, due to the customer consumption time and are less than the service life of integral, then
Current user integral consumption effectively, needs to change user account remaining sum, but due to the presence of above-mentioned time delay, after 2 seconds possible,
User account carries out remaining sum change, but is 100 integrals in 2017-10-01 00:00:00 inquiry user account remaining sum, determines
The expired amount of money is 100 integrals in user account, but the practical expired amount of money is 80 integrals, (is removed when assets settlement operation executes
100 integrals of above-mentioned determination) when, user account remaining sum becomes 80 at this time, and assets settlement is caused to fail.
In view of the above-mentioned problems, this specification embodiment provides a kind of technical solution, real balance assets can be obtained in real time,
Expired assets are determined from real balance assets, and then complete the clearance of user account assets, such as above-mentioned described practical account
Family remaining sum should be 80 integrals, and then the expired amount of money determined is 80 integrals, and the expired amount of money removed is 80 integrals.Such one
To avoid the generation of clearance failure phenomenon.
The technical solution that specific this specification embodiment provides is as follows:
Configure user account assets settlement table;The stage is recorded in user's assets change situation: user account is received
User's assets change request, except being recorded in the user account, and the user account assets settlement is recorded
In table;In the user account assets settlement stage: when triggering user account assets settlement, inquiring user account described in current time
Assets settlement table obtains remaining sum assets, and expired assets are determined from the remaining sum assets;More than user account current time
Volume assets subtract expired assets, and the available assets of user account current time are calculated.
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, for a kind of implementing procedure of user account assets settlement method provided by this specification embodiment
Figure, this method can specifically include following steps:
S101 configures user account assets settlement table;
As mentioned in the background art, user account is arranged according to accounting item, has certain format and structure, is used
In the increase and decrease change conditions of reaction accounting element and its carrier of result, this specification embodiment additionally configures user account assets
Liquidation statement, wherein the user account assets settlement table configured may include that user's assets flow into record, user's assets outflow note
Record, user's assets Date Of Change, user's assets remaining sum etc., can be configured, this specification does not make this according to actual needs
It limits.
The stage is recorded in user's assets change situation:
S102 carries out recording it in the user account for user's assets change request that user account receives
Outside, it and is recorded in the user account assets settlement table;
For the user account assets settlement table configured in S101, user's assets change that user account receives is asked
It asks, except being recorded in user account, in the user account assets settlement table that synchronous recording is configured into S101, it is meant that
Two parts of records are done to the change request of user's assets, as shown in Figure 2.
User account assets settlement table can recorde user's assets change request that each user account receives every time, lead to
Real-time servicing user account assets settlement table is crossed, i.e., synchronous recording user account receives in user account assets settlement table
User's assets change request, to guarantee the timeliness of information.
The change request of user's assets is the change request of the assets as caused by some operations of user.For example, user exists
Some time has consumed 20 integrals, then can generate user integral change request, and user completes some task in some time, encourages
The integral of user 20 is encouraged, can also generate user integral change request accordingly, user made mistakes in some time, and needed to deduct use
Family 20 integrates, and can also generate user integral change request accordingly, it is meant that the change request of user's assets is the behavior by user
It determines, user triggers certain operation, generates corresponding user assets change request.
In the user account assets settlement stage:
S103 inquires user account assets settlement table described in current time and obtains when triggering user account assets settlement
Remaining sum assets, and expired assets are determined from the remaining sum assets;
The stage is recorded in user's assets change situation by above-mentioned, the synchronous recording user in user's assets change liquidation statement
User's assets that account receives change request, when triggering user account assets settlement, inquiry current time user account money
It produces liquidation statement and obtains remaining sum assets corresponding with user account assets settlement table, and be not as in the prior art from user account
Middle inquiry account balance, and expired assets are determined from remaining sum assets.The opportunity for wherein triggering user account assets settlement can be with
It is configured according to the service life of user's assets, such as by taking integral as an example, the service life of integral is a calendar month, can be with
The end of month or the beginning of the month in every month triggers user account assets settlement.
Wherein, inquiry current time user account assets settlement table obtains remaining sum corresponding with user account assets settlement table
Assets, there are following two for implementation:
One of which inquiry current time user account assets settlement table obtains corresponding with user account assets settlement table
The implementation of remaining sum assets are as follows: inquiry user account assets settlement table recorded in user's assets change request, according to
Assets change request in family calculates the corresponding remaining sum assets of current time user account assets settlement table, it is meant that becomes in user's assets
More situation records the stage, and user's assets change that synchronous recording user account receives in user account assets settlement table is asked
It asks, in the user account assets settlement stage, inquires the change request of user's assets recorded in user account assets settlement table, and
The remaining sum assets of current time are calculated in real time.
Another inquiry current time user account assets settlement table obtains corresponding with user account assets settlement table
The implementation of remaining sum assets are as follows: record the stage in user's assets change situation, the synchronous note in user account assets settlement table
User's assets change request that record user account receives, while request can be changed according to user's assets and calculate user's account in real time
The corresponding remaining sum assets of family assets settlement table, and update in user account assets settlement table, it is meant that in user account
In assets settlement table, remaining sum assets can be obtained in real time, it is subsequent in user account assets settlement stage, directly inquiry user account
The remaining sum assets recorded in assets settlement table.
For example, as stated in the background art, user 2017-09-30 23:59:59 consumed 20 integral, may 2 seconds it
Afterwards, user account carries out remaining sum change, triggers user account assets settlement in 2017-10-01 00:00:00, at this time user's account
Family remaining sum is 100 integrals (not carrying out remaining sum change also), and this specification embodiment inquiry user account assets settlement table is worked as
The remaining sum assets of preceding time should for 80 integral, this 80 integral can be this moment of 2017-09-30 23:59:59 according to
The change request of user's assets is calculated, and is also possible to inquire user account at this moment of 2017-10-01 00:00:00
What user's assets change request that assets settlement table is recorded was calculated.Preferred embodiment is clear in user account assets
Record user's assets change request in table is calculated, and calculates the corresponding remaining sum assets of user account assets settlement table in real time.
After obtaining the corresponding remaining sum assets of user account assets settlement table, expired money is determined from the remaining sum assets
It produces, wherein determining the implementations of expired assets, there are following two:
A kind of implementation determining expired assets are as follows: according to the service life of user account assets, directly provided from remaining sum
Expired assets are determined in production, wherein remaining sum assets inquiry user account assets settlement table obtains.User account is provided
It produces, some general assets have service life, when these assets reach service life, can determine that these assets are expired money
It produces.
Another determines the implementation of expired assets are as follows: from the corresponding remaining sum assets of user account assets settlement table
It determines grace period assets, the corresponding remaining sum assets of user account assets settlement table is subtracted into grace period assets, are calculated expired
Assets.Here grace period assets, such as can be the integral of no service life, such as can also be extension integral, the reason of integral
It is a calendar month by service life, but a calendar month can be delayed, it is meant that actual service life is two natures
Month.Grace period assets can regard not out of date assets as, during determining expired assets, determine the assets that do not delay,
To obtain expired assets indirectly.
For example, in the user account assets settlement stage, in this moment user account assets of 2017-10-01 00:00:00
The corresponding remaining sum assets of liquidation statement are 80, determine that expired assets are 80.For user account, there are corresponding remaining sum moneys
It produces, for user account assets settlement table, there are corresponding remaining sum assets, two remaining sum assets may be inconsistent, for
The corresponding remaining sum assets of user account update not in time, and there are certain time delays, corresponding for user account assets settlement table
Remaining sum assets, it is timely and effective, time delay is not present.
The remaining sum assets of user account current time are subtracted expired assets by S104, be calculated user account it is current when
Between available assets.
For the expired assets determined in S103, which is that reality when triggering user account assets settlement is expired
Assets, and in the absence of prolong, the remaining sum assets of user account current time are subtracted into expired assets, user account is calculated and works as
The available assets of preceding time.
Such as at this moment of 2017-10-01 00:00:00, the remaining sum assets of user account are 100, and what is determined is expired
Assets are 80, and the remaining sum assets of user account are subtracted expired assets, and the available assets that user account is calculated are 20.
In addition during calculating the available assets of user account current time, except above-mentioned described expired assets, also
Including freezing of assets, i.e., the assets freezed in user account, the corresponding assets of current execution remaining sum change, such as
The change of 2017-09-30 23:59:58 this moment user's assets requests corresponding assets to be changed to 20, in 2017-10-01
This moment of 00:00:00 execute remaining sum change, corresponding change assets be 20, i.e., 2017-10-01 00:00:00 this when
It carves, remaining sum assets, which subtract expired assets and subtract freezing of assets and subtract, executes the corresponding assets=currently available money of remaining sum change
It produces.
On the basis of above-mentioned technical proposal, as shown in figure 3, this specification embodiment can with the following steps are included:
S105, after the available assets that user account current time is calculated, more new user account assets settlement day
Phase.
After being cleared to user account assets, timely update the user account assets settlement date, i.e., for user
The account assets settlement date timely updated as this user account assets settlement date.Such as last user account assets settlement
Date is 2017-09-01 00:00:00, this user account assets settlement date is 2017-10-01 00:00:00, in time
The user account assets settlement date is updated to this user account assets settlement date.
By the description of the above-mentioned technical solution provided this specification, in user's assets change record stage, by
User's assets change request that user account receives is recorded in user account assets settlement table, in user account assets settlement rank
Section can inquire user account assets settlement table and obtain remaining sum assets, and determination is expired when triggering user account assets settlement
Assets, and then the available assets of user account current time are calculated.Due to recording user's money in user's assets settlement table
Change request is produced, can be calculated the corresponding real balance assets of current time user's assets settlement table in real time, and then can be with
User account assets settlement is completed, the generation of clearance failure phenomenon is avoided.
Relative to above method embodiment, this specification embodiment additionally provides a kind of user account assets settlement device,
As shown in figure 4, may include: configuration module 410, request logging modle 420, asset search module 430, assets determining module
440, assets settlement module 450.
Configuration module 410, for configuring user account assets settlement table;
Logging modle 420 is requested, for recording stage, the use received for user account in user's assets change situation
The change request of family assets, except being recorded in the user account, and is recorded in the user account assets settlement table;
Asset search module 430 was used in the user account assets settlement stage, when triggering user account assets settlement,
User account assets settlement table described in inquiry current time obtains remaining sum assets;
Assets determining module 440, for determining expired money from the remaining sum assets in the user account assets settlement stage
It produces;
Assets settlement module 450, in the user account assets settlement stage, the remaining sum of user account current time to be provided
Production subtracts expired assets, and the available assets of user account current time are calculated.
According to a kind of specific embodiment that this specification provides, the asset search module 430 is specifically used for:
Inquire the change request of user's assets recorded in the user account assets settlement table;
Request, which is changed, according to user's assets calculates the corresponding remaining sum of user account assets settlement table described in current time
Assets.
According to a kind of specific embodiment that this specification provides, described device further include: assets computing module 460;
Assets computing module 460, for recording the stage in user's assets change situation, in the user account assets settlement
In table, request is changed according to user's assets and calculates the corresponding remaining sum assets of the user account assets settlement table, and is updated
Into the user account assets settlement table;
The asset search module 430 is specifically used for:
Inquire the remaining sum assets recorded in the user account assets settlement table.
According to a kind of specific embodiment that this specification provides, the assets determining module 440 is specifically used for:
According to the service life of user account assets, expired assets are determined from the remaining sum assets;
Or
Grace period assets are determined from the remaining sum assets;
The remaining sum assets are subtracted into the grace period assets, expired assets are calculated.
According to a kind of specific embodiment that this specification provides, described device further include: update module 470;
Update module 470, for after the available assets that user account current time is calculated, more new user account
The assets settlement date.
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, in user's assets change record stage, by
User's assets change request that user account receives is recorded in user account assets settlement table, in user account assets settlement rank
Section can inquire user account assets settlement table and obtain remaining sum assets, and determination is expired when triggering user account assets settlement
Assets, and then the available assets of user account current time are calculated.Due to recording user's money in user's assets settlement table
Change request is produced, can be calculated the corresponding real balance assets of current time user's assets settlement table in real time, and then can be with
User account assets settlement is completed, the generation of clearance failure phenomenon is avoided.
This specification embodiment also provides a kind of computer equipment, as shown in figure 5, the equipment may include: processor
510, memory 520, input/output interface 530, communication interface 540 and bus 550.Wherein processor 510, memory 520,
Input/output interface 530 and communication interface 540 pass through the communication connection between the realization of bus 550 inside equipment.
Processor 510 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 520 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 520 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 520, and execution is called by processor 510.
Input/output interface 530 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 540 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 550 includes an access, in various components (such as the processor 510, memory 520, input/output of equipment
Interface 530 and communication interface 540) between transmit information.
It should be noted that although above equipment illustrates only processor 510, memory 520, input/output interface
530, communication interface 540 and bus 550, 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
User account assets settlement method above-mentioned is realized when sequence is executed by processor.This method includes at least:
A kind of user account assets settlement method, this method comprises:
Configure user account assets settlement table;
The stage is recorded in user's assets change situation:
For user's assets change request that user account receives, except being recorded in the user account, and
It is recorded in the user account assets settlement table;
In the user account assets settlement stage:
When triggering user account assets settlement, inquires user account assets settlement table described in current time and obtain remaining sum money
It produces, and determines expired assets from the remaining sum assets;
The remaining sum assets of user account current time are subtracted into expired assets, be calculated user account current time can
Use assets.
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.