Account data processing method and device, electronic equipment and storage medium

文档序号:9149 发布日期:2021-09-17 浏览:136次 中文

1. An account data processing method, comprising:

when the balance of the virtual currency of the account is increased, acquiring a target time when the balance is increased and a first balance increment of the increased balance;

determining a balance period to which the target time belongs;

accumulating the first balance increment to a second balance increment of the account over the balance period;

freezing the virtual currency with the amount being the second balance increment in a freezing period taking the period starting time of the balance period as the freezing starting time;

when a business processing request for the balance of the account is received, responding to the business processing request based on the second balance increment.

2. The account data processing method according to claim 1, wherein, when the balance of the virtual money of the account increases, before acquiring the target time at which the balance increases and the first balance increment of the increased balance, the method further comprises:

detecting the account to determine whether a preset event occurs, wherein the preset event is a virtual currency increase request aiming at the account;

if yes, the step of obtaining the target time when the balance is increased and the first balance increment of the increased balance is executed.

3. The account data processing method according to claim 2, wherein the acquiring, when the balance of the virtual money of the account increases, the target time at the time of the increase in the balance and the first balance increment of the increased balance includes:

acquiring a request time of a virtual money increase request for the account and a target amount of virtual money requested to be increased;

determining the request time as a target time when the balance is increased; and

determining the target amount as a first balance increment of the increased balance.

4. The account data processing method according to claim 1, wherein, after the balance of the virtual currency of the account is increased, before acquiring the target time at which the balance is increased and the first balance increment of the increased balance, the method further comprises:

acquiring the type of the virtual currency;

and when the type is a specified type, executing a step of acquiring a target time when the balance is increased and a first balance increment of the increased balance.

5. The account data processing method of claim 1, wherein the determining the balance period to which the target time belongs comprises:

acquiring the time period of each balance period;

determining a target time period containing the target time from a plurality of time periods;

and determining the balance cycle corresponding to the target time period as the balance cycle to which the target time belongs.

6. The account data processing method of claim 1, wherein freezing the virtual currency with the amount being the second balance increment during a freezing period with a period start time of the balance period as a start time comprises:

acquiring the type of the virtual currency;

searching a freezing duration matched with the type in a preset type-freezing duration table;

determining the period starting time of the balance period as a freezing starting time;

calculating the sum of the cycle start time and the freezing duration to obtain a freezing end time;

and setting the virtual currency with the amount being the second balance increment in the account into a frozen state in a time period from the freezing starting time to the freezing ending time.

7. The account data processing method of claim 6, further comprising, after freezing the virtual currency with a credit equal to the second balance increment:

and when the current time is the freezing end time, unfreezing the virtual currency with the amount being the second balance increment.

8. The account data processing method according to any one of claims 1 to 7, wherein the responding to the business processing request based on the second balance increment when the business processing request for the account is received comprises:

when an available balance inquiry request of a service end is received, acquiring the total balance of the account;

judging whether the account currently has frozen virtual currency or not;

if yes, calculating the sum of second balance increment of the frozen virtual currency to be worth freezing the balance;

calculating the difference value of the total balance and the frozen balance to obtain the available balance of the account;

if not, determining the total balance as the available balance of the account;

and sending the available balance to the service end.

9. The account data processing method of claim 8, wherein after the sending the available balance to the service end, further comprising:

when a balance deduction request of a service end is received, determining the deduction amount of deducting virtual money in the balance deduction request;

judging whether the available balance is larger than the deduction amount or not;

if so, calculating a difference value between the available balance and the deduction amount as the available balance of the account;

if not, generating prompt information with insufficient balance and sending the prompt information to the service end.

10. An account data processing apparatus, comprising:

the account balance increment acquisition module is used for acquiring a target time when the balance is increased and a first balance increment of the increased balance when the balance is increased;

the balance cycle determining module is used for determining a balance cycle to which the target time belongs;

a balance increment accumulation module, configured to accumulate the first balance increment into a second balance increment of the account in the balance period;

the freezing module is used for freezing the virtual currency with the quota being the second balance increment in a freezing period taking the period starting time of the balance period as the freezing starting time;

