Transaction clearing method and device, electronic equipment and storage medium
By addressing the time difference problem of different exchanges in the financial market, the preset batch and within trading days are adopted to solve the problem of extended liquidation after the end of the trading period of the subject matter, and the liquidity of capital and market activity are improved.
Patent Information
- Application Number
- CN202411587344.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2024-12-10
AI Technical Summary
In the field of over-the-counter derivatives in the financial market, the time difference between the underlying product trading periods is caused by the time difference between different exchanges, resulting in the extension of the liquidation process, affecting user transactions and market activity.
By receiving the subject matter clearing instruction, the subject matter of the preset batch is liquidated after the transaction period within the preset trading day is over, the waiting time is reduced, and the user's holding amount is calculated using the transaction records within the preset trading day, and in a natural way, the transaction records within the preset trading day are used to calculate the amount of the user's holding. Clear users' deposits and withdrawals within the day to ensure the timely flow of funds.
It reduces the impact of the liquidation process after the end of the underlying transaction period, improves the liquidity of capital and the activity of the financial market, and reduces the impact of the liquidation process on user transactions.
Smart Images

Figure CN119107182A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a transaction clearing method, device, electronic device and storage medium. Background Art
[0002] Currently, in the field of over-the-counter derivatives in the financial market, users' transactions may involve the underlying assets of multiple exchanges such as A-shares, Hong Kong stocks, US stocks and overseas futures, so that a user's over-the-counter derivatives contract may contain multiple underlying assets. The user's transaction amount of the underlying asset is cleared, and the purchase amount and sale amount of the underlying asset can be offset, thereby verifying and registering the user's holding amount of the underlying asset.
[0003] Due to the time difference between the locations of different exchanges, there are differences in the trading hours of the underlying assets of different exchanges on the same trading day. For example, assuming that the trading hours of A shares are 9:30-11:30 and 13:00-15:00 based on Beijing time; while the trading hours of US stocks are 21:30-4:00 in summer time and 22:30-5:00 in winter time. When clearing the underlying assets, it is required that the trading hours of the underlying assets on the trading day have ended. Therefore, the clearing of different underlying assets must be after the trading time of each underlying asset has ended. There are cases where the waiting time for clearing of some underlying assets after the trading hours has ended is too long. However, before the underlying asset is cleared, users cannot trade the underlying asset. Therefore, the clearing process affects user transactions, reduces the liquidity of funds and the activity of the financial market. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a transaction clearing method, device, electronic device and storage medium to reduce the impact of the clearing process on the underlying transaction. The specific technical solution is as follows:
[0005] In a first aspect of an embodiment of the present application, a transaction settlement method is provided, the method comprising:
[0006] receiving a subject matter settlement instruction, wherein the subject matter settlement instruction is used to instruct: to settle the transaction amounts of multiple subject matters of preset batches on a preset trading day, wherein the errors between the trading periods of the multiple subject matters on the preset trading day are less than a preset error, and each trading period is earlier than the time of receiving the subject matter settlement instruction;
[0007] For each subject matter of the preset batch, the transaction record of the subject matter within the preset trading day is obtained, and based on the transaction record, the transaction amount of the subject matter is settled to obtain the amount of the subject matter held by each user at the end of the preset trading day.
[0008] Optionally, the liquidation of the transaction amount of the subject matter based on the transaction record to obtain the amount of the subject matter held by each user at the end of the preset transaction day includes:
[0009] For each user, according to the transaction record of the user for the subject matter, determine a first difference between the purchase amount and the sale amount of the subject matter by the user in the trading platform during the preset trading day;
[0010] The first difference and the historical holding amount are added together as the holding amount of the subject matter by the user at the end of the preset trading day, and the historical holding amount is: the holding amount of the subject matter by the user at the end of the trading day before the preset trading day.
[0011] Optionally, the method further includes:
[0012] Receive a fund settlement instruction, where the fund settlement instruction is used to instruct: to settle the deposits and withdrawals of the user on the trading platform within a preset natural day;
[0013] Obtain the user's fund inflow and outflow records in the trading platform within the preset natural day;
[0014] According to the fund inflow and outflow records, the deposits and withdrawals of users in the trading platform are settled to obtain the available amount of each user in the trading platform.
[0015] Optionally, the clearing of deposits and withdrawals of users in the trading platform according to the fund inflow and outflow records to obtain the available amount of each user in the trading platform includes:
[0016] Determine, based on each user's fund inflow and outflow records, a second difference between the user's transferred-in funds and transferred-out funds in the trading platform within the preset natural day;
[0017] The second difference and the historical available amount are added together as the available amount of the user in the trading platform within the preset natural day, and the historical available amount is: the available amount of the user in the trading platform within the natural day before the preset natural day.
[0018] Optionally, the method further includes:
[0019] Receive a query instruction, wherein the query instruction is used to instruct: query the current total fund balance of the target user in the trading platform;
[0020] Determine the current available amount based on the available amount of the target user in the trading platform in the previous natural day and the fund inflow and outflow records of the target user in the trading platform in the current natural day;
[0021] For each subject matter held by the target user, the amount of the subject matter held by the target user at the end of the first trading day is obtained as the first holding amount, and the transaction amount of the subject matter by the target user on the second trading day is obtained as the first transaction amount, where the first trading day is the last trading day on which the settlement of the subject matter is completed, and the second trading day is the next trading day after the first trading day;
[0022] The sum of the first held amount, the first transaction amount and the current available amount is taken as the total fund balance.
[0023] Optionally, after receiving the query instruction, the method further includes:
[0024] For each underlying asset held by the target user, if the first trading day is in a backtracking state, obtain the amount of the underlying asset held by the target user at the end of the third trading day as the second holding amount, and obtain the transaction amount of the underlying asset by the target user on the fourth trading day as the second transaction amount. The third trading day is the last trading day on which the settlement of the underlying asset is completed and is not in a backtracking state, and the fourth trading day is each trading day after the third trading day that has been opened for trading;
[0025] The sum of the second held amount, the second transaction amount and the current available amount is taken as the total fund balance.
[0026] According to a second aspect of the embodiment of the present application, a transaction settlement device is provided, the device comprising:
[0027] A receiving module, configured to receive a subject matter settlement instruction, wherein the subject matter settlement instruction is used to instruct: settlement of transaction amounts of multiple subject matters of preset batches within a preset trading day, wherein the errors between the trading periods of the multiple subject matters on the preset trading day are less than a preset error, and each trading period is earlier than the receiving time of the subject matter settlement instruction;
[0028] The clearing module is used to obtain the transaction record of each subject matter of the preset batch within the preset trading day, and to clear the transaction amount of the subject matter based on the transaction record to obtain the amount of the subject matter held by each user at the end of the preset trading day.
[0029] Optionally, the clearing module is specifically used to:
[0030] For each user, according to the transaction record of the user for the subject matter, determine a first difference between the purchase amount and the sale amount of the subject matter by the user in the trading platform during the preset trading day;
[0031] The first difference and the historical holding amount are added together as the holding amount of the subject matter by the user at the end of the preset trading day, and the historical holding amount is: the holding amount of the subject matter by the user at the end of the trading day before the preset trading day.
[0032] Optionally, the device further comprises:
[0033] The receiving module is further used to receive a fund settlement instruction, wherein the fund settlement instruction is used to instruct: to settle the deposits and withdrawals of the user on the trading platform within a preset natural day;
[0034] An acquisition module, used to acquire the user's fund inflow and outflow records in the trading platform within the preset natural day;
[0035] The clearing module is also used to clear the deposits and withdrawals of users in the trading platform according to the fund inflow and outflow records, and obtain the available amount of each user in the trading platform.
[0036] Optionally, the clearing module is specifically used to:
[0037] Determine, based on each user's fund inflow and outflow records, a second difference between the user's transferred-in funds and transferred-out funds in the trading platform within the preset natural day;
[0038] The second difference and the historical available amount are added together as the available amount of the user in the trading platform within the preset natural day, and the historical available amount is: the available amount of the user in the trading platform within the natural day before the preset natural day.
[0039] Optionally, the device further comprises:
[0040] The receiving module is further used to receive a query instruction, wherein the query instruction is used to instruct: querying the total fund balance of the target user currently in the trading platform;
[0041] A determination module, configured to determine the current available amount based on the available amount of the target user in the trading platform in the previous natural day and the fund inflow and outflow records of the target user in the trading platform in the current natural day;
[0042] The acquisition module is further configured to acquire, for each subject matter held by the target user, the amount of the subject matter held by the target user at the end of the first trading day as a first holding amount, and acquire the transaction amount of the subject matter held by the target user on the second trading day as a first transaction amount, wherein the first trading day is the last trading day on which the settlement of the subject matter is completed, and the second trading day is the next trading day of the first trading day;
[0043] A calculation module is used to take the sum of the first held amount, the first transaction amount and the current available amount as the total fund balance.
[0044] Optionally, the acquisition module is further used to, after receiving the query instruction, for each underlying asset held by the target user, if the first trading day is in a backtracking state, obtain the amount of the underlying asset held by the target user at the end of the third trading day as the second holding amount, and obtain the transaction amount of the underlying asset by the target user on the fourth trading day as the second transaction amount, the third trading day being the last trading day on which the settlement of the underlying asset is completed and is not in a backtracking state, and the fourth trading day being each trading day after the third trading day on which trading has been opened;
[0045] The calculation module is further used to take the sum of the second held amount, the second transaction amount and the current available amount as the total fund balance.
[0046] According to a third aspect of the embodiments of the present application, an electronic device is provided, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0047] Memory, used to store computer programs;
[0048] The processor is used to implement the transaction settlement method described in any one of the first aspects when executing the program stored in the memory.
[0049] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the transaction settlement method described in any one of the first aspects is implemented.
[0050] According to a fifth aspect of the embodiments of the present application, there is also provided a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any of the transaction settlement methods described above.
[0051] Beneficial effects of the embodiments of the present application:
[0052] The transaction clearing method, device, electronic device and storage medium provided in the embodiments of the present application can, upon receiving the subject matter clearing instruction, for each subject matter of a preset batch, clear the transaction amount of the subject matter based on the user's transaction record of the subject matter on the preset trading day. Since the error between the trading periods of each subject matter in the preset batch is less than the preset error, that is, each trading period is similar, there is no need to wait for a long time before clearing after the trading period of each subject matter of the same batch ends. It can be seen that the embodiments of the present application can clear each subject matter in batches, reducing the waiting time for clearing after the trading period of the subject matter ends, and reducing the impact of the clearing process on the subject matter transaction.
[0053] Of course, implementing any product or method of the present application does not necessarily require achieving all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other embodiments can also be obtained based on these drawings.
[0055] Figure 1 A flow chart of a transaction settlement method provided by an embodiment of the present disclosure;
[0056] Figure 2 An exemplary schematic diagram of batch division provided for an embodiment of the present disclosure;
[0057] Figure 3 An exemplary schematic diagram of a liquidation progress provided by an embodiment of the present disclosure;
[0058] Figure 4 A flow chart of a method for fund settlement provided in an embodiment of the present disclosure;
[0059] Figure 5 A flowchart of a method for determining a total fund balance provided in an embodiment of the present disclosure;
[0060] Figure 6 A schematic diagram of the structure of various systems included in an electronic device provided in an embodiment of the present disclosure;
[0061] Figure 7 An exemplary schematic diagram of components of a total fund balance provided for an embodiment of the present disclosure;
[0062] Figure 8 Another exemplary schematic diagram of components of the total fund balance provided for an embodiment of the present disclosure;
[0063] Fig. 9 A schematic diagram of the structure of a transaction settlement device provided in an embodiment of the present disclosure;
[0064] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0065] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field based on the present application belong to the scope of protection of the present application.
[0066] In order to reduce the impact of the clearing process on the underlying transaction, the present application embodiment provides a transaction clearing method, which is applied to an electronic device, such as a server or a desktop computer, etc., which has data processing capabilities. Figure 1 As shown, the transaction settlement method provided in the embodiment of the present application includes the following steps.
[0067] S101. Receive a subject matter settlement instruction, wherein the subject matter settlement instruction is used to instruct: to settle the transaction amounts of multiple subject matters in preset batches within a preset trading day.
[0068] The various underlying assets in the preset batches are received earlier than the time of the underlying asset settlement instruction in each trading period of the preset trading day, that is, when the electronic device receives the underlying asset settlement instruction, the various underlying assets in the preset batches have ended in the trading period of the preset trading day, meeting the settlement requirements, and therefore the various underlying assets in the preset batches can be settled.
[0069] Moreover, the error between the trading periods of the preset batches of various underlying assets on the preset trading day is less than the preset error. That is, the trading periods of the preset batches of various underlying assets on the same trading day are similar. This method can effectively reduce the waiting time between the underlying assets after the trading period ends and before the settlement, so that the underlying assets can be settled more quickly, thereby reducing the impact of the settlement process on the underlying asset transactions on the next trading day.
[0070] Optionally, the subject matter clearing instruction may be triggered by an administrator of a trading platform, or may be automatically triggered at a fixed time, where the trading platform is a software module in an electronic device that provides subject matter trading. The subject matter clearing instruction may include a batch identifier (ID), and the electronic device may use the batch corresponding to the batch identifier as a preset batch. The subject matter clearing instruction may also include a trading day identifier, and the electronic device may use the trading day corresponding to the trading day identifier as a preset trading day; or, when the subject matter clearing instruction does not include a trading day identifier, the electronic device may use the last trading day of the trading period of each subject matter of the preset batch as the preset trading day.
[0071] S102. For each subject matter of a preset batch, the transaction record of the subject matter within the preset trading day is obtained, and the transaction amount of the subject matter is settled based on the transaction record to obtain the amount of the subject matter held by each user at the end of the preset trading day.
[0072] Each transaction record may include: user ID, subject matter ID, transaction behavior, transaction amount, transaction time, etc. Transaction behavior includes buying and selling.
[0073] By clearing the transaction amount of each underlying asset, it is possible to obtain the difference between the buying amount and selling amount of the underlying asset by each user in the trading platform at the end of the trading period on the preset trading day, which is equivalent to the difference between the buying quantity and selling quantity of the underlying asset by each user at the end of the preset trading day, as well as the difference between the buying quantity and selling quantity of the underlying asset by each user, and the difference between the buying amount and selling amount of the underlying asset by each user, thereby obtaining the holding amount of each user for the underlying asset and the holding quantity of each user for the underlying asset.
[0074] In the embodiment of the present application, the software module for clearing the subject matter in the trading platform of the electronic device is called a bookkeeping and clearing system, and the software module for managing user transactions in the trading platform is called an order management system. On this basis, the bookkeeping and clearing system can obtain the transaction records of the user for the preset batch of subject matter from the order management system, and perform clearing based on the transaction records.
[0075] The transaction settlement method provided in the embodiment of the present application can settle the transaction amount of each subject matter of a preset batch according to the transaction record of the subject matter by the user on the preset trading day when receiving the subject matter settlement instruction. Since the error between the trading periods of each subject matter in the preset batch is less than the preset error, that is, each trading period is similar, there is no need to wait for a long time before settlement after the trading period of each subject matter of the same batch ends. It can be seen that the embodiment of the present application can settle each subject matter in batches, reducing the waiting time for settlement after the trading period of the subject matter ends, and reducing the impact of the settlement process on the subject matter transaction.
[0076] In some embodiments of the present application, the electronic device S102 settles the transaction amount of each subject matter of the preset batch according to the transaction record, and obtains the amount of each user holding the subject matter at the end of the preset trading day. The method can be implemented as follows: for each user, according to the user's transaction record of the subject matter, determine the first difference between the user's purchase amount and the sale amount of the subject matter in the trading platform during the preset trading day, and then add the first difference and the historical holding amount as the user's holding amount of the subject matter at the end of the preset trading day. The historical holding amount is: the amount of the subject matter held by the user at the end of the previous trading day of the preset trading day.
[0077] When the embodiment of the present application settles the transaction amount of the underlying asset within a trading day, it is possible to separately count the transaction amount of the underlying asset within the trading day, and add the statistical result to the historical holding amount obtained on the previous trading day to obtain the settlement result of the trading day, thereby reducing the amount of settlement calculations and improving settlement efficiency.
[0078] In the above Figure 1 Before the illustrated subject matter liquidation process, the embodiment of the present application may also pre-divide various subject matters into batches, wherein each batch includes a plurality of subject matters.
[0079] In the financial field, different exchanges have different tradable subject matters, and due to differences in the geographical locations of the exchanges, the trading hours of the subject matters on each trading day are different. For example, assuming that the trading day is July 1, the trading hours of stocks listed on the Shanghai Stock Exchange on July 1 are 9:30-11:30 and 13:00-15:00; since July 1 is in daylight saving time, the trading hours of stocks listed on the American Stock Exchange on July 1 are 9:30-16:00, which is converted to Beijing time from 21:30 on July 1 to 4:00 on July 2. It can be seen that there are differences between the trading hours of different subject matters on the same trading day. The embodiment of the present application can divide each subject matter into multiple batches in advance according to the trading hours of each subject matter on each trading day, so that the error between the trading hours of each subject matter of the same batch on the same trading day is less than the preset error.
[0080] The errors between trading periods within the same trading day include: the errors between the start times of the trading periods and the errors between the end times of the trading periods. The errors between the start times and the errors between the end times can be determined by methods such as range, mean deviation, variance or standard deviation.
[0081] In the embodiment of the present application, when dividing the batches of each subject matter, in addition to the trading period of each subject matter, it can also be based on the business needs in the actual scenario. For example, if the user requires the liquidation of subject matter 1 and subject matter 2 at the same time, subject matter 1 and subject matter 2 are divided into the same batch.
[0082] After the batch division is completed, the embodiment of the present application can also determine the settlement time of each batch, that is, determine the triggering time of the subject matter settlement instruction, and the settlement time of each batch is later than the trading period of the various subject matters in the batch, for example, the settlement time of each batch is within the preset time after the trading period of the various subject matters in the batch ends. When the subject matter settlement instruction is manually triggered, the settlement time of each batch can be a time period, and the management personnel of the trading platform can trigger the subject matter settlement instruction within the time period. When the subject matter settlement instruction is automatically triggered at a scheduled time, the settlement time of each batch can be a moment, and the subject matter settlement instruction can be automatically triggered at this moment.
[0083] For example, see Figure 2, assuming that the tradable underlying assets include: stocks listed on the Shanghai Stock Exchange, stocks listed on the Shenzhen Stock Exchange, stocks listed on the Hong Kong Stock Exchange, stocks listed on the American Stock Exchange, and West Texas Intermediate (WTI), etc. For the convenience of description, the embodiment of the present application refers to the stocks listed on the Shanghai Stock Exchange as Shanghai stocks, the stocks listed on the Shenzhen Stock Exchange as Shenzhen stocks, the stocks listed on the Hong Kong Stock Exchange as Hong Kong stocks, and the stocks listed on the American Stock Exchange as US stocks. Assuming that the trading hours of Shanghai stocks and Shenzhen stocks are 9:30-11:30 and 13:00-15:00 from Monday to Friday based on Beijing time, and the trading hours of Hong Kong stocks are 9:30-12:00 13:00-16:00 from Monday to Friday. Assuming that the error between the trading hours of Shanghai stocks, Shenzhen stocks and Hong Kong stocks is less than the preset error, the Shanghai stocks, Shenzhen stocks and Hong Kong stocks are divided into batch A, and the settlement time of batch A is determined to be 16:30-17:30 from Monday to Friday. The trading hours of US stocks and WTI are 21:30-4:00 every day in summer time and 22:30-5:00 every day in winter time. Assuming that the error between the trading hours of US stocks and WTI is less than the preset error, US stocks and WTI are divided into batch B, and the settlement time of batch B is determined to be 10:00-10:30 every day in summer time and 11:00-11:30 every day in winter time. Similarly, other underlying assets can be divided into other batches and the settlement time of other batches can be determined.
[0084] Optionally, in addition to determining the clearing time of a batch based on the trading period of each underlying asset in the batch, it can also be determined based on actual conditions such as user requirements and the working hours of the management personnel of the trading platform. For example, if the user requires the clearing of US stocks to be completed before 10:00 every day, and the management personnel of the trading platform go to work at 9:00 every day, then the clearing time of batch B is set to 9:00-9:30 every day in summer time and 09:10-09:40 every day in winter time.
[0085] After batch division, you can Figure 1 In the manner shown, each subject matter is liquidated in batches. Since each batch includes multiple subject matters, and multiple subject matters can be liquidated at the same time, the embodiment of the present application can integrate the subject matters of different trading periods into the same batch for liquidation, thereby avoiding separate liquidation for each subject matter. When the liquidation process is manually triggered, manual operations are reduced and liquidation efficiency is improved.
[0086] Since the embodiments of the present application can perform batch liquidation of each subject matter, the problem of long waiting time before liquidation after the transaction time of each subject matter ends when all subject matters are liquidated uniformly is avoided.
[0087] For example, see Figure 3 , Figure 3 The chart shows the liquidation status of Shanghai stocks, Hong Kong stocks and US stocks on January 10, January 11 and January 12 respectively. The black circles indicate that the liquidation has been completed on the trading day, and the white circles indicate that the trading day is in a tradable state. Figure 3 It can be seen that the Shanghai, Hong Kong and US stocks were all cleared on January 10, which can be called the "public bottom". The "public bottom" means that all underlying assets in the trading platform have been cleared on that trading day, indicating that as of that trading day, the amount of each underlying asset is stable and the clearing results have been confirmed, providing a reliable basis for subsequent problem investigation and data tracing. The Shanghai and Hong Kong stocks were cleared on January 11, so they can be traded on January 12. The US stocks were cleared on January 10, so they can be traded on January 11, but the clearing on January 11 has not been completed, so they cannot be traded on January 12 for the time being.
[0088] Since the embodiment of the present application can liquidate the subject matter in batches, Figure 3 The Shanghai and Hong Kong stocks in the account can be cleared after the trading session on January 11th, without waiting until the US stock trading session ends on January 11th, and then the Shanghai, Hong Kong and US stocks are cleared uniformly, so that the underlying assets can be cleared more timely after the trading session ends, so that trading activities can be carried out on the next trading day, and the flexible scheduling and efficient clearing between the trading markets to which the underlying assets belong is improved. It ensures the orderly and continuous operation of the financial market, improves the flexibility of the underlying asset clearing, reduces the impact of the clearing process on the underlying asset trading, optimizes the user experience, and improves the liquidity of funds and the activity of the financial market.
[0089] In the embodiment of the present application, when the preset batches of the subject matter are cleared, the normal transactions of other batches of the subject matter will not be affected. Therefore, users can trade different subject matters at different times throughout the day, that is, users are supported to place orders for different subject matters continuously throughout the day to ensure the continuity of transactions.
[0090] Moreover, compared with the method of dividing A-shares and overseas assets into different platforms for separate management, users can only trade A-shares or overseas assets on a single platform, which limits the flexibility of trading, and managers need to manage various assets through multiple platforms, which increases the burden on staff. Among them, A-shares refer to stocks issued by companies registered in China, listed in China, with par value in RMB, and subscribed and traded in RMB.
[0091] The embodiment of the present application supports batch clearing of multiple underlying assets on the trading platform, thereby supporting users to cover the underlying assets of various exchanges through one over-the-counter derivatives contract within the trading platform, thereby improving the efficiency of user transactions, and also improving the management efficiency and flexibility of electronic devices for various underlying assets, thereby enhancing the market competitiveness of the trading platform.
[0092] In the financial field, when a trading platform performs clearing, in addition to clearing the underlying assets, it also needs to clear the deposits and withdrawals of users within the trading platform. Among them, the deposits and withdrawals of users within the trading platform include: funds transferred from other platforms to the trading platform by users, and funds transferred from the trading platform to other platforms by users. The transfer-in and transfer-out operations of users on the trading platform have nothing to do with the user's trading behavior on the underlying assets within the trading platform. Therefore, in order to further optimize the clearing process, the embodiment of the present application sets the deposits and withdrawals of users as a batch of funds for clearing.
[0093] See also Figure 4 , when clearing a batch of funds, the electronic device may also perform the following steps:
[0094] S401. Receive a fund settlement instruction, wherein the fund settlement instruction is used to instruct: to settle the deposits and withdrawals of the user on the trading platform within a preset natural day.
[0095] The fund settlement instruction can be triggered by the administrator of the trading platform, or automatically triggered at a fixed time. The fund settlement instruction can include a natural day mark, and the electronic device can use the natural day corresponding to the natural day mark as the preset natural day; or, when the subject matter settlement instruction does not include a natural day mark, the electronic device can use the current natural day or the previous natural day as the preset natural day. The natural day in the embodiment of the present application is the natural day of the location of the electronic device, such as 0:00-24:00 Beijing time.
[0096] Optionally, the electronic device may receive the subject matter liquidation instruction and the fund liquidation instruction simultaneously, or may receive the subject matter liquidation instruction and the fund liquidation instruction successively. Accordingly, the electronic device may execute the subject matter liquidation process and the fund liquidation process in parallel, or may execute the subject matter liquidation process and the fund liquidation process successively.
[0097] S402: Obtain the user's fund inflow and outflow records in the trading platform within a preset natural day.
[0098] Each fund inflow and outflow record may include: user ID, inflow and outflow type, time and amount, etc., where the inflow and outflow type includes transfer in and transfer out.
[0099] S403. According to the fund inflow and outflow records, the deposits and withdrawals of users in the trading platform are settled to obtain the available amount of each user in the trading platform.
[0100] When the electronic device performs deposit and withdrawal settlement, it can determine the total difference between the transferred-in funds and the transferred-out funds of each user in the trading platform within the preset natural day based on the fund inflow and outflow records, and add the total difference to the total available amount in the trading platform on the previous natural day to obtain the total available amount in the trading platform within the preset natural day. In addition, the electronic device can also determine the second difference between the transferred-in funds and the transferred-out funds of the user in the trading platform within the preset natural day based on the fund inflow and outflow records of each user, and then add the second difference to the historical available amount as the available amount of the user in the trading platform within the preset natural day, where the historical available amount is: the available amount of the user in the trading platform within the previous natural day of the preset natural day.
[0101] Among them, the available amount of users in the trading platform can be used to purchase various objects.
[0102] Through the above method, the embodiment of the present application can separately settle the deposits and withdrawals of users in the trading platform, that is, separate the settlement of the underlying assets from the settlement of deposits and withdrawals, so that the settlement of deposits and withdrawals is not affected by the settlement of the underlying assets, further improving the flexibility and efficiency of the trading platform in clearing.
[0103] In the embodiment of the present application, the electronic device also supports the user to view the total fund balance in the trading platform. Figure 5 , the electronic device may further perform the following steps:
[0104] S501. Receive a query instruction, wherein the query instruction is used to instruct: query the total fund balance of the target user currently in the trading platform.
[0105] The query instruction may be triggered by the user. For example, the user terminal may display the user interaction interface provided by the trading platform through an application, a webpage, or a mini-program. When the user terminal detects that the user clicks the balance display control in the user interaction interface, or detects that the user opens the balance display page in the user interaction interface, the query instruction is sent to the electronic device.
[0106] Alternatively, the query instruction may be automatically triggered at a fixed time. For example, after the user terminal sends a query request to the electronic device, if the user does not click on the balance close control or the user does not close the balance display page, the query instruction is sent to the electronic device every 1 second.
[0107] Alternatively, the query instruction may be triggered by an administrator of the trading platform. For example, the administrator selects a target user on the trading platform interface displayed on the electronic device and clicks on a balance display control, thereby triggering the query instruction.
[0108] The query instruction may include a user identifier, and the electronic device may take the user corresponding to the user identifier as a target user.
[0109] S502: Determine the current available amount based on the available amount of the target user in the trading platform in the previous natural day and the fund inflow and outflow record of the target user in the trading platform in the current natural day.
[0110] Among them, the available amount of the target user in the trading platform in the previous natural day of the current natural day is obtained based on the settlement of deposits and withdrawals in the trading platform in the previous natural day. Based on the fund inflow and outflow records of the target user in the trading platform in the current natural day, the amount of transfers and inflows of the user in the trading platform in the current natural day can be obtained. Therefore, the available amount of the target user in the trading platform in the previous natural day + the amount of transfers of the target user in the trading platform in the current natural day - the amount of transfers of the target user in the trading platform in the current natural day can be calculated, and the calculation result is used as the current available amount. The current available amount reflects the latest status of the user's funds in the trading platform that are not related to the underlying transaction.
[0111] S503. For each subject matter held by the target user, obtain the amount of the subject matter held by the target user at the end of the first trading day as the first holding amount, and obtain the transaction amount of the subject matter held by the target user on the second trading day as the first transaction amount.
[0112] The transaction amount of a user for an underlying asset within a trading day is the difference between the amount of the underlying asset purchased by the user and the amount of the underlying asset sold by the user within the trading day.
[0113] The first trading day is the last trading day to complete the settlement of the underlying asset, and the second trading day is the next trading day after the first trading day. Since the transactions involving the underlying asset have been settled on the first trading day, users can trade the underlying asset on the second trading day. The sum of the first holding amount and the first transaction amount reflects the latest status of the user's funds related to the underlying asset transaction on the trading platform.
[0114] It should be noted that S502 and S503 can be executed in parallel, or sequentially, that is, S502 is executed first and then S503, or S503 is executed first and then S502. The embodiment of the present application does not specifically limit the execution order of these two steps.
[0115] In the embodiment of the present application, the software module that interacts with the user terminal in the trading platform of the electronic device is called the online hall system; the software module that manages user transactions in the trading platform is called the order management system, and the software module that clears the subject matter in the trading platform is called the bookkeeping and clearing system. On this basis, see Figure 6 , the online hall system 601 can receive the query instruction and send the query instruction to the order management system 602. When receiving the query instruction, the order management system 602 searches the available amount of the target user in the trading platform in the previous natural day from the bookkeeping and clearing system 603, and searches the first holding amount of the target user for the subject matter at the end of the first trading day, so that the subsequent order management system 602 uses the sum of the first holding amount, the first transaction amount and the current available amount as the total fund balance. The various systems in the embodiment of the present application have clear division of labor, and can work together to clear and determine the total fund balance, which ensures the fluency and efficiency of the clearing and determining the total fund balance process.
[0116] S504: The sum of the first held amount, the first transaction amount, and the current available amount is taken as the total fund balance.
[0117] The total fund balance of the user in the trading platform includes two parts. The first part is the funds related to the trading contract, that is, the amount of each subject matter held by the user and the transaction amount, among which the holding amount has been settled and has a higher accuracy, and the transaction amount is the amount that has been traded but has not been settled. The second part is the funds unrelated to the trading contract, that is, the current available amount of the user in the trading platform. This part is related to the user's deposits and withdrawals, that is, the funds transferred into and out of the trading platform by the user, but this part is not related to the user's trading behavior on the subject matter, that is, this part of the fund changes is not directly related to any trading contract of the subject matter. The embodiment of the present application takes the sum of these two parts as the total fund balance to ensure the accuracy of the total fund balance queried by the user.
[0118] For example, Figure 7 As shown in Figure 1, the total balance of funds of users in the trading platform includes: funds unrelated to trading contracts and funds related to trading contracts. Funds unrelated to trading contracts include: the current available amount of users in the trading platform; funds related to trading contracts include: the amount held and the transaction amount of users in Shanghai stocks, Shenzhen stocks, US stocks, Hong Kong stocks and futures.
[0119] When the query instruction in S501 is sent by the user terminal, after determining the total fund balance, the electronic device may also send the total fund balance to the user terminal so that the user terminal displays the total fund balance.
[0120] Alternatively, when the query instruction in S501 is triggered by a manager in the electronic device, the electronic device may display the total fund balance after determining the total fund balance.
[0121] Through the above method, the embodiment of the present application can use the current available amount of the user in the trading platform that is not related to the subject matter transaction, and the sum of the holding amount and the transaction amount related to the subject matter transaction as the total fund balance of the user in the trading platform, avoiding using only the current available amount or the holding amount as the total fund balance, which causes the user to have a wrong understanding of his total fund balance in the trading platform. Therefore, the embodiment of the present application improves the integrity and real-time performance of the determined total fund balance, can show the user a more accurate total fund balance, provide the user with a more reliable fund management function, and improve the user's experience.
[0122] In actual application scenarios, there may be inaccurate clearing results within a trading day, which may lead to the need to backtrack the clearing results within the trading day, that is, the need to re-clear the transactions within the trading day. For example, the management personnel of the trading platform can check the clearing results within each trading day to determine whether the clearing results are accurate. If they are inaccurate, the clearing results within the trading day can be backtracked.
[0123] On this basis, after receiving the query instruction in S501, the electronic device determines the total fund balance in the following two ways:
[0124] In the first implementation, regardless of whether the first trading day is in a backtracking state, that is, regardless of whether the settlement results within the first trading day are being backtracked, the total fund balance is determined in accordance with S502-S504.
[0125] That is, even if the first trading day is in a backtracking state, making the settlement result of the first trading day inaccurate, the sum of the first holding amount, the first transaction amount, and the current available amount of the target user in the trading platform is still used as the total fund balance to ensure the efficiency of determining the total fund balance. Moreover, since the electronic device can continuously receive the query request periodically sent by the user terminal during the process of the user viewing the total fund balance, it can obtain the first holding amount obtained after the backtracking in time after the first trading day is backtracked, and determine the total fund balance based on the first holding amount obtained after the backtracking, thereby ensuring the accuracy of the determined total fund balance.
[0126] In the second implementation, the electronic device can obtain, for each subject matter held by the target user, the amount of the subject matter held by the target user at the end of the third trading day as the second amount held, and obtain the transaction amount of the subject matter by the target user on the fourth trading day as the second transaction amount, while being in the backtracking state on the first trading day. Then, the sum of the second amount held, the second transaction amount, and the current available amount is taken as the total fund balance.
[0127] Among them, the third trading day is the last trading day on which the settlement of the underlying asset is completed and is not in a retrospective state, and the fourth trading day is each trading day after the third trading day that has been opened for trading. Since the settlement of the underlying asset has been completed on the third trading day and is not in a retrospective state, it means that the second holding amount of the underlying asset by the target user at the end of the third trading day has a high degree of accuracy. On the fourth trading day after the third trading day, which is open for trading, users are supported to trade the underlying asset, but the fourth trading day is in a retrospective state, and the settlement result of the fourth trading day may not be accurate. Therefore, the settlement result of the fourth trading day is not directly obtained, but the second transaction amount of the target user for the underlying asset on the fourth trading day is obtained. Afterwards, the sum of the second holding amount, the second transaction amount, and the available amount of the target user in the trading platform is taken as the total fund balance to ensure the accuracy of the determined total fund balance.
[0128] In the embodiment of the present application, when the first trading day is in a retrospective state, the determination of the total funds balance based on the settlement result of the first trading day is abandoned, so as to avoid the influence of the erroneous settlement result on the determination of the total funds balance. By using the sum of the second holding amount on the third trading day with higher accuracy, the second transaction amount on the fourth trading day and the current available amount as the total funds balance, the accuracy of the determined total funds balance is improved.
[0129] See also Figure 8 The following is an example to illustrate the method of determining the total fund balance in the embodiment of the present application:
[0130] The total fund balance of users on the trading platform includes: funds related to trading contracts and funds unrelated to trading contracts. Among them, funds unrelated to trading contracts include the current available amount of users on the trading platform, and funds related to trading contracts include: the amount of shares held and traded by users, as well as the amount of shares held and traded by users on US stocks. Among them, 5.26, 5.27 and 5.28 corresponding to funds unrelated to trading contracts are one natural day respectively, and 5.26, 5.27 and 5.28 corresponding to funds related to trading contracts are one trading day respectively. Assume that the user's available funds in the trading platform have been settled on May 26 and May 27, but not on May 28; the listed stocks have been settled on May 26 and May 27, so the listed stocks can be traded on May 28, but the listed stocks have not been settled on May 28; the US stocks have been settled on May 26, so the US stocks can be traded on May 27, but the US stocks have not been settled on May 27, so the US stocks cannot be traded on May 28.
[0131] When the user checks the total fund balance on May 28, the electronic device obtains the available amount of the user in the trading platform on May 27, and determines the current available amount F1 of the user in combination with the deposit and withdrawal of the user in the trading platform on May 28. At the same time, the electronic device obtains the user's holding amount S1 of the listed stocks on May 27, the user's trading amount S2 of the listed stocks on May 28, the user's holding amount U1 of US stocks on May 26, and the user's trading amount U2 of US stocks on May 27. Afterwards, the sum of the current available amount F1, the holding amount S1, the trading amount S2, the holding amount U1 and the trading amount U2 is taken as the total fund balance.
[0132] Based on the same inventive concept, corresponding to the above method embodiment, the present application embodiment also provides a transaction settlement device, such as Fig. 9 As shown, the device includes: a receiving module 901 and a clearing module 902;
[0133] The receiving module 901 is used to receive a subject matter settlement instruction, where the subject matter settlement instruction is used to instruct: to settle the transaction amounts of multiple subject matters of a preset batch on a preset trading day, where the error between the trading periods of the multiple subject matters of the preset batch on the preset trading day is less than a preset error, and each trading period is earlier than the receiving time of the subject matter settlement instruction;
[0134] The clearing module 902 is used to obtain the transaction record of each subject matter of the preset batch within the preset trading day, and settle the transaction amount of the subject matter based on the transaction record to obtain the amount of the subject matter held by each user at the end of the preset trading day.
[0135] Optionally, the clearing module 902 is specifically used for:
[0136] For each user, based on the user's transaction record of the subject matter, determine a first difference between the purchase amount and the sale amount of the subject matter by the user in the trading platform on a preset trading day;
[0137] The first difference and the historical holding amount are added together to obtain the amount of the underlying asset held by the user at the end of the preset trading day. The historical holding amount is: the amount of the underlying asset held by the user at the end of the previous trading day before the preset trading day.
[0138] Optionally, the device further comprises:
[0139] The receiving module is also used to receive a fund settlement instruction, which is used to instruct: to settle the deposits and withdrawals of users on the trading platform within a preset natural day;
[0140] The acquisition module is used to obtain the user's fund inflow and outflow records in the trading platform within a preset natural day;
[0141] The clearing module 902 is also used to clear the deposits and withdrawals of users in the trading platform according to the fund inflow and outflow records, and obtain the available amount of each user in the trading platform.
[0142] Optionally, the clearing module 902 is specifically used for:
[0143] Determine the second difference between the user's funds transferred in and out within the trading platform within a preset natural day based on each user's fund in and out records;
[0144] The second difference and the historical available amount are added together to obtain the available amount of the user in the trading platform within the preset natural day. The historical available amount is: the available amount of the user in the trading platform within the natural day before the preset natural day.
[0145] Optionally, the device further comprises:
[0146] The receiving module is further used to receive a query instruction, where the query instruction is used to instruct: query the total fund balance of the target user in the trading platform;
[0147] A determination module, used to determine the current available amount based on the available amount of the target user in the trading platform in the previous natural day and the fund inflow and outflow records of the target user in the trading platform in the current natural day;
[0148] The acquisition module is further used to acquire, for each underlying asset held by the target user, the amount of the underlying asset held by the target user at the end of the first trading day as the first holding amount, and acquire the transaction amount of the underlying asset by the target user on the second trading day as the first transaction amount, wherein the first trading day is the last trading day on which the liquidation of the underlying asset is completed, and the second trading day is the next trading day of the first trading day;
[0149] The calculation module is used to take the sum of the first holding amount, the first transaction amount and the current available amount as the total fund balance.
[0150] Optionally, the acquisition module is further used to, after receiving the query instruction, for each underlying asset held by the target user, if the first trading day is in a backtracking state, obtain the target user's holding amount of the underlying asset at the end of the third trading day as the second holding amount, and obtain the target user's transaction amount of the underlying asset on the fourth trading day as the second transaction amount, the third trading day being the last trading day on which the settlement of the underlying asset is completed and is not in a backtracking state, and the fourth trading day being each trading day after the third trading day on which trading has been opened;
[0151] The calculation module is also used to take the sum of the second holding amount, the second transaction amount and the current available amount as the total fund balance.
[0152] The present application also provides an electronic device, such as Fig.10 As shown, it includes a processor 1001 , a communication interface 1002 , a memory 1003 and a communication bus 1004 , wherein the processor 1001 , the communication interface 1002 , and the memory 1003 communicate with each other via the communication bus 1004 .
[0153] Memory 1003, used for storing computer programs;
[0154] The processor 1001 is used to implement the steps performed by the electronic device in the above method embodiment when executing the program stored in the memory 1003.
[0155] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0156] The communication interface is used for communication between the above electronic device and other devices.
[0157] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0158] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0159] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned transaction settlement methods are implemented.
[0160] In another embodiment provided in the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any transaction settlement method in the above embodiments.
[0161] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.
[0162] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0163] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0164] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.
Claims
1. A transaction settlement method, characterized in that: The method comprises: receiving a subject matter settlement instruction, wherein the subject matter settlement instruction is used to instruct: to settle the transaction amounts of multiple subject matters of preset batches on a preset trading day, wherein the errors between the trading periods of the multiple subject matters on the preset trading day are less than a preset error, and each trading period is earlier than the time of receiving the subject matter settlement instruction; For each subject matter of the preset batch, the transaction record of the subject matter within the preset trading day is obtained, and based on the transaction record, the transaction amount of the subject matter is settled to obtain the amount of the subject matter held by each user at the end of the preset trading day.
2. The method according to claim 1, characterized in that The transaction amount of the subject matter is settled based on the transaction record to obtain the amount of the subject matter held by each user at the end of the preset transaction day, including: For each user, according to the transaction record of the user for the subject matter, determine a first difference between the purchase amount and the sale amount of the subject matter by the user in the trading platform during the preset trading day; The first difference and the historical holding amount are added together as the holding amount of the subject matter by the user at the end of the preset trading day, and the historical holding amount is: the holding amount of the subject matter by the user at the end of the trading day before the preset trading day.
3. The method according to claim 1, characterized in that The method further comprises: Receive a fund settlement instruction, where the fund settlement instruction is used to instruct: to settle the deposits and withdrawals of the user on the trading platform within a preset natural day; Obtain the user's fund inflow and outflow records in the trading platform within the preset natural day; According to the fund inflow and outflow records, the deposits and withdrawals of users in the trading platform are settled to obtain the available amount of each user in the trading platform.
4. The method according to claim 3, characterized in that The method of clearing the deposits and withdrawals of users in the trading platform according to the fund inflow and outflow records to obtain the available amount of each user in the trading platform includes: Determine, based on each user's fund inflow and outflow records, a second difference between the user's transferred-in funds and transferred-out funds in the trading platform within the preset natural day; The second difference and the historical available amount are added together as the available amount of the user in the trading platform within the preset natural day, and the historical available amount is: the available amount of the user in the trading platform within the natural day before the preset natural day.
5. The method according to claim 3 or 4, characterized in that: The method further comprises: Receive a query instruction, wherein the query instruction is used to instruct: query the current total fund balance of the target user in the trading platform; Determine the current available amount based on the available amount of the target user in the trading platform in the previous natural day and the fund inflow and outflow records of the target user in the trading platform in the current natural day; For each subject matter held by the target user, the amount of the subject matter held by the target user at the end of the first trading day is obtained as the first holding amount, and the transaction amount of the subject matter by the target user on the second trading day is obtained as the first transaction amount, where the first trading day is the last trading day on which the settlement of the subject matter is completed, and the second trading day is the next trading day after the first trading day; The sum of the first held amount, the first transaction amount and the current available amount is taken as the total fund balance.
6. The method according to claim 5, characterized in that After receiving the query instruction, the method further includes: For each underlying asset held by the target user, if the first trading day is in a backtracking state, obtain the amount of the underlying asset held by the target user at the end of the third trading day as the second holding amount, and obtain the transaction amount of the underlying asset by the target user on the fourth trading day as the second transaction amount. The third trading day is the last trading day on which the settlement of the underlying asset is completed and is not in a backtracking state, and the fourth trading day is each trading day after the third trading day that has been opened for trading; The sum of the second held amount, the second transaction amount and the current available amount is taken as the total fund balance.
7. A transaction clearing device, characterized in that: The device comprises: A receiving module, configured to receive a subject matter settlement instruction, wherein the subject matter settlement instruction is used to instruct: settlement of transaction amounts of multiple subject matters of preset batches within a preset trading day, wherein the errors between the trading periods of the multiple subject matters on the preset trading day are less than a preset error, and each trading period is earlier than the receiving time of the subject matter settlement instruction; The clearing module is used to obtain the transaction record of each subject matter of the preset batch within the preset trading day, and to clear the transaction amount of the subject matter based on the transaction record to obtain the amount of the subject matter held by each user at the end of the preset trading day.
8. The device according to claim 7, characterized in that The clearing module is specifically used for: For each user, according to the transaction record of the user for the subject matter, determine a first difference between the purchase amount and the sale amount of the subject matter by the user in the trading platform during the preset trading day; Add the first difference and the historical holding amount as the amount of the subject matter held by the user at the end of the preset trading day, where the historical holding amount is: the amount of the subject matter held by the user at the end of the trading day before the preset trading day; And / or, the device further comprises: The receiving module is further used to receive a fund settlement instruction, wherein the fund settlement instruction is used to instruct: to settle the deposits and withdrawals of the user on the trading platform within a preset natural day; An acquisition module, used to acquire the user's fund inflow and outflow records in the trading platform within the preset natural day; The clearing module is further used to clear the deposits and withdrawals of users in the trading platform according to the fund deposit and withdrawal records, and obtain the available amount of each user in the trading platform; And / or, the clearing module is specifically used for: Determine, based on each user's fund inflow and outflow records, a second difference between the user's transferred-in funds and transferred-out funds in the trading platform within the preset natural day; Adding the second difference and the historical available amount as the available amount of the user in the trading platform within the preset natural day, the historical available amount is: the available amount of the user in the trading platform within the natural day before the preset natural day; And / or, the device further comprises: The receiving module is further used to receive a query instruction, wherein the query instruction is used to instruct: querying the total fund balance of the target user currently in the trading platform; A determination module, configured to determine the current available amount based on the available amount of the target user in the trading platform in the previous natural day and the fund inflow and outflow records of the target user in the trading platform in the current natural day; The acquisition module is further configured to acquire, for each subject matter held by the target user, the amount of the subject matter held by the target user at the end of the first trading day as a first holding amount, and acquire the transaction amount of the subject matter held by the target user on the second trading day as a first transaction amount, wherein the first trading day is the last trading day on which the settlement of the subject matter is completed, and the second trading day is the next trading day of the first trading day; a calculation module, configured to take the sum of the first held amount, the first transaction amount and the current available amount as the total fund balance; and / or, The acquisition module is further configured to, after receiving the query instruction, acquire, for each underlying asset held by the target user, the amount of the underlying asset held by the target user at the end of the third trading day as the second holding amount, and acquire the transaction amount of the underlying asset by the target user on the fourth trading day as the second transaction amount, for each underlying asset held by the target user, if the first trading day is in a backtracking state, wherein the third trading day is the last trading day on which the settlement of the underlying asset is completed and is not in a backtracking state, and the fourth trading day is each trading day after the third trading day on which trading has been opened; The calculation module is further used to take the sum of the second held amount, the second transaction amount and the current available amount as the total fund balance.
9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method according to any one of claims 1 to 6 when executing a program stored in a memory.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
