The content of the invention
To overcome problem present in correlation technique, present description provides inquiry into balance method, apparatus and equipment.
A kind of inquiry into balance method, methods described include:
Inquiry request is received, the inquiry request is used to inquire about remaining sum of at least two desired assets in the scheduled date, institute
The scheduled date for stating at least two desired assets is identical;
One inquiry is built according to the asset identification of at least two desired assets in the scheduled date and inquiry request
Sentence, for inquire about at least two desired assets less than or equal in the scheduled date occur remaining sum change when keep accounts data and
Enter an item of expenditure in the accounts data;
According to keep accounts data and the data progress remaining sum calculating of entering an item of expenditure in the accounts of every desired asset, obtain every desired asset and referring to
The remaining sum fixed the date.
In an optional implementation, the scheduled date is using day as minimum time unit, if an assets are same
When remaining sum variation occurs in one day first, newly-built data and/or the data of entering an item of expenditure in the accounts of keeping accounts;If an assets within same day it is non-first
When generation remaining sum changes, keep accounts data and/or the data of entering an item of expenditure in the accounts established are updated, so that an assets are at most wrapped within same day
Containing keep accounts a data and/or a data of entering an item of expenditure in the accounts.
In an optional implementation, changing record based on remaining sum, structure concordance list, the concordance list include in advance
Keep accounts data and four attributes of data of entering an item of expenditure in the accounts when asset identification, remaining sum transfer date, remaining sum variation, the remaining sum change record
It is updated when remaining sum changes;
The asset identification according at least two desired assets in the scheduled date and inquiry request builds one
Query statement, for inquiring about at least two desired assets less than or equal to the number that keeps accounts occurred in the scheduled date when remaining sum changes
According to data of entering an item of expenditure in the accounts, including:
Asset identification based at least two desired assets in the inquiry request and less than or equal to scheduled date structure
Build a query statement;
According to constructed query statement, one query goes out the remaining sum variation less than or equal to the scheduled date from concordance list
Date and asset identification are data and the data of entering an item of expenditure in the accounts of being kept accounts corresponding to the asset identification of desired asset.
In an optional implementation, more than keep accounts data and the data progress of entering an item of expenditure in the accounts according to every desired asset
Volume calculates, and obtains remaining sum of the every desired asset in the scheduled date, including:
According to the asset identification of every desired asset, keep accounts data and the data of entering an item of expenditure in the accounts that inquire about acquisition are grouped;
The summation of the summation for the data that kept accounts in every group of data and data of entering an item of expenditure in the accounts is sought into difference, obtains mesh corresponding to this group of data
Mark remaining sum of the assets in the scheduled date.
In an optional implementation, methods described also includes:
If keep accounts data or data of entering an item of expenditure in the accounts are not present in desired asset within less than or equal to the scheduled date, by desired asset
Zero is arranged in the remaining sum of scheduled date.
A kind of inquiry into balance device, described device include:
Request receiving module, for receiving inquiry request, the inquiry request is used for inquiry at least two desired assets and existed
The remaining sum of scheduled date, the scheduled date of at least two desired assets are identical;
Data inquiry module, for the assets according at least two desired assets in the scheduled date and inquiry request
Mark one query statement of structure, become for inquiring about at least two desired assets less than or equal to generation remaining sum in the scheduled date
Keep accounts data and data of entering an item of expenditure in the accounts when dynamic;
Remaining sum obtains module, for keep accounts data and the data progress remaining sum calculating of entering an item of expenditure in the accounts according to every desired asset, obtains
Obtain remaining sum of the every desired asset in the scheduled date.
In an optional implementation, the scheduled date also includes by minimum time unit, described device of day
Data recordin module, it is used for:If remaining sum occurs first within same day for an assets when changing, newly-built keep accounts and/or goes out data
Account data;If an assets are non-when remaining sum occurs first changing within same day, update keeping accounts of having established and data and/or enter an item of expenditure in the accounts
Data a, so that assets contain up to keep accounts data and/or a data of entering an item of expenditure in the accounts within same day.
In an optional implementation, changing record based on remaining sum, structure concordance list, the concordance list include in advance
Keep accounts data and four attributes of data of entering an item of expenditure in the accounts when asset identification, remaining sum transfer date, remaining sum variation, the remaining sum change record
It is updated when remaining sum changes;
The data inquiry module is specifically used for:
Asset identification based at least two desired assets in the inquiry request and less than or equal to scheduled date structure
Build a query statement;
According to constructed query statement, one query goes out the remaining sum variation less than or equal to the scheduled date from concordance list
Date and asset identification are data and the data of entering an item of expenditure in the accounts of being kept accounts corresponding to the asset identification of desired asset.
In an optional implementation, the remaining sum obtains module and is specifically used for:
According to the asset identification of every desired asset, keep accounts data and the data of entering an item of expenditure in the accounts that inquire about acquisition are grouped;
The summation of the summation for the data that kept accounts in every group of data and data of entering an item of expenditure in the accounts is sought into difference, obtains mesh corresponding to this group of data
Mark remaining sum of the assets in the scheduled date.
In an optional implementation, the remaining sum obtains module and is additionally operable to:
If keep accounts data or data of entering an item of expenditure in the accounts are not present in desired asset within less than or equal to the scheduled date, by desired asset
Zero is arranged in the remaining sum of scheduled date.
A kind of computer equipment, including:
Processor;
For storing the memory of processor-executable instruction;
Wherein, the processor is configured as:
Inquiry request is received, the inquiry request is used to inquire about remaining sum of at least two desired assets in the scheduled date, institute
The scheduled date for stating at least two desired assets is identical;
One inquiry is built according to the asset identification of at least two desired assets in the scheduled date and inquiry request
Sentence, for inquire about at least two desired assets less than or equal in the scheduled date occur remaining sum change when keep accounts data and
Enter an item of expenditure in the accounts data;
According to keep accounts data and the data progress remaining sum calculating of entering an item of expenditure in the accounts of every desired asset, obtain every desired asset and referring to
The remaining sum fixed the date.
Periodicity remaining sum characterize assets specify the cycle at the last moment hold quantity.
The technical scheme that the embodiment of this specification provides can include the following benefits:
This specification embodiment receive for inquire about at least two desired assets are in the remaining sum of same scheduled date when,
One query statement is built according to the asset identification of scheduled date and desired asset, realizes that one query obtains at least two mesh
Mark assets provide less than or equal to keep accounts data and the data of entering an item of expenditure in the accounts occurred in the scheduled date when remaining sum changes according to every target
Keep accounts data and the data progress remaining sum calculating of entering an item of expenditure in the accounts of production, obtain remaining sum of the every desired asset in the scheduled date.It can be seen that for
At least two assets, only need to build a query statement realizes one query, is looked into without being built respectively for every desired asset
Sentence is ask, avoids repeatedly inquiry from causing inquiry time-consuming accumulative, therefore improve search efficiency.
It should be appreciated that the general description and following detailed description of the above are only exemplary and explanatory, not
This specification can be limited.
Embodiment
Here exemplary embodiment will be illustrated in detail, its example is illustrated in the accompanying drawings.Following description is related to
During accompanying drawing, unless otherwise indicated, the same numbers in different accompanying drawings represent same or analogous key element.Following exemplary embodiment
Described in embodiment do not represent all embodiments consistent with this specification.On the contrary, they are only and such as institute
The example of the consistent apparatus and method of some aspects be described in detail in attached claims, this specification.
It is only merely for the purpose of description specific embodiment in the term that this specification uses, and is not intended to be limiting this explanation
Book." one kind " of used singulative, " described " and "the" are also intended to bag in this specification and in the appended claims
Most forms are included, unless context clearly shows that other implications.It is also understood that term "and/or" used herein is
Refer to and any or all may be combined comprising the associated list items purpose of one or more.
It will be appreciated that though various information may be described using term first, second, third, etc. in this specification, but
These information should not necessarily be limited by these terms.These terms are only used for same type of information being distinguished from each other out.For example, do not taking off
In the case of this specification scope, the first information can also be referred to as the second information, and similarly, the second information can also be claimed
For the first information.Depending on linguistic context, word as used in this " if " can be construed to " ... when " or
" when ... " or " in response to determining ".
As the payment epoch march toward the financial epoch, the abundant financial product of category occurs.For example, user can pass through client
End purchase fund, wealth bringing in treasured etc. are invested, and carrying out fund short-term loan at daily interest by client realizes financing etc., the investment of user and financing
The final assets that can all form user.Remaining sum can be used to indicate that the amount of money or fund share of assets etc..Remaining sum possible application exists
In plurality of application scenes, for example, the inquiry request that user triggers generation is received, according to inquiry request queries asset in specified day
The remaining sum of phase.And for example, remaining sum carries out inquiry into balance etc. as the important factor for calculating income when needing to carry out income calculation.
Wherein, return on assets is the value-added part of user's holding assets.Assets mainly have two kinds of increment forms:One kind is money
The time cost form of production, such as user are stored in the current deposit of bank, according to deposit rate and hold number of days and are rised in value;
Another kind is assets to marking fair value version, such as user's purchase stock fund, the market value of the stock of capital investment
Go up, then corresponding fund asset, which can also rise in value, obtains income.
Income calculation is that the calculating of the value-added part of user's holding assets confirms process, with two kinds of return on assets shapes of rising in value
Formula illustrates the definition of income calculation:For the current deposit interest of time cost appreciation type, income calculation can be combined
Day whole remaining sum, interest rate (cost rate) and the process for depositing the phase the final interest value of the calculating such as (time span) factor;To marking fair value
Change the mutual fund earnings of appreciation type, income calculation can combine fund share (end day remaining sum) and the ACCNAV that user holds
Etc. the factor, the process of ultimate yield is calculated.The income of assets is the important measurement index of asset quality, is that user buys assets
One of referring especially to.And end day remaining sum represents assets in amount of money in hand at the last moment of corresponding date or quantity, herein it is signified most
A moment is related to assets category afterwards, and non-fully with consecutive days at the last moment (24 points) equity.In the work of time cost appreciation type
24 points of remaining sum of current deposit is corresponded in phase interest on deposit, then can be 24 points at the last moment;Become to mark fair value
Change 15 points of the share that fund is corresponded in the mutual fund earnings of appreciation type, then can be 15 points at the last moment.
It can be seen that inquiry into balance can be carried out when needing to carry out income calculation.Query the balance can be applied in other should
With in scene, do not repeat one by one herein.The financial product enriched with category occurs, it is not only possible to because different user is held not
Cause the demand that remaining sum batch query be present with assets, it is also possible to cause remaining sum batch be present because same user holds multiple assets
Measure the demand of inquiry.Therefore need to provide a kind of scheme of remaining sum batch query.
The a large amount of wastes that can exist to storage resource are recorded because the fixed cycle records remaining sum variation, therefore, only remaining
Volume can just record remaining sum and change record when changing.Wherein, remaining sum change record can include asset identification, balance type, currency type,
Keep accounts the attributes such as data, data of entering an item of expenditure in the accounts and current balance.
At present, an assets are inquired about in the remaining sum of scheduled date, the scheduled date can be inquired about with the presence or absence of remaining sum variation
Record, if it does, obtaining remaining sum from remaining sum daily variation record, and the remaining sum of acquisition is defined as assets in the scheduled date
Remaining sum;Change and record if there is no remaining sum, using the scheduled date as time reference line, backtracking remaining sum changes record, and remaining sum is become
Dynamic record is arranged in chronological order, is obtained a newest remaining sum and is changed record, and then obtains assets more than the scheduled date
Volume.
But when carrying out inquiry into balance at least two assets, only had a surplus because the remaining sum of every assets changes record
Volume can just record (i.e. remaining sum change record not exists daily) when changing, the remaining sum transfer date of a different assets may not
Together, therefore need to generate query statement respectively for every assets and inquired about, the time-consuming of service can be with the increasing of amount of assets
Add and linearly increasing, search efficiency is low.
In consideration of it, this specification embodiment provides a kind of scheme of quick search remaining sum.This specification embodiment is receiving
To for inquire about at least two desired assets in the remaining sum of same scheduled date, according to scheduled date and the money of desired asset
Production mark one query statement of structure, realizes that one query obtains at least two desired assets within less than or equal to the scheduled date
Keep accounts data and the data of entering an item of expenditure in the accounts when remaining sum changes occur, more than keep accounts data and the data progress of entering an item of expenditure in the accounts of every desired asset
Volume calculates, and obtains remaining sum of the every desired asset in the scheduled date.It can be seen that at least two assets, it only need to build one and look into
Ask sentence and realize one query, without building query statement respectively for every desired asset, avoid repeatedly inquiry from causing to inquire about
It is time-consuming accumulative, therefore improve search efficiency.
As shown in figure 1, Fig. 1 is a kind of flow of inquiry into balance method of this specification according to an exemplary embodiment
Figure, this method can be used in database, and this method can include step 102,104 and 106.
In a step 102, inquiry request is received, the inquiry request is used to inquire about at least two desired assets in specified day
The remaining sum of phase, the scheduled date of at least two desired assets are identical.
At step 104, according to the asset identification of at least two desired assets in the scheduled date and inquiry request
A query statement is built, for inquiring about at least two desired assets when less than or equal to remaining sum variation occurs in the scheduled date
Keep accounts and data and enter an item of expenditure in the accounts data.
In step 106, according to keep accounts data and the data progress remaining sum calculating of entering an item of expenditure in the accounts of every desired asset, every is obtained
Remaining sum of the desired asset in the scheduled date.
Wherein, in different application scenarios, the executive agent for sending inquiry request can be different, step 102 to step
106 executive agent can also be different.For example, need to inquire about desired asset in the scene of the remaining sum of scheduled date in user,
User can send inquiry request by client to service end, and step 102 is performed to 106 by service end, and by Query Result
It is back to client.And for example, in the scene for needing to calculate income, return on assets computing module can send to database and inquire about
Request, step 102 is performed by database and is back to return on assets computing module to step 106, and by Query Result.
Inquiry request can be used for inquiring about remaining sum of at least two desired assets in the scheduled date.The application scenarios of this programme
Can be the situation for the remaining sum for being related to more desired assets of inquiry, it is to be understood that during the remaining sum of one desired asset of inquiry
This specification embodiment scheme can also be used.More desired assets can be the assets of same user or different use
The assets at family.Asset identification and the scheduled date of desired asset can be carried in inquiry request.Asset identification is to be used for
The mark of desired asset is identified, the asset identification of different assets is different, and different assets are distinguished using asset identification to realize.It is same
Multiple assets are there may be under user account, can be in user's account in order to distinguish the different assets under same user account
On the basis of number, with reference to different assets, the asset identification of different assets is generated, the asset identification can be assets account, assets
Account etc..
On the scheduled date, the scheduled date is historical date.Scheduled date can using specify the cycle as minimum time unit,
For example, the scheduled date can using the second, point, when, day, week, the specified cycle such as the moon or year is minimum time unit.For example, specify day
When phase is using day as minimum time unit, the form of scheduled date can be the forms such as 00 day 00 month 00 year or 0000-00-00,
If the scheduled date can be 20170501, then can with queries asset on May 1st, 2017 remaining sum.And for example, the scheduled date is with year
For minimum time unit when, the scheduled date can be 2016, then can be with remaining sum of the queries asset in 2016.
Accordingly, the remaining sum of scheduled date can be all ending balances, for example, end second remaining sum, point whole remaining sum, Shi Zhongyu
Volume, end day remaining sum, week whole remaining sum, end of the month remaining sum or annual balance etc..So-called all ending balances, represent that assets were specified in the cycle
The amount of money or share at last moment.By taking end day remaining sum as an example, end day remaining sum represents the amount of money of assets last moment in one day
Or share.
And in practical application, incremental data can be just recorded in remaining sum when remaining sum changes and changed in record.Incremental data
The information such as data, data of entering an item of expenditure in the accounts, current balance that keep accounts can be included.Wherein, the data that keep accounts are to flow into the data of account, again can be with
Referred to as flow into data.For example, it may be flowing into the amount of money, fund share etc. is flowed into.Data of entering an item of expenditure in the accounts are to flow out the data of account, again may be used
To be referred to as flowing out data.For example, it may be the outflow amount of money, outflow fund share etc..
As a kind of recording mode, occur to generate a remaining sum variation record when remaining sum changes every time, work as the scheduled date
Remaining sum when being all ending balances, can obtain and change record less than or equal to institute's surplus in the scheduled date, and then obtain
At least two desired assets are less than or equal to keep accounts data and the data of entering an item of expenditure in the accounts occurred in the scheduled date when remaining sum changes.
In order to improve subsequent query efficiency, the incremental data in same period is recorded in same remaining sum and changed in record,
Incremental data in different cycles is recorded in different bar remaining sums and changed in record.If more than an assets occur first within a cycle
Volume changes, and the remaining sum in the newly-built cycle changes record;If an assets in same period it is non-first occur remaining sum change when, more
The remaining sum in the new cycle changes record, so that an assets contain up to a remaining sum in same period and change record.Wherein,
Often kept accounts because remaining sum changes caused by data or data of entering an item of expenditure in the accounts, thus will can keep accounts data or enter an item of expenditure in the accounts data and
Remaining sum after renewal is recorded in remaining sum corresponding to the cycle and changed in record.Incremental data comprises at least keep accounts data and number of entering an item of expenditure in the accounts
According to.
Scheduled date is illustrated by minimum time unit of day, remaining sum variation occurs within same day for assets
When, incremental data is recorded in same remaining sum and changed in record;Assets are when different in a few days generation remaining sums change, by changing number
Changed according to different bar remaining sums are recorded in record.If specifically, an assets occur first within same day remaining sum change when, newly
It is built into account data and/or data of entering an item of expenditure in the accounts;If an assets during the non-remaining sum variation of generation first, update what is established within same day
The data that keep accounts and/or data of entering an item of expenditure in the accounts, so that an assets contain up to one within same day keeps accounts data and/or one is entered an item of expenditure in the accounts
Data.
Wherein, the same day can carry out division acquisition at the last moment according to assets category defined.If for example, most
A moment is 24 points afterwards, then dividing mode on the one is:0 point to 24 points of the same day.If it is at the last moment at 15 points, division side on the one
Formula is:15 points of the previous day are to 15 points of the same day.
Multiple remaining sum variation is carried out in same period, the incremental data that the variation of each remaining sum obtains is updated and replaced
Change, so that remaining sum changes each attribute at most only assignment in record.Renewal can tire out when replacing to incremental data
Meter.For example, in same period, if first time remaining sum is changed for 10,000 RMB that keep accounts, the remaining sum for establishing the cycle changes note
Record, remaining sum, which changes record, to be included:
Asset identification (xxxx), the data that keep accounts (10,000 yuan), data of entering an item of expenditure in the accounts (0), remaining sum (remaining sum of upper cycle+1 ten thousand), currency type
(RMB) ...;
If second remaining sum is changed for 20,000 RMB that keep accounts, by remaining sum change in record keep accounts data and remaining sum is entered
Row renewal, remaining sum change record and are updated to:
Asset identification (xxxx), the data that keep accounts (30,000 yuan), data of entering an item of expenditure in the accounts (0), remaining sum (remaining sum of upper cycle+3 ten thousand), currency type
(RMB) ....
Because the scheduled date of more desired assets in inquiry request is identical, therefore, can will the scheduled date as the time
Line carries out one query, for example, can the asset identification based at least two desired assets in scheduled date and inquiry request
A query statement is built, for inquiring about at least two desired assets when less than or equal to remaining sum variation occurs in the scheduled date
Keep accounts and data and enter an item of expenditure in the accounts data.
In one example, record is changed due to remaining sum can be carried out when remaining sum changes, and remaining sum is changed in record at least
, therefore, can be according to desired asset including asset identification, remaining sum transfer date, the data that keep accounts, data of entering an item of expenditure in the accounts and current balance
Asset identification and the scheduled date inquired about, inquiry obtain less than or equal to the scheduled date remaining sum transfer date and provide
The remaining sum that production is identified as the asset identification of desired asset changes record, and changes to obtain to keep accounts in record from remaining sum and data and enter an item of expenditure in the accounts
Data.
However, it is desired asset to obtain the remaining sum transfer date for being less than or equal to the scheduled date and asset identification in inquiry
The remaining sum of asset identification change record, it is necessary to by way of returning table, change to obtain to keep accounts in record from remaining sum and data and go out
Account data, therefore, in order to further improve search efficiency, record structure concordance list in advance is changed based on remaining sum.Wherein, the rope
Draw keep accounts data and four attributes of data of entering an item of expenditure in the accounts when table includes asset identification, remaining sum transfer date, remaining sum variation, the remaining sum
Variation is recorded in when remaining sum changes and is updated.In consideration of it, based at least two desired assets in the inquiry request
Asset identification and less than or equal to the scheduled date build a query statement;According to constructed query statement from concordance list
One query goes out corresponding for the asset identification of desired asset less than or equal to the remaining sum transfer date and asset identification of scheduled date
Keep accounts and data and enter an item of expenditure in the accounts data.
Keep accounts data and to go out when asset identification, remaining sum transfer date, remaining sum change due to having contained in concordance list
Four attributes of account data, then can using the asset identification of desired asset and less than or equal to the scheduled date as index condition,
Inquiry obtains keep accounts data and data of entering an item of expenditure in the accounts from concordance list, and reduction indexes back table, improves search efficiency.
After acquisition keeps accounts data and data of entering an item of expenditure in the accounts, due at least two desired assets be present, target is every in order to obtain
Remaining sum of the desired asset in the scheduled date, therefore, entering of obtaining can will be inquired about according to the asset identification of every desired asset
Account data and data of entering an item of expenditure in the accounts are grouped;Based on keep accounts data and the data progress remaining sum calculating of entering an item of expenditure in the accounts in every group of data, obtain
Remaining sum of the every desired asset in the scheduled date., can be by the number that kept accounts in every group of data as one of which remaining sum computational methods
According to summation and the summation of data of entering an item of expenditure in the accounts seek difference, obtain desired asset corresponding to this group of data in the remaining sum of scheduled date.
It can be seen that once obtaining the process data of desired asset by a timeline (scheduled date), added up in real time
Calculate and obtain per remaining sum of the reward for writing or painting sheet in the scheduled date, calculated by align data with real-time, solve the main consumption repeatedly inquired about
When bottleneck, ensure inquiry service stable performance.
Further, if keep accounts data or data of entering an item of expenditure in the accounts are not present in desired asset within less than or equal to the scheduled date, i.e.,
Remaining sum is not present within less than or equal to the scheduled date and changes for desired asset, then sets remaining sum of the desired asset in the scheduled date
It is zero.
Wherein, one is built according to the asset identification of at least two desired assets in the scheduled date and inquiry request
Query statement, keep accounts data or data of entering an item of expenditure in the accounts are not found based on query statement, then remaining sum of the desired asset in the scheduled date
It is zero.
Various technical characteristics in embodiment of above can be arbitrarily combined, as long as the combination between feature is not present
Conflict or contradiction, but as space is limited, do not described one by one, therefore the various technical characteristics in above-mentioned embodiment is any
It is combined the scope for falling within this disclosure.Combined with one of which and entered with reference to one of which application scenarios below
Row illustrates.
As shown in Fig. 2 Fig. 2 is showing for another inquiry into balance method of this specification according to an exemplary embodiment
It is intended to.Return on assets module can send inquiry batch when needing to carry out return on assets to the inquiry into balance module in database
Desired asset is measured in the inquiry request (step 202) of the remaining sum of scheduled date, desired asset can be wherein carried in inquiry request
Assets account (can abbreviation desired asset account).Scheduled date can be the historical date for including the date.Inquiry into balance
Module inquires about the daily variation record for meeting date terms and assets account condition from the daily variation data module of database.Date
Condition:The date of daily variation record is less than or equal to scheduled date, assets account condition:The assets account of daily variation record is mesh
The assets account of assets is marked, that is, from daily variation data module, Query Dates are less than or equal to the scheduled date and provided
Produce account and record (step 204) for the daily variation of desired asset account.Wherein, daily variation note is stored with daily variation data module
Record, daily variation record are the record informations carried out when assets generation remaining sum changes.Inquiry into balance module is according to daily variation data
Response results carry out daily variation record and judge, recorded if there is daily variation, will according to the asset identification of every desired asset
Keep accounts data and data of entering an item of expenditure in the accounts in daily variation record are grouped;By the summation for the data that kept accounts in every group of data and data of entering an item of expenditure in the accounts
Summation seek difference, obtain remaining sum of the desired asset in the scheduled date corresponding to this group of data, the remaining sum can be understood as end day
Remaining sum (step 206).If wherein one or more desired assets record in the absence of daily variation, daily variation record there will be no
The remaining sum of desired asset be arranged to zero (step 208).Inquiry into balance module sends batch day end remaining sum to return on assets meter
Calculate module (step 210).
By taking end day remaining sum as an example, surplus daily variation record is often recorded in billing and accounting system, it is main to include with properties:
Asset account, balance type, currency type, day inflow data, day outflow data and current balance.It is related to remaining sum with other building account
During variation can more new balance daily variation record, by user buy fund share exemplified by:
The first stroke desired asset:
A1. on January 1st, 2016 opens an account, and asset account is:2088XXX10156, increase the remaining sum that the date is 20160101 newly
Daily variation records, and record same day remaining sum is 0.0000 (part), flows into 0.0000 (part), flows out 0.0000 (part).
A2. 200.0000 (parts) are applied to purchase and confirmed on January 10th, 2016, increases newly and becomes the remaining sum day that the date is 20160110
Dynamic record, record same day remaining sum is 200.0000 (parts), flows into 200.0000 (parts), flows out 0.0000 (part).
A3. redeem on January 10th, 2017 and confirm 20.0000 (parts), increase the remaining sum daily variation that the date is 20170110 newly
Record, record same day remaining sum is 180.0000 (parts), flows into 0.0000 (part), flows out 20.0000 (parts).
Second desired asset:
B1. on May 1st, 2017 opens an account, and asset account is:2088XXX20156, increase the remaining sum that the date is 20170501 newly
Daily variation records, and record same day remaining sum is 0.0000 (part), flows into 0.0000 (part), flows out 0.0000 (part).
B2. 100.0000 (parts) are applied to purchase and confirmed on May 3rd, 2017, increases the remaining sum daily variation that the date is 20170503 newly
Record, record same day remaining sum is 100.0000 (parts), flows into 100.0000 (parts), flows out 0.0000 (part).
B3. redeem on May 10th, 2017 and confirm 20.0000 (parts), increase the remaining sum daily variation that the date is 20170510 newly
Record, record same day remaining sum is 80.0000 (parts), flows into 0.0000 (part), flows out 20.0000 (parts).
B4. 1000.0000 (parts) are applied to purchase and confirmed on May 20th, 2017 again, increases the remaining sum that the date is 20170520 newly
Daily variation records, and record same day remaining sum is 1080.0000 (parts), flows into 1000.0000 (parts), flows out 0.0000 (part).
Remaining sum daily variation record only can just be recorded when remaining sum changes, and on the one hand daily record becomes day
Dynamic record, do not possess corresponding condition (not having trigger event) when no remaining sum changes, become in the absence of day another aspect one day
When dynamic, end day remaining sum can be obtained by this specification embodiment, all record a large amount of wastes that can exist to storage resource daily.
When the return on assets of scheduled date to be carried out calculates the end day remaining sum for obtaining account, query steps can be such as step
204 to 208.With on May 11st, 2017 for the scheduled date, using the asset identification of desired asset as 2088XXX10156 and
Exemplified by 2088XXX20156, keep accounts data and number of entering an item of expenditure in the accounts before on May 11st, 2017 and 11 days Mays in 2017 can be obtained
According to because the assets that asset identification is 2088XXX10156 flow into 0.0000 (part), outflow 0.0000 on January 1st, 2016
(part);200.0000 (parts) are flowed on January 10th, 2016, flow out 0.0000 (part);0.0000 is flowed on January 10th, 2017
(part), flow out 20.0000 (parts);And the assets that asset identification is 2088XXX20156 flowed into 0.0000 on May 1st, 2017
(part), 0.0000 (part) is flowed out, flow into 100.0000 (parts) on May 3rd, 2017, flow out 0.0000 (part);On May 10th, 2017
0.0000 (part) is flowed into, flows out 20.0000 (parts).Therefore, according to the asset identification of every desired asset, entering for acquisition will be inquired about
Account data and data of entering an item of expenditure in the accounts are grouped;The summation of the summation for the data that kept accounts in every group of data and data of entering an item of expenditure in the accounts is sought into difference, obtained
Remaining sum of the desired asset in the scheduled date corresponding to this group of data is obtained, so as to obtain the assets that asset identification is 2088XXX10156
It is 180.0000 (parts) in the remaining sum on May 11st, 2017, asset identification is 2088XXX20156 assets May 11 in 2017
The remaining sum of day is 80.0000 (parts).
It can be seen that the daily variation Time Inconsistency of the first stroke desired asset and second desired asset, then two desired assets
The irregular discrete distribution of target data, the present embodiment obtains two desired assets by using the scheduled date as a timeline
All intermediate data (flow into data and outflow data), so as to turn parts into the whole, inquiry times are effectively reduced, so as to improve inquiry
Efficiency.
Corresponding with the embodiment of foregoing inquiry into balance method, this specification additionally provides inquiry into balance device and its answered
The embodiment of electronic equipment.
The embodiment of this specification inquiry into balance device can be applied in computer equipment.Device embodiment can be by soft
Part is realized, can also be realized by way of hardware or software and hardware combining.Exemplified by implemented in software, as a logical meaning
On device, be by corresponding computer program instructions in nonvolatile memory by the processor of computer equipment where it
Read what operation in internal memory was formed.For hardware view, as shown in figure 3, being counted where this specification inquiry into balance device
Calculate machine equipment a kind of hardware structure diagram, except the processor 310 shown in Fig. 3, internal memory 330, network interface 320 and it is non-easily
Outside the property lost memory 340, the computer equipment in embodiment where device 331 is gone back generally according to the actual functional capability of the equipment
Other hardware can be included, this is repeated no more.
As shown in figure 4, be a kind of block diagram of inquiry into balance device of this specification according to an exemplary embodiment, institute
Stating device includes:
Request receiving module 410, for receiving inquiry request, the inquiry request is used to inquire about at least two desired assets
It is identical in the remaining sum of scheduled date, the scheduled date of at least two desired assets;
Data inquiry module 420, for according at least two desired assets in the scheduled date and inquiry request
Asset identification build a query statement, for inquire about at least two desired assets less than or equal in the scheduled date occur more than
Keep accounts data and data of entering an item of expenditure in the accounts when volume changes;
Remaining sum obtains module 430, for carrying out remaining sum calculating with data of entering an item of expenditure in the accounts according to the data that keep accounts of every desired asset,
Obtain remaining sum of the every desired asset in the scheduled date.
In an optional implementation, the scheduled date also includes by minimum time unit, described device of day
Data recordin module (Fig. 4 is not shown), is used for:It is newly-built to keep accounts if remaining sum variation occurs first within same day for an assets
Data and/or data of entering an item of expenditure in the accounts;If an assets during the non-remaining sum variation of generation first, update the number that keeps accounts established within same day
According to and/or data of entering an item of expenditure in the accounts so that an assets contain up to keep accounts data and/or a data of entering an item of expenditure in the accounts within same day.
In an optional implementation, changing record based on remaining sum, structure concordance list, the concordance list include in advance
Keep accounts data and four attributes of data of entering an item of expenditure in the accounts when asset identification, remaining sum transfer date, remaining sum variation, the remaining sum change record
It is updated when remaining sum changes;
The data inquiry module 420 is specifically used for:
Asset identification based at least two desired assets in the inquiry request and less than or equal to scheduled date structure
Build a query statement;
According to constructed query statement, one query goes out the remaining sum variation less than or equal to the scheduled date from concordance list
Date and asset identification are data and the data of entering an item of expenditure in the accounts of being kept accounts corresponding to the asset identification of desired asset.
In an optional implementation, the remaining sum obtains module 430 and is specifically used for:
According to the asset identification of every desired asset, keep accounts data and the data of entering an item of expenditure in the accounts that inquire about acquisition are grouped;
The summation of the summation for the data that kept accounts in every group of data and data of entering an item of expenditure in the accounts is sought into difference, obtains mesh corresponding to this group of data
Mark remaining sum of the assets in the scheduled date.
In an optional implementation, the remaining sum obtains module 430 and is additionally operable to:
If keep accounts data or data of entering an item of expenditure in the accounts are not present in desired asset within less than or equal to the scheduled date, by desired asset
Zero is arranged in the remaining sum of scheduled date.
For device embodiment, because it corresponds essentially to embodiment of the method, so related part is real referring to method
Apply the part explanation of example.Device embodiment described above is only schematical, wherein described be used as separating component
The module of explanation can be or may not be physically separate, can be as the part that module is shown or can also
It is not physical module, you can with positioned at a place, or can also be distributed on multiple mixed-media network modules mixed-medias.Can be according to reality
Need to select some or all of module therein to realize the purpose of this specification scheme.Those of ordinary skill in the art are not
In the case of paying creative work, you can to understand and implement.
Accordingly, this specification embodiment also provides a kind of computer equipment, including:Processor;For storing processor
The memory of executable instruction;Wherein, the processor is configured as:
Inquiry request is received, the inquiry request is used to inquire about remaining sum of at least two desired assets in the scheduled date, institute
The scheduled date for stating at least two desired assets is identical;
One inquiry is built according to the asset identification of at least two desired assets in the scheduled date and inquiry request
Sentence, for inquire about at least two desired assets less than or equal in the scheduled date occur remaining sum change when keep accounts data and
Enter an item of expenditure in the accounts data;
According to keep accounts data and the data progress remaining sum calculating of entering an item of expenditure in the accounts of every desired asset, obtain every desired asset and referring to
The remaining sum fixed the date.
Each embodiment in this specification is described by the way of progressive, identical similar portion between each embodiment
Divide mutually referring to what each embodiment stressed is the difference with other embodiment.It is real especially for equipment
For applying example, because it is substantially similar to embodiment of the method, so description is fairly simple, related part is referring to embodiment of the method
Part explanation.
A kind of computer-readable storage medium, have program stored therein in the storage medium instruction, and described program instruction includes:
Inquiry request is received, the inquiry request is used to inquire about remaining sum of at least two desired assets in the scheduled date, institute
The scheduled date for stating at least two desired assets is identical;
One inquiry is built according to the asset identification of at least two desired assets in the scheduled date and inquiry request
Sentence, for inquire about at least two desired assets less than or equal in the scheduled date occur remaining sum change when keep accounts data and
Enter an item of expenditure in the accounts data;
According to keep accounts data and the data progress remaining sum calculating of entering an item of expenditure in the accounts of every desired asset, obtain every desired asset and referring to
The remaining sum fixed the date.
This specification embodiment can use wherein includes the storage medium of program code (including but not in one or more
Be limited to magnetic disk storage, CD-ROM, optical memory etc.) on the form of computer program product implemented.Computer is available to be deposited
Storage media includes permanent and non-permanent, removable and non-removable media, can realize letter by any method or technique
Breath storage.Information can be computer-readable instruction, data structure, the module of program or other data.The storage of computer is situated between
The example of matter includes but is not limited to:Phase transition internal memory (PRAM), static RAM (SRAM), dynamic random access memory
Device (DRAM), other kinds of random access memory (RAM), read-only storage (ROM), the read-only storage of electrically erasable
Device (EEPROM), fast flash memory bank or other memory techniques, read-only optical disc read-only storage (CD-ROM), digital versatile disc
(DVD) or other optical storages, magnetic cassette tape, the storage of tape magnetic rigid disk or other magnetic storage apparatus or any other non-biography
Defeated medium, the information that can be accessed by a computing device available for storage.
Those skilled in the art will readily occur to this specification after considering specification and putting into practice the invention applied here
Other embodiments.This specification is intended to any modification, purposes or adaptations of this specification, these modifications,
Purposes or adaptations follow the general principle of this specification and not applied in the art including this specification
Common knowledge or conventional techniques.Description and embodiments be considered only as it is exemplary, the true scope of this specification and
Spirit is pointed out by following claim.
It should be appreciated that the precision architecture that this specification is not limited to be described above and is shown in the drawings,
And various modifications and changes can be being carried out without departing from the scope.The scope of this specification is only limited by appended claim
System.
The preferred embodiment of this specification is the foregoing is only, it is all in this explanation not to limit this specification
Within the spirit and principle of book, any modification, equivalent substitution and improvements done etc., the model of this specification protection should be included in
Within enclosing.