and the service request response module is used for responding to the service processing request based on the second balance increment when receiving the service processing request aiming at the balance of the account.

11. An electronic device, characterized in that the electronic device comprises:

one or more processors;

a storage device to store one or more computer programs,

when executed by the one or more processors, cause the one or more processors to implement the account data processing method of any one of claims 1-9.

12. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the account data processing method according to any one of claims 1 to 9.

Background

With the popularization of social application programs such as short videos and live broadcasts, in order to better realize social activities through the social application programs, the social application programs provide a recharging function, and users obtain virtual money after recharging so as to enjoy more personalized social services after consuming the virtual money.

At present, for the account of the user, whenever the user charges to increase the balance of the virtual money of the account, in order to protect the security of the account, when the total balance of the account increases, the newly added virtual money is generally frozen to be in an unavailable state, and after the freezing period of the newly added virtual money is over, the part of the virtual money is unfrozen to be in an available state. However, when the available balance of the account is counted in the presence of the virtual money for the freezing period, at present, all historical running water of the account is traversed mainly by running a script regularly, the frozen balance of each account is determined from the historical running water, and then the actual balance of the account up to the determined time except for the frozen virtual money is calculated as the available balance of the account.

In summary, the conventional method for acquiring the available balance of the account needs to store and traverse all historical pipelines of the account to determine the virtual currency in the freezing period, which is time-consuming and can not acquire the real-time available balance of the account.

Disclosure of Invention

Embodiments of the present invention provide an account data processing method, an account data processing apparatus, an electronic device, and a storage medium, so as to solve the problem in the prior art that when there is a frozen currency in an account, it is necessary to store and traverse all historical pipelines of the account to determine a virtual currency in a frozen period, which results in a long time for obtaining an available balance of the account and a failure to obtain a real-time available balance of the account.

In a first aspect, an embodiment of the present invention provides an account data processing method, including:

when the balance of the virtual currency of the account is increased, acquiring a target time when the balance is increased and a first balance increment of the increased balance;

determining a balance period to which the target time belongs;

accumulating the first balance increment to a second balance increment of the account over the balance period;

freezing the virtual currency with the amount being the second balance increment in a freezing period taking the period starting time of the balance period as the freezing starting time;

when a business processing request for the balance of the account is received, responding to the business processing request based on the second balance increment.

In a second aspect, an embodiment of the present invention provides an account data processing apparatus, including:

the account balance increment acquisition module is used for acquiring a target time when the balance is increased and a first balance increment of the increased balance when the balance is increased;

the balance cycle determining module is used for determining a balance cycle to which the target time belongs;

a balance increment accumulation module, configured to accumulate the first balance increment into a second balance increment of the account in the balance period;

the freezing module is used for freezing the virtual currency with the quota being the second balance increment in a freezing period taking the period starting time of the balance period as the freezing starting time;

and the service request response module is used for responding to the service processing request based on the second balance increment when receiving the service processing request aiming at the balance of the account.

In a third aspect, an embodiment of the present invention provides an electronic device, where the electronic device includes:

one or more processors;

a storage device to store one or more computer programs,

when executed by the one or more processors, cause the one or more processors to implement the account data processing method of the first aspect of the invention.

In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the account data processing method according to the first aspect of the present invention.

When the balance of the virtual currency of the account is increased, acquiring a target time when the balance is increased and a first balance increment of the increased balance, determining a balance period to which the target time belongs, accumulating the first balance increment into a second balance increment of the account in the balance period, freezing the virtual currency with the quota as the second balance increment in a freezing period with the period starting time of the balance period as a freezing starting time, when receiving a business processing request aiming at the balance of the account, responding to the business processing request based on the second balance increment, updating the newly-added balance of the corresponding balance period when the balance of the account is increased, freezing the balance increased in the balance period, acquiring the frozen balances of all the accounts when receiving business processing requests such as available balance, balance deduction and the like aiming at the account, and calculating the available balance, balance increment, balance amount balance, and the like based on the frozen balances, And deducting balance and the like, the frozen balance is obtained without storing and traversing historical running water of the account, the available balance can be quickly calculated through the frozen balance, the consumed time is short, and the real-time available balance of the account can be obtained.

