Resource exchange method, device, computer readable storage medium and computer equipment
By receiving resource exchange requests, calculating the amount of resources to be supplemented, and using resources in the resource exchange platform account to supplement, the problem of low resource exchange processing efficiency in the existing technology is solved, and more efficient resource exchange is achieved.
Patent Information
- Application Number
- CN201911403368.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-30
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2040-10-03
AI Technical Summary
In the existing resource exchange processing, resource exchange cannot be performed when there is insufficient exchange resources, resulting in low flexibility and processing efficiency of resource exchange.
By receiving resource exchange requests, determine the type and holding of the exchange resource, calculate the amount of resources to be replenished, and use the resources to be replenished in the resource exchange platform account and the resources to be replaced in the requesting account to achieve resource replenishment and exchange.
It improves the flexibility and processing efficiency of resource exchange, ensures that the exchange can be completed by supplementing resources when there is insufficient resources, and improves the fluency of resource interaction.
Smart Images

Figure CN111161073B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a resource exchange method, device, computer-readable storage medium and computer equipment. Background Art
[0002] With the development of computer technology, more and more resources are processed through the Internet, which has brought great convenience to people's lives. For example, people can make various transactions and payments through public payment platforms on the Internet (such as WeChat Pay), realizing resource transfer without carrying cash; for example, people can make various currency transactions through foreign exchange trading platforms, realizing resource exchange without going to physical business points for currency transactions.
[0003] However, in the current resource exchange process, when the swapped-out resources are insufficient, the resource exchange process cannot be performed, and the flexibility of the resource exchange is limited, which affects the processing efficiency of the resource exchange. Summary of the invention
[0004] Based on this, it is necessary to provide a resource exchange method, apparatus, computer-readable storage medium and computer device to address the current technical problem of low resource exchange processing efficiency.
[0005] A resource exchange method, comprising:
[0006] receiving a resource exchange request;
[0007] Determine the amount of swapped resources of the swapped resource type according to the resource exchange request;
[0008] Determine the resource holding amount of the resource to be exchanged in the account of the requester corresponding to the resource exchange request;
[0009] When the swapped-out resource holding amount is less than the swapped-out resource amount, determining the amount of resources to be supplemented according to the difference between the swapped-out resource amount and the swapped-out resource holding amount;
[0010] The swapped-in resources of the swapped-in resource type are exchanged according to the to-be-replenished resources of a quantity corresponding to the to-be-replenished amount of resources in the resource exchange platform account and the swapped-out resources in the requesting party account.
[0011] A resource exchange device, comprising:
[0012] An exchange request receiving module, used for receiving a resource exchange request;
[0013] A swap-out resource amount determination module, used to determine the swap-out resource amount of the swap-out resource type according to the resource exchange request;
[0014] A resource holding amount determination module, used to determine the swapped resource holding amount of the swapped resource in the requester account corresponding to the resource exchange request;
[0015] A supplementary resource determination module, configured to determine the amount of resources to be supplemented according to the difference between the amount of swapped resources and the amount of swapped resources held when the amount of swapped resources held is less than the amount of swapped resources;
[0016] The exchange module for incoming resources is used to exchange incoming resources of the type of incoming resources according to the to-be-replenished resources in the account of the resource exchange platform corresponding to the amount of the to-be-replenished resources and the exchanged-out resources in the account of the requesting party.
[0017] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the steps of the resource exchange method as described above.
[0018] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the resource exchange method as described above.
[0019] The above-mentioned resource exchange method, apparatus, computer-readable storage medium and computer equipment, when the swapped-out resource holding amount of the swapped-out resources in the requesting party account corresponding to the resource exchange request is less than the swapped-out resource amount determined according to the resource exchange request, determine the amount of resources to be replenished according to the difference between the swapped-out resource amount and the swapped-out resource holding amount, and exchange the swapped-in resources of the swapped-in resource type according to the to-be-replenished resources corresponding to the to-be-replenished amount in the resource exchange platform account and the swapped-out resources in the requesting party account. When the swapped-out resources in the requesting party account are insufficient, resource exchange can be realized after being supplemented by the to-be-replenished resources in the resource exchange platform account, thereby enhancing the flexibility of resource exchange and improving the processing efficiency of resource interaction. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 An application environment diagram of a resource exchange method in an embodiment;
[0021] Figure 2 A schematic diagram of a resource exchange method in one embodiment;
[0022] Figure 3 A schematic diagram of a process of exchanging resources in one embodiment;
[0023] Figure 4 A schematic diagram of a flow chart of supplementary cancellation in one embodiment;
[0024] Figure 5 This is a schematic diagram of the structure of a Class C account system in one embodiment;
[0025] Figure 6 A schematic diagram of the structure of a bank account system in one embodiment;
[0026] Figure 7 A schematic diagram of the structure of an account system for intermediary accounts in advance payment in one embodiment;
[0027] Figure 8 A schematic diagram of a process for creating a Class C account in one embodiment;
[0028] Fig. 9 A schematic diagram of a process of initiating foreign exchange purchase in an embodiment;
[0029] Fig.10 A schematic diagram of the process of foreign exchange purchase return in an embodiment;
[0030] Fig.11 This is a schematic diagram of the funds flow of the intermediary account for advance payment in one embodiment;
[0031] Fig.12 A schematic diagram of physical capital flow in one embodiment;
[0032] Fig.13 A schematic diagram of system funds flow in one embodiment;
[0033] Fig.14 A schematic diagram of a flow chart of an account balancing process in an embodiment;
[0034] Fig.15 This is a schematic diagram of the balance fund flow in one embodiment;
[0035] Fig.16 is a structural block diagram of a resource exchange device in an embodiment;
[0036] Fig.17 FIG. 4 is a structural block diagram of a computer device in one embodiment. DETAILED DESCRIPTION
[0037] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0038] Figure 1 FIG. 1 is an application environment diagram of a resource exchange method in an embodiment. (Example: Refer to Figure 1, the resource exchange method is applied to a foreign exchange trading system. The foreign exchange trading system includes a terminal 110, a foreign exchange trading platform server 120 and a bank server 130. The swapped-out resources and the swapped-in resources in the resource exchange request are currencies of different currencies. The terminal 110 sends a resource exchange request to the foreign exchange trading platform server 120. When the swapped-out resource holding amount of the swapped-out resources in the requester account corresponding to the received resource exchange request is less than the swapped-out resource amount determined according to the resource exchange request, the foreign exchange trading platform server 120 determines the amount of resources to be replenished according to the difference between the swapped-out resource amount and the swapped-out resource holding amount, and exchanges the swapped-in resources of the swapped-in resource type in the bank server 130 according to the amount of resources to be replenished corresponding to the amount of resources to be replenished in the resource exchange platform account and the swapped-out resources in the requester account. The terminal 110 and the foreign exchange trading platform server 120 are connected via a network, and the foreign exchange trading platform server 120 and the bank server 130 are connected via a network. In addition, the resource exchange method can also be applied to a game system, which includes a server to which a terminal is connected via a network, and the terminal sends a resource exchange request to the server to realize resource exchange, for example, it can be used to recharge virtual currency in the game, that is, to exchange the actual currency resources of the terminal for virtual currency resources in the game system. The terminal 110 can be a desktop terminal or a mobile terminal, and the mobile terminal can be at least one of a mobile phone, a tablet computer, a laptop computer, etc. The foreign exchange trading platform server 120 and the bank server 130 can be implemented as an independent server or a server cluster composed of multiple servers. )
[0039] like Figure 2 As shown, in one embodiment, a resource exchange method is provided. This embodiment mainly applies this method to the above Figure 1 The foreign exchange trading platform server 120 in FIG. Figure 2 , the resource exchange method specifically includes the following steps:
[0040] S202: Receive a resource exchange request.
[0041] Among them, resources are assets that can be exchanged for subject matter. Resources can be funds, electronic vouchers, shopping vouchers, virtual red envelopes, etc., and virtual red envelopes are virtual objects with certain fund numerical attributes. For example, funds can be exchanged for goods of equal value after a transaction. When applied to a foreign exchange trading system, resources are currencies of different currencies, and resource exchange is the exchange process between different resources, which can be specifically exchanged between currencies of different currencies. Through resource exchange, exchange between currencies of various currencies can be realized, and exchange can be realized, which is the process of exchanging account funds from a certain currency (such as RMB) to another currency (such as US dollars). A resource exchange request can be issued by an object that needs to perform resource exchange processing, such as terminal 110, to request resource exchange processing.
[0042] S204: Determine the amount of swapped-out resources of the swapped-out resource type according to the resource exchange request.
[0043] Among them, the resource type is a classification attribute of the resource, which is determined after classification according to the attribute of the resource itself. For example, when the resource is a currency, the resource type can be a currency, that is, the currency is divided according to different currencies to obtain the resource type corresponding to each currency. The swapped resource type is the resource type that needs to be swapped out in the resource exchange, the swapped resource is the resource that needs to be swapped out in the resource exchange, and the swapped resource amount is the amount of the resource that needs to be swapped out. For example, in foreign exchange transactions, if RMB needs to be exchanged into US dollars, the swapped resource type is RMB, and the swapped resource amount is the amount of RMB required to be spent when RMB is exchanged for US dollars. The swapped resource amount is related to the swapped resource type, swapped resource type and resource exchange amount involved in the resource exchange. In a specific application, the swapped resource type, swapped resource type and resource exchange amount can be determined according to the received resource exchange request. For example, when the resource exchange request includes fields corresponding to the swapped resource type, swapped resource type and resource exchange amount, the corresponding fields can be directly extracted from the resource exchange request to determine the swapped resource type, swapped resource type and resource exchange amount. Furthermore, exchange parameters are set between different resource types, and the exchange parameters between various resource types are different, and the exchange parameters can be fixed or dynamic. For example, in a foreign exchange transaction scenario, the exchange parameter between RMB and USD, that is, when the exchange rate is 6.8, it means that 680 RMB is needed to exchange 100 USD.
[0044] S206: Determine the resource holding amount of the resource to be exchanged in the account of the requesting party corresponding to the resource exchange request.
[0045] The requester account may be the corresponding account that issues the resource exchange request. The account holder may log in to the account and issue a resource exchange request to request resource exchange. The requester account may include the resources held by the account holder. By querying the resource holdings of the requester account, the swapped-out resource holdings of the swapped-out resources in the requester account may be determined. The resources in the requester account may include resources corresponding to various resource types, such as swapped-out resources corresponding to the swapped-out resource type or swapped-in resources corresponding to the swapped-in resource type. The swapped-out resource holdings are the number of swapped-out resources in the requester account, which represents the swapped-out resources currently owned in the requester account corresponding to the resource exchange request. The requester account is the account that is to exchange the swapped-out resources held in the account for the corresponding swapped-in resources. In a specific implementation, the requester account may include multiple sub-accounts, each of which corresponds to a resource type, so that the resources of various resource types in the requester account are managed by accounts.
[0046] In a specific application of foreign exchange transactions, the requester account includes requester sub-accounts corresponding to different currencies, such as RMB accounts, USD accounts, JPY accounts, etc. Each requester sub-account is associated with the requester account through currency, and the account holder can only perform corresponding foreign exchange transactions through the requester account.
[0047] S208: When the swapped-in resource holding amount is less than the swapped-in resource amount, the amount of resources to be supplemented is determined according to the difference between the swapped-in resource amount and the swapped-in resource holding amount.
[0048] After determining the amount of swapped out resources required for the resource exchange process, and obtaining the amount of swapped out resources held in the requester's account, compare the amount of swapped out resources held with the amount of swapped out resources held. When the amount of swapped out resources held is less than the amount of swapped out resources, it indicates that the number of swapped out resources held in the requester's account corresponding to the resource exchange request is insufficient to support this resource exchange. The amount of resources to be replenished is determined based on the difference between the amount of swapped out resources held in the requester's account and the amount of swapped out resources. Specifically, the difference between the amount of swapped out resources held and the amount of swapped out resources held can be directly taken. In a foreign exchange transaction scenario, when the resource exchange request is to convert RMB in the requester's account into US dollars, if the amount of RMB held in the requester's account is less than the amount of RMB required in this resource exchange process, the amount of resources to be replenished is determined based on the difference between the amount of RMB required in this resource exchange process and the amount of RMB held in the requester's account, that is, the RMB difference is determined.
[0049] In addition, if the amount of swapped-out resources held is not less than the amount of swapped-in resources, it indicates that the number of swapped-out resources held in the requester's account corresponding to the resource exchange request can support this resource exchange. Then the resource exchange is directly performed based on the swapped-out resources held in the requester's account in exchange for the swapped-in resources of the swapped-in resource type.
[0050] S210, exchanging incoming resources of the incoming resource type for the incoming resource type according to the to-be-replenished resources in the resource exchange platform account corresponding to the amount of the to-be-replenished resources and the swapped-out resources in the requester account.
[0051] Among them, the resource exchange platform account can be an account corresponding to the foreign exchange trading platform server 120, and the resource exchange platform account can include resource exchange platform sub-accounts corresponding to various resource types. The resources to be supplemented are loan resources provided by the resource exchange platform account to the requester account, so that when the swapped-out resources in the requester account are insufficient, the resources to be supplemented in the loan resource exchange platform account can be smoothly used to complete the resource exchange. After the resource exchange is successful, the resources to be supplemented are offset to realize the repayment of the loan resources. The exchanged-in resources are the resources requested to be exchanged in by the resource exchange request, such as the US dollars required to be traded in the foreign exchange transaction scenario. Specifically, after determining the amount of resources to be supplemented, the resources to be supplemented in the resource exchange platform account are determined, and the amount of resources to be supplemented is the amount of resources to be supplemented. The resources are exchanged according to the resources to be supplemented and the swapped-out resources in the requester account, so as to exchange the exchanged-in resources of the exchanged-in resource type, such as purchasing foreign exchange from a foreign exchange bank to obtain the currency corresponding to the required currency. By combining the resources to be supplemented in the resource exchange platform's account with the swapped resources in the requester's account, resource exchange can still be carried out smoothly when the number of swapped resources in the requester's account is insufficient, thereby improving the flexibility of resource exchange and the processing efficiency of resource interaction.
[0052] In the above-mentioned resource exchange method, when the swapped-out resource holding amount of the swapped-out resources in the requesting party account corresponding to the resource exchange request is less than the swapped-out resource amount determined according to the resource exchange request, the amount of resources to be replenished is determined according to the difference between the swapped-out resource amount and the swapped-out resource holding amount, and the swapped-in resources of the swapped-in resource type are exchanged according to the to-be-replenished resources corresponding to the to-be-replenished amount in the resource exchange platform account and the swapped-out resources in the requesting party account. When the swapped-out resources in the requesting party account are insufficient, resource exchange can be realized after being supplemented by the to-be-replenished resources in the resource exchange platform account, thereby enhancing the flexibility of resource exchange and improving the processing efficiency of resource interaction.
[0053] In one embodiment, determining the amount of resources swapped out of a swapped-out resource type based on a resource exchange request includes: determining the swapped-out resource type, swapped-in resource type, and resource exchange amount based on the resource exchange request; obtaining exchange parameters between the swapped-out resource type and the swapped-in resource type; and determining the amount of resources swapped out of the swapped-out resource type based on the resource exchange amount and the exchange parameters.
[0054] In this embodiment, the required amount of swapped-out resources corresponding to the exchange request is determined according to the swapped-out resource type, swapped-in resource type, resource exchange amount, and exchange parameters between the swapped-out resource type and the swapped-in resource type involved in the resource exchange.
[0055] Specifically, the type of swapped-out resources, the type of swapped-in resources, and the amount of resource exchange are determined according to the received resource exchange request. Among them, the type of swapped-out resources is the type of swapped-out resources that need to be swapped out in the resource exchange process requested, the type of swapped-in resources is the type of swapped-in resources that need to be exchanged for the swapped-out resources, and the amount of resource exchange can be the amount of swapped-in resources that need to be swapped in. For example, in a foreign exchange transaction application, user A sends a resource exchange request through terminal 110 to request to exchange RMB into US dollars, that is, to purchase foreign exchange through RMB, then the type of swapped-out resources is RMB, the type of swapped-in resources is US dollars, and the amount of resource exchange can be the amount of US dollars that need to be swapped in. In a specific application, the resource exchange request may include fields for the type of swapped-out resources, the type of swapped-in resources, and the amount of resource exchange, then the corresponding fields can be extracted from the resource exchange request and the type of swapped-out resources, the type of swapped-in resources, and the amount of resource exchange can be determined in this resource exchange process.
[0056] The exchange parameters between the swapped out resource type and the swapped in resource type are obtained. The exchange parameters represent the exchange ratio between the resource corresponding to the swapped out resource type and the resource corresponding to the swapped in resource type, such as the exchange rate in foreign exchange transactions, specifically the exchange rate between RMB and various currencies such as the US dollar and the Japanese yen, and the recharge exchange ratio in online games, specifically the exchange ratio between the recharged RMB and the virtual gold coins in the game. In the foreign exchange transaction scenario, the exchange parameter, that is, the exchange rate, changes dynamically according to the value attributes of each currency, and the exchange rate can be obtained from the foreign exchange bank. After obtaining the resource exchange amount and exchange parameter, the swapped out resource amount of the swapped out resource type is determined according to the resource exchange amount and the exchange parameter. The swapped out resource amount is the amount of swapped out resources required in this resource exchange process. For example, in a foreign exchange transaction, RMB needs to be exchanged for 100 US dollars, and the exchange rate is 6.9. The resource exchange amount is the amount of the swapped in resources, which is 100, and the exchange parameter, that is, the exchange rate is 6.9. The swapped out resource amount can be obtained according to the product of the resource exchange amount and the exchange parameter, that is, the amount of RMB required to be swapped out is 690.
[0057] In one embodiment, when the swapped-out resource holding amount is less than the swapped-out resource amount, determining the amount of resources to be replenished based on the difference between the swapped-out resource amount and the swapped-out resource holding amount includes: when the swapped-out resource holding amount is less than the swapped-out resource amount, determining the difference between the swapped-out resource amount and the swapped-out resource holding amount; determining the amount of resources to be replenished of the swapped-out resource type based on the difference and the preset floating resource amount.
[0058] In this embodiment, after obtaining the amount of swapped-out resources required for the resource exchange process and the amount of swapped-out resources held in the requesting party's account, the amount of swapped-out resources held is compared with the amount of swapped-in resources. If the amount of swapped-out resources held is less than the amount of swapped-out resources, it indicates that the number of swapped-out resources in the requesting party's account corresponding to the resource exchange request is insufficient and cannot be exchanged for the corresponding number of swapped-in resources. Then, the difference between the amount of swapped-out resources and the amount of swapped-in resources held is determined. Specifically, the difference can be obtained by subtracting the amount of swapped-out resources from the amount of swapped-out resources held. After obtaining the difference between the amount of swapped-out resources and the amount of swapped-out resources held, the amount of resources to be supplemented of the type of swapped-out resources is determined based on the difference. Specifically, the amount of resources to be supplemented of the type of swapped-out resources can be obtained by directly taking the difference, or the amount of resources to be supplemented of the type of swapped-out resources can be determined based on the difference and the preset floating resource amount. Among them, considering that the exchange parameters between the swapped-out resource type and the swapped-in resource type are dynamically changing, the corresponding swapped-out resource amount is also dynamically changing. By setting the floating resource amount to further adjust the difference between the swapped-out resource amount and the swapped-out resource holding amount, the amount of resources to be supplemented is obtained. The floating resource amount can be set according to the ratio of the difference between the swapped-out resource amount and the swapped-out resource holding amount. For example, it can be set to 0-5% of the difference, and the corresponding amount of resources to be supplemented is 100%-105% of the difference. When actually performing resource exchange, if the exchange parameters are increased, the amount of resources to be supplemented can still be used for resource exchange without re-determining the amount of resources to be supplemented, thereby improving the success rate of resource exchange and improving the processing efficiency of resource exchange.
[0059] In one embodiment, Figure 3 As shown, the step of exchanging the input resource, that is, exchanging the input resource of the input resource type according to the resources to be replenished in the resource exchange platform account corresponding to the amount of resources to be replenished and the swapped-out resources in the requester account, includes:
[0060] S302, determining the number of resources to be replenished in the account of the resource exchange platform corresponding to the amount of resources to be replenished.
[0061] In this embodiment, the swapped-out resources in the requester's account are supplemented through the resource exchange platform account, and the resource exchange is performed based on the supplemented swapped-out resources in the requester's account to obtain the swapped-out resources in the requester's account. Specifically, after determining the amount of resources to be supplemented, determine the amount of resources to be supplemented in the resource exchange platform account corresponding to the amount of resources to be supplemented. The resources to be supplemented are resources of the type of swapped-out resources in the resource exchange platform account. The resources to be supplemented are used to supplement the requester's account to ensure that the requester account corresponding to the resource exchange request can perform resource exchange.
[0062] S304: Update the amount of the swapped-out resources in the requester's account according to the resources to be replenished, and obtain the updated swapped-out resources in the requester's account.
[0063] After determining the resources to be replenished, the resources to be replenished are used to update the resource quantity of the swapped-out resources in the requester's account. Specifically, the resources to be replenished can be replenished to the requester's account, thereby updating the resource quantity of the swapped-out resources in the requester's account to obtain the updated swapped-out resources in the requester's account.
[0064] S306: Replace the swap-in resource of the swap-in resource type based on the updated swap-out resource.
[0065] After the resource quantity of the swapped-out resource in the requester's account is updated, the swapped-in resource of the swapped-in resource type is exchanged based on the updated swapped-out resource. For example, in a foreign exchange transaction scenario, if the resource exchange request requires the purchase of US dollars with RMB, and the amount of RMB in the requester's account corresponding to the resource exchange request is insufficient, the RMB in the resource exchange platform's account is used to supplement the requester's account, that is, the resource exchange platform's account is used to transfer RMB to the requester's account, so that the amount of RMB in the requester's account can purchase a corresponding amount of US dollars, thereby updating the amount of RMB in the requester's account, and then purchasing a corresponding amount of US dollars based on the updated RMB, and specifically purchasing the corresponding US dollars from a foreign exchange bank.
[0066] In one embodiment, exchanging the swapped-in resource for the swapped-in resource type based on the updated swapped-out resource includes: sending a resource exchange request to a resource exchange channel; the resource exchange request is used to instruct the resource exchange channel to perform resource exchange according to the resource exchange request; receiving the resource exchange result returned by the resource exchange channel; when the type of the resource exchange result is a successful resource exchange, obtaining the swapped-in resource of the swapped-in resource type by exchanging the updated swapped-out resource.
[0067] In this embodiment, resource exchange processing is performed through a resource exchange channel, and the swapped-in resource of the swapped-in resource type is obtained by exchanging the updated swapped-out resource according to the resource exchange result returned by the resource exchange channel. Specifically, after the resource amount of the requester's account is updated, the resource exchange request is sent to the resource exchange channel. The resource exchange channel is a channel for performing resource exchange processing. For example, the resource exchange channel in foreign exchange transactions can be a foreign exchange bank or a foreign exchange transaction service provider. The resource exchange request is sent to the resource exchange channel to instruct the resource exchange channel to perform resource exchange according to the resource exchange request. After the resource exchange channel performs resource exchange processing according to the resource exchange request, the resource exchange channel returns the resource exchange result to the server corresponding to the resource exchange platform party account, such as the foreign exchange transaction platform server in foreign exchange transactions. When the type of the resource exchange result is a successful resource exchange, it indicates that the resource exchange is successful, and the swapped-in resource of the swapped-in resource type is obtained by exchanging the updated swapped-out resource.
[0068] In the specific implementation, the updated swapped-out resources can be extracted from the requester's account, and the resource exchange request and the updated swapped-out resources can be sent to the resource exchange channel. The resource exchange request instructs the resource exchange channel to exchange the updated swapped-out resources for the corresponding swapped-in resources according to the resource exchange request, and returns the resource exchange result to the server corresponding to the resource exchange platform account. When the type of the resource exchange result is a successful resource exchange, the resource exchange result can include the swapped-in resources obtained, and the received swapped-in resources are transferred to the requester's account, thereby realizing the resource exchange of the requester's account.
[0069] In addition, the updated swapped-out resources in the requester's account can also be frozen, and the resource exchange request can be sent to the resource exchange channel to instruct the resource exchange channel to use the corresponding number of resources in the resource exchange platform account according to the resource exchange request, or use the corresponding number of resources in the resource exchange channel for resource exchange, and return the resource exchange result. When the type of resource exchange result is successful resource exchange, the resource exchange result can include the exchanged-in resources, and then the exchanged-in resources of the exchanged-in resource type are obtained by exchanging the updated swapped-out resources. Specifically, the updated swapped-out resources in the requester's account are transferred out, and the exchanged-in resources are transferred in, thereby realizing the resource exchange of the requester's account.
[0070] In one embodiment, after obtaining the updated swapped-out resources in the requester's account, it also includes: freezing the updated swapped-out resources in the requester's account; after receiving the resource exchange result returned by the resource exchange channel, it also includes: when the type of the resource exchange result is that the resource exchange is unsuccessful, unfreezing the updated swapped-out resources in the requester's account.
[0071] In this embodiment, the resources in the requester's account that need to be processed for resource exchange are frozen to prevent the resource changes from failing to achieve normal exchange. Specifically, after obtaining the updated swapped-out resources in the requester's account, the updated swapped-out resources in the requester's account are frozen, so that the updated swapped-out resources in the requester's account that need to be used for resource exchange cannot be processed in other ways, but only serve this resource exchange process. On the other hand, when the resource exchange is performed in the resource exchange channel and the type of resource exchange result returned is unsuccessful resource exchange, indicating that this resource exchange process has failed, the updated swapped-out resources in the requester's account are unfrozen, thereby releasing the updated swapped-out resources in the requester's account that need to be used for resource exchange, so that they can be processed in other ways, such as resource consumption, transfer, etc.
[0072] In one embodiment, it also includes: determining the actual amount of resources swapped out of the resource type according to the resource exchange result; obtaining the resource exchange difference amount according to the actual amount of resources swapped out and the amount of resources swapped out; and updating the resource amount of the resource exchange difference account corresponding to the resource exchange difference amount according to the resource exchange difference amount.
[0073] In this embodiment, in view of the dynamic change of exchange parameters between the swapped-out resource type and the swapped-in resource type, when the resource exchange process is actually performed, the actually swapped-out resources also change dynamically accordingly, and a resource exchange difference amount will be generated in the resource exchange, and the resource exchange difference amount can be managed through the corresponding resource exchange difference account.
[0074] Specifically, after obtaining the swapped-in resource of the swapped-in resource type, the actual swapped-out resource amount of the swapped-out resource type is determined according to the resource exchange result, and the actual swapped-out resource amount is the number of swapped-out resources actually exchanged in this resource exchange. The resource exchange difference amount is obtained according to the actual swapped-out resource amount and the swapped-out resource amount, and can be specifically obtained according to the difference between the actual swapped-out resource amount and the swapped-out resource amount. The resource amount of the resource exchange difference account corresponding to the resource exchange difference amount is updated according to the resource exchange difference amount. Among them, the resource exchange difference account is used to manage the resource exchange difference amount in each resource exchange process, and the resource exchange difference account can also include resource exchange difference sub-accounts corresponding to various resource types to manage resources of various resource types.
[0075] In the application scenario of foreign exchange transactions, the resource exchange difference reflects the gains and losses of the foreign exchange trading platform. For example, in a resource exchange, such as the purchase of 100 US dollars in RMB, if the exchanged resource amount determined by the exchange rate of 6.8 is 680 RMB, and the actual purchase cost is 670 RMB, then the actual exchanged resource amount is 10 RMB, that is, the foreign exchange trading platform's profit in this exchange is 10 RMB.
[0076] In one embodiment, Figure 4 As shown, it also includes the processing of supplementing and offsetting the resources to be supplemented in the account of the resource exchange platform, specifically including:
[0077] S402, obtaining a resource replenishment record of the resource exchange platform account according to the requester account, the type of swapped resources, and the amount of resources to be replenished.
[0078] In this embodiment, when resources are exchanged through the resources to be replenished in the resource exchange platform party account, a corresponding resource replenishment record is generated, and the resource replenishment record is used to perform replenishment and cancellation processing on the resource exchange platform party account to ensure the account balance of the resource exchange platform party account. Specifically, the resource replenishment record of the resource exchange platform party account is obtained according to the requesting party account, the type of resources swapped out, and the amount of resources to be replenished. The resource replenishment record is used to record the event of the resource exchange platform party account replenishing resources to each requesting party account, so as to perform subsequent replenishment and cancellation processing. In specific implementation, the resource replenishment record includes the requesting party account, the type of resources swapped out, and the amount of resources to be replenished, and may further include but is not limited to the resource replenishment time, the resource exchange serial number, the resource exchange order number, etc.
[0079] S404: When the resource replenishment record processing condition is met, the replenishment and cancellation resources in the requester's account are determined according to the resource replenishment record.
[0080] Monitor whether the resource replenishment record processing conditions are met. The resource replenishment record processing conditions can be set according to actual needs. For example, it can be set to determine the replenishment cancellation resources in the requester's account according to the resource replenishment record when no supplementary cancellation record corresponding to the resource replenishment record is detected, or when it is detected that the type of the supplementary cancellation record corresponding to the resource replenishment record is a supplementary cancellation failure. Specifically, the resources of the resource type swapped out corresponding to the amount of resources to be replenished can be determined from the requester's account as the supplementary cancellation resources.
[0081] S406, transferring the supplementary cancellation resources to the account of the resource exchange platform for supplementary cancellation, obtaining a supplementary cancellation record according to the supplementary cancellation result, and storing the supplementary cancellation record in the blockchain.
[0082] After determining the supplementary cancellation resources in the requester's account, supplementary cancellation is performed based on the supplementary cancellation resources, specifically transferring the supplementary cancellation resources to the resource exchange platform account for supplementary cancellation, and obtaining a supplementary cancellation record based on the supplementary cancellation result. For the resource exchange platform account, the resource replenishment record is a replenishment, and the supplementary cancellation record is a replenishment. The supplementary cancellation record corresponds to the resource replenishment record, thereby achieving a resource replenishment balance in the resource exchange platform account. Specifically, the supplementary cancellation record may include the requester account, the type of resources swapped out, and the amount of resources to be replenished, and may further include but is not limited to the supplementary cancellation time, the supplementary cancellation serial number, the supplementary cancellation order number, etc.
[0083] Optionally, the obtained supplementary cancellation record can also be stored in the blockchain. Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithm. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains information about a batch of network transactions, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Storing the supplementary cancellation record in the blockchain can prevent the supplementary cancellation record from being tampered with, thereby ensuring the security of the supplementary cancellation record. Correspondingly, in the specific implementation, the resource replenishment record corresponding to the supplementary cancellation record can also be uploaded to the chain and stored in the blockchain to ensure the security of the supplementary cancellation record and the resource replenishment record.
[0084] In one embodiment, when the resource replenishment record processing conditions are met, determining the supplementary cancellation resources in the requester's account based on the resource replenishment record includes: when no supplementary cancellation record corresponding to the resource replenishment record is detected, or when it is detected that the type of the supplementary cancellation record corresponding to the resource replenishment record is a supplementary cancellation failure, determining the amount of supplementary cancellation resources corresponding to the amount of resources to be replenished in the resource replenishment record; determining the supplementary cancellation resources in the requester's account based on the amount of supplementary cancellation resources; the supplementary cancellation resources are resources of the swapped-out resource type.
[0085] In this embodiment, when the resource replenishment record processing conditions are met and the resource replenishment record of the resource exchange platform account is triggered to be supplemented and cancelled, the corresponding resources are determined from the requesting party account according to the amount of resources to be supplemented in the resource replenishment record to obtain the supplemented and cancelled resources.
[0086] Specifically, when the supplementary cancellation record corresponding to the resource replenishment record is not detected, or when it is detected that the type of the supplementary cancellation record corresponding to the resource replenishment record is a supplementary cancellation failure, the supplementary cancellation resource amount corresponding to the amount of resources to be replenished in the resource replenishment record is determined. Among them, the supplementary cancellation record corresponds to the resource replenishment record, the resource replenishment record is the resource replenishment of the resource exchange platform party account, and the supplementary cancellation record is the resource replenishment of the resource exchange platform party account. The supplementary cancellation record corresponding to the resource replenishment record is not detected, indicating that the resource replenishment record has not been supplemented. The type of the cancellation record is a supplementary cancellation failure, indicating that the supplementary cancellation is unsuccessful and needs to be re-processed. The corresponding supplementary cancellation resource amount is determined according to the amount of resources to be replenished in the resource replenishment record, and the supplementary cancellation resource amount is the same as the amount of resources to be replenished. The supplementary cancellation resources in the requester's account are determined according to the supplementary cancellation resource amount. The supplementary cancellation resources are resources of the swapped-out resource type, that is, the resource type of the supplementary cancellation resources is the same as the resource type of the resources to be replenished, both of which are swapped-out resource types.
[0087] In one embodiment, it also includes: obtaining a resource replenishment record of the requesting party's account based on the type of swapped resources and the amount of resources to be replenished; when the resource replenishment record processing conditions are met, obtaining a supplementary cancellation record of the requesting party's account; the supplementary cancellation record is obtained by the requesting party's account transferring the supplementary cancellation resources corresponding to the resources to be replenished to the resource exchange platform account for supplementary cancellation; and obtaining the amount of supplementary resources to be cancelled of the requesting party's account based on the resource replenishment record and the supplementary cancellation record of the requesting party's account.
[0088] In this embodiment, the resource replenishment of the requesting party account is analyzed to determine the amount of replenished resources to be offset in the requesting party account, that is, the amount of resources that the requesting party account needs to be replenished and offset, so as to timely perform replenishment and offset processing and risk management on the requesting party account.
[0089] Specifically, the resource replenishment record of the requester's account is obtained according to the type of swapped out resources and the amount of resources to be replenished. The resource replenishment record corresponds to the requester's account. If the resource exchange platform account replenishes resources during the resource exchange request, the resource replenishment record of the requester's account is generated. In specific applications, the resource replenishment record can correspond to the resource replenishment record of the resource exchange platform account, that is, when the resource exchange platform account replenishes resources for the requester's account, the resource replenishment record of the requester's account and the resource replenishment record of the resource exchange platform account are generated. The resource replenishment record may include the type of swapped out resources and the amount of resources to be replenished, and may further include the resource replenishment time, the resource exchange serial number, the resource exchange order number, etc. Monitor whether the resource replenishment record processing conditions are met, such as setting the resource replenishment record processing periodically, and processing the resource replenishment record when the resource replenishment record processing cycle is reached, and obtain the replenishment cancellation record of the requester's account. The supplementary cancellation record is obtained after the requesting party account transfers the supplementary cancellation resources corresponding to the resources to be supplemented to the resource exchange platform account for supplementary cancellation. The supplementary cancellation record reflects the situation of supplementary cancellation of the resource exchange platform account in the resource exchange. After obtaining the resource replenishment record and supplementary cancellation record of the requesting party account, the amount of supplementary resources to be cancelled in the requesting party account is obtained according to the resource replenishment record and the supplementary cancellation record. The amount of supplementary resources to be cancelled reflects the amount of resources that need to be supplemented in the requesting party account. For example, in the application of foreign exchange trading scenarios, the amount of supplementary resources to be cancelled can be the amount of resources that still need to be supplemented and cancelled after the requesting party account has counted the resource replenishment record and the supplementary cancellation record. The resource exchange platform account can recover the amount of the requesting party account according to the amount of supplementary resources to be cancelled to achieve the settlement of the resource exchange platform account.
[0090] In one embodiment, the requester account includes requester sub-accounts corresponding to various resource types; the resource exchange platform account includes platform sub-accounts corresponding to various resource types.
[0091] In this embodiment, the requester account includes requester sub-accounts corresponding to various resource types, and each requester sub-account can correspond to the requester account through resource type, so that the requester account is classified and managed according to resource type. The resource exchange platform account includes platform sub-accounts corresponding to various resource types. Corresponding to the requester account, the resource exchange platform account is also associated with the platform sub-account through resource type to classify and manage resources of each resource type of the resource exchange platform account.
[0092] For example, in a foreign exchange trading application, if the resource type is currency, then both the requester account and the resource exchange platform account can be associated with sub-accounts of different currencies, thereby effectively classifying and managing currencies of various currencies.
[0093] In one embodiment, a resource exchange method is provided, and the resource exchange method is applied to a foreign exchange transaction scenario. Specifically, the resource exchange method can be applied to a foreign exchange platform. A foreign exchange platform refers to a system platform that provides foreign exchange services to customers; the customer is the object of the foreign exchange platform service, which can be an internal business party (such as cross-border acquiring or overseas games), or an external merchant (such as an import and export trade service provider). The customer's account balance represents the balance saved by the customer in the foreign exchange platform system, representing the liabilities of the foreign exchange platform. The resources involved in resource exchange are currencies, and the resource type corresponds to the currency of the currency. The resource exchange process realizes the purchase or exchange of foreign exchange, that is, it realizes the process of converting account funds from a certain currency (such as RMB) to another currency (such as US dollars).
[0094] For the exchange platform, accounts can be divided into liability accounts, asset accounts and intermediate accounts according to their attributes; among them, liability accounts, namely customer accounts, store the balance information of customers in the exchange platform system; for example, if a customer recharges 100 yuan in RMB in the exchange platform system, the balance of the customer's RMB account will increase by 100 yuan, and this 100 yuan will be recorded as the liability of the exchange platform; asset accounts, namely channel accounts, store the balance information of the exchange platform system on the channel side. Among them, channels are also called bank channels and downstream channels, which refer to the downstream service providers connected to the exchange platform. Channels are usually banks (such as Citibank) or foreign exchange trading service providers (such as Airwallex). The account balance of the channel represents the deposit balance of the exchange platform as the main body stored in each downstream channel, representing the assets of the exchange platform. For example, if the RMB 100 startup capital held by the exchange platform is stored in Citibank, the RMB balance of Citibank will increase by RMB 100, and this RMB 100 will be recorded as the asset of the exchange platform; the intermediate account, namely the advance payment intermediate account, stores the flow information of the customer's advance payment "borrowing money" and balance "repaying money" and the balance of outstanding debts. In this embodiment, the above three accounts are named C account (liability account), bank account (asset account), and advance payment intermediate account (intermediate category), among which the customer opens a C account and the downstream channel opens a bank account. The exchange platform has several types of accounts as shown in Table 1 below.
[0095]
[0096]
[0097] Table 1
[0098] Among them, the income account and the floating loss account are both C accounts, which are also accounts of the exchange platform, used to record the fixed income and floating profit and loss when the exchange platform provides exchange services to customers. In specific applications, there can be multiple banks and customers in the exchange platform (determined by the number of banks and customers connected to the system), only one fixed income account, only one floating loss account, and only one intermediary account for advance payment. In addition, there can be a fixed income account for each currency, or a fixed income account for each bank. Each account can open sub-accounts in multiple currencies, and each currency is recorded separately. The account opened by the exchange platform in the bank is called a physical account, the balance in the account is called physical funds, and the change in the balance of the account is called physical fund flow; while the account recorded in the exchange platform system is called a system account, the balance in the account is called system funds, and the change in the balance of the account is called system fund flow; for bank accounts, the physical fund flow corresponds to the system fund flow. For example, if the balance of the exchange platform's escrow account at Citibank increases by 100 yuan, the balance of the Citibank account recorded in the system also increases by 100 yuan.
[0099] In this embodiment, the requester account is account C, the resource exchange platform account may include a funding intermediary account; the account type corresponding to the resource exchange channel is a bank account; the resource exchange difference account may include an income account and a floating loss account. The account in the exchange platform is used to record the balance of the customer in the system, and the key information of the account balance table corresponding to the account can be shown in Table 2 below.
[0100] Field Name Field Type illustrate Example acno String Customer / channel system account 1000001156 currency String Currency CNY num number Balance 100.00 modify_time Time format Balance update time 2000-01-01 00:00:00
[0101] Table 2
[0102] In this embodiment, the currency exchange platform can create sub-accounts for various accounts, and the sub-accounts are system accounts of multiple currencies, and each system account as a sub-account is associated with a corresponding account, so that the account holder, such as a customer, does not have to record the specific account numbers of multiple currencies. Specifically, this is achieved by establishing an association relationship between the account and the system account.
[0103] For example, a customer M is assigned a customer external number spid. The customer logs in and queries the account balance information in the exchange platform through spid. A customer internal number uid is created for each spid. The uid is invisible to the customer. An association table is used, such as the key information of the customer account association table shown in Table 3 below, to manage the association between the customer and each currency account.
[0104] Field Name Field Type illustrate Example spid String Customer External Number Jingdong001 uid String Customer Internal Number 1000001 currency String Currency CNY acno String System Account 1000001156
[0105] Table 3
[0106] Similarly, for the channel accounts, that is, for the foreign exchange bank accounts, a channel bank number bank_type can be assigned to each channel bank. Bank_type is used to distinguish banks for account management. For each bank_type, a bank internal number uid is created. The uid is not visible to the outside. A channel bank association table is used to manage the association between the channel bank and each currency account. The following Table 4 shows the key information of the channel bank account association table.
[0107] Field Name Field Type illustrate Example bank_type String External ID of the bank channel 4598 uid String Internal number of the bank channel 0004598 currency String Currency CNY acno String System Account 4598156
[0108] Table 4
[0109] Similarly, for the accounts of the intermediary accounts, a number loan_type can be assigned to the intermediary accounts. Finance uses loan_type to identify the intermediary accounts and manage accounts. Each loan_type creates an internal number uid for the intermediary accounts. The uid is not visible to the outside world. A relationship table for intermediary accounts is used to manage the relationship between the intermediary accounts and accounts in various currencies. The key information of the relationship table for intermediary accounts is shown in Table 5 below.
[0110] Field Name Field Type illustrate Example loan_type String External number of the intermediary account for advance payment 9999 uid String Internal number of the intermediary account for advance payment 0009999 currency String Currency CNY acno String System Account 9999156
[0111] Table 5
[0112] In this embodiment, the overall account system in the exchange platform is divided into a Class C account system, a bank account system, and a funding intermediary account system. Figure 5 As shown in Figure 1, Class C accounts include external customers and platform revenue accounts (revenue accounts can be considered internal customers). Each customer can open multiple currency accounts, and the customer number and system account number are associated through key elements such as currency. Figure 5 Merchant M corresponds to spid-uid, and uid corresponds to acno_11, acno_12, ... acno_1n, where the currency of acno_11 is CNY, the currency of acno_12 is HKD, and the currency of acno_1n is cur_n.
[0113] Bank account system Figure 6 As shown in the figure, bank accounts are downstream channel accounts. Each channel can also open multiple currency accounts, and the bank number and system account number are associated through key elements such as currency. Figure 6 Bank B corresponds to bankType-uid, and uid corresponds to acno_21, acno_22, ... acno_2n, where the currency of acno_21 is CNY, the currency of acno_22 is HKD, and the currency of acno_2n is cur_n.
[0114] The account system of intermediary account for advance payment is as follows: Figure 7 As shown in the figure, the intermediary account can also open multiple currency accounts, and the intermediary account number and system account number are associated with each other through key elements such as currency. Figure 7 The intermediate account for middle-level funding corresponds to loanType-uid, and uid corresponds to acno_31, acno_32,...acno_3n, among which the currency of acno_31 is CNY, the currency of acno_32 is HKD, and the currency of acno_3n is cur_n.
[0115] In this embodiment, account creation also distinguishes between Class C accounts, bank accounts, and intermediary accounts for advance payment. Among them, the process of creating a Class C account is as follows: Figure 8 As shown, the steps include:
[0116] S802, generating an external number spid for client M;
[0117] S804, generate customer internal number uid;
[0118] S806, query the customer account association table; determine whether the customer's system account with the same currency already exists, if so, execute S812; if not, execute S808.
[0119] S808, generating a system account acno;
[0120] S810, record the C-type account association table;
[0121] S812, query the Class C balance account table; determine whether the system account acno already exists, if so, execute S816; if not, execute S814;
[0122] S814, write into the Class C balance account table;
[0123] S816, obtain the system account of customer M.
[0124] The corresponding relationship between the external number spid, the internal number uid and the system account acno is as follows: Figure 5 As shown in Table 2, the customer account association table is used to record the correspondence between the external number spid, the internal number uid and the system account acno. The Class C balance account table is used to record the balance information of the account, and its key information is shown in Table 2. When querying the customer account association table, if there is no system account of the corresponding currency, a new system account acno is generated and recorded in the Class C account association table. The Class C account association table records the association between various Class C accounts and the corresponding system accounts. Query the Class C balance account table to determine whether the system account acno has been successfully written. If so, the newly created system account of customer M is obtained. Otherwise, the system account acno is written into the Class C account association table to obtain the newly created system account of customer M.
[0125] The process of creating bank accounts and intermediary accounts for advance payment is similar to the process of creating Class C accounts. The corresponding creation objects are replaced accordingly to create bank accounts and intermediary accounts for advance payment. In this embodiment, each customer can open multiple currency accounts on the exchange platform to record the balance information of each currency of the customer, which can provide the most basic underlying account system for the exchange platform to access customers and downstream channels. By using this set of account systems, the exchange platform can access multiple customers and downstream channels with unlimited quantity; at the same time, different currency accounts can be flexibly created for customers and channels according to the actual needs of customers and the actual support capabilities of channels. In addition, it can also support multi-currency collection and payment services, bringing more application prospects for business expansion.
[0126] In this embodiment, after the exchange platform accepts the merchant's request and completes the exchange, it is necessary to conduct system fund settlement. Fund settlement refers to the process of fund delivery by the transfer of account balances among the related parties involved in foreign exchange transactions within the exchange platform. In the fund settlement process, it is necessary to strictly comply with the basic principle of accounting that "there must be a loan if there is a debit, and the loan must be equal". Specifically, the exchange platform accepts customer requests, that is, receives resource exchange requests, and the customer specifies the buy and sell currencies and the amount of foreign currency purchased; the exchange platform quotes the customer based on the market benchmark price + fixed markup, and calculates the amount of local currency payable by the customer, that is, the amount of resources exchanged for the type of resources exchanged, and freezes the customer's local currency funds; if the customer's account balance is insufficient, the advance payment intermediary account will first advance funds to "borrow money" to the customer, that is, when the amount of resources exchanged in the requester's account corresponding to the resource exchange request is less than the amount of resources exchanged, the amount of resources to be supplemented is determined according to the difference between the amount of resources exchanged and the amount of resources exchanged, and the amount of resources to be supplemented in the resource exchange platform account corresponding to the amount of resources to be supplemented is supplemented to the requester's account, and then the customer's local currency funds are frozen. Among them, the benchmark exchange rate refers to a cost exchange rate estimated by the exchange rate platform when receiving the customer's exchange request; fixed income refers to the income brought by the exchange rate markup or handling fee charged by the exchange rate platform to the customer during the exchange process; floating profit and loss is also called floating loss, which is the floating profit or loss caused by the difference between the actual transaction price of the downstream channel and the platform's benchmark price due to exchange rate fluctuations; advance funding is when the customer's account balance on the exchange rate platform is insufficient, the exchange rate platform uses its own funds to trade for the customer. At this time, it is equivalent to the customer generating a loan at the exchange rate platform; the advance funding intermediary account is a type of system account. When the customer's balance is insufficient and advance funding is needed, money is withdrawn from the advance funding intermediary account and money is deposited into the customer's account.
[0127] The exchange platform submits a request to the downstream channel bank, which includes the purchase and sale of currencies and the amount of foreign currency purchased. The channel bank returns the purchase result, which includes the actual transaction exchange rate and the actual deduction amount in local currency. The exchange platform calculates the fixed income and floating profit and loss based on the quotation amount given to the customer, the system benchmark price, and the actual transaction amount of the channel, as shown in formulas (1) to (4).
[0128] Fixed income (local currency) = Quoted amount to customers - System benchmark price calculation amount (1)
[0129] Floating profit and loss (local currency) = actual transaction amount of the channel - amount calculated by the system benchmark price Formula (2) Where,
[0130] The amount quoted to the customer = the purchase amount specified by the customer * the exchange rate quoted to the customer (3)
[0131] System base price calculation amount = customer specified purchase amount * system base exchange rate formula (4)
[0132] Then, according to the above calculated amount, the amount between each account is transferred to realize the currency exchange process.
[0133] Among them, the process in which the foreign exchange exchange platform accepts customer requests, makes quotations and freezes local currency funds is called foreign exchange purchase initiation; the process in which the foreign exchange exchange platform calculates fixed income and floating profit and loss based on the foreign exchange purchase results returned by the channel bank is called foreign exchange purchase return. Fig. 9 The process initiated for foreign exchange purchases, Fig.10 This is the processing flow for the return of foreign exchange purchases.
[0134] Specifically, take the case where a customer initiates a CNY->USD purchase request (i.e., the customer requests to exchange CNY into USD, and the same is true for other currencies) as an example. At the stage where the customer initiates the purchase request, it is assumed that the customer request and market benchmark exchange rate parameters are as shown in Table 6 below.
[0135]
[0136] Table 6
[0137] After the markup calculation, the customer needs to freeze CNY¥690. If the customer's balance is insufficient, the customer needs to "borrow" ¥690 from the intermediary account. The funds flow is as follows: Fig.11 As shown in the figure, the intermediary has advanced RMB 690 to the customer account corresponding to Merchant C, and frozen the local currency funds in the customer account corresponding to Merchant C. Among them, the initiation stage of foreign exchange purchase does not involve physical bank account changes, so there is only system fund flow, no physical fund flow, that is, it does not involve the payment of foreign exchange between the exchange platform and the bank. Payment of foreign exchange refers to the process of paying funds to another bank account by transfer.
[0138] During the foreign exchange purchase and re-guidance stage, the actual transaction results are shown in Table 7.
[0139]
[0140] Table 7
[0141] Since the actual transaction exchange rate is different from the exchange rate when the purchase is initiated, the actual transaction amount is inconsistent with the benchmark amount, which will result in floating gains and losses. At the same time, when the customer initiates the purchase, the exchange platform will add a markup to the exchange rate for the customer, which will also generate fixed income. The final capital flow is as follows: Fig.12 and Fig.13 As shown, Fig.12 For physical capital flow, the bank purchases foreign exchange in the foreign exchange market, using 675 RMB to buy 100 USD. Fig.13For the system fund flow, unfreeze RMB 690 in the customer account of merchant C, and transfer RMB 690 to the fixed income account, the foreign exchange purchase bank account and the profit and loss account respectively. At the same time, transfer USD 100 to the corresponding customer account of merchant C through the foreign exchange purchase bank account. In the physical fund flow, after Citibank completes the foreign exchange purchase, it will record a deduction of CNY 675 and an increase of USD 100 in the physical account of the exchange platform. In the system fund flow, the changes in Citibank system accounts correspond to the changes in physical accounts, and there is also a settlement between customer C's account and the income account.
[0142] In this embodiment, when the customer's balance is insufficient, the advance payment intermediary account needs to "lend money" to the customer, so it is necessary to record the advance payment arrears of each customer; finally, the money borrowed by the customer from the advance payment intermediary account needs to be returned, so a settlement process is also required. Among them, settlement refers to when the customer replenishes the account balance through recharge and other methods, the system initiates the settlement, which is equivalent to the customer "repaying the money" to the exchange platform. Specifically, an account flow sheet is used to record each fund operation of each account. The flow sheet records the key elements of the transaction parties' accounts, currencies, amounts, transaction types, transaction times, etc. of this fund operation, as shown in Table 8 below.
[0143]
[0144]
[0145] Table 8
[0146] By checking the account flow, specifying the transaction account number and transaction type, you can know the details of each customer's advance payment arrears.
[0147] When performing the account balancing process, query the transaction flow of the advance payment intermediary account, and filter out the transaction flow with the advance payment type; process each advance payment transaction flow in turn. Specifically, parse the transaction flow to obtain key information such as the account number, currency, amount, transaction order number, etc. of the two parties to the transaction; query the account balancing record table. If the account balancing record table does not exist or the account balancing fails, and the customer account balance is sufficient, then clear the funds and transfer the customer account funds to the advance payment intermediary account (i.e. repay the money), and update the account balancing record status to success; if the customer balance is insufficient, then record the account balancing record status as failure. Among them, the key information of the account balancing record table is shown in Table 9 below. The account balancing record table includes information such as the transaction flow number, transaction order number, balance account number, counterparty account number, currency, amount, status, and record creation time.
[0148]
[0149] Table 9
[0150] The process of account balance processing is as follows Fig.14Query the account flow of the advance payment intermediary account, parse the flow, obtain the transaction number, the account numbers of both parties, the currency and the amount, and query the balance record table. If the balance record exists, determine whether it is written successfully. If so, proceed to the next process analysis. If the balance record does not exist, write the balance record into the balance record table to determine whether the customer account balance is greater than or equal to the advance payment amount. If so, balance the advance payment, update the balance record table to success, and then proceed to the next process analysis until all the flow records are balanced. Fig.15 As shown, Merchant C's RMB account repays RMB 690 to the RMB account of the intermediary account, thereby settling the loan.
[0151] In this embodiment, the customer advance payment and account settlement process are recorded in the flow, which also records the details of each advance payment and account settlement. In addition, a supporting accounting program is also required to count the customer's daily arrears to facilitate relevant personnel to collect payments from customers. Specifically, the arrears include the customer's beginning arrears balance, the customer's current arrears amount, and the customer's ending arrears balance. Specifically, it can be managed by establishing a customer advance payment accounting table, which can include the amount of supplementary resources to be offset. Specifically, the key information of the customer advance payment accounting table is shown in Table 10 below.
[0152] Field Name Field Type illustrate Example account_calc_date Date Format Accounting date 2000-01-01 spid String Customer Number 1000001 currency String Currency CNY acno String Customer balance account 1000001156 begin_balance number Beginning balance 100 trade_num number Amount of current outstanding debt 50 end_balance number Ending balance 150
[0153] Table 10
[0154] Among them, the balance of outstanding balance at the beginning of the period = the balance of outstanding balance at the end of the period yesterday, and the balance of outstanding balance at the end of the period = the balance of outstanding balance at the beginning of the period + the amount of outstanding balance in the current period. The amount of outstanding balance in the current period is calculated by counting the advance payment flow and the balance flow of the customer in the currency, specifically:
[0155]
[0156] Through the calculation results, we can know the outstanding balance of each customer in each currency, so as to collect the payment from the customer. In specific applications, we can also increase the handling fee and interest of the outstanding balance.
[0157] In this embodiment, customers are allowed to submit transaction requests when their account balance is insufficient, and the exchange platform uses its own funds to advance funds for customers. At the same time, in the process of advance funding transactions, the double-entry bookkeeping method in accounting is used to clear funds, ensuring the clarity and verifiability of the system account fund flow, and ensuring the safety of account funds. At the same time, the matching account balance processing is carried out according to the customer's current debt and account balance. In addition, the customer's current debt is calculated through the customer advance funding accounting table, providing a basis for collection, thereby carrying out effective risk control. In addition, the resource exchange method of this embodiment can also be applied to the remittance process. Specifically, different transaction types can be distinguished in the account flow to distinguish different types of advance funding, and then different fees and interest rates can be used to improve the processing of resource exchange and improve the efficiency of resource exchange processing.
[0158] Figure 2 , Figure 3 , Figure 4 , Figure 8 , Fig. 9 , Fig.10 and Fig.14 FIG. 1 is a flow chart of a resource exchange method in some embodiments. It should be understood that although Figure 2 , Figure 3 , Figure 4 , Figure 8 , Fig. 9 , Fig.10 and Fig.14 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2 , Figure 3 , Figure 4 , Figure 8 , Fig. 9 , Fig.10 and Fig.14 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0159] like Fig.16 As shown, in one embodiment, a resource exchange device 1600 is provided, including:
[0160] The exchange request receiving module 1602 is used to receive a resource exchange request;
[0161] A swap-out resource amount determination module 1604, configured to determine a swap-out resource amount of a swap-out resource type according to a resource exchange request;
[0162] The resource holding amount determination module 1606 is used to determine the swapped resource holding amount of the swapped resource in the requester account corresponding to the resource exchange request;
[0163] A supplementary resource determination module 1608, configured to determine the amount of resources to be supplemented according to the difference between the amount of swapped-in resources and the amount of swapped-in resources held when the amount of swapped-in resources held is less than the amount of swapped-in resources;
[0164] The incoming resource exchange module 1610 is used to exchange incoming resources of the incoming resource type according to the to-be-replenished resources in the resource exchange platform account corresponding to the amount of the to-be-replenished resources and the swapped-out resources in the requester account.
[0165] In one embodiment, the resource quantity determination module 1604 includes: an exchange request analysis module, which is used to determine the resource type to be swapped out, the resource type to be swapped in, and the resource exchange quantity according to the resource exchange request; an exchange parameter determination module, which is used to obtain the exchange parameters between the resource type to be swapped out and the resource type to be swapped in; and a resource quantity acquisition module, which is used to determine the resource quantity to be swapped out of the resource type to be swapped out according to the resource exchange quantity and the exchange parameters.
[0166] In one embodiment, the supplementary resource determination module 1608 includes a difference determination module and a to-be-supplemented resource quantity determination module; wherein: the difference determination module is used to determine the difference between the swapped-out resource quantity and the swapped-out resource holding quantity when the swapped-out resource holding quantity is less than the swapped-out resource quantity; the to-be-supplemented resource quantity determination module is used to determine the to-be-supplemented resource quantity of the swapped-out resource type based on the difference and the preset floating resource quantity.
[0167] In one embodiment, the swap-in resource exchange module 1610 includes a to-be-replenished resource determination module, a swap-out resource update module and a resource exchange module; wherein: the to-be-replenished resource determination module is used to determine the to-be-replenished resources in the resource exchange platform account corresponding to the amount of to-be-replenished resources; the swap-out resource update module is used to update the amount of swap-out resources in the requesting party account according to the to-be-replenished resources, and obtain the updated swap-out resources in the requesting party account; the resource exchange module is used to exchange the swap-in resources of the swap-in resource type based on the updated swap-out resources.
[0168] In one embodiment, the resource exchange module includes an exchange request forwarding module, an exchange result receiving module and an update resource processing module; wherein: the exchange request forwarding module is used to send the resource exchange request to the resource exchange channel; the resource exchange request is used to instruct the resource exchange channel to perform resource exchange according to the resource exchange request; the exchange result receiving module is used to receive the resource exchange result returned by the resource exchange channel; the update resource processing module is used to obtain the incoming resource of the incoming resource type through the updated outgoing resource exchange when the type of the resource exchange result is a successful resource exchange.
[0169] In one embodiment, it also includes a swapped resource freezing module and a swapped resource thawing module; wherein: the swapped resource freezing module is used to freeze the updated swapped resources in the requester's account; the swapped resource thawing module is used to thaw the updated swapped resources in the requester's account when the type of resource exchange result is unsuccessful resource exchange.
[0170] In one embodiment, it also includes an actual swapped-out resource determination module, an exchange difference amount determination module and an exchange difference account update module; wherein: the actual swapped-out resource determination module is used to determine the actual swapped-out resource amount of the swapped-out resource type according to the resource exchange result; the exchange difference amount determination module is used to obtain the resource exchange difference amount according to the actual swapped-out resource amount and the swapped-out resource amount; the exchange difference account update module is used to update the resource amount of the resource exchange difference account corresponding to the resource exchange difference amount according to the resource exchange difference amount.
[0171] In one embodiment, it also includes a resource replenishment record acquisition module, a supplementary cancellation resource determination module and a supplementary cancellation processing module; wherein: the resource replenishment record acquisition module is used to obtain the resource replenishment record of the resource exchange platform account according to the requesting party account, the type of swapped resources and the amount of resources to be replenished; the supplementary cancellation resource determination module is used to determine the supplementary cancellation resources in the requesting party account according to the resource replenishment record when the resource replenishment record processing conditions are met; the supplementary cancellation processing module is used to transfer the supplementary cancellation resources to the resource exchange platform account for supplementary cancellation, and obtain the supplementary cancellation record according to the supplementary cancellation result.
[0172] In one embodiment, the supplementary cancellation resource determination module includes a supplementary cancellation resource quantity determination module and a supplementary cancellation resource quantity processing module; wherein: the supplementary cancellation resource quantity determination module is used to determine the supplementary cancellation resource quantity corresponding to the resource quantity to be supplemented in the resource supplement-out record when the supplementary cancellation record corresponding to the resource supplement-out record is not detected, or the type of the supplementary cancellation record corresponding to the resource supplement-out record is detected as supplementary cancellation failure; the supplementary cancellation resource quantity processing module is used to determine the supplementary cancellation resources in the requester's account according to the supplementary cancellation resource quantity; the supplementary cancellation resources are resources of the swapped-out resource type.
[0173] In one embodiment, it also includes a resource replenishment record acquisition module, a supplementary cancellation record acquisition module and a supplementary resource amount determination module; wherein: the resource replenishment record acquisition module is used to obtain the resource replenishment record of the requesting party account according to the type of swapped resources and the amount of resources to be replenished; the supplementary cancellation record acquisition module is used to obtain the supplementary cancellation record of the requesting party account when the resource replenishment record processing conditions are met; the supplementary cancellation record is obtained by the requesting party account transferring the supplementary cancellation resources corresponding to the resources to be replenished to the resource exchange platform account for supplementary cancellation; the supplementary resource amount determination module is used to obtain the supplementary resource amount to be cancelled of the requesting party account according to the resource replenishment record and the supplementary cancellation record of the requesting party account.
[0174] In one embodiment, the requester account includes requester sub-accounts corresponding to various resource types; the resource exchange platform account includes platform sub-accounts corresponding to various resource types.
[0175] Fig.17 The internal structure diagram of a computer device in one embodiment is shown. The computer device may specifically be Figure 1 The foreign exchange trading platform server 120. Fig.17 As shown, the computer device includes a processor, a memory, a network interface, an input device and a display screen connected through a system bus. Among them, the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program, which, when executed by the processor, enables the processor to implement a resource exchange method. The internal memory may also store a computer program, which, when executed by the processor, enables the processor to execute a resource exchange method. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covering the display screen, or a button, trackball or touchpad provided on the housing of the computer device, or an external keyboard, touchpad or mouse, etc.
[0176] Those skilled in the art will understand that Fig.17 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0177] In one embodiment, the resource exchange device provided by the present application can be implemented in the form of a computer program. The computer program can be Fig.17 The computer device shown in the figure is run. The memory of the computer device can store various program modules constituting the resource exchange device, for example, Fig.16 The illustrated exchange request receiving module 1602, the swap-out resource quantity determination module 1604, the resource holding quantity determination module 1606, the supplementary resource determination module 1608 and the swap-in resource exchange module 1610. The computer program composed of each program module enables the processor to execute the steps of the resource exchange method of each embodiment of the present application described in this specification.
[0178] For example, Fig.17 The computer device shown can be Fig.16 The exchange request receiving module 1602 in the resource exchange device shown receives the resource exchange request. The computer device can determine the amount of swapped out resources of the swapped out resource type according to the resource exchange request through the swapped out resource amount determination module 1604. The computer device can determine the swapped out resource holding amount of the swapped out resources in the requester account corresponding to the resource exchange request through the resource holding amount determination module 1606. The computer device can determine the amount of resources to be supplemented according to the difference between the swapped out resource amount and the swapped out resource holding amount when the swapped out resource holding amount is less than the swapped out resource amount through the supplementary resource determination module 1608. The computer device can exchange the swapped in resource type according to the amount of resources to be supplemented in the resource exchange platform account corresponding to the amount of resources to be supplemented and the swapped out resources in the requester account through the swapped in resource exchange module 1610.
[0179] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the resource exchange method described above. The steps of the resource exchange method here may be the steps of the resource exchange method described in each of the above embodiments.
[0180] In one embodiment, a computer-readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the processor executes the steps of the resource exchange method described above. The steps of the resource exchange method here may be the steps of the resource exchange method described in each of the above embodiments.
[0181] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0182] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0183] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A resource exchange method, characterized in that: Applied to a currency exchange platform, the method includes: receiving a resource exchange request; Determine the amount of the swapped resource type according to the resource exchange request, the exchange parameters between the swapped resource type and the swapped resource type, and the markup points for the exchange parameters; the swapped resource type and the swapped resource type include different currencies for monetary resources; Determine the amount of resources to be exchanged in the account of the requester corresponding to the resource exchange request, wherein the resources to be exchanged include monetary resources to be exchanged; When the swapped-out resource holding amount is less than the swapped-out resource amount, the amount of resources to be supplemented is determined according to the difference between the swapped-out resource amount and the swapped-out resource holding amount and the floating resource amount; the floating resource amount is determined in proportion to the difference; According to the to-be-replenished resources of the to-be-replenished amount corresponding to the to-be-replenished amount in the resource exchange platform account and the swapped-out resources in the requester account, exchanging the swapped-in resources of the swapped-in resource type through the resource exchange channel, and obtaining the resource exchange result returned by the resource exchange channel; the swapped-in resources include currency resources of a different currency from the swapped-out resources; When the resource exchange result is a successful resource exchange, determining an actual amount of resources swapped out of the resource type according to the resource exchange result; Obtaining a resource exchange difference amount according to the actual swapped-out resource amount and the swapped-out resource amount; The resource amount of the resource exchange difference account corresponding to the resource exchange difference amount is updated according to the resource exchange difference amount.
2. The method according to claim 1, characterized in that The determining, according to the resource exchange request, the exchange parameters between the exchanged resource type and the exchanged resource type, and the markup points for the exchange parameters, the amount of the exchanged resource of the exchanged resource type comprises: Determine the resource type to be swapped out, the resource type to be swapped in, and the resource exchange amount according to the resource exchange request; Acquire the exchange parameters between the exchanged-out resource type and the exchanged-in resource type and the markup points for the exchange parameters; The amount of resources to be exchanged out of the resource type is determined according to the resource exchange amount, the exchange parameter and the markup points.
3. The method according to claim 1, characterized in that The method further comprises: When the swap-out resource holding amount is less than the swap-out resource amount, a difference between the swap-out resource amount and the swap-out resource holding amount is determined.
4. The method according to claim 1, characterized in that: The exchanging of the incoming resources of the incoming resource type through the resource exchange channel according to the resources to be replenished in the resource exchange platform account corresponding to the amount of the resources to be replenished and the outgoing resources in the requester account includes: Determine the resources to be replenished in the account of the resource exchange platform in an amount corresponding to the amount of resources to be replenished; Update the resource amount of the swapped-out resources in the requester's account according to the resources to be supplemented, and obtain the updated swapped-out resources in the requester's account; Based on the updated swap-out resource, a swap-in resource of the swap-in resource type is exchanged through a resource exchange channel.
5. The method according to claim 4, characterized in that The exchanging of the updated outgoing resources for the incoming resource type through the resource exchange channel includes: Sending the resource exchange request to a resource exchange channel; the resource exchange request is used to instruct the resource exchange channel to perform resource exchange according to the resource exchange request; Receiving the resource exchange result returned by the resource exchange channel; When the resource exchange result is of the type of successful resource exchange, a swap-in resource of the swap-in resource type is obtained by exchanging the updated swap-out resource.
6. The method according to claim 5, characterized in that The method further includes: freezing the updated swapped-out resources in the requester account; After receiving the resource exchange result returned by the resource exchange channel, the method further includes: when the type of the resource exchange result is that the resource exchange is unsuccessful, unfreezing the updated exchanged resources in the requester account.
7. The method according to claim 1, characterized in that The method further comprises: Obtaining a resource replenishment record of the resource exchange platform account according to the requester account, the type of swapped resources, and the amount of resources to be replenished; When the resource supplement record processing condition is met, determining the supplementary cancellation resources in the requester's account according to the resource supplement record; The supplementary cancellation resources are transferred to the account of the resource exchange platform for supplementary cancellation, and a supplementary cancellation record is obtained according to the supplementary cancellation result, and the supplementary cancellation record is stored in the blockchain.
8. The method according to claim 7, characterized in that When the resource supplement record processing condition is met, determining the supplementary cancellation resource in the requester account according to the resource supplement record includes: When no supplementary cancellation record corresponding to the resource replenishment record is detected, or when it is detected that the type of the supplementary cancellation record corresponding to the resource replenishment record is supplementary cancellation failure, determining the supplementary cancellation resource amount corresponding to the resource amount to be replenished in the resource replenishment record; The supplementary cancellation resources in the requester's account are determined according to the supplementary cancellation resource amount; the supplementary cancellation resources are resources of the swapped-out resource type.
9. The method according to claim 1, characterized in that: The method further comprises: Obtaining a resource replenishment record of the requester's account according to the swapped-out resource type and the amount of resources to be replenished; When the resource supplement record processing conditions are met, the supplement cancellation record of the requesting party account is obtained; the supplement cancellation record is obtained after the requesting party account transfers the supplement cancellation resource corresponding to the resource to be supplemented to the resource exchange platform account for supplement cancellation; The amount of supplementary resources to be cancelled of the requesting party account is obtained according to the resource replenishment record and the supplementary cancellation record of the requesting party account.
10. The method according to claim 1, characterized in that The requester account includes requester sub-accounts corresponding to various resource types; the resource exchange platform account includes platform sub-accounts corresponding to various resource types.
11. A resource exchange device, characterized in that: Applied to a currency exchange platform, the device comprises: An exchange request receiving module, used for receiving a resource exchange request; A swap-out resource amount determination module, configured to determine the swap-out resource amount of the swap-out resource type according to the resource exchange request, the exchange parameters between the swap-out resource type and the swap-in resource type, and the markup points for the exchange parameters; the swap-out resource type and the swap-in resource type include different currencies for monetary resources; A resource holding amount determination module, used to determine the resource holding amount of the exchanged resources in the requester account corresponding to the resource exchange request, wherein the exchanged resources include the monetary resources to be exchanged; A supplementary resource determination module, configured to determine the amount of resources to be supplemented according to the difference between the amount of swapped resources and the amount of swapped resources held and the amount of floating resources when the amount of swapped resources held is less than the amount of swapped resources; the amount of floating resources is determined in proportion to the difference; The exchange module for incoming resources is used to exchange incoming resources of the type of the incoming resources through a resource exchange channel according to the resources to be replenished in the account of the resource exchange platform corresponding to the amount of the resources to be replenished and the exchanged resources in the account of the requesting party, and obtain the resource exchange result returned by the resource exchange channel; the exchanged resources include monetary resources of different currencies from the exchanged resources; An actual swapped-out resource determination module, configured to determine, when the resource exchange result type is a successful resource exchange, an actual swapped-out resource amount of the swapped-out resource type according to the resource exchange result; An exchange difference amount determination module, used for obtaining a resource exchange difference amount according to the actual exchanged resource amount and the exchanged resource amount; The exchange difference account updating module is used to update the resource amount of the resource exchange difference account corresponding to the resource exchange difference amount according to the resource exchange difference amount.
12. The device according to claim 11, characterized in that The swap-out resource amount determination module includes: An exchange request analysis module, used to determine the type of resources to be exchanged out, the type of resources to be exchanged in, and the amount of resources to be exchanged according to the resource exchange request; An exchange parameter determination module, used to obtain the exchange parameters between the exchanged resource type and the exchanged resource type and the markup points for the exchange parameters; The swapped resource quantity obtaining module is used to determine the swapped resource quantity of the swapped resource type according to the resource exchange quantity, the exchange parameter and the markup points.
13. The device according to claim 11, characterized in that The supplementary resource determination module is further configured to determine the difference between the swapped-out resource amount and the swapped-out resource holding amount when the swapped-out resource holding amount is less than the swapped-out resource amount.
14. The device according to claim 11, characterized in that The swap-in resource exchange module includes: A module for determining resources to be replenished, used to determine the number of resources to be replenished corresponding to the amount of resources to be replenished in the account of the resource exchange platform; A swapped-out resource updating module, configured to update the amount of the swapped-out resources in the requester's account according to the resources to be supplemented, and obtain the updated swapped-out resources in the requester's account; The resource exchange module is used to exchange the updated swap-out resource for the swap-in resource of the swap-in resource type through the resource exchange channel.
15. The device according to claim 14, characterized in that The resource exchange module includes: An exchange request forwarding module, used to send the resource exchange request to a resource exchange channel; the resource exchange request is used to instruct the resource exchange channel to perform resource exchange according to the resource exchange request; An exchange result receiving module, used for receiving the resource exchange result returned by the resource exchange channel; The update resource processing module is used to obtain a swap-in resource of the swap-in resource type by exchanging the updated swap-out resource when the resource exchange result is a successful resource exchange.
16. The device according to claim 15, characterized in that Also includes: A swap-out resource freezing module, used to freeze the updated swap-out resources in the requester account; The swapped-out resource unfreezing module is used to unfreeze the updated swapped-out resource in the requester account when the resource exchange result is of the type that the resource exchange is unsuccessful.
17. The device according to claim 11, characterized in that Also includes: A resource replenishment record obtaining module, used to obtain the resource replenishment record of the resource exchange platform account according to the requester account, the type of the swapped resources and the amount of the resources to be replenished; A supplementary cancellation resource determination module, configured to determine the supplementary cancellation resources in the requester's account according to the resource supplement record when a resource supplement record processing condition is met; The supplementary cancellation processing module is used to transfer the supplementary cancellation resources to the resource exchange platform account for supplementary cancellation, obtain a supplementary cancellation record based on the supplementary cancellation result, and store the supplementary cancellation record in the blockchain.
18. The device according to claim 17, characterized in that The supplementary cancellation resource determination module includes: A supplementary cancellation resource quantity determination module, configured to determine the supplementary cancellation resource quantity corresponding to the to-be-supplemented resource quantity in the resource supplement record when no supplementary cancellation record corresponding to the resource supplement record is detected, or when it is detected that the type of the supplementary cancellation record corresponding to the resource supplement record is a supplementary cancellation failure; A supplementary cancellation resource quantity processing module is used to determine the supplementary cancellation resources in the requester's account according to the supplementary cancellation resource quantity; the supplementary cancellation resources are resources of the swapped-out resource type.
19. The device according to claim 11, characterized in that Also includes: A resource replenishment record obtaining module, used for obtaining the resource replenishment record of the requesting party account according to the type of the swapped-out resource and the amount of the resource to be replenished; A supplementary cancellation record acquisition module is used to acquire the supplementary cancellation record of the requesting party account when the resource supplement record processing condition is met; the supplementary cancellation record is obtained by the requesting party account transferring the supplementary cancellation resource corresponding to the resource to be supplemented to the resource exchange platform account for supplementary cancellation; A module for determining the amount of supplementary resources to be cancelled is used to obtain the amount of supplementary resources to be cancelled of the requesting party's account based on the resource replenishment record and the supplementary cancellation record of the requesting party's account.
20. The device according to claim 11, characterized in that The requester account includes requester sub-accounts corresponding to various resource types; the resource exchange platform account includes platform sub-accounts corresponding to various resource types.
21. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 10.
22. A computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method according to any one of claims 1 to 10.
