Resource exchange processing method and device, computer equipment and storage medium
By introducing request identification and resource version identification mechanisms in resource exchange processing, the problem of low efficiency in traditional resource exchange processing is solved, and the resource revenue and expenditure difference is accurately compensated, which improves the efficiency of resource exchange.
Patent Information
- Application Number
- CN202410008084.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-02
- Publication Date
- 2025-07-04
AI Technical Summary
Traditional resource exchange processing methods are inefficient and cannot effectively balance the resource revenue and expenditure differences of service institutions, resulting in total resource loss.
By introducing request identification and resource version identification mechanisms in resource exchange processing, we ensure the identity consistency between the trigger time and the response time, and realize the precise exchange of unbalanced resources.
It improves the efficiency of resource exchange processing, ensures that the expected income and expenditure difference of resource exchange requests is consistent with the actual income and expenditure difference, and reduces the total resource loss.
Smart Images

Figure CN120258972A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technologies, and in particular, to a resource exchange processing method, apparatus, computer device, computer-readable storage medium, and computer program product. Background Art
[0002] With the rapid development of computer technologies, a resource exchange method based on computers has emerged. For example, a user can interact with a server of a service institution through a terminal to exchange one type of resource held by the user for another type of resource held by the service institution. For the service institution, in the process of providing resource exchange services, there may be an imbalance in the income and expenditure of the same type of resource.
[0003] In traditional technologies, a trader initiates a resource exchange request for unbalanced resources with an income and expenditure difference to the server according to the current income and expenditure difference of the service institution, and then the server responds to the resource exchange request to complete the resource exchange. However, as the business data of resource exchange services continues to increase and the data update frequency continues to accelerate, the trader needs to perform multiple resource exchange processes to balance the income and expenditure difference. Therefore, the traditional resource exchange processing method has the disadvantage of low work efficiency. Summary of the Invention
[0004] Based on this, it is necessary to provide a resource exchange processing method, apparatus, computer device, computer-readable storage medium, and computer program product that can improve work efficiency for the above technical problems.
[0005] In a first aspect, the present application provides a resource exchange processing method. The method includes:
[0006] In response to a trigger operation of a first terminal for a resource exchange service, sending a request identifier and a resource version identifier corresponding to the trigger moment of the resource exchange service to the first terminal; the request identifier is used to represent the most recently accepted historical resource exchange request; the resource version identifier is used to represent the number of times of change in the resource income and expenditure difference of the resources held by the server;
[0007] Obtaining a first resource exchange request initiated by the first terminal for at least one type of unbalanced resource; the unbalanced resource refers to a type of resource with an income and expenditure difference among the currently held resources of the server; the first resource exchange request carries the request identifier and the resource version identifier corresponding to the trigger moment;
[0008] Determining a request identifier and a resource version identifier corresponding to the response moment of the first resource exchange request;
[0009] If the request identifiers corresponding to the trigger time and the response time are the same, and the resource version identifiers corresponding to the trigger time and the response time are the same, then perform resource exchange for the unbalanced resources.
[0010] In a second aspect, the present application also provides a resource exchange processing method. The method includes:
[0011] Perform a trigger operation for a resource exchange service, and obtain a request identifier and a resource version identifier corresponding to the trigger time of the resource exchange service; the request identifier is used to represent the latest received historical resource exchange request; the resource version identifier is used to represent the number of times of change in the resource balance of the resources held by the server.
[0012] Generate a first resource exchange request for at least one type of unbalanced resource; the unbalanced resource refers to a type of resource with a resource balance difference in the currently held resources of the server; the first resource exchange request carries the request identifier and the resource version identifier corresponding to the trigger time.
[0013] Send the first resource exchange request to the server; the first resource exchange request is used to instruct the server to determine the request identifier and the resource version identifier corresponding to the response time of the first resource exchange request, and perform resource exchange for the unbalanced resources when the request identifiers corresponding to the trigger time and the response time are the same, and the resource version identifiers corresponding to the trigger time and the response time are the same.
[0014] In a third aspect, the present application also provides a resource exchange processing device. The device includes:
[0015] An identification feedback module, configured to, in response to a trigger operation of a first terminal for a resource exchange service, send the request identifier and the resource version identifier corresponding to the trigger time of the resource exchange service to the first terminal; the request identifier is used to represent the latest received historical resource exchange request; the resource version identifier is used to represent the number of times of change in the resource balance of the resources held by the server.
[0016] A request acquisition module, configured to acquire a first resource exchange request initiated by the first terminal for at least one type of unbalanced resource; the unbalanced resource refers to a type of resource with a resource balance difference in the currently held resources of the server; the first resource exchange request carries the request identifier and the resource version identifier corresponding to the trigger time.
[0017] An identification determination module, configured to determine the request identifier and the resource version identifier corresponding to the response time of the first resource exchange request.
[0018] A resource exchange module, configured to perform resource exchange for the unbalanced resources if the request identifiers corresponding to the trigger moment and the response moment are the same, and the resource version identifiers corresponding to the trigger moment and the response moment are the same.
[0019] In a fourth aspect, the present application further provides a resource exchange processing device. The device includes:
[0020] An identifier acquisition module, configured to, in response to a trigger operation for a resource exchange service, acquire a request identifier and a resource version identifier corresponding to the trigger moment of the resource exchange service; the request identifier is used to represent the latest received historical resource exchange request; the resource version identifier is used to represent the number of times of change in the resource balance of the resources held by the server.
[0021] A request generation module, configured to generate a first resource exchange request for at least one type of unbalanced resources; the unbalanced resources refer to a type of resources in the currently held resources of the server that have a resource balance difference; the first resource exchange request carries the request identifier and the resource version identifier corresponding to the trigger moment.
[0022] A request sending module, configured to send the first resource exchange request to the server; the first resource exchange request is used to instruct the server to determine the request identifier and the resource version identifier corresponding to the response moment of the first resource exchange request, and perform resource exchange for the unbalanced resources when the request identifiers corresponding to the trigger moment and the response moment are the same, and the resource version identifiers corresponding to the trigger moment and the response moment are the same.
[0023] In a fifth aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the steps of the above method are implemented.
[0024] In a sixth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0025] In a seventh aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0026] The above resource exchange processing method, device, computer device, computer-readable storage medium, and computer program product respond to a trigger operation of a first terminal for a resource exchange service, send a request identifier and a resource version identifier corresponding to the trigger moment of the resource exchange service to the first terminal; obtain a first resource exchange request initiated by the first terminal for at least one type of unbalanced resource; determine a request identifier and a resource version identifier corresponding to the response moment of the first resource exchange request; if the request identifiers corresponding to the trigger moment and the response moment are the same, and the resource version identifiers corresponding to the trigger moment and the response moment are the same, then perform a resource exchange for the unbalanced resource. Among them, the request identifier is used to represent the latest accepted historical resource exchange request; the resource version identifier is used to represent the number of times of change in the resource balance of the resources held by the server; the unbalanced resource refers to a type of resource with a resource balance in the currently held resources of the server; the first resource exchange request carries the request identifier and the resource version identifier corresponding to the trigger moment. During the above resource exchange processing, an identification management mechanism is established for the resource exchange request and the resource balance respectively, which can ensure that the resource balance expected by the first terminal when initiating the first resource exchange request is the same as the actual resource balance when the first resource exchange request is responded to, so that the resource exchange executed by the server in response to the first resource exchange request can make up for the resource balance of the unbalanced resource, which is beneficial to improving the working efficiency of resource exchange processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 FIG. is an application environment diagram of the resource exchange processing method in an embodiment;
[0028] Figure 2 FIG. is a schematic flowchart of the resource exchange processing method in an embodiment;
[0029] Figure 3 FIG. is a schematic diagram of the composition of the server in an embodiment;
[0030] Figure 4 FIG. is a schematic flowchart of the resource exchange processing method in another embodiment;
[0031] Figure 5 FIG. is a schematic flowchart of the resource exchange processing method in still another embodiment;
[0032] Figure 6 FIG. is a schematic diagram of the interaction principle between the second terminal and the identification management system in an embodiment;
[0033] Figure 7 FIG. is a schematic diagram of the order placement process of the second terminal in an embodiment;
[0034] Figure 8 FIG. is a structural block diagram of the resource exchange processing device in an embodiment;
[0035] Figure 9 is a structural block diagram of a resource exchange processing device in another embodiment;
[0036] Figure 10 is an internal structure diagram of a computer device in one embodiment;
[0037] Figure 11 is an internal structure diagram of a computer device in another embodiment. Detailed implementation manners
[0038] In order to make the objectives, technical solutions, and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to 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.
[0039] The resource exchange processing method provided by the embodiments of the present application can be applied to an application environment as Figure 1 shown. Among them, the first terminal 102 and the second terminal 104 can communicate with the server 106 through a network. The communication network can be a wired network or a wireless network. Therefore, both between the first terminal 102 and the server 106, and between the second terminal 104 and the server 106, can be directly or indirectly connected through wired or wireless communication methods. For example, the first terminal 102 can be indirectly connected to the server 106 through a wireless access point, or the first terminal 102 can be directly connected to the server 106 through the Internet. The present application does not make any restrictions here.
[0040] Among them, the first terminal 102 or the second terminal 104 can be, but is not limited to, various desktop computers, laptop computers, smartphones, tablet computers, Internet of Things devices, and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, in-vehicle intelligent devices, etc. The portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The embodiments of the present application can be applied to a resource exchange processing scenario, and the resources to be exchanged can be, for example, digital resources, game props, and so on. A client related to the resource exchange service can be installed on the first terminal 102, and the client can be software, a web page, a mini program, or the like. The server 106 is a background server corresponding to the software, web page, mini program, etc., or a server dedicated to resource exchange. Further, the server 106 can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The data storage system can store the data that the server 106 needs to process. The data storage system can be set separately, integrated on the server 106, or placed on the cloud or other servers.
[0041] In one embodiment, the server 106 can be the background server of a service institution providing resource exchange services. The first terminal 102 can be the terminal held by a trader of the service institution, and the second terminal 104 can be the terminal held by a user of the service institution. Specifically, the user can initiate a resource exchange request to the server 106 through the second terminal 104 to exchange one type of resource held by the user for another type of resource held by the server 106. In the process of providing resource exchange services, the server 106 involves the transfer in and transfer out of various types of resources. A type of resource with a resource balance difference between the transfer-in amount and the transfer-out amount is called an unbalanced resource. In practical applications, since the resource exchange ratio between different types of resources is not fixed, then, in the case of an unbalanced income and expenditure, it is possible to cause a loss of the total amount of resources due to fluctuations in the resource exchange ratio.
[0042] Based on this, the trader of the service institution can initiate a resource exchange request to the server 106 through the first terminal 102 to minimize the resource revenue and expenditure difference of the unbalanced resources. During the process of the server 106 implementing the resource exchange processing method: in response to the trigger operation of the first terminal 102 for the resource exchange service, send the request identifier and the resource version identifier corresponding to the trigger moment of the resource exchange service to the first terminal 102; obtain the first resource exchange request initiated by the first terminal 102 for at least one type of unbalanced resource; determine the request identifier and the resource version identifier corresponding to the response moment of the first resource exchange request; if the request identifiers corresponding to the trigger moment and the response moment are consistent, and the resource version identifiers corresponding to the trigger moment and the response moment are consistent, then perform the resource exchange for the unbalanced resources. Among them, the request identifier is used to represent the latest accepted historical resource exchange request; the resource version identifier is used to represent the number of times of change in the resource revenue and expenditure difference of the resources held by the server 106; the unbalanced resource refers to a type of resource with a resource revenue and expenditure difference among the currently held resources of the server 106; the first resource exchange request carries the request identifier and the resource version identifier corresponding to the trigger moment.
[0043] In one embodiment, as Figure 2 shown, a resource exchange processing method is provided. This method can be executed by a computer device. In this embodiment, taking the application of this method to Figure 1 the server 106 therein as an example for illustration, it includes the following steps:
[0044] Step S202, in response to the trigger operation of the first terminal for the resource exchange service, send the request identifier and the resource version identifier corresponding to the trigger moment of the resource exchange service to the first terminal.
[0045] Among them, the first terminal refers to the terminal held by a trader of a service institution. In the process of providing resource exchange services, the service institution involves the transfer in and out of various types of resources, which will inevitably cause an imbalance between income and expenditure. A type of resource with a resource income and expenditure difference between the transfer-in amount and the transfer-out amount is called an unbalanced resource. Exemplarily, for resource A, the transfer-in amount is A1 and the transfer-out amount is A2. If A1 is not equal to A2, then there is a resource income and expenditure difference for the resource A held by the server. In practical applications, since the resource exchange ratio between different types of resources is not fixed, then, in the case of income and expenditure imbalance, there may be a loss of the total amount of resources due to the fluctuation of the resource exchange ratio. For example, when A1 is greater than A2, if the resource exchange ratio of resource A to other types of resources decreases, it will cause a loss of the total amount of resources of the server. Based on this, the trader of the service institution can initiate a resource exchange request to the server through the first terminal to minimize the resource income and expenditure difference of the unbalanced resource and avoid the risk of loss of the total amount of resources. The resources in this application can include game props, digital goods, commodity coupons, and so on. In a specific embodiment, the resource can refer to virtual resources circulating on the blockchain, including native digital resources generated by the on-chain processing node through block packaging, and on-chain data published through smart contracts.
[0046] The request identifier is used to represent the latest accepted historical resource exchange request. The specific data form of this request identifier can include at least one of text or symbols. The historical resource exchange request can include a resource exchange request initiated by a user through the second terminal to the server for requesting to exchange the first type of resource held by the second terminal for the second type of resource held by the server, and can also include a resource exchange request initiated by a trader of the service institution through the first terminal to the server for at least one type of unbalanced resource. For the convenience of distinction, this application refers to the resource exchange request initiated by the first terminal as the first resource exchange request, and the resource exchange request initiated by the second terminal as the second resource exchange request. It can be understood that what the first resource exchange request realizes is the resource exchange between the server and the resource issuer (or operator), and what the second resource exchange request realizes is the resource exchange between the user and the server. Therefore, the service institution can be equivalent to a third-party payment institution. Third-party payment refers to an independent institution with certain strength and reputation guarantee, which provides a network payment mode of a transaction payment platform with an interface to the payment and settlement system of the resource issuer (or operator) by signing contracts with major resource issuers (or operators).
[0047] In a specific embodiment, the request identifier may include request sub-identifiers of various types of historical resource exchange requests. Among them, the method of classifying historical resource exchange requests may be, for example, classification based on trigger parameters. The trigger parameters may include, for example, trigger methods, trigger times, and the types of terminals implementing the trigger parameters, etc. The trigger method may be, for example, automatic trigger or manual trigger. The types of terminals may include, for example, terminals held by individual users, terminals held by enterprise users, terminals held by traders, and so on.
[0048] The resource version identifier is used to represent the number of times of changes in the resource balance of the resources held by the server. Similar to the request identifier, the specific data form of the resource version identifier may include at least one of text or symbols. The resource balance of the resources held by the server is affected by various factors. The influencing factors may include, for example, performing resource exchange processing, or changes in the resource exchange ratio of a certain resource in the resources held by the server relative to other resources, and so on. For example, when the server responds to a first resource exchange request and exchanges the resource A held by the first terminal into the resource B held by the server, the resource balances of the resource A and the resource B held by the server will both change. In a specific embodiment, the resource version identifier may include multiple sub-version identifiers. Among them, the method of classifying the resource version identifier may be, for example, classification based on resource types, or classification based on the resource pairs corresponding to resource exchange services, which is not limited herein. Exemplarily, for resource A, the sub-version identifier corresponding to resource A may include a sub-version identifier representing the resource balance of resource A in the resource exchange service between resource A and resource B, may also include a sub-version identifier representing the resource balance of resource A in the resource exchange service between resource A and resource C, and may further include a sub-version identifier representing the global resource balance of resource A.
[0049] Specifically, a trader of a service institution may use the first terminal held by himself / herself to initiate a trigger operation for the resource exchange service. The specific method for the first terminal to trigger the resource exchange service may be, for example, opening the page of the resource exchange service, or clicking on the control of the resource exchange service, etc. The server may respond to the trigger operation, determine the trigger moment of the resource exchange service, and send the request identifier and the resource version identifier corresponding to the trigger moment to the first terminal.
[0050] In a specific embodiment, the resource exchange processing method further includes: in response to the trigger operation of the first terminal for the resource exchange service, generating an identifier snapshot from the trigger moment of the resource exchange service; and determining the request identifier and the resource version identifier corresponding to the trigger moment in the identifier information saved in the identifier snapshot.
[0051] Among them, a snapshot is a technology for quickly reading memory based on hardware programming technology. A snapshot is a fully available copy of a specified data set, and this copy includes the image of the corresponding data at a certain point in time (the time point when the copy starts). A snapshot can be a copy of the data it represents or a replica of the data. Specifically, the server can, in response to a trigger operation of the first terminal for a resource exchange service, generate an identity snapshot at the trigger moment of the resource exchange service and copy the identity information managed by the server at the trigger moment. Then, the server determines the request identity and resource version identity corresponding to the trigger moment from the identity information saved in the identity snapshot. Exemplarily, the server can screen out the request identity and resource version identity corresponding to the trigger moment from the identity information saved in the identity snapshot according to the respective field compositions of the request identity and the resource version identity.
[0052] In this embodiment, by using the snapshot method to determine the request identity and resource version identity corresponding to the trigger moment, due to the convenience and flexibility of the snapshot technology, it is beneficial to further improve the working efficiency of the resource exchange processing method.
[0053] Step S204, obtain a first resource exchange request initiated by the first terminal for at least one type of unbalanced resource.
[0054] Among them, unbalanced resources refer to a type of resource with a resource income and expenditure difference among the currently held resources of the server. It can be understood that the resource balance situation is dynamically changing. That is to say, unbalanced resources with a resource income and expenditure difference at a certain moment may be balanced resources without a resource income and expenditure difference at another moment. For the first terminal, it can initiate a first resource exchange request for the unbalanced resources held by the server at the trigger moment according to the resource balance situation at the trigger moment when it triggers the resource exchange service, so as to achieve income and expenditure balance.
[0055] Specifically, the first terminal can obtain the request identity and resource version identity corresponding to the trigger moment of the resource exchange service from the server and initiate a first resource exchange request for at least one type of unbalanced resource among the currently held resources of the server. The first resource exchange request carries the request identity and resource version identity corresponding to the trigger moment. Thus, the server can obtain the first resource exchange request and execute the resource exchange for the unbalanced resources by responding to the first resource exchange request. Further, the specific way for the server to obtain the first resource exchange request can be active acquisition or passive reception.
[0056] Exemplarily, when the server currently holds unbalanced resource A and unbalanced resource B among the resources, the first terminal may initiate a first resource exchange request for at least one of unbalanced resource A or unbalanced resource B, so as to instruct the server to perform a corresponding resource exchange operation by responding to the first resource exchange request, make up the resource income and expenditure difference of the unbalanced resource, and convert the unbalanced resource into a balanced resource.
[0057] Step S206: Determine the request identifier and resource version identifier corresponding to the response time of the first resource exchange request.
[0058] Among them, the response time of the first resource exchange request may refer to the time when the server receives the first resource exchange request and prepares to accept the first resource exchange request. Specifically, the server may determine the request identifier and resource version identifier corresponding to the response time of the first resource exchange request.
[0059] In a specific embodiment, as Figure 3 shown, the server may include a resource exchange management system 301 and an identifier management system 302. Among them, the resource exchange management system 301 is used to obtain the resource exchange request initiated by the terminal through interaction with the terminal; the identifier management system 302 is used to manage the request identifier and resource version identifier, specifically including the update, storage, and release of the request identifier; and the update, storage, and release of the resource version identifier. Specifically, after obtaining the first resource exchange request, the resource exchange management system 301 may extract the request identifier and resource version identifier carried in the first resource exchange request, and transmit the extracted identifier information to the identifier management system 302. In the case of this embodiment, the response time of the first resource exchange request refers to the time when the identifier management system 302 receives the identifier information. Furthermore, the identifier management system 302 may determine the request identifier and resource version identifier corresponding to the response time of the first resource exchange request when receiving the request identifier and resource version identifier corresponding to the trigger time.
[0060] Exemplarily, as Figure 3As shown, the resource exchange management system 301 can send the extracted request identifier to the identifier management system 302 through an order change message. Thus, the identifier management system 302 can use the received request identifier to update the cache of the resource exchange request, update the request identifier of the latest accepted historical resource exchange request, and publish the updated request identifier. This request identifier can be, for example, "197". Further, the resource exchange management system 301 can also send the extracted resource version identifier to the identifier management system 302 through a resource balance update message. Thus, the identifier management system 302 can use the received resource version identifier to update the cache of the resource balance, update the resource version identifier representing the number of changes in the resource balance of the resources held by the server, and publish the updated resource version identifier. This resource version identifier can be, for example, "3305".
[0061] Step S208: If the request identifiers corresponding to the trigger time and the response time are the same, and the resource version identifiers corresponding to the trigger time and the response time are the same, then perform resource exchange for unbalanced resources.
[0062] Among them, the resource exchange for unbalanced resources can include transferring in unbalanced resources and transferring out unbalanced resources. It can be understood that when the resource balance of unbalanced resources is positive, that is, the amount transferred in is greater than the amount transferred out, the server can transfer out the unbalanced resources corresponding to this resource balance to maintain resource balance; correspondingly, when the resource balance of unbalanced resources is negative, that is, the amount transferred in is less than the amount transferred out, the server can transfer in the unbalanced resources corresponding to this resource balance to maintain resource balance.
[0063] Specifically, the server can verify the identifier of the first resource exchange request to determine whether the request identifiers corresponding to the trigger time and the response time are the same, and whether the resource version identifiers corresponding to the trigger time and the response time are the same. If the request identifiers corresponding to the trigger time and the response time are the same, and the resource version identifiers corresponding to the trigger time and the response time are the same, it indicates that during the generation and transmission of the first resource exchange request, no new resource exchange request has been accepted, and the resource balance of the resources held by the server has not changed either. That is to say, the resource balance expected by the first terminal when initiating the first resource exchange request is the same as the actual resource balance when this first resource exchange request is responded to. In this case, the server can perform resource exchange for unbalanced resources to make up the resource balance of this unbalanced resource. Further, the server can also feedback a prompt message indicating that the order placement is successful to the first terminal.
[0064] In a specific embodiment, if any group of the request identifiers corresponding to the trigger time and the response time, or the resource version identifiers corresponding to the trigger time and the response time are inconsistent, it indicates that even if the server performs resource exchange for unbalanced resources, it is impossible to make up the resource income and expenditure difference of the unbalanced resources. At this time, the server returns the first resource exchange request and feeds back a prompt message indicating that the order placement fails to the first terminal. The prompt message can include, for example, text or symbols. Exemplarily, the prompt message can be "Order placement failed - the current version number has expired".
[0065] In practical applications, to avoid having no fallback path for identity management in abnormal situations, an option of "skipping" for identity verification can also be provided. The server can trigger the skip option for identity verification, so that after receiving the first resource exchange request, the server can skip the identity verification step, that is, perform resource exchange for unbalanced resources.
[0066] In the above resource exchange processing method, in response to the trigger operation of the first terminal for the resource exchange service, the request identifier and the resource version identifier corresponding to the trigger time of the resource exchange service are sent to the first terminal; the first resource exchange request for at least one type of unbalanced resource initiated by the first terminal is obtained; the request identifier and the resource version identifier corresponding to the response time of the first resource exchange request are determined; if the request identifiers corresponding to the trigger time and the response time are consistent, and the resource version identifiers corresponding to the trigger time and the response time are consistent, then resource exchange for unbalanced resources is performed. Among them, the request identifier is used to represent the latest accepted historical resource exchange request; the resource version identifier is used to represent the number of times of change in the resource income and expenditure difference of the resources held by the server; the unbalanced resource refers to a type of resource with a resource income and expenditure difference in the currently held resources of the server; the first resource exchange request carries the request identifier and the resource version identifier corresponding to the trigger time. In the process of the above resource exchange processing, by establishing an identity management mechanism for the resource exchange request and the resource income and expenditure difference respectively, it can be ensured that the resource income and expenditure difference expected when the first terminal initiates the first resource exchange request is consistent with the actual resource income and expenditure difference when the first resource exchange request is responded to, so that the resource exchange performed by the server in response to the first resource exchange request can make up the resource income and expenditure difference of the unbalanced resources, which is beneficial to improving the working efficiency of resource exchange processing.
[0067] In one embodiment, in response to a trigger operation of a first terminal for a resource exchange service, sending a request identifier corresponding to the trigger moment of the resource exchange service to the first terminal includes: when the first terminal triggers the resource exchange service, determining the trigger parameter of the first terminal for the resource exchange service and the trigger moment of the resource exchange service; determining and sending to the first terminal a request identifier that matches the trigger parameter from among a plurality of candidate request identifiers corresponding to the trigger moment. In the case of this embodiment, determining a request identifier corresponding to the response moment of a first resource exchange request includes: determining a request identifier that matches the trigger parameter from among a plurality of candidate request identifiers corresponding to the response moment of the first resource exchange request.
[0068] Among them, the trigger parameter may include, for example, a trigger mode, a trigger time, and a terminal type for implementing the trigger parameter, etc. The trigger mode may be, for example, automatic trigger or manual trigger. The terminal type may include, for example, a terminal held by an individual user, a terminal held by an enterprise user, a terminal held by a trader, and so on. The trigger time may be, for example, morning or afternoon, etc.
[0069] Taking the automatic trigger scenario as an example. For the second terminal held by a user, the resource exchange service can be automatically triggered at a set time to initiate a second resource exchange request, or when the resource amount of resource A held by the user himself reaches a set amount, the resource exchange service can be automatically triggered to send a request to the server to convert resource A into other types of resources for the second resource exchange request. For the first terminal held by a trader, the server can perform statistics on the resource income and expenditure balance of its own held resources and send the statistical data to the first terminal. When the resource income and expenditure balance of the first terminal meets the trigger condition of the resource exchange service, the first terminal automatically executes the trigger operation for the resource exchange service. It can be understood that the greater the resource income and expenditure balance, the greater the risk of resource loss caused by fluctuations in the resource exchange ratio between different resources; the more the number of unbalanced resources with a resource income and expenditure balance, the greater the risk of resource loss caused by fluctuations in the resource exchange ratio. Based on this, the trigger condition of the first terminal can be characterized by the resource income and expenditure balance or by the number of unbalanced resources whose resource income and expenditure balance reaches the balance threshold. In a possible implementation, the server can perform statistics on the resource income and expenditure balance for each type of resource it holds respectively. Furthermore, the first terminal can automatically trigger the resource exchange service when the statistical values of the resource income and expenditure balance of each unbalanced resource meet the trigger condition. The statistical value may be, for example, the total amount or the average value, etc.
[0070] Specifically, the server can classify resource exchange requests according to trigger parameters, and then perform identification management for each category of resource exchange requests respectively. Thus, multiple candidate request identifiers can be corresponding at the same time. Each candidate request identifier is used to represent a category of resource exchange requests. In practical applications, when the server triggers a resource exchange service at the first terminal, the server can determine the trigger parameters for the resource exchange service by the first terminal and the trigger time of the resource exchange service. Then, the server determines the request identifier that matches the trigger parameter from the multiple candidate request identifiers corresponding to the trigger time as the request identifier corresponding to the trigger time in the current resource exchange service scenario, and sends the request identifier corresponding to the trigger time to the first terminal. After receiving the first resource exchange request sent by the first terminal, the server determines the request identifier that matches the trigger parameter from the multiple candidate request identifiers corresponding to the response time of the first resource exchange request as the request identifier corresponding to the response time in the current resource exchange service scenario.
[0071] In the above embodiment, the management of request identifiers is performed separately for different trigger parameters, which can achieve fine-grained identifier management, is beneficial to further ensure the effect of making up the resource income and expenditure balance for the resource exchange process implemented based on identifier management, and is beneficial to further improving the working efficiency of the resource exchange process.
[0072] In one embodiment, the resource version identifier includes the sub-version identifiers of each group of resources; each group of resources includes two resource types. In this embodiment, the resource exchange processing method further includes: determining a target resource pair including unbalanced resources; determining the first sub-version identifier of the target resource pair from the sub-version identifiers corresponding to the trigger time. Determining the resource version identifier corresponding to the response time of the first resource exchange request includes: determining the second sub-version identifier of the target resource pair from the multiple sub-version identifiers corresponding to the response time of the first resource exchange request.
[0073] Among them, the resource exchange process is a process of exchanging one type of resource for another type of resource. Therefore, in the resource exchange process, two types of resources to be exchanged must be involved. Based on this, the server can perform fine-grained management of the change times of the resource income and expenditure balance, and record the corresponding sub-version identifier for each resource pair respectively. The sub-version identifier is used to represent the change times of the resource income and expenditure balance of each resource type in the resource pair during the resource pair exchange process in the resources held by the server. Exemplarily, the resource version identifier may include the sub-version identifier of the resource pair composed of resource A and resource B, and the sub-version identifier of the resource pair composed of resource C and resource D.
[0074] Specifically, when the first terminal triggers a resource exchange service, the server can determine the unbalanced resources with resource income and expenditure differences based on the resource income and expenditure differences of each resource in the currently held resources. Furthermore, the server can determine a target resource pair including the unbalanced resources and determine the first sub-version identifier of the target resource pair from the sub-version identifiers corresponding to each trigger moment. Exemplarily, when resource A is an unbalanced resource, the target resource pair may include resource A and resource B, and the first sub-version identifier may include the sub-version identifier of the resource pair composed of resource A and resource B.
[0075] When the server obtains a first resource exchange request initiated by the first terminal for at least one type of unbalanced resource, the server can determine the second sub-version identifier of the target resource pair from the multiple sub-version identifiers corresponding to the response moment of the first resource exchange request. Exemplarily, when the first sub-version identifier includes the sub-version identifier of the resource pair composed of resource A and resource B at the trigger moment, the second sub-version identifier includes the sub-version identifier of the resource pair composed of resource A and resource B at the response moment.
[0076] It should be noted that in practical applications, for the same resource type, there can be multiple resource pairs. Therefore, the number of the first sub-version identifier and the second sub-version identifier corresponding to the unbalanced resources can be multiple, and the number of the first sub-version identifier and the second sub-version identifier corresponding to the same unbalanced resource is the same. In this case, if the sub-version identifiers corresponding to the same resource pair at the trigger moment and the response moment are consistent, and the request identifiers corresponding to the trigger moment and the response moment are consistent, the server performs resource exchange for the unbalanced resources.
[0077] Exemplarily, the resource version identifier may include the sub-version identifier of the first resource pair composed of resource A and resource B, and the sub-version identifier of the second resource pair composed of resource A and resource C; the first sub-version identifier corresponding to the trigger moment may include the sub-version identifier of the first resource pair corresponding to the trigger moment and the sub-version identifier of the second resource pair corresponding to the trigger moment; the second sub-version identifier corresponding to the response moment may include the sub-version identifier of the first resource pair corresponding to the response moment and the sub-version identifier of the second resource pair corresponding to the response moment. Thus, the server can compare the sub-version identifiers corresponding to the same resource pair at the response moment and the trigger moment respectively. If the sub-version identifiers corresponding to the first resource pair at the response moment and the trigger moment are consistent, the sub-version identifiers corresponding to the second resource pair at the response moment and the trigger moment are consistent, and the request identifiers corresponding to the trigger moment and the response moment are consistent, then the server performs resource exchange for the unbalanced resources.
[0078] Optionally, when the second terminal initiates a first resource exchange request for multiple types of unbalanced resources, the server can compare the first sub-version identifier and the second sub-version identifier for each unbalanced resource respectively. When the request identifiers corresponding to the trigger moment and the response moment are the same, for the unbalanced resources with the same first sub-version identifier and second sub-version identifier, the server can perform resource exchange for the unbalanced resources, while for the unbalanced resources with different first sub-version identifier and second sub-version identifier, the server can refrain from performing resource exchange for the unbalanced resources. That is to say, when the second terminal initiates a first resource exchange request for multiple types of unbalanced resources, the server can, based on the comparison of the resource version identifiers of each unbalanced resource, perform resource exchange processing separately to improve the flexibility of resource exchange processing.
[0079] In the above embodiments, by managing the resource version identifiers for different resource pairs respectively, fine-grained identifier management can be achieved, which is conducive to further ensuring that the resource exchange processing can make up for the resource income and expenditure difference of unbalanced resources and is conducive to further improving the working efficiency of resource exchange processing.
[0080] It can be understood that during the process of resource exchange processing, the update of the request identifier and the resource version identifier is also involved. In one embodiment, the resource exchange processing method further includes: determining the request identifier of the first resource exchange request based on the request identifier corresponding to the response moment; determining the resource version identifier of the resources held by the server after the resource exchange is completed based on the resource version identifier corresponding to the response moment.
[0081] In practical applications, when the server responds to the first resource exchange request and performs resource exchange for unbalanced resources, the latest received historical resource exchange request is changed to the first resource exchange request. Therefore, the server can update the request identifier based on the request identifier corresponding to the response moment and determine the request identifier representing the first resource exchange request as the request identifier corresponding to the moment when the resource exchange is completed. At the same time, performing resource exchange for unbalanced resources will inevitably cause changes in the resource income and expenditure difference of the resources held by the server. Therefore, the server can also update the resource version identifier.
[0082] Specifically, the server can determine the request identifier of the first resource exchange request based on the request identifier corresponding to the response time according to the encoding method of the request identifier; the server can also determine the resource version identifier of the resources held by the server after completing the resource exchange based on the resource version identifier corresponding to the response time according to the encoding method of the resource version identifier. Among them, the encoding method adopted in the identifier encoding process can ensure the uniqueness of the identifier, and the encoding methods of the request identifier and the resource version identifier can be the same or different. This encoding method can be, for example, an encoding based on non-repeating random numbers or an encoding based on a number system.
[0083] Taking the determination process of the request identifier as an example. For example, the request identifier can include a random number, and the server can generate a new random number that is different from the historical random numbers existing in the request identifier. Then, the server can replace the random number in the request identifier with the new random number to obtain an updated request identifier. Another example is that the request identifier can include a count string encoded based on a number system. Then, the server can update the count string in an increasing or decreasing order to obtain an updated string, and by replacing the count string in the request identifier with the new count string, obtain an updated request identifier.
[0084] In the above embodiments, after performing the resource exchange for unbalanced resources, the request identifier and the resource version identifier are respectively updated, which can ensure the accuracy of the identifier, and further ensure the effect of making up the resource balance difference based on the identifier management, and improve the working efficiency of the resource exchange process.
[0085] Similar to the request identifier type, the update method of the resource version identifier is not unique either. For example, the resource version identifier can include a random number, and the server can generate a new random number that is different from the historical random numbers existing in the resource version identifier. Then, the server can replace the random number in the resource version identifier with the new random number to obtain an updated resource version identifier.
[0086] In a specific embodiment, determining the resource version identifier of the resources held by the server after completing the resource exchange based on the resource version identifier corresponding to the response time includes: extracting the count string encoded based on a number system from the resource version identifier corresponding to the response time; updating the count string according to the set counting order to obtain an updated string; in the case where the server completes the resource exchange, replacing the count string with the above-mentioned updated string to obtain the resource version identifier of the resources held by the server.
[0087] Among them, the number system, also known as the "counting system", is a method of representing numerical values using a set of fixed symbols and unified rules. The number system can be, for example, binary, octal, decimal, or hexadecimal, etc. The set counting order can be, for example, increasing or decreasing. It can be understood that encoding based on the number system according to the set counting order can ensure the uniqueness of the obtained character string of digits.
[0088] Specifically, the resource version identifier may include a character string of counts encoded based on the number system. The server can extract the character string of counts encoded based on the number system from the resource version identifier corresponding to the response moment, and then update the character string of counts according to the set counting order to obtain an updated character string. The numerical increment in each update process can be the same or different. Furthermore, when the resource exchange is completed on the server side, the character string of counts can be replaced with the above-mentioned updated character string to obtain the resource version identifier of the resources held by the server. Taking binary encoding as an example, the server can, in an increasing order, obtain the updated resource version identifier when the resource exchange on the server side is completed by adding 1 to the character string of counts in the resource version identifier corresponding to the response moment.
[0089] In the above embodiment, the update of the resource version identifier is achieved by updating the character string of counts encoded based on the number system. The algorithm is simple and can ensure different resource version identifiers corresponding to different moments, which is beneficial to further improving the working efficiency of resource exchange processing.
[0090] In one embodiment, the resource exchange processing method further includes: determining a reference resource type from multiple candidate resource types; for each service cycle, calculating the total amount of resources held by the server in this service cycle based on the resource exchange ratio between the reference resource type and the remaining non-reference resource types among the resources held by the server; and determining and feeding back to the first terminal the resource gain of the resources held by the server based on the current total amount of resources in the current service cycle and the historical total amount of resources in at least one historical service cycle.
[0091] Among them, the candidate resource type refers to the resource types supported by the resource exchange service, which may include the resource types held by the server and the resource types not held by the server. The reference resource type refers to the resource type used as a reference in the process of calculating the total amount of resources. The reference resource type can be, for example, a resource type with a relatively stable resource exchange ratio or a resource type with a relatively large holding amount by the server. The service cycle refers to the service processing cycle divided for the resource exchange service, which can be, for example, one day, ten days, or one month, etc.
[0092] Specifically, the server can determine a reference resource type from multiple candidate resource types, and for each service cycle, at the characteristic moment of the service cycle, based on the resource exchange ratio between the reference resource type and the remaining non-reference resource types among the resources held by the server, calculate the total amount of resources held by the server in the service cycle. The characteristic moment can be, for example, the starting moment or the intermediate moment, etc., which is not limited here. Finally, the server determines and feeds back to the first terminal the resource gain of the resources held by the server based on the current total amount of resources in the current service cycle and the historical total amount of resources in at least one historical service cycle. Exemplarily, the server can determine the difference between the current total amount of resources and the historical total amount of resources in the previous historical service cycle as the resource gain of the resources held by the server; the server can also determine the difference between the current total amount of resources and the average value of the historical total amount of resources in the previous n historical service cycles as the resource gain of the resources held by the server.
[0093] In this embodiment, the server determines and feeds back to the first terminal the resource gain of the resources held by the server based on the reference resource type and the resource exchange ratio, which can provide richer reference data to the first terminal, facilitate the first terminal to initiate the first resource exchange request by integrating multiple types of data, and is conducive to further improving the decision-making accuracy of the first terminal, thereby improving the working efficiency of the resource exchange processing method.
[0094] In one embodiment, the resource exchange processing method further includes: in response to a trigger operation of the second terminal for the resource exchange service, obtaining a second resource exchange request initiated by the second terminal; in response to the second resource exchange request, receiving the first type of resource and transferring the second type of resource to the second terminal; and determining the request identifier of the second resource exchange request based on the request identifier corresponding to the current moment.
[0095] Among them, the second terminal refers to the terminal held by the user of the service institution. For the sake of distinction, the resource exchange request initiated by the second terminal in this application is called the second resource exchange request. The second resource exchange request is used to request to exchange the first type of resource held by the second terminal for the second type of resource held by the server, which realizes the resource exchange between the user and the service institution.
[0096] Specifically, users of the service institution can use the second terminal they hold to initiate a trigger operation for the resource exchange service. The specific way for the second terminal to trigger the resource exchange service can be, for example, to open the page of the resource exchange service or click on the control of the resource exchange service. The server can respond to this trigger operation, obtain the second resource exchange request initiated by the second terminal, and in response to the second resource exchange request, receive the first type of resource and transfer the second type of resource to the second terminal. Further, in the case of performing resource exchange, the most recently accepted historical resource exchange request is the second resource exchange request. In this case, the server can also update the request identifier, specifically determine the request identifier of the second resource exchange request based on the request identifier corresponding to the current moment. The specific update method of the request identifier can be referred to above and will not be elaborated here.
[0097] Further, if the execution of the second resource exchange request causes a change in the resource balance difference of the resources held by the server, the server can also update the resource version identifier. Taking the case where the resource version identifier includes the sub-version identifiers of each resource type as an example, if the second resource exchange request is used to request to exchange resource A held by the second terminal for resource B held by the server, it will cause changes in the balance differences of resource A and resource B in the resources held by the server. At this time, the server can update the sub-version identifiers of resource A and resource B respectively.
[0098] In the above embodiments, when the server updates the request identifier of the most recently accepted historical resource exchange request in response to the second terminal initiating the second resource exchange request, it can ensure that in the process of processing the first resource exchange request, the latest user order is not missed, which is beneficial to further ensuring the effect of filling in the unbalanced resources in the resource exchange process, and thus ensuring the working efficiency of the resource exchange process.
[0099] In one embodiment, the resource exchange processing method further includes: obtaining a configured duration threshold for the first resource exchange request; within the configured duration threshold after the trigger moment, changing the state of the resource exchange service to a prohibited trigger state.
[0100] In practical applications, a placing order cooling mechanism can be set at the front end to initially estimate the completion time of a transaction placing order, that is, the configured duration threshold for the first resource exchange request, and design it as the minimum waiting time between two placing orders, so as to avoid detecting inconsistent identifiers after placing an order and resulting in the failure of the placing order. Specifically, the server can obtain the configured duration threshold for the first resource exchange request. This configured duration threshold can be set artificially or determined by statistically analyzing the actual configured durations of multiple executed first resource exchange requests. Exemplarily, the average value or the maximum value of multiple actual configured durations can be determined as the configured duration threshold. Then, within the configured duration threshold after the triggering moment, the server changes the status of the resource exchange service to a prohibited triggering state to prevent other terminals from triggering the resource exchange service and initiating other resource exchange requests during the process of the second terminal configuring the first resource exchange request, thereby causing a change in the request identifier and resulting in the first resource exchange request not being accepted.
[0101] In this embodiment, by setting the placing order cooling mechanism, it is possible to ensure the smooth acceptance of the first resource exchange request, which is beneficial to further improving the working efficiency of the resource exchange processing method.
[0102] In one embodiment, as Figure 4 shown, a resource exchange processing method is provided. This method can be executed by a computer device, and the computer device can be the Figure 1 server shown. In this embodiment, the method includes the following steps:
[0103] Step S401, in response to a triggering operation of the first terminal for the resource exchange service, determine the triggering moment of the resource exchange service, as well as the request identifier and resource version identifier corresponding to this triggering moment;
[0104] Among them, the request identifier is used to represent the latest accepted historical resource exchange request; the resource version identifier includes the sub-version identifiers of each group of resource pairs, and each group of resource pairs includes two resource types; the sub-version identifier of the resource pair is used to represent the number of times of changes in the resource income and expenditure balance of the resource types included in the resource pair during the resource exchange processing of the resources held by the server.
[0105] Step S402, according to the resource income and expenditure balance of each resource type held by the server, determine the unbalanced resources with resource income and expenditure balance from each resource type;
[0106] Step S403, determine the target resource pair including the unbalanced resources;
[0107] Step S404, from the sub-version identifiers corresponding to the triggering moment, determine the first sub-version identifier of the target resource pair;
[0108] Step S405: Send the request identifier corresponding to the trigger moment and the first sub-version identifier of the target resource pair to the first terminal;
[0109] Step S406: Obtain the configured duration threshold for the first resource exchange request;
[0110] Step S407: Within the configured duration threshold after the trigger moment, change the status of the resource exchange service to a prohibited trigger status;
[0111] Step S408: Obtain the first resource exchange request initiated by the first terminal for at least one type of unbalanced resource;
[0112] Wherein, the first resource exchange request carries the request identifier corresponding to the trigger moment and the first sub-version identifier corresponding to the at least one type of unbalanced resource;
[0113] Step S409: Determine the second sub-version identifier corresponding to the at least one type of unbalanced resource from among the multiple sub-version identifiers corresponding to the response moment of the first resource exchange request;
[0114] Step S410: Determine the request identifier corresponding to the response moment of the first resource exchange request;
[0115] Step S411: If the request identifiers corresponding to the trigger moment and the response moment are the same, and the first sub-version identifier and the second sub-version identifier corresponding to the same unbalanced resource are the same, then perform the resource exchange for the unbalanced resource;
[0116] Step S412: Extract the first count string encoded in a number system from the request identifier corresponding to the response moment, update the first count string in the set counting order to obtain the first updated string;
[0117] Step S413: When the resource exchange is completed on the server side, replace the first count string with the first updated string to obtain the updated request identifier;
[0118] Step S414: Extract the second count string encoded in a number system from the resource version identifier corresponding to the response moment, update the second count string in the set counting order to obtain the second updated string;
[0119] Step S415: When the resource exchange is completed on the server side, replace the second count string with the second updated string to obtain the updated resource version identifier of the resource held by the server.
[0120] During the above resource exchange process, an identification management mechanism is established for the resource exchange request and the resource balance difference respectively, which can ensure that the resource balance difference expected when the first terminal initiates the first resource exchange request is consistent with the actual resource balance difference when the first resource exchange request is responded to. As a result, the resource exchange executed by the server in response to the first resource exchange request can make up for the resource balance difference of the unbalanced resources, which is beneficial to improving the working efficiency of resource exchange processing.
[0121] In one embodiment, as Figure 5 shown, the present application also provides another resource exchange processing method, which can be executed by a computer device. In this embodiment, taking the application of this method to Figure 1 the first terminal 102 in as an example for illustration, the method includes the following steps:
[0122] Step S502, perform a triggering operation for the resource exchange service, and obtain a request identifier and a resource version identifier corresponding to the triggering moment of the resource exchange service.
[0123] Among them, the first terminal refers to the terminal held by a trader of a service institution. During the process of providing resource exchange services, the service institution involves the transfer in and transfer out of various types of resources, which will inevitably cause an imbalance in income and expenditure. A type of resource with a resource balance difference between the transfer-in amount and the transfer-out amount is called an unbalanced resource. Exemplarily, the transfer-in amount of resource A is A1, and the transfer-out amount is A2. If A1 is not equal to A2, then there is a resource balance difference in the resource A held by the server. In practical applications, since the resource exchange ratio between different types of resources is not fixed, then, in the case of income and expenditure imbalance, there may be a loss of the total amount of resources due to fluctuations in the resource exchange ratio. For example, when A1 is greater than A2, if the resource exchange ratio between resource A and other types of resources decreases, it will cause a loss of the total amount of resources of the server. Based on this, a trader of a service institution can initiate a resource exchange request to the server through the first terminal to minimize the resource balance difference of the unbalanced resources and avoid the risk of loss of the total amount of resources. The resources in the present application may include game props, digital goods, commodity coupons, and so on. In a specific embodiment, the resource may refer to virtual resources circulating on the blockchain, including native digital resources generated by the on-chain processing node through block packaging, and on-chain data published through smart contracts. The request identifier is used to represent the latest accepted historical resource exchange request; the resource version identifier is used to represent the number of times of change in the resource balance difference of the resources held by the server.
[0124] Specifically, a trader of a service institution can use the first terminal in his own possession to execute a trigger operation for a resource exchange service. The specific way for the first terminal to trigger the resource exchange service can be, for example, to open the page of the resource exchange service, or to click on the control of the resource exchange service, etc. The server can, in response to this trigger operation, determine the trigger moment of the resource exchange service, and send the request identifier and the resource version identifier corresponding to this trigger moment to the first terminal. Thus, the first terminal can obtain the request identifier and the resource version identifier corresponding to the trigger moment of the resource exchange service.
[0125] In a specific embodiment, a real-time communication channel can be established between the first terminal and the server. Thus, after the identifier is updated, the server can push the latest request identifier and resource version identifier to the logged-in first terminal, so as to ensure that the identifiers observed by the trader of the service institution when placing an order are all the latest identifiers. Optionally, as Figure 6 shown, the first terminals held by Trader A and Trader B respectively can establish a long connection communication channel with the identifier management system in the server through WebSocket (a two-way communication protocol). Thus, after any identifier is updated, the identifier management system can push the latest message to each first terminal, enabling the trader to obtain the latest order identifier and resource version identifier. Further, the first terminal can display the latest resource exchange request information and resource balance on the display page of the browser or application software, and can also cache the latest order identifier and resource version identifier for use.
[0126] Step S504, generate a first resource exchange request for at least one type of unbalanced resource.
[0127] Among them, the unbalanced resource refers to a type of resource with a resource balance difference in the currently held resources of the server; the first resource exchange request carries the request identifier and the resource version identifier corresponding to the trigger moment. Specifically, after triggering the resource exchange service, a trader of a service institution can, through input or selection operations, determine the resource exchange parameters, which can include the resource type and the resource amount for resource exchange. The resource type can include at least one type of unbalanced resource. Thus, the first terminal can, in response to the determination event of the resource exchange parameters, obtain the resource exchange parameters, and generate a first resource exchange request based on the resource exchange parameters, as well as the request identifier and the resource version identifier corresponding to the trigger moment.
[0128] Step S506, send the first resource exchange request to the server.
[0129] Among them, the first resource exchange request is used to instruct the server to determine the request identifier and resource version identifier corresponding to the response moment of the first resource exchange request, and perform resource exchange for unbalanced resources when the request identifiers corresponding to the trigger moment and the response moment are the same, and the resource version identifiers corresponding to the trigger moment and the response moment are the same.
[0130] For the specific limitations on the resource exchange processing method executed by the first terminal, refer to the limitations on the resource exchange processing method executed by the server in the above text, which will not be elaborated here.
[0131] The above resource exchange processing method performs a trigger operation for the resource exchange service, obtains the request identifier and resource version identifier corresponding to the trigger moment of the resource exchange service; generates a first resource exchange request for at least one type of unbalanced resource; and sends the first resource exchange request to the server. Among them, the request identifier is used to represent the latest accepted historical resource exchange request; the resource version identifier is used to represent the number of times of change in the resource income and expenditure balance of the resources held by the server; the unbalanced resource refers to a type of resource with a resource income and expenditure balance in the currently held resources of the server; the first resource exchange request carries the request identifier and resource version identifier corresponding to the trigger moment; the first resource exchange request is used to instruct the server to determine the request identifier and resource version identifier corresponding to the response moment of the first resource exchange request, and perform resource exchange for unbalanced resources when the request identifiers corresponding to the trigger moment and the response moment are the same, and the resource version identifiers corresponding to the trigger moment and the response moment are the same. During the above resource exchange processing, an identification management mechanism is established for the resource exchange request and the resource income and expenditure balance respectively, which can ensure that the resource income and expenditure balance expected when the first terminal initiates the first resource exchange request is the same as the actual resource income and expenditure balance when the first resource exchange request is responded, so that the resource exchange executed by the server in response to the first resource exchange request can make up for the resource income and expenditure balance of the unbalanced resource, which is beneficial to improving the work efficiency of resource exchange processing.
[0132] In one embodiment, the present application further provides an application scenario, in which the above-mentioned resource exchange processing method is applied. Taking the case where the application scenario is a blockchain-based on-chain resource exchange scenario as an example. Multiple nodes on the blockchain can publish different types of digital resources, and various types of digital resources can be exchanged according to a resource exchange ratio. The service node where the service institution is located can accept a resource exchange request initiated by a user node, receive a first type of resource provided by the user node, and transfer a second type of resource to the user node. The service node can also, in response to a trigger operation for a resource exchange service by a first terminal held by a trader of the service institution, send a request identifier and a resource version identifier corresponding to the trigger moment of the resource exchange service to the first terminal; obtain a first resource exchange request initiated by the first terminal for at least one type of unbalanced resource; determine a request identifier and a resource version identifier corresponding to the response moment of the first resource exchange request; if the request identifiers corresponding to the trigger moment and the response moment are the same, and the resource version identifiers corresponding to the trigger moment and the response moment are the same, then perform a resource exchange for the unbalanced resource. Among them, the request identifier is used to represent the latest accepted historical resource exchange request; the resource version identifier is used to represent the number of times of change in the resource income and expenditure balance of the resources held by the service node; the unbalanced resource refers to a type of resource with a resource income and expenditure balance among the currently held resources of the service node; the first resource exchange request carries the request identifier and the resource version identifier corresponding to the trigger moment.
[0133] In one embodiment, the resource exchange processing method provided by the present application can also be applied to a foreign exchange exposure processing scenario. Among them, foreign exchange trading is to buy one currency in a pair of currency combinations and sell another currency at the same time. It is the exchange of one country's currency for another country's currency. Different from other financial markets, the foreign exchange market has no specific location and no central exchange, but conducts transactions through an electronic network among banks, enterprises, and individuals. In the intermediary service of foreign exchange trading for customers by banks or institutions, there are often "long positions" or "short positions" in foreign exchange positions (which is the professional term for foreign exchange assets in the financial industry). A long position means that the purchase amount is greater than the sale amount, and a short position means that the sale amount is greater than the purchase amount. Such "short positions" and "long positions" are called "foreign exchange exposures". Exposures carry factors of income and expenditure imbalance, and due to exchange rate fluctuations, risks may be brought. Therefore, banks or institutions often need to sell long positions and cover short positions, which is called closing positions or covering exposures.
[0134] Specifically, the server can generate globally unique version numbers (i.e., identifiers) for the newly received foreign exchange in terms of orders and the latest exposure changes respectively, and the version numbers are incremented separately to ensure uniqueness. Before multiple traders place orders on their respective front-end interfaces, they receive the latest order information and exposure information, including the order version number and the exposure version number. In this scenario, the system that executes resource exchange processing on the server is called the exposure management system, and the computer module on the server that manages version numbers is called the version sub-module. When a trader places an order, they need to submit the transaction order information and the version number information of the current front-end interface of this person to the exposure management system on the server. When the exposure management system receives the order placement information and version information from the trader, it needs to check whether the version number is the latest version number. Only under this condition will it accept this transaction and return a prompt message of "order placed successfully", and at the same time prompt the version sub-module to update the version information. If the received version information includes a non-latest version number, the server will reject the transaction and return a prompt message of "order placement failed - the current version number has expired".
[0135] In one embodiment, as Figure 7 shown, the order placement process of a trader may include the following steps:
[0136] Step S701, the trader opens the order placement interface;
[0137] Step S702, since the trader cannot observe the subsequent latest order and exposure information after opening the order placement interface, that is, the latest information obtained by the trader stays at the moment of opening the order placement interface, so a snapshot of the current latest version number is taken when opening the interface;
[0138] Step S703, when the trader fills in the transaction information and submits a transaction request, carry the version number snapshot taken in the previous step;
[0139] Step S704, after the exposure management system receives the order placement request, send the snapshot version number carried in the request to the version sub-module for verification to determine whether the snapshot version number is consistent with the latest version number;
[0140] Step S705, if the verification is inconsistent, return to the trader the information "order placement failed - the current version number has expired";
[0141] Step S706, if the verification is consistent, accept the request and return to the trader "order placed successfully";
[0142] Step S707, after the exposure management system accepts the order, notify the version sub-module to update the order version number and the exposure version number.
[0143] By adopting the above method, when a trader places a trading order, they no longer need to worry about whether they have missed the latest order and exposure information and placed a wrong order. Moreover, through the release of version numbers, all logged-in traders can obtain the latest trading decision-making data and its version number as soon as possible. Due to these two direct reasons above, when an institution sets up exposure management, it no longer needs to split and isolate different businesses. Instead, it can manage the exposures of different businesses together in a unified manner. The number of trading personnel operating is also greatly reduced, and they can jointly manage the unified exposure without worrying about incorrect information. Therefore, the efficiency of the institution in managing exposures can be significantly improved.
[0144] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are shown sequentially in the direction of the arrows, these steps are not necessarily executed sequentially in the direction of the arrows. Unless there is a clear indication in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least some of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least some of the steps or stages in other steps or other steps.
[0145] Based on the same inventive concept, the embodiments of the present application also provide a resource exchange processing device for implementing the resource exchange processing method described above. The solution provided by this device to solve the problem is similar to the solution described in the above method. Therefore, the specific limitations in one or more of the following embodiments of the resource exchange processing device can refer to the limitations on the resource exchange processing method in the above text, and will not be repeated here.
[0146] In one embodiment, as Figure 8 shown, a resource exchange processing device is provided, including: an identification feedback module 801, a request acquisition module 802, an identification determination module 803, and a resource exchange module 804, where:
[0147] The identification feedback module 801 is configured to, in response to a trigger operation of the first terminal for a resource exchange service, send a request identifier and a resource version identifier corresponding to the trigger moment of the resource exchange service to the first terminal; the request identifier is used to represent the latest accepted historical resource exchange request; the resource version identifier is used to represent the number of times of change in the resource income and expenditure balance of the resources held by the server;
[0148] A request acquisition module 802, configured to acquire a first resource exchange request initiated by a first terminal for at least one type of unbalanced resource; an unbalanced resource refers to a type of resource with a resource income and expenditure difference among the currently held resources of the server; the first resource exchange request carries a request identifier and a resource version identifier corresponding to the trigger moment.
[0149] An identifier determination module 803, configured to determine a request identifier and a resource version identifier corresponding to the response moment of the first resource exchange request.
[0150] A resource exchange module 804, configured to perform resource exchange for the unbalanced resource if the request identifiers corresponding to the trigger moment and the response moment are consistent, and the resource version identifiers corresponding to the trigger moment and the response moment are consistent.
[0151] In one embodiment, the identifier feedback module 801 is specifically configured to: when the first terminal triggers a resource exchange service, determine the trigger parameter of the first terminal for the resource exchange service and the trigger moment of the resource exchange service; determine and send to the first terminal a request identifier that matches the trigger parameter from multiple candidate request identifiers corresponding to the trigger moment. In the case of this embodiment, the identifier determination module 803 is specifically configured to: determine a request identifier that matches the trigger parameter from multiple candidate request identifiers corresponding to the response moment of the first resource exchange request.
[0152] In one embodiment, the resource version identifier includes sub-version identifiers of respective multiple resource pairs; each group of the resource pairs includes two resource types. In the case of this embodiment, the resource exchange processing device further includes a trigger moment identifier determination module, specifically configured to: determine a target resource pair including the unbalanced resource; determine a first sub-version identifier of the target resource pair from the respective sub-version identifiers corresponding to the trigger moment. The identifier determination module 803 is specifically configured to: determine a second sub-version identifier of the target resource pair from multiple sub-version identifiers corresponding to the response moment of the first resource exchange request.
[0153] In one embodiment, the resource exchange processing device further includes a trigger moment identifier determination module, configured to: in response to a trigger operation of the first terminal for the resource exchange service, generate an identifier snapshot at the trigger moment of the resource exchange service; determine a request identifier and a resource version identifier corresponding to the trigger moment from the identifier information saved in the identifier snapshot.
[0154] In one embodiment, the resource exchange processing device further includes an identifier update module, configured to: based on the request identifier corresponding to the response moment, determine the request identifier of the first resource exchange request; based on the resource version identifier corresponding to the response moment, determine the resource version identifier of the resources held by the server after the resource exchange is completed.
[0155] In one embodiment, the identity update module is specifically configured to: extract a count string encoded based on a number system from the resource version identity corresponding to the response moment; update the count string according to a set counting order to obtain an updated string; when the resource exchange is completed on the server side, replace the count string with the updated string to obtain the resource version identity of the resources held by the server side.
[0156] In one embodiment, the resource exchange processing device further includes a resource gain feedback module, configured to: determine a reference resource type from multiple candidate resource types; for each service cycle, calculate the total amount of resources held by the server side in this service cycle based on the resource exchange ratio between the reference resource type and the remaining non-reference resource types among the resources held by the server side; determine and feedback to the first terminal the resource gain of the resources held by the server side based on the current total amount of resources in the current service cycle and the historical total amount of resources in at least one historical service cycle.
[0157] In one embodiment, the request acquisition module 802 is further configured to: in response to a trigger operation of the second terminal for the resource exchange service, acquire a second resource exchange request initiated by the second terminal; the second resource exchange request is used to request to exchange the first type of resources held by the second terminal for the second type of resources held by the server side. The resource exchange module 804 is further configured to: in response to the second resource exchange request, receive the first type of resources and transfer the second type of resources to the second terminal. In the case of this embodiment, the resource exchange processing device further includes an identity update module, configured to determine the request identity of the second resource exchange request based on the request identity corresponding to the current moment.
[0158] In one embodiment, the resource exchange processing device further includes a status change module, configured to acquire a configured duration threshold for the first resource exchange request; within the configured duration threshold after the trigger moment, change the status of the resource exchange service to a prohibited trigger status.
[0159] Each module in the above resource exchange processing device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the computer device in hardware form or be independent of it, or can be stored in the memory of the computer device in software form, so as to facilitate the processor to call and execute the operations corresponding to the above respective modules.
[0160] In one embodiment, as Figure 9 shown, a resource exchange processing device is provided, including: an identity acquisition module 901, a request generation module 902, and a request sending module 903, where:
[0161] An identification acquisition module 901, configured to acquire a request identifier and a resource version identifier corresponding to the triggering moment of the resource exchange service in response to a triggering operation for the resource exchange service; the request identifier is used to represent the latest accepted historical resource exchange request; the resource version identifier is used to represent the number of times of change in the resource balance difference of the resources held by the server.
[0162] A request generation module 902, configured to generate a first resource exchange request for at least one type of unbalanced resource; the unbalanced resource refers to a type of resource with a resource balance difference in the currently held resources of the server; the first resource exchange request carries the request identifier and the resource version identifier corresponding to the triggering moment.
[0163] A request sending module 903, configured to send the first resource exchange request to the server; the first resource exchange request is used to instruct the server to determine the request identifier and the resource version identifier corresponding to the response moment of the first resource exchange request, and perform resource exchange for the unbalanced resource when the request identifiers corresponding to the triggering moment and the response moment are consistent, and the resource version identifiers corresponding to the triggering moment and the response moment are consistent.
[0164] Each module in the above resource exchange processing device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor in the computer device in the form of hardware or be independent of the processor, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0165] In one embodiment, a computer device is provided. The computer device can be a server or a terminal, and its internal structure diagram can be as Figure 10 shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store the data involved in the above resource exchange processing process. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals through a network connection. When the computer program is executed by the processor, a resource exchange processing method is implemented.
[0166] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structural diagram may be as shown in Figure 11 . The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface, the display unit, and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals in a wired or wireless manner. The wireless manner can be implemented through WIFI, a mobile cellular network, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a resource exchange processing method. The display unit of the computer device is used to form a visually visible picture, which may be a display screen, a projection device, or a virtual reality imaging device. The display screen may be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device may be a touch layer covering the display screen, or may be a button, a trackball, or a touchpad provided on the housing of the computer device, or may also be an external keyboard, touchpad, or mouse, etc.
[0167] Those skilled in the art can understand that Figure 11 the structure shown in or 12 is only a block diagram of some structures 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 component layout.
[0168] In one embodiment, a computer device is further provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in the above method embodiments are implemented.
[0169] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by the processor, the steps in the above method embodiments are implemented.
[0170] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by the processor, the steps in the above method embodiments are implemented.
[0171] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data that have been authorized by the user or fully authorized by all parties. Moreover, the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards in the relevant regions and areas. Additionally, the object can choose not to authorize the object information and relevant data, or can refuse or conveniently refuse to push information, etc.
[0172] In this application, during the process of collecting and processing relevant data in practical applications, the informed consent or separate consent of the personal information subject should be obtained strictly in accordance with the requirements of relevant regional laws and regulations, and subsequent data use and processing behaviors should be carried out within the scope authorized by laws, regulations, and the personal information subject.
[0173] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memories can include read-only memory (ROM), magnetic tapes, floppy disks, flash memories, optical memories, high-density embedded non-volatile memories, resistive random access memories (ReRAM), magnetoresistive random access memories (MRAM), ferroelectric random access memories (FRAM), phase change memories (PCM), graphene memories, etc. Volatile memories can include random access memory (RAM) or external cache memories, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logics, data processing logics based on quantum computing, etc., without limitation.
[0174] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, 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, it should be considered as the scope recorded in this specification.
[0175] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A resource exchange processing method, characterized in that The method includes: In response to a trigger operation of a first terminal for a resource exchange service, sending a request identifier and a resource version identifier corresponding to the trigger moment of the resource exchange service to the first terminal; the request identifier is used to represent the most recently accepted historical resource exchange request; the resource version identifier is used to represent the number of times of change in the resource balance of the resources held by the server; Obtaining a first resource exchange request initiated by the first terminal for at least one type of unbalanced resource; the unbalanced resource refers to a type of resource with a resource balance in the currently held resources of the server; the first resource exchange request carries the request identifier and the resource version identifier corresponding to the trigger moment; Determining a request identifier and a resource version identifier corresponding to the response moment of the first resource exchange request; If the request identifiers corresponding to the trigger moment and the response moment are the same, and the resource version identifiers corresponding to the trigger moment and the response moment are the same, then perform a resource exchange for the unbalanced resource.
2. The method according to claim 1, wherein The step of, in response to a trigger operation of a first terminal for a resource exchange service, sending a request identifier corresponding to the trigger moment of the resource exchange service to the first terminal includes: In the case where the first terminal triggers a resource exchange service, determining the trigger parameter of the first terminal for the resource exchange service and the trigger moment of the resource exchange service; Determining and sending to the first terminal a request identifier that matches the trigger parameter from among a plurality of candidate request identifiers corresponding to the trigger moment; The step of determining a request identifier corresponding to the response moment of the first resource exchange request includes: Determining a request identifier that matches the trigger parameter from among a plurality of candidate request identifiers corresponding to the response moment of the first resource exchange request.
3. The method according to claim 1, characterized in that, The resource version identifier includes sub-version identifiers of respective resource pairs; each resource pair includes two resource types; the method further includes: Determining a target resource pair including the unbalanced resource; Determining a first sub-version identifier of the target resource pair from among the sub-version identifiers corresponding to the trigger moment; The step of determining a resource version identifier corresponding to the response moment of the first resource exchange request includes: Determining a second sub-version identifier of the target resource pair from among a plurality of sub-version identifiers corresponding to the response moment of the first resource exchange request.
4. The method according to claim 1, wherein The method further includes: In response to a trigger operation of a first terminal for a resource exchange service, generating an identifier snapshot at the trigger moment of the resource exchange service; Determining the request identifier and the resource version identifier corresponding to the trigger moment from the identifier information saved in the identifier snapshot.
5. The method according to claim 1, wherein The method further includes: Determining the request identifier of the first resource exchange request based on the request identifier corresponding to the response moment; Determining the resource version identifier of the resources held by the server after the resource exchange is completed based on the resource version identifier corresponding to the response moment.
6. The method according to claim 5, characterized in that, The step of determining the resource version identifier of the resources held by the server after the resource exchange is completed based on the resource version identifier corresponding to the response moment includes: Extract a count string encoded based on a number system from the resource version identifier corresponding to the response moment; Update the count string according to a set counting order to obtain an updated string; When the resource exchange is completed on the server side, replace the count string with the updated string to obtain the resource version identifier of the resources held by the server side.
7. The method according to claim 1, characterized in that The method further includes: Determine a reference resource type from multiple candidate resource types; For each service cycle, calculate the total amount of resources held by the server side in the service cycle based on the resource exchange ratio between the reference resource type and the remaining non-reference resource types among the resources held by the server side; Based on the current total amount of resources in the current service cycle and the historical total amount of resources in at least one historical service cycle, determine and feedback to the first terminal the resource gain of the resources held by the server side.
8. The method according to any one of claims 1 to 7, characterized in that, The method further includes: In response to a trigger operation of the second terminal for the resource exchange service, obtain a second resource exchange request initiated by the second terminal; the second resource exchange request is used to request to exchange the first type of resources held by the second terminal for the second type of resources held by the server side; In response to the second resource exchange request, receive the first type of resources and transfer the second type of resources to the second terminal; Based on the request identifier corresponding to the current moment, determine the request identifier of the second resource exchange request.
9. The method according to claim 8, characterized in that, The method further includes: Obtain a configured duration threshold for the first resource exchange request; Within the configured duration threshold after the trigger moment, change the state of the resource exchange service to a prohibited trigger state.
10. A resource exchange processing method, characterized in that The method includes: Execute a trigger operation for the resource exchange service, and obtain a request identifier and a resource version identifier corresponding to the trigger moment of the resource exchange service; the request identifier is used to represent the latest accepted historical resource exchange request; the resource version identifier is used to represent the number of times of change in the resource income and expenditure balance of the resources held by the server side; Generate a first resource exchange request for at least one type of unbalanced resources; the unbalanced resources refer to a type of resources with a resource income and expenditure balance among the currently held resources of the server side; the first resource exchange request carries the request identifier and the resource version identifier corresponding to the trigger moment; Send the first resource exchange request to the server side; the first resource exchange request is used to instruct the server side to determine the request identifier and the resource version identifier corresponding to the response moment of the first resource exchange request, and perform a resource exchange for the unbalanced resources when the request identifiers corresponding to the trigger moment and the response moment are the same, and the resource version identifiers corresponding to the trigger moment and the response moment are the same.
11. A resource exchange processing device, characterized in that, The device includes: An identification feedback module, configured to send a request identification and a resource version identification corresponding to the triggering moment of the resource exchange service to the first terminal in response to a triggering operation of the first terminal for the resource exchange service; the request identification is used to represent the latest accepted historical resource exchange request; the resource version identification is used to represent the number of times of change in the resource balance of the resources held by the server. A request acquisition module, configured to acquire a first resource exchange request initiated by the first terminal for at least one type of unbalanced resource; the unbalanced resource refers to a type of resource with a resource balance difference among the currently held resources of the server; the first resource exchange request carries the request identification and the resource version identification corresponding to the triggering moment. An identification determination module, configured to determine the request identification and the resource version identification corresponding to the response moment of the first resource exchange request. A resource exchange module, configured to perform a resource exchange for the unbalanced resource if the request identifications corresponding to the triggering moment and the response moment are consistent, and the resource version identifications corresponding to the triggering moment and the response moment are consistent.
12. A resource exchange processing device, characterized in that, The apparatus includes: An identification acquisition module, configured to acquire a request identification and a resource version identification corresponding to the triggering moment of the resource exchange service in response to a triggering operation for the resource exchange service; the request identification is used to represent the latest accepted historical resource exchange request; the resource version identification is used to represent the number of times of change in the resource balance of the resources held by the server. A request generation module, configured to generate a first resource exchange request for at least one type of unbalanced resource; the unbalanced resource refers to a type of resource with a resource balance difference among the currently held resources of the server; the first resource exchange request carries the request identification and the resource version identification corresponding to the triggering moment. A request sending module, configured to send the first resource exchange request to the server; the first resource exchange request is used to instruct the server to determine the request identification and the resource version identification corresponding to the response moment of the first resource exchange request, and perform a resource exchange for the unbalanced resource when the request identifications corresponding to the triggering moment and the response moment are consistent, and the resource version identifications corresponding to the triggering moment and the response moment are consistent.
13. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 10 are implemented.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 10 are implemented.
15. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 10 are implemented.