Drawings

FIG. 1 is a flowchart illustrating steps of a method for processing account data according to an embodiment of the present invention;

FIG. 2 is a flowchart illustrating steps of a method for processing account data according to a second embodiment of the present invention;

fig. 3 is a block diagram of an account data processing apparatus according to a third embodiment of the present invention;

fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.

Detailed Description

The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures. The embodiments and features of the embodiments in the present application may be combined with each other without conflict.

Example one

Fig. 1 is a flowchart of steps of an account data processing method according to an embodiment of the present invention, where the method is applicable to a case where an account responds to a service processing request when a frozen balance exists, and the method may be executed by an account data processing apparatus according to an embodiment of the present invention, where the account data processing apparatus may be implemented by hardware or software and is integrated in an electronic device according to an embodiment of the present invention, and specifically, as shown in fig. 1, the account data processing method according to an embodiment of the present invention may include the following steps:

s101, when the balance of the virtual currency of the account is increased, acquiring the target time when the balance is increased and a first balance increment of the increased balance.

In the embodiment of the present invention, the balance of the account may be a balance of virtual money, for example, after a user recharges on a short video platform, a voice platform, a live broadcast platform, and other social platforms, the user may obtain the virtual money, the amount of the virtual money owned by the user is the balance of the account of the user, and the user may obtain a corresponding service by consuming the virtual money.

For the balance of the account, when the user of the account consumes or charges the account, the balance of the account changes, and the system records the time when the balance changes and the changed balance value.

And S102, determining the balance cycle of the target time.

In this embodiment of the present invention, the balance period may be a period for recording an increase in a balance of the account, that is, the balance increased by the account is accumulated in the balance period, in an example, the balance period may be in units of month, day, hour, and the like, and the period of the balance period is not limited in the embodiment of the present invention.

Taking the balance period as 1 day as an example, the balance period to which the target time belongs is the natural day to which the target time belongs, for example, if balance is increased by 100 coins at 10:30 at 7/5/2021, the target time for balance increase is 10:30 at 7/5/2021, the first balance increment is 100, and the balance period to which the target time is 10:30 at 7/5/2021 is 2021, 7/5/00 at 7/2021, 5/24: 00 at 7/5/2021.

S103, adding the first balance increment into a second balance increment of the account in the balance period.

In the embodiment of the present invention, for each account, if the account balance increases in a balance cycle, a balance data table may be maintained, where the balance data table is used to record information of the account, such as the Uid, the type of virtual currency, the balance cycle, a second balance increment, and an update time, where the second balance increment is a total amount of virtual currency added to the account in the balance cycle, and the update time is a time of a last balance increase.

And accumulating the first balance increment of the added virtual currency into the second balance increment to obtain a new second balance increment every time the balance increase of the account is detected in the balance period, and modifying the updating time to the target time of the balance increase.

And S104, freezing the virtual currency with the quota being the second balance increment in a freezing period taking the cycle starting time of the balance cycle as the freezing starting time.

The cycle start time of the balance cycle is the start time of each balance cycle, in one example, the balance cycle is 1 month, the cycle start time of the balance cycle is 00:00:00 of 1 day of each month, similarly, the balance cycle is 1 day, the cycle start time of the balance cycle is 00:00:00 of each day, and the balance cycle is 1 hour, the cycle start time of the balance cycle is 0 minute 0 second of each hour.

The freezing of the virtual money is provided with a freezing period, different types of virtual money can be provided with freezing periods with different freezing time lengths, when the balance period starts, the period starting time of the balance period can be taken as the freezing starting time of the freezing period, the virtual money added in the balance period is frozen, namely the virtual money with the frozen amount being the second balance increment, the frozen virtual money is unusable virtual money, the unusable virtual money is recorded in the total balance of the account and is not recorded in the usable balance of the account until the frozen virtual money is converted into the usable virtual money after the freezing period ends.

And S105, when receiving a business processing request aiming at the balance of the account, responding the business processing request based on the second balance increment.

