Accounting details determination method and device
By caching and reordering transaction details, and using the base amount of shadow accounts to generate account details, the problem of disordered account details in online transactions is solved, ensuring the correct order of account details and timely user perception, thereby improving the stability of accounting and user experience.
Patent Information
- Application Number
- CN202311053337.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-18
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2043-08-18
AI Technical Summary
In online transactions, when high-frequency trading accounts generate a large number of concurrent transactions in a short period of time, the order of transactions may not match the actual order of accounting entries, resulting in disordered accounting details and affecting the stability of accounting and user experience.
By caching the transaction details of the target account within a preset time period and rearranging them according to the order of transaction occurrence, the transaction details are generated using the base amount of the shadow account, ensuring the correct order of the transaction details.
It achieves stability of account details, allowing users to promptly perceive balance changes, avoiding the problem of out-of-order account details during querying, and improving the stability of bookkeeping and user experience.
Smart Images

Figure CN117112560B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] One or more embodiments of the present specification relate to the technical field of data processing, and in particular, to a method and device for determining account details. BACKGROUND
[0002] With the popularity of online payment, users often choose to complete transactions online through payment software. When a user conducts an online transaction, the user's online transaction needs to be recorded accordingly, and the corresponding account details need to be saved. With the continuous increase in transaction volume, for some high-frequency transaction hot accounts, when a large number of concurrent transactions are received in a short period of time, the order of transaction occurrence often does not match the actual recording order, resulting in account details out of order, which affects the stability of recording. SUMMARY
[0003] To solve the problem of account details out of order and ensure the stability of recording, one or more embodiments of the present specification provide a method and device for determining account details, an electronic device, and a storage medium.
[0004] In a first aspect, one or more embodiments of the present specification provide a method for determining account details, comprising:
[0005] caching at least one transaction detail generated by a target account in a preset time period, the transaction detail including a transaction occurrence amount and a transaction occurrence time;
[0006] sequentially rearranging the transaction details in the preset time period according to the order of the transaction occurrence times;
[0007] according to the transaction occurrence amount of the sequentially rearranged transaction details, changing the reference amount of a shadow account corresponding to the target account on a transaction-by-transaction basis to obtain the account details of the target account.
[0008] In one or more embodiments of the present specification, the caching of at least one transaction detail generated by a target account in a preset time period comprises:
[0009] obtaining a transaction detail generated by a target account;
[0010] determining whether there is a detail processing task that covers the transaction occurrence time according to the transaction occurrence time of the transaction detail, the time period of the detail processing task being the preset time period;
[0011] if so, caching the transaction detail in a detail list associated with the detail processing task;
[0012] If not, a detail processing task corresponding to the transaction detail is generated, and a transaction occurrence time of the transaction detail is determined as a start time of a time period of the detail processing task.
[0013] In one or more embodiments of the present disclosure, the sequentially rearranging the transaction details in the preset time period according to the transaction occurrence time comprises:
[0014] In response to the end of the time period of the detail processing task, all the transaction details cached in the detail list of the detail processing task are obtained;
[0015] The all the transaction details cached in the detail list are sequentially rearranged according to the transaction occurrence time of the transaction details.
[0016] In one or more embodiments of the present disclosure, the changing the reference amount of the shadow account corresponding to the target account according to the transaction occurrence amount of the sequentially rearranged transaction details comprises:
[0017] The reference amount of the shadow account corresponding to the target account is obtained;
[0018] The shadow account balance before and after each transaction detail is calculated according to the reference amount and the transaction occurrence amount of the sequentially rearranged transaction details;
[0019] The account statement is obtained according to each transaction detail and the corresponding shadow account balance.
[0020] In one or more embodiments of the present disclosure, before the at least one transaction detail generated by the target account in the preset time period is cached, the method further comprises:
[0021] The state information of each account is obtained, and in response to the state information being preset state information, the account is determined as the target account;
[0022] The shadow account corresponding to the target account is generated, and the reference amount of the shadow account is synchronized according to the balance information of the target account.
[0023] In one or more embodiments of the present disclosure, the account statement determination method further comprises:
[0024] In response to the historical transaction volume of the account exceeding a preset transaction volume threshold, the state information of the account is configured as the preset state information;
[0025] Or,
[0026] In response to the number of feedbacks of the account exceeding a preset number threshold, the state information of the account is configured as the preset state information.
[0027] In one or more embodiments of the present disclosure, after obtaining the account statement of the target account, the method further comprises:
[0028] deleting all transaction details of the target account in a preset time period from the cache;
[0029] and / or,
[0030] According to the result of the change processing on the reference amount of the shadow account, the reference amount of the shadow account is updated.
[0031] In a second aspect, one or more embodiments of the present disclosure provide an account statement determination device, comprising:
[0032] a detail cache module configured to cache at least one transaction detail generated by a target account in a preset time period, the transaction detail comprising a transaction amount and a transaction time;
[0033] a sequence rearrangement module configured to rearrange the transaction details in the preset time period according to the sequence of the transaction times;
[0034] an account statement module configured to change the reference amount of a shadow account corresponding to the target account on a transaction-by-transaction basis according to the transaction amount of the transaction details after sequence rearrangement, to obtain the account statement of the target account.
[0035] In some embodiments, the detail cache module is configured to:
[0036] obtain a transaction detail generated by a target account;
[0037] determine whether there is a detail processing task covering the transaction time of the transaction detail according to the transaction time of the transaction detail, the time period of the detail processing task being the preset time period;
[0038] if yes, cache the transaction detail in a detail list associated with the detail processing task;
[0039] if no, generate a detail processing task corresponding to the transaction detail, and determine the transaction time of the transaction detail as the start time of the time period of the detail processing task.
[0040] In some embodiments, the sequence rearrangement module is configured to:
[0041] in response to the end of the time period of the detailed processing task, obtaining all the transaction details cached in the detailed list of the detailed processing task;
[0042] sequentially rearranging all the transaction details cached in the detailed list according to the chronological order of the transaction occurrence time of the transaction details.
[0043] In some embodiments, the account detail module is configured to:
[0044] obtaining the reference amount of the shadow account corresponding to the target account;
[0045] calculating the shadow account balance before and after each transaction detail according to the reference amount and the transaction amount of the sequentially rearranged transaction details;
[0046] obtaining the account details according to each transaction detail and its corresponding shadow account balance.
[0047] In some embodiments, the detail caching module is configured to:
[0048] obtaining the state information of each account, and determining the account as the target account in response to the state information being preset state information;
[0049] generating the shadow account corresponding to the target account, and synchronizing the reference amount of the shadow account according to the balance information of the target account.
[0050] In some embodiments, the detail caching module is configured to:
[0051] in response to the historical transaction volume of the account exceeding a preset transaction volume threshold, configuring the state information of the account as the preset state information;
[0052] or,
[0053] in response to the feedback frequency of the account exceeding a preset frequency threshold, configuring the state information of the account as the preset state information.
[0054] In some embodiments, the account detail module is configured to:
[0055] deleting all the transaction details of the target account cached in a preset time period;
[0056] and / or,
[0057] updating the reference amount of the shadow account according to the result of the change processing of the reference amount of the shadow account.
[0058] In a third aspect, one or more embodiments of the present specification provide an electronic device, comprising:
[0059] a processor; and
[0060] a memory storing computer instructions for causing the processor to execute the method of any embodiment of the first aspect.
[0061] In a fourth aspect, one or more embodiments of the present specification provide a storage medium storing computer instructions for causing a computer to execute the method of any embodiment of the first aspect.
[0062] The account statement determination method of one or more embodiments of the present specification comprises caching at least one transaction statement generated by a target account in a preset time period, sequentially rearranging the transaction statements according to the time of transaction occurrence, and changing the reference amount of the shadow account on a transaction-by-transaction basis according to the transaction amount of the rearranged transaction statements to obtain the account statement. In the embodiments of the present specification, the transaction statements in the preset time period that are prone to out-of-order are sequentially rearranged using the caching mechanism, solving the out-of-order problem of the account statement, and the account statement is based on the reference amount of the shadow account, realizing parallel processing of balance update and account statement, without delaying the balance update, so that the user can perceive the balance in a timely manner. In addition, since the account statement is in the correct order when stored in the database, the account statement will not change repeatedly when the user queries the account statement, ensuring the stability of the account. BRIEF DESCRIPTION OF DRAWINGS
[0063] Figure 1 is a schematic diagram of an application scenario of the account statement determination method in an exemplary embodiment of the present specification.
[0064] Figure 2 is a flowchart of the account statement determination method in an exemplary embodiment of the present specification.
[0065] Figure 3 is a schematic diagram of the principle of the account statement determination method in an exemplary embodiment of the present specification.
[0066] Figure 4 is a flowchart of the account statement determination method in an exemplary embodiment of the present specification.
[0067] Figure 5 is a flowchart of the account statement determination method in an exemplary embodiment of the present specification.
[0068] Figure 6 is a flowchart of the account statement determination method in an exemplary embodiment of the present specification.
[0069] Figure 7is a flowchart of a method for determining an account statement according to an example embodiment of the present specification.
[0070] Figure 8 is a structural block diagram of an apparatus for determining an account statement according to an example embodiment of the present specification.
[0071] Figure 9 is a structural block diagram of an electronic device according to an example embodiment of the present specification. DETAILED DESCRIPTION
[0072] The example embodiments will be described in detail herein with reference to the accompanying drawings. In the following description, the same numbers are used to represent the same elements throughout the drawings. The embodiments described in the following example embodiments are not representative of all embodiments consistent with one or more embodiments of the present specification. Rather, they are merely examples of apparatuses and methods consistent with some aspects of one or more embodiments of the present specification as detailed in the appended claims.
[0073] It should be noted that the steps of the corresponding method are not necessarily performed in the order shown and described in the present specification in other embodiments. In some other embodiments, the steps included in the method can be more or less than those described in the present specification. In addition, a single step described in the present specification can be divided into multiple steps for description in other embodiments, and multiple steps described in the present specification can be combined into a single step for description in other embodiments.
[0074] In addition, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation portal for user to choose authorization or refusal.
[0075] With the popularity of online payment, users often choose to complete transactions online through various payment software. During the user's online transaction, the payment platform party needs to record the user's online transaction and generate an account statement. The account statement is used to record the occurrence time, occurrence amount and balance change of each transaction, so that the user can view the balance change or reconciliation by querying the account statement.
[0076] However, with the increasing amount of online transactions, some high-frequency trading hot accounts begin to emerge, which are accounts that generate a large number of concurrent transactions in a short period of time, for example, for a merchant account, a large number of concurrent transactions may be generated in a short period of time during a promotion. When the payment platform accounts for the hot accounts, it is likely that the order of the transactions will not be consistent with the actual accounting order, resulting in the generated account details being out of order.
[0077] For example, in one example, the initial amount of an account is 100 yuan, and the following two transactions are generated in a short period of time: transaction A, spending 20 yuan; transaction B, income 10 yuan; the transaction time of transaction A is earlier than that of transaction B. The correct account details should be: first spending 20 yuan, the balance changes to 80 yuan; then income 10 yuan, the balance changes to 90 yuan. However, in actual platform accounting, the request of transaction B may arrive earlier than that of transaction A, and thus the generated account details will be: first income 10 yuan, the balance changes to 110 yuan; then spending 20 yuan, the balance changes to 90 yuan.
[0078] As can be seen, the out-of-order account details will result in inconsistency with the actual transaction order, reducing user experience, for example, the merchant cannot correctly reconcile the account according to the out-of-order account details, which may cause the merchant to complain.
[0079] In related technologies, in order to solve the out-of-order problem of account details, one way is to strictly update the balance according to the occurrence time of each transaction during the accounting process. In this way, all transaction accounting needs to be processed in series, and the final accurate balance can be obtained only after all transaction accounting is completed, resulting in a significant lengthening of the time for the user to perceive the balance. Another way is to reorder the account details according to the transaction occurrence time when the user views the account details. Although this way can ensure that the account details viewed by the user will not be out of order, when the user views the account details multiple times in a short period of time, the account details need to be constantly rearranged, which may cause the account details seen by the user to change repeatedly, reducing user experience.
[0080] Based on the defects mentioned in the above related technologies, the embodiments of the present specification provide an account details determination method and device, electronic equipment and storage medium, aiming to solve the out-of-order problem of account details, and without delaying the balance update, ensuring the stability of the accounting.
[0081] Figure 1 The application scenario of the payment system in some embodiments of the present specification is shown, and the application scenario of the embodiments of the present specification is described below Figure 1 The application scenario of the embodiments of the present specification is described.
[0082] As Figure 1As shown, the payment system includes a terminal device 110, a network 120 and a server 130. The terminal device 110 can be, for example, a mobile terminal, a PC terminal, a wearable device, etc., and the server 130 can be, for example, a cloud server. The mobile terminal 110 establishes a communication connection with the server 130 through the network 120.
[0083] In a payment scenario, a user can implement online transactions through a payment platform software on the mobile terminal 110, and when an online transaction is generated, the transaction request is sent to the server 130 through the network 120. The server 130 completes the accounting according to the details in the received transaction request, and saves the corresponding account details in the database. When the user wants to check the account details, the mobile terminal 110 can send a query request to the server 130, so that the server 130 returns the account details saved in the database to the mobile terminal 110, and the user can query the account details and balance changes in the required time period.
[0084] As can be seen from the foregoing, for a hot account with a large number of transactions generated in a short time, the accounting sequence of the server 130 can be inconsistent with the actual transaction sequence, resulting in the problem of out-of-order account details saved in the database by the server 130. The account details determination method of the present embodiment is to solve the problem of out-of-order account details, which will be described below in combination with Figure 2 the account details determination method of the present embodiment.
[0085] It can be understood that the account details determination method of the present embodiment can be applied to the server 130 described above, and the processing is performed by the server 130, which will be described below in combination with Figure 2 the account details determination method of the present embodiment.
[0086] As shown in Figure 2 some embodiments, the account details determination method of the present embodiment includes:
[0087] S210, cache at least one transaction detail generated by the target account in a preset time period.
[0088] It can be understood that the method of the present embodiment mainly solves the problem of out-of-order account details, and the main reason for the out-of-order account details is the generation of a large number of transactions in a short time. In other words, for accounts with small transaction volumes, the problem of out-of-order account details generally does not occur. Therefore, in the present embodiment, the target account is an account that has a risk of out-of-order account details, and the target account is characterized by high-frequency transactions, i.e., it is easy to generate a large number of concurrent transactions in a short time.
[0089] In some embodiments, considering that the transaction volume of the target account is usually large, whether an account is a target account can be determined according to the transaction volume of each account. In some other embodiments, considering that the target account has a high risk of disordered account details, which in turn leads to a high user complaint rate, whether an account is a target account can be determined according to the user complaint rate.
[0090] In some embodiments, when it is determined that an account is a target account, the account can be set with corresponding state information, which is used to identify whether the account is a target account, so that whether an account is a target account can be determined by identifying the state information.
[0091] In the embodiments of the present specification, since the target account is an account that has a risk of disordered account details, the account details determination method described in the present specification can be performed only for the target account, and for a non-target account, since the risk of disordered account details is very low, the traditional logic can be performed. Of course, those skilled in the art can understand that the target account can also include all accounts of the payment platform, that is, the method of the embodiments of the present specification is performed for all accounts, and no further description is made.
[0092] In the embodiments of the present specification, when an account has an online transaction, a transaction detail is generated at the same time, which is used to record the transaction amount, the transaction time, the order number, and the information of the two parties of the transaction. For example, in one example, user A uses a payment software to transfer 500 yuan to the account of user B at 11:20:51, and the transaction detail generated for this transaction can include: order number: xxx; transaction amount: 500 yuan; transaction time: x year / x month / x day 11:20:51; and receiver account: xxx.
[0093] It can be understood that for a large number of online transaction businesses occurring in a short period of time, each online transaction corresponds to a transaction detail, so that a large number of transaction details are generated. In the embodiments of the present specification, if the corresponding account details are generated directly according to the accounting order of these transaction details, the problem of disordered account details is likely to occur.
[0094] Therefore, in the embodiments of the present specification, a time window period can be set in advance, which is the preset time period described in the present specification. The preset time period can be understood as a small time buffer period, and the specific length of the preset time period can be selected according to the system requirements of the server, which is not limited in the present specification.
[0095] For example, in one example, concurrent transactions of the server prone to out-of-order are generally less than 5 seconds, that is, for multiple transactions generated within 5 seconds, the out-of-order risk is easy to occur, and for two transactions separated by more than 5 seconds, the out-of-order risk does not occur, so in this example, the length of the preset time period can be set to 5 seconds. Of course, the embodiments of the present specification are not limited to this example, and in a more general embodiment, the preset time period can be 5s-60s.
[0096] In the embodiments of the present specification, for multiple transactions generated by a target account within a preset time period, all transaction details within the preset time period can be cached first without processing, and at the end of the preset time period, all transaction details within the preset time period are uniformly reordered to ensure that all transaction details within the preset time period do not have an out-of-order problem.
[0097] For example, in one example, a target account generates a first transaction at 11:20:20, and the system can cache the transaction details of the first transaction. Then a second transaction is generated at 11:20:22, and the system can continue to cache the transaction details of the second transaction. Then a third transaction is generated at 11:20:23, and the system continues to cache the transaction details of the third transaction. Until the time reaches the end of the preset time period, for example, in this example, the length of the preset time period is 10 seconds, so the system can cache all transaction details generated between 11:20:20 and 11:20:30.
[0098] S220, reorder the transaction details in the preset time period according to the order of the transaction occurrence time.
[0099] In the embodiments of the present specification, the transaction details of each transaction generated by the target account record the corresponding transaction occurrence amount and transaction occurrence time, and the transaction occurrence time is the actual transaction business occurrence time.
[0100] Through the foregoing process, all transaction details generated by the target account within the preset time period can be cached, and as known from the foregoing, the caching order of these transaction details is not necessarily the order of the actual transaction business occurrence, and the out-of-order situation can occur.
[0101] Therefore, in the embodiments of the present specification, at the end of the preset time period, all transaction details cached within the preset time period can be reordered to maintain the correct order. The basis for reordering the transaction details is the transaction occurrence time recorded in the transaction details of each transaction.
[0102] For example, in one example, the transaction details cached by the system within the preset time period include 3 transactions, and the order is:
[0103] Transaction 1, 11:20:20; expenditure: 20 yuan;
[0104] Transaction 3, 11:20:23; expenditure: 10 yuan;
[0105] Transaction 2, 11:20:22; Income: 15 yuan.
[0106] In this embodiment, by combining the transaction occurrence time in the transaction details, it can be determined that the transaction occurrence time of transaction 2 is earlier than that of transaction 3. However, the order in which the two are cached in the system is disordered. Therefore, the order of the cached transaction details within the preset time period can be rearranged, and the new order of the transaction details is as follows:
[0107] Transaction 1, 11:20:20; expenditure: 20 yuan;
[0108] Transaction 2, 11:20:22; Revenue: 15 yuan;
[0109] Transaction 3, 11:20:23; expenditure of 10 yuan.
[0110] S230. Based on the transaction amounts of the rearranged transaction details, change the base amount of the shadow account corresponding to the target account for each transaction to obtain the accounting details of the target account.
[0111] It is worth noting that, in the implementation method of this specification, in order to avoid the user having to wait too long to perceive the balance, the change of the user's physical account balance does not need to rely on the account details. In other words, the balance of the physical account can be changed when an online transaction occurs.
[0112] For example, in the previous example, assuming the initial balance of the target account is 100 yuan, regardless of whether the balance is changed in the order of "Transaction 1, Transaction 3, Transaction 2" or "Transaction 1, Transaction 2, Transaction 3", the final balance will be 85 yuan. In other words, the final balance of the target account is not affected by the order of the transaction details. Therefore, in the implementation method of this specification, the balance of the target account can be changed directly according to the transaction amount in the transaction details when an online transaction occurs, without waiting for the processing of the account details.
[0113] In the implementation method described in this manual, the generation of accounting details must ensure that each item in the accounting details is presented in the correct order, so that when users view the accounting details, they will see the accounting details in the correct order and it will not affect the merchant's reconciliation.
[0114] The shadow account refers to a mapping account corresponding to the target account, and there is no real fund in and out in the shadow account, but it plays a role of resolving the transaction situation and balance change of the target account. In the embodiments of the present specification, the generation of the account statement needs to be completed by relying on the shadow account.
[0115] As can be understood from the foregoing, for the real balance in the target account, the balance has been changed when the transaction occurs, for example, in the foregoing example, the balance in the target account has been changed to 85 yuan when the three transactions occur. Therefore, if the account statement is calculated based on the changed balance at the end of the preset time period, the balance before and after the transaction will be calculated on the basis of 85 yuan, thereby generating an incorrect account statement.
[0116] Therefore, in the embodiments of the present specification, the corresponding shadow account can be generated for the target account when the account is determined as the target account, and the balance in the target account is synchronized to the shadow account as the reference amount of the shadow account.
[0117] For example, in the foregoing example, in combination with Figure 3 , the initial balance of the target account is 100 yuan, so the reference amount synchronized to the shadow account is also 100 yuan. After each transaction occurs in the foregoing, the balance of the target account can be calculated in real time according to the transaction amount of the transaction details, and finally is 85 yuan, so the user can timely perceive the balance change. At the same time, since the calculation of the account statement needs to wait until the end of the preset time period, at the end of the preset time period, the real balance of the target account has been changed to 85 yuan, and if the account statement is calculated based on 85 yuan, an incorrect account statement will be generated, so in the embodiments of the present specification, the account statement is calculated according to the reference amount 100 yuan of the shadow account when calculating the account statement.
[0118] Specifically, after the foregoing sequential rearrangement of the plurality of transaction details in the preset time period, the transaction details in the correct order are obtained, so that the reference amount is changed by being calculated based on the reference amount of the shadow account, and the correct account statement is generated.
[0119] For example, in the foregoing example, referring to Figure 3 , after the transaction details cache is rearranged by the foregoing method process, the new order of the transaction details is:
[0120] 1) Transaction 1, 11:20:20; spending 20 yuan;
[0121] 2) Transaction 2, 11:20:22; income 15 yuan;
[0122] 3) Transaction 3, 11:20:23; spending 10 yuan.
[0123] The reference amount of the shadow account is 100 yuan, so the account details calculated piece by piece can be as follows Figure 3 The right lower corner solid line box, that is,
[0124] 1) Transaction 1, 11:20:20; expenditure 20 yuan; balance 80 yuan;
[0125] 2) Transaction 2, 11:20:22; income 15 yuan; balance 95 yuan;
[0126] 3) Transaction 3, 11:20:23; expenditure 10 yuan; balance 85 yuan.
[0127] It can be understood that in the above example, if the sequential rearrangement is not performed by the method of the present application, the final account details will be as follows Figure 3 The right upper corner dotted line box, that is,
[0128] 1) Transaction 1, 11:20:20; expenditure 20 yuan; balance 80 yuan;
[0129] 3) Transaction 3, 11:20:23; expenditure 10 yuan; balance 70 yuan;
[0130] 2) Transaction 2, 11:20:22; income 15 yuan; balance 85 yuan.
[0131] It can be seen that the disordering of the account details will cause the balance change to be inconsistent with the real scene, and the reconciliation error will occur in the reconciliation scene of the merchant. By the method of the present application, the sequential rearrangement of the transaction details in the preset time period which is prone to disorder is performed by using the cache mechanism, and finally the account details in the correct order can be obtained.
[0132] Moreover, the account details are based on the reference amount of the shadow account, which can not affect the timely change of the balance of the target account, and the user can perceive the balance in a timely manner. For example, in the above example, assuming that the preset time period is 1 min, and only the above three transactions occur in the preset time period, the generation process of the account details needs to wait until 11:21:20 to rearrange the three transaction details in the period, but the real balance of the target account can be updated in real time when the transaction occurs, that is, as shown in Figure 3 When the above three transactions occur, the real balance of the target account has been updated to 85 yuan, and there is no need to wait for the generation process of the account details, so that the balance update and the account details generation are parallel to each other.
[0133] In combination with Figure 1As shown, in the embodiments of the present specification, the server 130 can store the account statement in the statement database after completing the account statement generation, and when the user wants to query the account statement, the user can select the required time period on the terminal device 110, and the server 130 returns the corresponding account statement to the terminal device 110 according to the user query request. Since the account statement stored in the server 130 is already in the correct order, the account statement queried by the user will not have the problem of disorder, and the user's operations such as account checking and account checking will not be affected.
[0134] As can be seen from the above, in the embodiments of the present specification, the cache mechanism is used to reorder the transaction details in the preset time period which is prone to disorder, solving the disorder problem of the account statement, and the account statement is based on the reference amount of the shadow account, realizing parallel processing of balance update and account statement, without delaying the balance update, so that the user can perceive the balance in a timely manner. In addition, since the account statement is already in the correct order when stored in the database, the account statement will not change repeatedly when the user queries the account statement, ensuring the stability of the account.
[0135] In some embodiments of the present specification, the target account can be, for example, an account prone to disorder risk, and the account statement determination method described above can be performed only for the target account. The following will be described in conjunction with Figure 4 the embodiments.
[0136] As Figure 4 shown, in some embodiments, the account statement determination method of the present specification further includes, before caching the transaction details generated by the target account in the preset time period:
[0137] S201, obtaining the state information of each account, and determining that the account is a target account in response to the state information being preset state information.
[0138] S202, generating a shadow account corresponding to the target account, and synchronizing the reference amount of the shadow account according to the balance information of the target account.
[0139] In the embodiments of the present specification, the state information of each account can be set in advance, and the state information is used to identify whether the account is a target account, that is, whether the account has the risk of account statement disorder.
[0140] As can be seen from the foregoing, account statement disorder mainly occurs in accounts with a large number of transactions in a short period of time, and at the same time, account statement disorder will cause an increase in user complaint rate. Therefore, in some embodiments of the present specification, the state information of the account can be set according to the historical transaction volume and / or historical complaint rate of the account.
[0141] For example, in some embodiments, a preset transaction volume threshold of high-frequency transactions can be preset, which represents a critical value of account transaction volume. Thus, in response to the historical transaction volume of a certain account exceeding the preset transaction volume threshold, it indicates that the historical transaction volume of the account is large, and there is a high risk of account detail disorder, so the state information of the account can be configured as preset state information. Conversely, in response to the historical transaction volume being less than or equal to the preset transaction volume threshold, it indicates that the historical transaction volume of the account is small, and there is no risk of account detail disorder, so the state information of the account can be configured as other.
[0142] The historical transaction volume can be the transaction volume of the account in the past 1 day, 7 days, or half a month, so the corresponding preset transaction volume threshold can also be set according to the specific scene requirements, which is not limited in the present specification.
[0143] For example, in some embodiments, a preset number of user complaints threshold can be preset, which represents a critical value of user complaint volume. Thus, in response to the historical feedback number of a certain account exceeding the preset number of complaints threshold, it indicates that the user complaint volume of the account is large, and there is a risk of account detail disorder, so the state information of the account can be configured as preset state information. Conversely, in response to the feedback number being less than or equal to the preset number of complaints threshold, it indicates that the account does not exist account detail disorder, so the state information of the account can be configured as other.
[0144] The historical feedback number can be the feedback number of the account in the past 7 days, 15 days, or a month, so the corresponding preset number of complaints threshold can also be set according to the specific scene requirements, which is not limited in the present specification.
[0145] Of course, those skilled in the art can understand that the way to determine whether an account has a risk of account detail disorder is not limited to the above examples, and any other suitable implementation can also be used, which will not be described in detail herein.
[0146] In the embodiments of the present specification, after configuring the state information of each account, the server can determine whether the account is a target account according to the state information of each account. For example, taking an account as an example, the server can obtain the state information of the account, and in the case that the state information of the account is preset state information, it indicates that the account has a high risk of account detail disorder, that is, the account is determined to be a target account, and vice versa.
[0147] In some embodiments, in the case that a certain account is determined to be a target account, a shadow account corresponding to the target account can be generated, and the reference amount of the shadow account can be synchronized according to the balance information of the current target account. For example Figure 3In an example, assume that the balance information of the target account is 100 yuan, so the reference amount of the corresponding shadow account is 100 yuan after synchronization.
[0148] After the above process is completed, when the target account generates an online transaction, the corresponding transaction details can be cached according to the method of the present specification. The following will be described in combination with Figure 5 the embodiments.
[0149] As Figure 5 shown, in some embodiments, the process of caching the transaction details generated by the target account in the preset time period by the account balance determination method of the present specification includes:
[0150] S211, obtaining the transaction details generated by the target account.
[0151] It can be understood that when the target account performs an online transaction, a corresponding transaction detail is generated for each transaction. The transaction detail includes the transaction generation time and the transaction amount of the transaction.
[0152] S212, determining whether there is a detail processing task covering the transaction generation time according to the transaction generation time of the transaction detail. If yes, execute step S213, and if no, execute step S214.
[0153] S213, caching the transaction detail in the detail list associated with the detail processing task.
[0154] S214, generating a detail processing task corresponding to the transaction detail, and determining the transaction generation time of the transaction detail as the start time of the time period of the detail processing task.
[0155] In the embodiments of the present specification, the detail processing task is the aforementioned task of sequentially rearranging the cached transaction details. The data relied on by a certain detail processing task is the transaction details cached by the target account in the preset time period.
[0156] It can be understood that when a certain transaction is generated, the transaction can be the first transaction or a transaction close to a previous transaction. In the embodiments of the present specification, the transaction close to the previous transaction refers to the interval between the transaction generation times of the two transactions being less than the preset time period.
[0157] For example, in an example, assume that the preset time period is 10 seconds, and for 3 transactions generated by the target account, the transaction details are as follows:
[0158] Transaction a, 11:20:20; spending 20 yuan;
[0159] Transaction b, 11:20:22; spending 10 yuan;
[0160] Transaction c, 11:21:00; income 15 yuan.
[0161] Wherein, assuming that the transaction a is the first transaction, so that when the transaction a occurs, no detail processing task is constructed in the system, so according to the transaction occurrence time 11:20:20 of the transaction a, it is determined that there is no detail processing task that can cover the transaction occurrence time, so according to the S540 process, a detail processing task 1 corresponding to the transaction detail of the transaction a is newly generated.
[0162] For the detail processing task 1, the start time of the time period is the transaction occurrence time 11:20:20 of the transaction a, and the length of the time period is the preset time period 10 seconds, so the end time of the time period corresponding to the detail processing task 1 is 11:20:30. It can be understood that the data relied on by the detail processing task 1 is all transaction details generated by the target account between 11:20:20 and 11:20:30. At the same time, the transaction detail of the transaction a can be cached in the detail list of the detail processing task 1.
[0163] The time continues, and the target account generates a second transaction b at 11:20:22. At this time, according to the transaction occurrence time 11:20:22 recorded in the transaction detail of the transaction b, it can be determined that the time period 11:20:20-11:20:30 of the detail processing task 1 covers the transaction occurrence time of the transaction b, that is, the transaction occurrence time of the transaction b is within the time period 11:20:20-11:20:30, so that the transaction b is associated with the detail processing task 1. It can be understood that the transaction b is a transaction adjacent to the transaction a, and the transaction details of the two are prone to out-of-order. Therefore, in the embodiments of the present specification, the transaction detail of the transaction b can be associated with the detail processing task 1, and the transaction detail of the transaction b can be cached in the detail list of the detail processing task 1.
[0164] The time continues, and the target account generates a third transaction c at 11:21:00. At this time, since the transaction occurrence time 11:21:00 recorded in the transaction detail of the transaction c is not in the time period 11:20:20-11:20:30 of the detail processing task 1, it is determined that there is no detail processing task that can cover the transaction occurrence time of the transaction c. Therefore, a detail processing task 2 corresponding to the transaction detail of the transaction c can be newly generated for the transaction c.
[0165] For the detailed processing task 2, the start time of the time period thereof is the transaction occurrence time 11:21:00 of the transaction c, and the length of the time period is the preset time period 10 seconds, so the end time of the time period corresponding to the detailed processing task 2 is 11:21:10. It can be understood that the data relied on by the detailed processing task 2 is all transaction details of the target account generated between 11:21:00 and 11:21:10. At the same time, the transaction details of the transaction c can be cached in the detail list of the detailed processing task 2.
[0166] It can be seen that, with the continuous generation of transactions, through the process of the above-mentioned Figure 5 embodiments of the present specification, it can be continuously determined whether the newly generated transaction details are associated with the existing detailed processing tasks or new detailed processing tasks are generated, and the present specification will not be repeated here.
[0167] For each detailed processing task, when the time period of the detailed processing task ends, the server can perform the sequential rearrangement of the cached transaction details of the detailed processing task, which will be described below in combination with Figure 6 .
[0168] As shown in Figure 6 , in some embodiments, the accounting detail determination method exemplified by the present specification includes the following steps in the process of sequentially rearranging the transaction details:
[0169] S221, in response to the end of the time period of the detailed processing task, obtaining all the transaction details cached in the detail list of the detailed processing task.
[0170] S222, sequentially rearranging all the transaction details cached in the detail list according to the chronological order of the transaction occurrence time of the transaction details.
[0171] According to the foregoing, each detailed processing task is a task of sequentially rearranging all the transaction details cached in the time period of the detailed processing task, so that all the transaction details can be retrieved from the detail list when the time period of the detailed processing task ends, and the transaction details are sequentially rearranged according to the transaction occurrence time of the transaction details.
[0172] For example, in the previous example, the time period of the detail processing task 1 is 11:20:20-11:20:30, so at 11:20:30, the time period of the detail processing task 1 ends, at which time all cached transaction details in the detail list of the detail processing task 1 can be taken out and sequentially rearranged according to the transaction occurrence time of the transaction details. The time period of the detail processing task 2 is 11:21:00-11:21:10, so at 11:21:10, the time period of the detail processing task 2 ends, at which time all cached transaction details in the detail list of the detail processing task 2 can be taken out and sequentially rearranged according to the transaction occurrence time of the transaction details.
[0173] For example, in one example, assume that the transaction details cached in the detail list of a detail processing task include 3 transaction details as shown in the following table: Figure 3
[0174] Transaction 1, 11:20:20; spending 20 yuan;
[0175] Transaction 3, 11:20:23; spending 10 yuan;
[0176] Transaction 2, 11:20:22; income 15 yuan.
[0177] Therefore, the transaction details of the 3 transactions can be obtained from the detail list and sequentially rearranged according to the transaction occurrence time of the transaction details, and the rearranged transaction details are represented as:
[0178] Transaction 1, 11:20:20; spending 20 yuan;
[0179] Transaction 2, 11:20:22; income 15 yuan;
[0180] Transaction 3, 11:20:23; spending 10 yuan.
[0181] In the embodiments of the present specification, the sequential rearrangement of transaction details is achieved by establishing a detail processing task, so that a new task is only generated when a transaction occurs, and no new detail processing task is established when there is no transaction in the account. On the one hand, this can avoid repeated reading of the cache by the system and reduce system power consumption, and on the other hand, it can also associate adjacent transactions to the same task, further avoiding out-of-order occurrence.
[0182] For example, in some feasible embodiments, the system can be configured to read the transaction details in the cache every 10 seconds and perform the above sequential rearrangement process.
[0183] However, in some scenarios, if an account has no transactions for a period of time, the system will still read the cache every 10 seconds, increasing system power consumption. In the example implementation described above, a new task is only generated to perform the reordering process when a transaction occurs. If the account has no transactions for a period of time, no new task will be generated, thus the system will not repeatedly read the cache, reducing system power consumption.
[0184] Furthermore, the scheme of reading the cache every 10 seconds might cache two truly adjacent transactions in different time periods, thus still posing a certain risk of out-of-order processing. However, in the example implementation described above, a new task is only generated when a transaction occurs, and subsequent adjacent transactions can be associated with the same task, greatly reducing the risk of out-of-order processing.
[0185] As can be seen from the above, in the embodiments of this specification, the use of a task mechanism to create a sorting task and associate adjacent transaction details can, on the one hand, avoid the system repeatedly reading the cache and reduce system power consumption, and on the other hand, associate adjacent transactions with the same task to further avoid out-of-order occurrence.
[0186] like Figure 7 As shown, in some embodiments, the method for determining accounting details exemplified in this specification, the process of generating accounting details, includes:
[0187] S231. Obtain the base amount of the shadow account corresponding to the target account.
[0188] S232. Based on the base amount and the transaction amount of the transaction details after the order is rearranged, calculate the shadow account balance before and after each transaction.
[0189] S233. Obtain the accounting details based on each transaction detail and its corresponding shadow account balance.
[0190] In this embodiment of the specification, the transaction details of the target account in a preset time period are rearranged through the aforementioned process, and then the account details can be generated based on the base amount of the shadow account.
[0191] In one example, see Figure 3 As shown, assume the transaction details of the target account after rearrangement are as follows:
[0192] Transaction 1, 11:20:20; expenditure: 20 yuan;
[0193] Transaction 2, 11:20:22; Revenue: 15 yuan;
[0194] Transaction 3, 11:20:23; expenditure of 10 yuan.
[0195] The base amount of the shadow account is 100 yuan, so the shadow account balance before and after each transaction is calculated in the order of the rearranged transaction details, which are respectively:
[0196] Transaction 1, the shadow account balance before the transaction is 100 yuan, the transaction amount is -20 yuan, and the shadow account balance after the transaction is 80 yuan;
[0197] Transaction 2, the shadow account balance before the transaction is 80 yuan, the transaction amount is 15 yuan, and the shadow account balance after the transaction is 95 yuan;
[0198] Transaction 3, the shadow account balance before the transaction is 95 yuan, the transaction amount is -10 yuan, and the shadow account balance after the transaction is 85 yuan.
[0199] Then, according to the account details generated by each transaction detail and the shadow account balance, the account details can be as shown in the lower right corner of Figure 3 , specifically:
[0200] 1) Transaction 1, 11:20:20; spending 20 yuan; balance 80 yuan;
[0201] 2) Transaction 2, 11:20:22; income 15 yuan; balance 95 yuan;
[0202] 3) Transaction 3, 11:20:23; spending 10 yuan; balance 85 yuan.
[0203] It is worth noting that in the embodiments of the present specification, the shadow account balance of the previous detail is needed in the calculation of each detail, so the server can lock each transaction detail before calculating the account details. The purpose of locking is to ensure that the transaction details are processed in series according to the time sequence, avoiding the situation that parallel processing leads to missing accounts and wrong accounts. The present specification will not repeat it.
[0204] In some embodiments, after obtaining the account details, all cached transaction details corresponding to the account details can be deleted. For example, in one example, after a certain detail processing task is executed, all transaction details cached in the detail list of the detail processing task can be deleted.
[0205] In some embodiments, in combination with Figure 3 , after generating the account details, the base amount of the shadow account can be updated from the initial 100 yuan to 85 yuan according to the change processing result of the base amount of the shadow account.
[0206] It can be known from the above that, in the embodiments of the present specification, the transaction details in the preset time period prone to out-of-order are sequentially rearranged by using the cache mechanism, the out-of-order problem of the account details is solved, the account details are based on the benchmark amount of the shadow account, the balance update and the account details are processed in parallel, the balance update does not need to be delayed, the user can perceive the balance in time, in addition, since the account details are in correct order when stored in the database, the account details will not change repeatedly when the user queries the account details, and the accounting stability is ensured.
[0207] In addition, in the embodiments of the present specification, a new sorting task is created and the adjacent transaction details are associated by using the task mechanism, on the one hand, the system can be prevented from repeatedly reading the cache, and the system power consumption is reduced, and on the other hand, the adjacent transactions can be associated to the same task, and the out-of-order is further avoided.
[0208] In some embodiments, the present specification provides an account detail determination device, which can be applied to the server 130 described above, and the following will be described in combination with Figure 8 .
[0209] As shown in Figure 8 , in some embodiments, the account detail determination device of the present specification includes:
[0210] The detail cache module 10 is configured to cache at least one transaction detail generated by a target account in a preset time period, the transaction detail including a transaction occurrence amount and a transaction occurrence time;
[0211] The sequential rearrangement module 20 is configured to sequentially rearrange the transaction details in the preset time period according to the order of the transaction occurrence time;
[0212] The account detail module 30 is configured to change the benchmark amount of the shadow account corresponding to the target account on a transaction-by-transaction basis according to the transaction occurrence amount of the sequentially rearranged transaction details, and obtain the account details of the target account.
[0213] It can be known from the above that, in the embodiments of the present specification, the transaction details in the preset time period prone to out-of-order are sequentially rearranged by using the cache mechanism, the out-of-order problem of the account details is solved, the account details are based on the benchmark amount of the shadow account, the balance update and the account details are processed in parallel, the balance update does not need to be delayed, the user can perceive the balance in time, in addition, since the account details are in correct order when stored in the database, the account details will not change repeatedly when the user queries the account details, and the accounting stability is ensured.
[0214] In some embodiments, the detail cache module 10 is configured to:
[0215] obtaining transaction details generated by the target account;
[0216] determining, according to a transaction occurrence time of the transaction details, whether there is a detail processing task covering the transaction occurrence time, a time period of the detail processing task being a preset time period;
[0217] if yes, caching the transaction details in a detail list associated with the detail processing task;
[0218] if no, generating a detail processing task corresponding to the transaction details, and determining the transaction occurrence time of the transaction details as a start time of the time period of the detail processing task.
[0219] In some embodiments, the sequential rearrangement module 20 is configured to:
[0220] obtaining all the transaction details cached in the detail list of the detail processing task in response to the end of the time period of the detail processing task;
[0221] sequentially rearranging all the transaction details cached in the detail list according to the order of the transaction occurrence time of the transaction details.
[0222] In some embodiments, the account transaction details module 30 is configured to:
[0223] obtaining a reference amount of a shadow account corresponding to the target account;
[0224] calculating the shadow account balance before and after each transaction detail according to the reference amount and the transaction occurrence amount of the sequentially rearranged transaction details;
[0225] obtaining the account transaction details according to each transaction detail and the corresponding shadow account balance.
[0226] As can be seen from the above, in the embodiments of the present specification, the cache mechanism is used to sequentially rearrange the transaction details in the preset time period which are prone to out-of-order, solving the out-of-order problem of the account transaction details, and the account transaction details are based on the reference amount of the shadow account, realizing parallel processing of balance update and account transaction details, without delaying the balance update, so that the user can perceive the balance in a timely manner. In addition, since the account transaction details are in the correct order when stored in the database, the account transaction details will not change repeatedly when the user queries the account transaction details, ensuring the stability of the account.
[0227] Moreover, in the embodiments of the present specification, the task mechanism is used to newly create a sorting task and associate adjacent transaction details, which can avoid repeated reading of the cache by the system, reduce the power consumption of the system, and also associate adjacent transactions to the same task, further avoiding out-of-order.
[0228] In some embodiments, the detail caching module 10 is configured to:
[0229] obtaining state information of each account, determining the account as a target account in response to the state information being preset state information;
[0230] generating a shadow account corresponding to the target account, and synchronizing a reference amount of the shadow account according to balance information of the target account.
[0231] In some embodiments, the detail cache module 10 is configured to:
[0232] configuring the state information of the account as the preset state information in response to a historical transaction volume of the account exceeding a preset transaction volume threshold;
[0233] or,
[0234] configuring the state information of the account as the preset state information in response to a feedback frequency of the account exceeding a preset frequency threshold.
[0235] In some embodiments, the account detail module 30 is configured to:
[0236] deleting all transaction details of the cached target account in a preset time period;
[0237] and / or,
[0238] updating the reference amount of the shadow account according to a result of the changing process on the reference amount of the shadow account.
[0239] In some embodiments, the present specification provides an electronic device, comprising:
[0240] a processor; and
[0241] a memory storing computer instructions for causing the processor to execute the method of any of the above embodiments.
[0242] In some embodiments, the present specification provides a storage medium storing computer instructions for causing a computer to execute the method of any of the above embodiments.
[0243] Figure 9 is a schematic structural diagram of a device provided by an exemplary embodiment. Please refer to Figure 9At the hardware level, the device includes a processor 702, an internal bus 704, a network interface 706, a memory 708, and a non-volatile memory 710, and of course can also include other hardware required by the scenario. One or more embodiments of the present disclosure can be implemented in a software manner, such as reading a corresponding computer program from the non-volatile memory 710 by the processor 702 into the memory 708 and then running. Of course, in addition to the software implementation, one or more embodiments of the present disclosure do not exclude other implementation manners, such as a logic device or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or a logic device.
[0244] The system, apparatus, module or unit illustrated in the above embodiments can be specifically implemented by a computer chip or entity, or by a product with certain functions. A typical implementation device is a computer, and the specific form of the computer can be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0245] In a typical configuration, a computer includes one or more processors (CPUs), input / output interfaces, network interfaces, and memories.
[0246] The memory can include non-persistent memory in computer readable media, random access memory (RAM), and / or non-volatile memory such as read-only memory (ROM) or flash memory (flash RAM). The memory is an example of computer readable media.
[0247] The computer readable media includes permanent and non-permanent, removable and non-removable media, which can be implemented by any method or technology to store information. The information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, disk storage, quantum memory, graphene-based storage medium or other magnetic storage device, or any other non-transmission medium that can be used to store information accessible by a computing device. According to the definition in this paper, computer readable media does not include transitory computer readable media, such as modulated data signals and carriers.
[0248] It is also to be noted that the terms "comprising", "including", and "having" or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises, includes, or has a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a", "includes... a", "has... a", or "consists of" does not, without more constraints, preclude the existence of additional identical elements in the process, method, article, or apparatus that comprises, includes, or consists of the element. The terms "a", "an" and "the" are defined to encompass one or more instances of the element following the term, unless the context clearly indicates otherwise.
[0249] The above description of certain implementations has been described. Other implementations are within the scope of the following claims. In some cases, the actions recited in the claims can be performed in a different order and still achieve desirable results. Additionally, some of the processes described herein can be performed concurrently, in parallel, or sequentially, as appropriate, and some of the components described herein can be combined, divided, or otherwise reaimed as appropriate. In some cases, the processes described herein can be performed by one or more computing devices operating in concert.
[0250] The terminology used in this description is for the purpose of describing particular implementations only and is not intended to be limiting of one or more implementations described in this disclosure. As used in this description and the appended claims, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
[0251] It will be understood that, although the terms first, second, third, etc. can be used herein to describe various information, the information should not be limited by these terms. These terms are used only to distinguish one piece of information from another. For example, a first information could be termed a second information, and, similarly, a second information could be termed a first information without departing from the scope of one or more implementations described herein. As used herein, the term "if' can be construed to mean "when" or "upon" or "in response to determining" terms that indicate some form of functionality, dependency, or causation.
[0252] The foregoing is considered as illustrative only of the principles of one or more implementations described herein. Further, since numerous modifications and changes will readily occur to those skilled in the art, it is not desired to limit the one or more implementations described herein to the exact construction and process shown. Therefore, accordingly, all such variations are intended to be included within the scope of one or more implementations described herein. The disclosure is not to be limited to the details or representations set forth herein.
Claims
1. A method for determining a transaction detail, comprising: determining a user account as a target account and generating a corresponding shadow account for the target account, in a case that the user account is determined as an account with a risk of out-of-order transaction details, wherein a reference amount of the shadow account is consistent with an initial balance of the target account, and the shadow account is used to generate transaction details of the target account; updating the initial balance of the target account based on a transaction amount corresponding to a transaction event, to obtain an account balance of the target account for a user to view, after detecting the transaction event; generating a corresponding transaction detail based on the transaction event, and caching at least one transaction detail generated by the target account in a preset time period, wherein the transaction detail comprises a transaction amount and a transaction time; sequentially rearranging the transaction details in the preset time period according to the transaction time; changing the reference amount of the shadow account corresponding to the target account based on the transaction amount of the sequentially rearranged transaction details, to obtain the transaction details of the target account. 2.The method of claim 1, wherein the caching at least one transaction detail generated by the target account in a preset time period comprises: obtaining a transaction detail generated by the target account; determining whether there is a detail processing task covering the transaction time according to the transaction time of the transaction detail, wherein a time period of the detail processing task is the preset time period; if yes, caching the transaction detail in a detail list associated with the detail processing task; if no, generating a detail processing task corresponding to the transaction detail, and determining the transaction time of the transaction detail as a start time of the time period of the detail processing task. 3.The method of claim 2, wherein the sequentially rearranging the transaction details in the preset time period according to the transaction time comprises: obtaining all transaction details cached in a detail list of the detail processing task in response to an end of the time period of the detail processing task; sequentially rearranging all transaction details cached in the detail list according to the transaction time. 4.The method of any one of claims 1 to 3, wherein the changing the reference amount of the shadow account corresponding to the target account based on the transaction amount of the sequentially rearranged transaction details to obtain the transaction details of the target account comprises: obtaining the reference amount of the shadow account corresponding to the target account; calculating shadow account balances before and after each transaction detail based on the reference amount and the transaction amount of the sequentially rearranged transaction details; obtaining the transaction details based on each transaction detail and the corresponding shadow account balance. 5.The method of claim 1, wherein the determining a user account as a target account comprises: obtaining state information of each user account, determining that the user account is a target account with a risk of disordered account details in response to the state information being preset state information; generating a shadow account corresponding to the target account, and synchronizing the reference amount of the shadow account according to the balance information of the target account.
6. The method of claim 5, further comprising: configuring the state information of the user account as the preset state information in response to a historical transaction volume of the user account exceeding a preset transaction volume threshold; or, configuring the state information of the user account as the preset state information in response to a feedback frequency of the user account exceeding a preset frequency threshold.
7. The method of claim 1, after obtaining the account details of the target account, the method further comprising: deleting all transaction details of the target account in a preset time period cached; and / or, updating the reference amount of the shadow account according to a result of changing the reference amount of the shadow account.
8. An account details determination apparatus, comprising: a details cache module configured to determine a user account as a target account in a case where the user account is an account with a risk of disordered account details, and generate a corresponding shadow account for the target account, wherein the reference amount of the shadow account is consistent with an initial balance of the target account, and the shadow account is used to generate account details of the target account; after detecting a transaction event, updating the initial balance of the target account based on a transaction amount corresponding to the transaction event to obtain an account balance of the target account for a user to view; generating a corresponding transaction detail based on the transaction event, and caching at least one transaction detail generated by the target account in a preset time period, the transaction detail including a transaction amount and a transaction time; a sequence rearrangement module configured to rearrange the transaction details in the preset time period according to the sequence of the transaction times; an account details module configured to change the reference amount of the shadow account corresponding to the target account on a transaction-by-transaction basis according to the transaction amounts of the transaction details after sequence rearrangement, to obtain the account details of the target account.
9. An electronic device, comprising: a processor; and a memory storing computer instructions for causing the processor to execute the method of any one of claims 1 to 7.
10. A storage medium storing computer instructions for causing a computer to execute the method of any one of claims 1 to 7.
Citation Information
Patent Citations
Buffer bookkeeping method, apparatus and equipment thereof
CN107016604A
Transaction data processing method and device
CN110659971A
Hotspot account accounting method
CN112381537A