The service processing request aiming at the balance of the account can be an available balance inquiry request, a balance deduction request and the like, when the service processing request is the available balance inquiry request aiming at the account, the total balance of the account can be obtained, when frozen virtual money exists in the account, the sum of second balance increment of all the virtual money in the freezing period can be calculated to obtain the frozen balance, the difference value of the total balance and the frozen balance is calculated to be used as the available balance of the account, and the available balance is sent to the service terminal. Or when the service processing request is a balance deduction request aiming at the account, after the available balance of the account is obtained, comparing the available balance with the deduction balance, if the available balance is larger than the deduction balance, directly deducting, otherwise, prompting the information that the available balance is insufficient.

When the balance of the virtual currency of the account is increased, acquiring a target time when the balance is increased and a first balance increment of the increased balance, determining a balance period to which the target time belongs, accumulating the first balance increment into a second balance increment of the account in the balance period, freezing the virtual currency with the quota as the second balance increment in a freezing period with the period starting time of the balance period as a freezing starting time, when receiving a business processing request aiming at the balance of the account, responding to the business processing request based on the second balance increment, updating the newly-added balance of the corresponding balance period when the balance of the account is increased, freezing the balance increased in the balance period, acquiring the frozen balances of all the accounts when receiving business processing requests such as available balance, balance deduction and the like aiming at the account, and calculating the available balance, balance increment, balance amount balance, and the like based on the frozen balances, And deducting balance and the like, the frozen balance is obtained without storing and traversing historical running water of the account, the available balance can be quickly calculated through the frozen balance, the consumed time is short, and the real-time available balance of the account can be obtained.

Example two

Fig. 2 is a flowchart of steps of an account data processing method according to a second embodiment of the present invention, where the second embodiment of the present invention is optimized based on the first embodiment, specifically, as shown in fig. 2, the account data processing method according to the second embodiment of the present invention may include the following steps:

s201, when the balance of the virtual currency of the account is increased, acquiring the target time when the balance is increased and a first balance increment of the increased balance.

In the embodiment of the present invention, the balance of the account may be a balance of virtual money, for example, after a user recharges on a short video platform, a voice platform, a live broadcast platform, and other social platforms, the user may obtain the virtual money, the amount of the virtual money owned by the user is the balance of the account of the user, and the user may obtain a corresponding service by consuming the virtual money.

In an alternative embodiment of the present invention, an account may be checked to determine whether a preset event occurs, where the preset event may be a virtual money increase request for the account, and if so, the balance of the virtual money of the account is determined to be increased, a request time of the virtual money increase request for the account and a target amount of the virtual money requested to be increased may be acquired, the request time is determined as a target time when the balance is increased, and the target amount is determined as a first balance increment of the increased balance.

The preset event is a virtual currency increase request for an account, and may be, for example, a recharge operation event of a user, or a transfer event (transfer) between accounts, or a virtual currency reward event issued by a system to an account, and the like. The embodiment of the invention determines whether the balance of the account is increased or not by detecting the preset event, and can avoid the detection amount caused by the reduction of the balance and more accurately detect the increase of the balance of the account compared with the detection of the numerical value change of the balance of the account.

In one example, a specified type of virtual currency may be frozen, the type of virtual currency may be acquired after detecting a preset event, a request time for a virtual currency increase request for an account and a target amount of virtual currency requested to be increased are acquired when the type is the specified type, the request time is determined as a target time when a balance is increased, and the target amount is determined as a first balance increment of the increased balance. For example, the type of the virtual currency may include a copper currency, a silver currency, a gold currency, a diamond wheel, and the like, and the gold currency, the diamond wheel, and the diamond wheel may be set as a specific type, so that the target time when the balance is increased and the first balance increment of the increased balance are obtained when the virtual currency is the specific type, that is, the increased specific type of virtual currency may be frozen.

S202, determining the balance cycle of the target time.

In the embodiment of the present invention, the balance period may be a period for recording the balance increase of the account, that is, the balance increased by the account is accumulated in the balance period. After the target time when the balance is increased is obtained, the time period of each balance cycle can be obtained, the target time period including the target time is determined from the multiple time periods, and the balance cycle corresponding to the target time period is determined as the balance cycle to which the target time belongs.

Illustratively, if the balance of the account is increased to 13:00 at 6: 00 at 7 and 6 at 2021, the target time of the newly added 100 red drills is 13:00 at 7 and 6 at 2021, and the target time falls within the range of 00:00 at 7 and 6 at 2021, and the account cycle of the newly added 100 red drills is determined to be 7 and 6 at 2021, 6 at 2021.

The balance cycle to which the target time belongs is described above with the balance cycle being 1 day, and the balance cycle to which the target time belongs may be determined with reference to the balance cycle being 1 day for 1 hour, 1 week, and 1 month.

S203, adding the first balance increment into a second balance increment of the account in the balance period.

Illustratively, for each account, a balance data table for each balance cycle may be maintained as in table 1 below:

name of field Meaning of a field
Uid Account id
Vmtype Virtual currency type
Period Period of statistical balance increase
Balance Sum of balance increased in balance period
Utime Last time of balance increase in balance period

Taking account uid of 12345 and currency type vm _ type of 1 as an example, the number of virtual currencies of the account is 100, 2021-04-2213: 00 obtains 10 virtual currencies for the first time, and the total balance of the virtual currencies becomes 110, table 1 is generated as follows:

when the account has acquired 20 more virtual currencies at 2021-04-2223: 00, the total balance of the virtual currencies becomes 130, and table 1 above is updated as follows:

name of field Meaning of a field
Uid 12345
Vmtype 1
Period 2021-04-22
Balance 30 (second balance increment)
Utime 2021-04-22 23:00

That is, in the balance period 2021-04-22, the account Uid of 12345 has two new balances added, and the two new balances are added as the second new balance of the balance period, that is, the total amount of the virtual money added to the account in the balance period.

S204, freezing the virtual currency with the quota being the second balance increment in a freezing period taking the cycle starting time of the balance period as the freezing starting time.

In an optional embodiment of the invention, for the virtual currency which is newly added in the balance period and has the quota of the second balance increment, the type of the virtual currency can be obtained, the freezing duration matched with the type is searched in a preset type-freezing duration table, the period starting time of the balance period is determined as the freezing starting time, the sum of the period starting time and the freezing duration is calculated to obtain the freezing ending time, the virtual currency with the quota of the second balance increment in the account is set in the freezing state in the time period from the freezing starting time to the freezing ending time, and the quota is unfrozen into the virtual currency with the second balance increment when the current time is the freezing ending time.

For example, assuming that 50 red drills are newly added to the account 2021-07-06, the freezing period of the red drills can be found to be 3 days, 50 red drills are frozen at 2021-07-0600: 00, the freezing start time is 2021-07-0600: 00, the freezing end time is 2021-07-0900: 00 is calculated by taking 3 days as the freezing duration, and in the freezing period from 2021-07-0600: 00 to 2021-07-0900: 00, 50 red drills are frozen in an unavailable state until 2021-07-0900: 00 is thawed. In one example, the frozen virtual currency may be a balance data table that maintains a balance period, and the unfreezing may be destroying the balance data table for the balance period, e.g., for each balance period, if a balance is added, the balance data table for the balance period is established and the freezing of the virtual currency added for the balance period is started, and at the end of the freezing period, the balance data table for the balance period is destroyed.

The embodiment of the invention maintains a balance data table for the virtual money added in each balance period so as to record the number of the frozen virtual money in each balance period, if the balance data table is searched through the account Uid, the account can be shown to have the frozen balance, all historical running water of the account is not required to be stored and traversed to determine whether each increased virtual money of the account is in the frozen state, and the time consumption of determining the account frozen virtual money is short.

S205, when an available balance inquiry request of a service end is received, acquiring the total balance of the account.

In an optional embodiment of the present invention, the service processing request for the balance of the account may be an available balance query request, in one scenario, the service end may be a client that the user logs in, for example, the client may be a client of short video, voice, live broadcast, and the like, the client generates the available balance query request after receiving an available balance query operation of the user, in another scenario, the service end may also be a management platform that an operation and maintenance person of a platform of short video, voice, live broadcast, and the like logs in the management platform, and after the operation and maintenance person logs in the management platform, the operation and maintenance person may operate on the management platform to derive the available balance of each account, and then the service end generates the available balance query request.

In an example, a total balance table may be maintained for each account, and when there is a new balance added to the account or a balance is deducted from the account, the total balance table is updated in real time to determine that the total balance of the account in the total balance table is real-time.

S206, judging whether the account currently has the frozen virtual currency.

Since the virtual money is frozen and unfrozen over time, when an available balance inquiry request is received, whether the account has frozen virtual money or not can be determined, optionally, whether a balance data table exists or not can be matched with the account through the Uid of the account, if the balance data table exists, the account has frozen virtual money or not can be indicated, and of course, the account can be marked when the virtual money is frozen, so that whether the account has frozen virtual money or not can be determined through marking.

If the account currently has frozen virtual money, S207-S208 are executed, otherwise S209 is executed.

S207, calculating the sum of the second balance increment of the frozen virtual currency to be worth freezing the balance.

If the virtual currency added in each balance period is frozen, the virtual currency with the frozen amount of the balance period being the second balance increment is in an unavailable state and is not counted in the available balance of the account, the second balance increments of the frozen virtual currency in all the balance periods are accumulated, and the frozen balance of the virtual currency frozen in the account can be obtained.

In one example, taking account Uid of 12345 as an example, the freezing period of the virtual currency is 3 days, and the virtual currency freezing process is as follows:

2021-04-20: the number of frozen virtual currencies is 50;

2021-04-21: the number of frozen virtual currencies is 20;

2021-04-22: the number of frozen virtual currencies is 30;

at 2021-04-22, the account Uid 12345 has an amount of frozen virtual currency of 50+20+30 to 100; at 2021-04-23, 50 frozen virtual currencies were thawed, at 2021-04-23, the account Uid-12345 was frozen with a quantity of 20+ 30-50.

And S208, calculating the difference value between the total balance and the frozen balance to obtain the available balance of the account.

The available balance is a balance other than the frozen balance, taking account Uid of 12345 as an example, the freezing period of the virtual currency is 3 days, and the virtual currency freezing process is as follows:

2021-04-20: the number of the frozen virtual currencies is 50, and the total balance is 200;

2021-04-21: the number of frozen virtual currencies is 20, and the total balance is 220;

2021-04-22: the number of frozen virtual currencies is 30, and the total balance is 250;

at 2021-04-22, the account Uid 12345 is frozen with a quantity of 50+20+30 to 100, and the available balance is 250-100 to 150; at 2021-04-23, 50 frozen virtual currencies were thawed, at 2021-04-23, the account Uid-12345 was frozen with a quantity of 20+ 30-50 and an available balance of 250-50-200.

S209, determining the total balance as the available balance of the account.

If the account does not have frozen virtual currency, the total balance of the account is directly determined as the available balance.

S210, sending the available balance to the service end.

After the available balance of the account is determined, the available balance may be sent to the service end, for example, the available balance may be sent to a client of the user, so that the available balance of the account is displayed at the client, or the available balance is sent to a management platform on which the operation and maintenance staff logs in, and the available balance of the account is displayed at the management platform, or of course, the total balance and the frozen balance may also be sent to the service end together to display the balance details of the account.

In another optional embodiment of the present invention, after determining the available balance of the account, when a balance deduction request of the service end is received, determining a deduction amount of deducting the virtual money in the balance deduction request, and determining whether the available balance is greater than the deduction amount, if yes, calculating a difference between the available balance and the deduction amount as the available balance of the account, and if not, generating a prompt message indicating that the available balance is insufficient.

Taking account Uid of 12345 as an example, the freezing period of the virtual currency is 3 days, and the virtual currency freezing process is as follows:

2021-04-20: the number of the frozen virtual currencies is 50, and the total balance is 200;

2021-04-21: the number of frozen virtual currencies is 20, and the total balance is 220;

2021-04-22: the number of frozen virtual currencies is 30, and the total balance is 250;

at 2021-04-22, the amount of the virtual money frozen in the account Uid-12345 is 50+20+30 100, the available balance is 250-100-150, if the virtual money for which the balance deduction request is received is 180, the balance deduction fails because the available balance 150 is less than the deduction amount 180, the insufficient balance prompt message may be generated, at 2021-04-23, the 50 frozen virtual money is thawed at 2021-04-20, at 2021-04-23, the amount of the virtual money frozen in the account Uid-12345 is 20+ 30-50, the available balance is 250-50-200, if the virtual money for which the deduction is requested again is 180, the virtual money for which the account Uid is 180 may be deducted because the available balance 200 is greater than the deduction amount 180, the available balance is 20, and the total balance is 70.

When the balance is increased, determining a balance period to which the target time when the balance is increased belongs and determining an increased first balance increment, accumulating the first balance increment into a second balance increment of the account in the balance period, freezing virtual money with the line being the second balance increment in a freezing period, acquiring the total balance of the account when receiving an available balance inquiry request of a service end, calculating the sum of the second balance increments of the virtual money frozen to the account to obtain the frozen balance, and calculating the difference between the total balance and the frozen balance to obtain the available balance of the account. For each account, the frozen balance of the account in each balance period can be recorded, when the available balance of the account needs to be inquired, the frozen balance is calculated without storing and traversing all historical running water of the account, the available balance can be quickly calculated through the frozen balance, the consumed time is short, and the real-time available balance of the account can be obtained.

Further, when the balance is deducted, because the frozen balance of the account in each balance period is recorded, the frozen balance does not need to be calculated by storing and traversing all historical running water of the account, the available balance can be quickly calculated by the frozen balance in each balance period, the consumed time is short, and the real-time available balance of the account can be obtained, so that the available balance and the deduction amount can be quickly judged to determine whether deduction service can be executed, and the response speed of the deduction service is improved.

EXAMPLE III

Fig. 3 is a block diagram of an account data processing apparatus according to a third embodiment of the present invention, and as shown in fig. 3, the account data processing apparatus according to the third embodiment of the present invention may specifically include the following modules:

a time and balance increment obtaining module 301, configured to, when a balance of virtual money of an account increases, obtain a target time when the balance increases and a first balance increment of the increased balance;

a balance cycle determining module 302, configured to determine a balance cycle to which the target time belongs;

a balance increment accumulation module 303, configured to accumulate the first balance increment into a second balance increment of the account in the balance period;

a freezing module 304, configured to freeze the virtual currency with the amount as the second balance increment in a freezing period with the period start time of the balance period as the freezing start time;

a service request response module 305, configured to, when a service processing request for the balance of the account is received, respond to the service processing request based on the second balance increment.

The account data processing device provided by the embodiment of the invention can execute the account data processing method provided by the first embodiment or the second embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.

Example four

Referring to fig. 4, a schematic structural diagram of an electronic device in one example of the invention is shown. As shown in fig. 4, the electronic device may specifically include: a processor 401, a storage device 402, a display screen 403 with touch functionality, an input device 404, an output device 405, and a communication device 406. The number of the processors 401 in the electronic device may be one or more, and one processor 401 is taken as an example in fig. 4. The processor 401, the storage device 402, the display 403, the input device 404, the output device 405, and the communication device 406 of the electronic apparatus may be connected by a bus or other means, and fig. 4 illustrates the connection by the bus as an example. The electronic equipment is used for executing the account data processing method provided by any embodiment of the invention.

An embodiment of the present invention further provides a computer-readable storage medium, where instructions in the storage medium, when executed by a processor of a device, enable the device to perform the account data processing method according to the above method embodiment.

It should be noted that, as for the embodiments of the apparatus, the electronic device, and the storage medium, since they are basically similar to the embodiments of the method, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the embodiments of the method.

In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious modifications, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

完整详细技术资料下载
上一篇:石墨接头机器人自动装卡簧、装栓机
下一篇:一种基于区块链的交易信息安全维护系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!