Token transaction method, device and electronic equipment in game

By specifying the transaction-related parameters for managing the token set on the server, and optimizing the token exchange process using Redis database and Lua scripts, the problem of low token exchange efficiency in existing technologies is solved, and efficient token trading is achieved.

CN122222729APending Publication Date: 2026-06-16NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NETEASE (HANGZHOU) NETWORK CO LTD
Filing Date
2026-04-21
Publication Date
2026-06-16

AI Technical Summary

Technical Problem

The token exchange process in existing technologies is inefficient, resulting in high system computational consumption and an inability to efficiently handle token exchange needs between players.

Method used

By storing transaction-related parameters for multiple token sets on a designated server, the target token set is determined and token transaction processing parameters are generated. The token set is managed using a Redis database, and atomic changes to the exchange rate pool are implemented using Lua scripts, reducing system computational performance consumption.

Benefits of technology

It improves the efficiency of token transactions, reduces the consumption of system computing power, and ensures the efficient operation of the token exchange process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122222729A_ABST
    Figure CN122222729A_ABST
Patent Text Reader

Abstract

The application provides a token transaction method and device in a game and electronic equipment, determines a required quantity of a first token of a first game account; determines a target token set from a plurality of token sets based on transaction related parameters of the plurality of token sets and the required quantity, and determines token transaction processing parameters corresponding to the target token set; and sends the token transaction processing parameters to a game server, so that the game server issues a first token in a to-be-transacted state in the target token set to the first game account based on the token transaction processing parameters. In this way, the server specifies the transaction related parameters of the tradable tokens saved, determines the token transaction processing parameters of the token exchange demand of the game account, and makes the game server solve the token exchange demand of the game account based on the token transaction processing parameters, thereby reducing the consumption of the system computing performance, improving the token transaction efficiency of the game system, reducing the error rate, and improving the auditing efficiency of the product packaging.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of game technology, and more specifically, to a method, apparatus, and electronic device for token trading in games. Background Technology

[0002] In games, different types of tokens can be designed. These different types of tokens typically have different acquisition and consumption methods. To meet players' needs for exchanging different types of tokens, the game system can allow players to list certain tokens, enabling the exchange of different types of tokens through exchange rates.

[0003] In related technologies, in-game item transactions can be stored in a document database. When an item transaction service exists in the game system, this document is loaded, and data operations for item transactions are implemented through the game system's memory. Since the amount of data a document can store is limited, different types of item transactions are typically stored in different documents. However, if token exchanges were also conducted using this method, cross-document processing would be required during the token exchange process, resulting in low efficiency.

[0004] Alternatively, each transaction could be stored as a commodity in the database. When a player wants to purchase a commodity, the commodity must be locked and the corresponding inventory deduction operation performed. However, a single exchange between tokens requires locking a large number of tokens to consign the corresponding commodity. During the locking process, other transactions for that commodity cannot be executed. Furthermore, given that the exchange rate for tokens is variable, the total amount of each exchange rate needs to be aggregated during each token exchange by a player, resulting in a significant increase in the system's computational performance and low efficiency. Summary of the Invention

[0005] In view of this, the purpose of the present invention is to provide a method, apparatus and electronic device for token trading in games, so as to reduce the consumption of system computing performance and improve the token trading efficiency of game systems.

[0006] In a first aspect, embodiments of the present invention provide a token trading method in a game. The method is applied to a designated server; the designated server is communicatively connected to a game server; the designated server stores transaction-related parameters for multiple token sets provided by game accounts on the game server; each token set includes multiple first tokens in a pending trading state; the transaction-related parameters are used to indicate at least the exchange ratio between the first tokens and second tokens in the token set; the method includes: determining the quantity of first tokens required by a first game account; determining a target token set from the multiple token sets based on the transaction-related parameters and the quantity required, and determining the token trading processing parameters corresponding to the target token set; sending the token trading processing parameters to the game server, so that the game server, based on the token trading processing parameters, distributes the first tokens in the pending trading state of the target token set to the first game account.

[0007] Secondly, embodiments of the present invention provide a token trading device in a game. This device is located on a designated server; the designated server is communicatively connected to a game server; the designated server stores transaction-related parameters for multiple token sets provided by game accounts on the game server; each token set includes multiple first tokens in a pending trading state; the transaction-related parameters at least indicate the exchange ratio between the first tokens and second tokens in the token set; the device includes: a demand quantity determination module, used to determine the demand quantity of the first game account for the first tokens; a transaction processing parameter determination module, used to determine a target token set from the multiple token sets based on the transaction-related parameters and demand quantity of the multiple token sets, and determine the token transaction processing parameters corresponding to the target token set; a transaction processing parameter sending module, used to send the token transaction processing parameters to the game server, so that the game server, based on the token transaction processing parameters, issues the first tokens in the pending trading state of the target token set to the first game account; and a target image generation module, used to input the content to be analyzed into a target model, output analysis results corresponding to at least some packaging elements through the target model, and generate a target image based on the image to be reviewed and the analysis results; the target image includes at least one icon, the at least one icon being used to indicate error information in the target text content, and / or, the analysis results.

[0008] Thirdly, embodiments of the present invention provide an electronic device, including a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the aforementioned token trading method in the game.

[0009] Fourthly, embodiments of the present invention provide a machine-readable storage medium storing machine-executable instructions. When the machine-executable instructions are invoked and executed by a processor, the machine-executable instructions cause the processor to implement the aforementioned token trading method in the game.

[0010] The embodiments of the present invention bring the following beneficial effects: The aforementioned method, apparatus, and electronic device for token trading in a game determine the quantity of first tokens required by a first game account; based on transaction-related parameters and required quantities of multiple token sets, a target token set is determined from the multiple token sets, and the corresponding token trading processing parameters are determined; the token trading processing parameters are sent to the game server, so that the game server, based on the token trading processing parameters, distributes the first tokens in the target token set that are in a pending trading state to the first game account. This method, by specifying a server to determine the token trading processing parameters for the token exchange demand generated by the game account based on the transaction-related parameters of the stored tradable tokens, enables the game server to resolve the token exchange demand of the game account based on the token trading processing parameters, reducing the consumption of system computing performance and improving the token trading efficiency of the game system.

[0011] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained in accordance with the structures particularly pointed out in the description, claims and drawings.

[0012] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0013] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0014] Figure 1 A flowchart illustrating a token trading method in a game, as provided in an embodiment of the present invention; Figure 2 A schematic diagram illustrating a player-provided token set as provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the data structure in a database for a remote dictionary service provided in an embodiment of the present invention; Figure 4A flowchart illustrating a player's token trading process is provided as an embodiment of the present invention. Figure 5 A flowchart illustrating the process of a player removing a collection of tokens, provided as an embodiment of the present invention; Figure 6 This is a schematic diagram of the structure of a token trading device in a game, provided by an embodiment of the present invention; Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0015] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0016] In games, various tokens (also called "currencies") often exist, such as silver, first tokens, and second tokens. Assuming the game includes first and second tokens, first tokens are obtained through daily tasks, while second tokens are obtained less frequently, often requiring payment or appearing in small quantities during events. The methods of using first and second tokens also typically differ; for example, some game items can only be purchased with first tokens, while in certain scenarios only second tokens can be used. In practical applications, first tokens can be set to a higher value and second tokens to a lower value; the specific settings can be configured according to needs and are not limited here.

[0017] To meet the exchange needs between players' currencies, the game system allows ordinary players to exchange their basic first tokens for higher-value second tokens, while players with second tokens can exchange them for first tokens through a market-like exchange rate. The game typically includes a token exchange system with an official exchange rate of x:1. Players can freely adjust their first tokens' exchange rate based on this official rate. For example, if the official rate is 140:1, a player acting as a seller can set their first tokens' exchange rate within the range of 140:1 to 150:1 and list them on the exchange system. Buyers can then exchange their second tokens for first tokens at a higher to lower exchange rate in the currency market.

[0018] When a player enters the token exchange system as a buyer, they can see the amount of currency available at each exchange rate, as shown in Table 1. When a player wants to exchange 150,000 First Tokens, they will be prioritized for the 100,000 First Tokens available at an exchange rate of 144:1, and then for the 50,000 First Tokens available at a rate of 143:1.

[0019] Table 1

[0020] In-game product trading can typically be achieved through the following two methods: One approach involves using a document database, such as MongoDB. All items are stored in a MongoDB document. When the game starts, a transaction service loads this document. All subsequent data operations are performed in memory, and persistence is achieved by periodically or in real-time saving to the database. All transaction activities reside in memory. When an item needs to be listed, the corresponding action is sent to the transaction service for centralized management.

[0021] The game's characteristic is that it tends to load all data into memory for operation. In memory, it's convenient to summarize and maintain the sums of token sets with various exchange rates, and it's also easy to implement logic for deductions based on exchange rates from high to low. Therefore, the above solution is quite suitable for games; however, its drawbacks are also very obvious. It centralizes the data in a MongoDB document, and most document databases have a limit on the size of a single document, for example, MongoDB documents have a 16MB limit. This solution is usually solved through sharding, that is, the transaction service is managed by different transaction service documents according to the type of goods, such as pets and equipment, to achieve horizontal scaling. However, this cannot be done in a currency token exchange system because the type of goods is singular—it's all currency. If sharding is done according to the exchange rate, cross-shard processing may need to be considered when completing a transaction, making the situation more complex.

[0022] Another approach is to use a document database or relational database, where each transaction is set as a product. When a player needs to purchase a product, the product must first be locked and the corresponding inventory deduction operation performed before the product lock is released.

[0023] This scheme has advantages when purchasing single items. Due to the locking logic, it's very easy to implement various locking actions for transactions. If the transaction involves multiple stages, such as auctions or pre-orders, this scheme is relatively simple. The disadvantage is that locking the item during purchase may affect concurrency to some extent. In a token exchange system, a single purchase might require locking thousands of consignments. For example, if 1000 players have consigned 10,000 second-tier tokens, and a buyer wants to purchase 10 million second-tier tokens, other transactions may have to wait or fail during the locking process. Furthermore, this scheme requires players to sum up all exchange rate orders each time they query for token exchange, which incurs performance overhead and is relatively inefficient.

[0024] Based on this, embodiments of the present invention provide a method, apparatus, and electronic device for token trading in games, which can be applied to live streaming scenarios.

[0025] See Figure 1 First, this invention introduces a method for token trading in a game, as provided in an embodiment of the present invention. This method is applied to a designated server. This designated server can be a single server, or it can refer to servers forming a server cluster, a cloud computing system, a distributed storage system, or one or more servers implementing a database; no limitation is made here. The designated server communicates with the game server. The designated server stores transaction-related parameters for multiple token sets provided by game accounts on the game server. Each token set includes multiple first tokens in a pending transaction state. The transaction-related parameters at least indicate the exchange ratio between the first tokens and second tokens in the token set.

[0026] Token sets are typically created by players. Players can add some or all of their own first tokens from their game accounts to a token set. Players can create one or more token sets, and the number of first tokens in different sets can be the same or different. First tokens added to a token set are in a pending-trade state and cannot be used by the player. When setting up a token set, players usually need to set the exchange rate between first and second tokens as a transaction-related parameter. For example, if 10 second tokens can be exchanged for 1 token, the exchange rate parameter could be 1:10. Transaction-related parameters may also include the creation time of the token set and the account identifier of the game account that created the token set. When the number of first tokens in a token set can be set by the game account itself, the transaction-related parameters can also include the number of first tokens in the set. Transaction-related parameters can be sent from the game server to a designated server, or the designated server can parse the data after receiving the token set data from the game server to generate a transaction record for the token set. Specific settings can be configured according to needs and are not limited here.

[0027] The method includes the following steps: Step S102: Determine the required quantity of the first game account for the first token.

[0028] The game account corresponding to the game server can typically send a token transaction request to acquire the first token. The game account can send a token transaction request to the game server or directly to a designated server. The token transaction request usually includes the required quantity of the first token. The aforementioned first game account can be any game account; no restrictions are imposed here.

[0029] Step S104: Based on the transaction-related parameters and required quantities of multiple token sets, determine the target token set from the multiple token sets, and determine the token transaction processing parameters corresponding to the target token set.

[0030] To ensure players acquire the required number of first tokens with the minimum amount of second tokens, the transaction-related parameters of multiple token sets can be sorted according to their corresponding exchange rates. The sorting order is typically from highest to lowest exchange rate. To shorten transaction times for token sets, among those with the same exchange rate, the transaction-related parameters of token sets established earlier can be prioritized.

[0031] Therefore, following this order, the first token in the token set can be used as the first token for transactions with the first game account. Correspondingly, the target token set includes the first token used for transactions with the first game account. When the first tokens in the determined target token set meet the required quantity, it is not necessary to further determine the target token set. The number of target token sets can be one or more.

[0032] The token transaction processing parameters for the target token set typically include the set identifier of the target token set to determine which token set's first token should be used for the transaction. The token transaction parameters also typically include the quantity of the first token in the target token set used for the transaction. This quantity can be the total quantity of all first tokens in the target token set or a portion of the first tokens in the target token set. The token transaction processing parameters also need to include the exchange rate parameter corresponding to the target token set to determine the quantity of second tokens to be issued to the game account providing the target token set. The token transaction processing parameters may also include the timeframe for determining the target token set, etc., which can be set according to requirements and are not limited here.

[0033] Step S106: Send the token transaction processing parameters to the game server so that the game server can issue the first token in the target token set that is in a pending transaction state to the first game account based on the token transaction processing parameters.

[0034] After determining the token transaction processing parameters, these parameters need to be sent to the game server. The game server needs to determine the target token set based on these parameters and distribute the corresponding quantity of first tokens from the target token set to the first game account. The game server also needs to calculate the second tokens required by the first game account based on the exchange rate parameters corresponding to the target token set and the token quantity, deduct the corresponding second tokens from the first game account, and distribute the second tokens to the game account that provided the target token set.

[0035] The aforementioned token trading method in a game involves determining the quantity of a first game account's required first token; based on transaction-related parameters and required quantities from multiple token sets, identifying a target token set and determining the corresponding token trading processing parameters; and sending these parameters to the game server, which then distributes the first tokens in the target token set that are awaiting trading to the first game account. This method, by specifying that the server determines the token trading processing parameters for the game account's token exchange request based on stored transaction-related parameters of tradable tokens, allows the game server to fulfill the game account's token exchange request, reducing the consumption of system computing power and improving the token trading efficiency of the game system.

[0036] The following embodiments provide transaction-related parameters and required quantities based on multiple token sets, determine the target token set from the multiple token sets, and determine the implementation method of the token transaction processing parameters corresponding to the target token set.

[0037] In practical applications, when a server stores transaction-related parameters for multiple token sets, it can form a data queue with these parameters. Each token set's transaction-related parameters are an element in this queue. These parameters typically include exchange rate parameters and set generation time parameters. Multiple token sets can be grouped according to their exchange rate parameters, with each group having the same exchange rate parameter. Then, for each group, the token sets are sorted from earliest to latest based on their set generation time. Finally, the sorted groups are arranged from largest to smallest based on their exchange rate parameters, thus obtaining the corresponding data queue. As discussed above, the position of a token set's transaction-related parameters in the data queue is negatively correlated with the exchange rate parameter and positively correlated with the set generation time parameter.

[0038] When a player creates a new token set comprising multiple tokens and determines its transaction parameters, these parameters need to be inserted into the data queue. For convenience, this new token set is referred to as the "new token set." After obtaining the transaction parameters of the new token set, the data queue can be updated based on these parameters; the transaction parameters of the new token set become elements of the updated data queue. When updating the data queue, the token set group to which the new token set belongs can be determined based on its exchange rate parameters. The new token set is then inserted after the last element in the token set group, forming the updated data queue.

[0039] In practical implementation, based on the data queue and the required quantity, a target token set needs to be determined from multiple token sets, along with the corresponding token transaction processing parameters. When determining the target token set, the number of tokens in the transaction-related parameters is required. This number is typically the number of currently tradable first tokens in the token set. This number can be the same as or different from the initial number of first tokens in the token set. If some of the first tokens in the token set have already been traded, the number of currently tradable first tokens in the token set will differ from the initial number.

[0040] Specifically, the first element in the data queue can be identified as the current transaction-related parameter. It is then determined whether the number of tokens in the current transaction-related parameter is less than the required quantity. For example, if the required quantity is 100 and the current number of tokens in the transaction-related parameter is 20, then the number of tokens in the current transaction-related parameter is less than the required quantity. If it is less than the required quantity, the token set corresponding to the current transaction-related parameter is identified as the first target token set, and the token transaction processing parameters corresponding to the first target token set are determined. Specifically, the number of tokens corresponding to the first target token set needs to be determined as the token transaction quantity corresponding to the first target token set. Then, the required quantity is updated based on the number of tokens in the first target token set. Typically, the updated required quantity is determined by subtracting the number of tokens in the first target token set from the required quantity.

[0041] If the number of tokens in the current transaction parameters is greater than or equal to the required quantity, then the first set of target tokens can cover the required quantity, and there is no need to further determine the target set. In this case, the required quantity needs to be determined as the number of token transactions corresponding to the first set of target tokens.

[0042] After updating the demand quantity, the elements in the data queue following the current transaction-related parameters also need to be updated to reflect the current transaction-related parameters. Then, it's determined whether the token quantity in the updated current transaction-related parameters is less than the updated demand quantity. If it is less, the token set corresponding to the updated current transaction-related parameters is designated as the second target token set, and the token transaction processing parameters corresponding to the second target token set are determined. Finally, the demand quantity is updated based on the token quantity in the second target token set.

[0043] If the number of tokens in the updated current transaction-related parameters is less than the updated demand quantity, continue updating the current transaction-related parameters until the number of tokens in the updated current transaction-related parameters is greater than or equal to the updated demand quantity. Then, the token set corresponding to the current transaction-related parameters is determined as the third target token set, and the token transaction processing parameters corresponding to the third target token set are determined based on the updated demand quantity. At this point, the updated demand quantity needs to be determined as the token transaction quantity corresponding to the third target token set.

[0044] In determining the target token sets mentioned above, it is necessary to delete the transaction-related parameters corresponding to the first and second target token sets that have been fully used for transactions, and update the token quantity corresponding to the third target token set based on the updated demand quantity, so that the updated token quantity matches the existing token quantity.

[0045] When the token transaction processing parameters corresponding to the target token set also include the target token consumption quantity, it is necessary to calculate the target token consumption quantity of the second token corresponding to the target token set based on the token transaction quantity and exchange ratio corresponding to the target token set. This allows the game server to understand the quantity of the second token that needs to be sent to the game account that provides the target token set.

[0046] To immediately lock the second token in the first game account used for trading the first token, the cumulative quantity of tokens in multiple token sets can be calculated before determining the target token set from multiple token sets. If the cumulative result is less than the required quantity, a first message is returned to the game server. The first message indicates that the token transaction corresponding to the first game account has failed. Therefore, no token transaction will be performed for the first game account.

[0047] If the accumulated result is greater than or equal to the required quantity, the initial token consumption amount of the second token corresponding to the first game account can be determined based on the token quantity and exchange ratio parameters of multiple token sets. For example, if the quantity of tokens with an exchange ratio of 10:1 is 100, and the required quantity is 50, then the initial token consumption amount of the second token for the first game account is 5. Further, this initial token consumption amount is sent to the game server so that the game server deducts the corresponding amount of second tokens from the first game account.

[0048] During the process of determining the target token set, the actual token consumption amount can be determined, namely the target token consumption amount mentioned above. If the target token consumption amount differs from the initial token consumption amount, a second message is sent to the game server, so that the game server deducts or issues a second set of tokens from the first game account based on the second message, which corresponds to the difference between the target token consumption amount and the initial token consumption amount, i.e., "refund for overpayment and supplement for underpayment".

[0049] When the token transaction processing parameters include the second game account corresponding to the target token set and the target token consumption quantity, the designated server sends the second game account corresponding to the target token set and the target token consumption quantity to the game server. The game server then issues the second tokens corresponding to the target token consumption quantity to the second game account, completing the token transaction for the second game account.

[0050] The following embodiments provide a specific way to implement the token transaction method in the above game using a remote dictionary server (Redis).

[0051] This method uses a remote dictionary service server as the designated server to centralize the transaction-related parameters of the token set provided by the game account into a Redis shard for management, and uses the atomicity of Redis Lua scripts to summarize the changes in the exchange rate pool when the token set is listed and purchased.

[0052] This approach requires collaboration between the game server and a Redis database that centrally manages the transaction-related parameters of the token set. In addition, a channel for sending reliable messages needs to be set up, which can be done through a message queue or a database. The sent reliable messages will eventually be consumed by the game server and the corresponding logic will be implemented.

[0053] The aforementioned transaction-related parameters may include consignment number, consignment details, etc. The consignment number can be regarded as the identifier of the corresponding token set, and the consignment details may include the number of tokens in the token set, the exchange ratio with the second token, etc.

[0054] The following example illustrates how players can list token collections within the game system. A minimum listing quantity is typically agreed upon, for example, 10,000. All listed orders must be in multiples of 10,000. For example... Figure 2 As shown, player A listed two token sets for trading, numbered 100001 and 100002. Upon listing, the corresponding amount of the first token held by the player's game account is deducted, and the transaction-related parameters of the token set are recorded. These parameters are then sent to the Redis database via the game server.

[0055] The Redis database can be updated via a pre-written Lua script on a designated server corresponding to a remote dictionary service. The database update process primarily involves three types of data. First, upon listing, a hash value with the consignment number as the key (e.g., order:100001) is inserted. This hash records key-value pairs (kv) information for the newly listed token set, including the core field exchange rate parameter (exchange_rate), the initial quantity of the first token in the set (total_amount), and if some tokens in the set have already been traded (sell_amount will be the quantity already traded). The uid is the game account providing the token set. Then, after insertion, the queue corresponding to the exchange rate for this order (e.g., 142:queue) is updated. This is a sorted set type in Redis, where the listing time is the numerical field (score) and the consignment number is the element (member), allowing for convenient iteration through orders starting from the earliest listing time. Next, we update the remaining amount of exchange rates in an exchange rate pool (key in the form of `exhcange_pool`). This is a hash set type where the key is the exchange rate and the value is the total consignment amount for that exchange rate. The data storage format in the database is as follows: Figure 3 As shown.

[0056] Suppose player C wants to purchase the first token, say 60,000 of them. The system first checks if the current exchange rate pool meets the requirements. If the amount of first tokens in the pool is less than 60,000, the player is notified that the purchase has failed due to insufficient funds in the pool. Otherwise, the system estimates the initial token consumption amount for the second token based on the current exchange rate pool. Since the exchange rate pool may change during the actual purchase, the initial token consumption amount may differ from the actual amount of the second token consumed. The initial token consumption amount can be sent to the game server so that the server deducts the amount of the second tokens that player C would have initially purchased.

[0057] Next, we will use a Redis Lua script to atomically execute the computational logic. The specific logic is roughly as follows: (1) Check whether the current Redis exchange rate pool still meets the planned consumption amount (there may be a situation where others have bought it all first).

[0058] (2) First, search according to the exchange rate pool from high to low. For example, here the exchange rate pool of 143 will be searched first and found to be non-empty.

[0059] (3) Next, according to the listing time, the consignment numbers will be traversed in order, that is, 100001, 100002, 100003... will be traversed in order.

[0060] (4) Next, based on the current demand (60,000), each order will be consumed individually. For example, here we will first modify the sell_amount of 100001 to 50,000. Since this consignment has been used up, it will be marked as deleted. Then, we will search for 100002 and update its sell_amount to 10,000. At the same time, the affected exchange rate pool and exchange rate queue will need to be updated. (5) During the process, the (consignment number, quantity sold, and player UID of the consignment) will be recorded and returned to the process that initiated the operation (i.e., the process where player C is located). In this example, it is (100001, 50000, A) and (100001, 10000, B). After the transaction is successfully completed, the corresponding currency will be issued to A, and the players involved in the order will be notified of the corresponding players A and B through reliable messages to process the proceeds. During the processing, the list of token sets provided by the players themselves will be updated synchronously. The specific implementation process is as follows: Figure 4 As shown.

[0061] In addition to listing and purchasing operations, another operation allows players to actively delist orders. The process for delisting a token set is similar: the order is deleted from the Redis database, and the associated exchange rate queue and exchange rate pool data are deducted. After the player successfully completes the transaction, the player will see their current token set record, and any unsold currency will be refunded. The specific implementation process is as follows... Figure 5 As shown.

[0062] In the above process, when listing a token set, the seller consumes tokens, and simultaneously maintains information about the corresponding token set in both the player's inventory and the Redis database. This allows players to see their currently available token sets and their trading status, enabling them to delist them. Since Redis, unlike relational databases, doesn't readily retrieve listed orders, players can directly view their current inventory data, reducing unnecessary database fetches. This information can also be used to delist token sets.

[0063] This method can also achieve disaster recovery. If the player's currency is deducted, this transaction may fail, and there may not even be a return message to the player when it fails. Or in a more extreme case, after Player C purchases something and hasn't had time to send out a reliable message, the process where Player C is located ends, which may result in losses for the player. Keeping an extra record on the player can ensure that in the worst-case scenario, the player can either convert the token set into earnings or can discover data inconsistencies by actively taking down the shelves (when it is found that the token set does not exist in the database during active take-down, it indicates data anomalies) and retrieve the original tokens.

[0064] During the process of purchasing tokens, a price A will be calculated first according to the current exchange rate pool. Then, when the purchase is actually executed, the exchange rate pool may change. It is possible that the price becomes B, or it may not be enough. In the case of not enough, the transaction will directly fail and prompt the player. If price B > A, then the player also needs to be prompted that the price of this transaction has changed and the information of the exchange rate pool needs to be retrieved again for display. If B < A, the over-withheld earnings can be returned to the player depending on the situation.

[0065] Token sets generally have a validity period, such as 1 day to 3 days. Therefore, orders need to expire regularly to update the exchange rate pool. Otherwise, there will be a situation where the remaining quantity shown in the exchange rate pool is very large, but the token sets inside have all expired. Therefore, a process can also be set up in the game server. This process will retrieve each order queue according to the exchange rate pool at regular intervals, close the expired orders, and notify the player via reliable message that the corresponding order has expired.

[0066] There is also a queue number called queue in the above-mentioned token set. This number can distinguish different priorities. Suspected studio accounts are marked as low priority, normal players are of normal priority, and some players who have purchased a monthly card or paid a certain fee are designated as high priority. When they place上架订单, the corresponding exchange rate queues will be consumed from high priority to low priority. This can ensure that normal players and paying players can have a relatively good experience.

[0067] This method overcomes the problem of insufficient horizontal scalability when managing all token sets through a single document in the traditional way. In addition, Redis itself is of high performance, and the execution logic is also serial, which can well solve the problem of possibly operating on a large amount of data during purchase. Moreover, Redis itself does not have the 16MB limit like the mongo single-document data management scheme. The memory of a single-node Redis can reach at least 16GB, which is sufficient for game services.

[0068] While using databases like Redis, being in-memory databases, may be more expensive than other databases, the requirement of consigning each order allows for controlled order quantity through periodic centralized expiration, keeping costs manageable. Redis can be replaced with similar data structures to achieve the same result; no restrictions are placed here.

[0069] For the above method embodiments, see Figure 6 The diagram illustrates a token trading device in a game. The device is located on a designated server; the designated server is communicatively connected to the game server; the designated server stores transaction-related parameters for multiple token sets provided by game accounts on the game server; each token set includes multiple first tokens in a pending trading state; the transaction-related parameters at least indicate the exchange ratio between the first and second tokens in the token set; the device includes: The demand quantity determination module 602 is used to determine the demand quantity of the first game account for the first token; The transaction processing parameter determination module 604 is used to determine the target token set from multiple token sets based on the transaction-related parameters and required quantities of multiple token sets, and to determine the token transaction processing parameters corresponding to the target token set. The transaction processing parameter sending module 604 is used to send token transaction processing parameters to the game server, so that the game server can issue the first token in the target token set that is in a pending transaction state to the first game account based on the token transaction processing parameters.

[0070] The aforementioned token trading device in a game determines the quantity of a first game account's required first token; based on transaction-related parameters and required quantities from multiple token sets, it identifies a target token set from these sets and determines the corresponding token trading processing parameters; these parameters are then sent to the game server, which in turn distributes the first tokens in the target token set that are awaiting trading to the first game account. This method, by having a designated server determine the token trading processing parameters for the game account's token exchange request based on stored transaction-related parameters of tradable tokens, allows the game server to fulfill the game account's token exchange needs, reducing the consumption of system computing power and improving the token trading efficiency of the game system.

[0071] The transaction-related parameters of the aforementioned multiple token sets form a data queue; the transaction-related parameters of each token set are elements of the data queue; the transaction processing parameter determination module is also used to: determine the target token set from the multiple token sets based on the data queue and the required quantity, and determine the token transaction processing parameters corresponding to the target token set.

[0072] The aforementioned transaction-related parameters include: exchange ratio parameters and set generation time parameters; the position of the transaction-related parameters of the token set in the data queue is negatively correlated with the exchange ratio parameters and positively correlated with the set generation time parameters; the aforementioned device also includes: a new parameter acquisition module, used to acquire the transaction-related parameters of a new token set; the new token set includes multiple tokens; a queue update module, used to update the data queue based on the transaction-related parameters of the new token set; the transaction-related parameters of the new token set are elements of the updated data queue.

[0073] The aforementioned transaction-related parameters include: the number of tokens. The transaction processing parameter determination module is further configured to: determine the first element in the data queue as the current transaction-related parameter; determine whether the number of tokens in the current transaction-related parameter is less than the required quantity; if it is less than the required quantity, determine the token set corresponding to the current transaction-related parameter as the first target token set, and determine the token transaction processing parameters corresponding to the first target token set; update the required quantity based on the number of tokens in the first target token set; update the elements in the data queue that are after the current transaction-related parameter to the current transaction-related parameter; determine whether the number of tokens in the updated current transaction-related parameter is less than the updated required quantity; if it is less than the updated required quantity, determine the token set corresponding to the updated current transaction-related parameter as the second target token set, and determine the token transaction processing parameters corresponding to the second target token set; update the required quantity based on the number of tokens in the second target token set; continue to update the elements in the data queue that are after the current transaction-related parameter to the current transaction-related parameter until the number of tokens in the updated current transaction-related parameter is greater than or equal to the updated required quantity, determine the token set corresponding to the current transaction-related parameter as the third target token set, and determine the token transaction processing parameters corresponding to the third target token set based on the updated required quantity.

[0074] The token transaction processing parameters corresponding to the aforementioned target token set include the token transaction quantity; the transaction processing parameter determination module is further used to: determine the token quantity corresponding to the first target token set as the token transaction quantity corresponding to the first target token set; the step of determining the token transaction processing parameters corresponding to the third target token set based on the updated demand quantity includes: determining the updated demand quantity as the token transaction quantity corresponding to the third target token set.

[0075] The token transaction processing parameters corresponding to the aforementioned target token set also include: the target token consumption quantity; the transaction processing parameter determination module is also used to: calculate the target token consumption quantity of the second token corresponding to the target token set based on the token transaction quantity and exchange ratio corresponding to the target token set.

[0076] The aforementioned device further includes: a parameter deletion module, used to delete transaction-related parameters corresponding to the first target token set and the second target token set; and to update the token quantity corresponding to the third target token set based on the updated demand quantity.

[0077] The aforementioned transaction-related parameters include: the number of tokens; the aforementioned device further includes: an accumulation calculation module, used to calculate the accumulation result of the number of tokens in multiple token sets; a first message return module, used to return a first message to the game server if the accumulation result is less than the required number; the first message is used to indicate: the token transaction corresponding to the first game account has failed.

[0078] The aforementioned transaction-related parameters also include: exchange ratio parameters; the aforementioned device further includes: an initial token consumption quantity determination module, used to determine the initial token consumption quantity of the second token corresponding to the first game account based on the token quantity and exchange ratio parameters of multiple token sets if the cumulative result is greater than or equal to the required quantity; and an initial token consumption quantity sending module, used to send the initial token consumption quantity to the game server so that the game server deducts the second token matching the initial token consumption quantity from the first game account.

[0079] The token transaction processing parameters corresponding to the aforementioned target token set also include: the target token consumption quantity; the aforementioned device further includes: a second message return module, used to send a second message to the game server if the target token consumption quantity is different from the initial token consumption quantity, so that the game server deducts or issues a second token from the first game account based on the second message, which matches the difference between the target token consumption quantity and the initial token consumption quantity.

[0080] The aforementioned token transaction processing parameters include: the second game account corresponding to the target token set and the amount of target tokens consumed; the transaction processing parameter sending module is also used to: send the second game account corresponding to the target token set and the amount of target tokens consumed to the game server, so that the game server issues the second tokens corresponding to the amount of target tokens consumed to the second game account.

[0081] This embodiment also provides an electronic device, including a processor and a memory. The memory stores machine-executable instructions that can be executed by the processor. The processor executes the machine-executable instructions to implement the token trading method in the aforementioned game, for example: Determine the required quantity of the first token for the first game account; based on the transaction-related parameters and required quantities of multiple token sets, determine the target token set from the multiple token sets, and determine the token transaction processing parameters corresponding to the target token set; send the token transaction processing parameters to the game server, so that the game server issues the first token in the target token set that is in a pending transaction state to the first game account based on the token transaction processing parameters.

[0082] The above method determines the token transaction processing parameters for token exchange requests generated by game accounts by specifying the server based on the transaction-related parameters of the saved tradable tokens. This allows the game server to resolve the token exchange requests of game accounts based on the token transaction processing parameters, reducing the consumption of system computing performance and improving the token transaction efficiency of the game system.

[0083] Optionally, the transaction-related parameters of the above multiple token sets form a data queue; the transaction-related parameters of each token set are elements of the data queue; the steps of determining the target token set from the multiple token sets based on the transaction-related parameters and demand quantity of the multiple token sets, and determining the token transaction processing parameters corresponding to the target token set, include: determining the target token set from the multiple token sets based on the data queue and demand quantity, and determining the token transaction processing parameters corresponding to the target token set.

[0084] Optionally, the aforementioned transaction-related parameters include: exchange ratio parameters and set generation time parameters; the position of the transaction-related parameters of the token set in the data queue is negatively correlated with the exchange ratio parameters and positively correlated with the set generation time parameters; the aforementioned method further includes: obtaining the transaction-related parameters of the newly added token set; the newly added token set includes multiple tokens; updating the data queue based on the transaction-related parameters of the newly added token set; the transaction-related parameters of the newly added token set are elements of the updated data queue.

[0085] Optionally, the aforementioned transaction-related parameters include: the number of tokens; the step of determining a target token set from multiple token sets based on the data queue and the demand quantity, and determining the token transaction processing parameters corresponding to the target token set, includes: determining the first element in the data queue as the current transaction-related parameter; determining whether the number of tokens in the current transaction-related parameter is less than the demand quantity; if it is less than the demand quantity, determining the token set corresponding to the current transaction-related parameter as the first target token set, and determining the token transaction processing parameters corresponding to the first target token set; updating the demand quantity based on the number of tokens in the first target token set; updating the elements in the data queue that are after the current transaction-related parameter to the current transaction-related parameter; determining the updated current... Check if the number of tokens in the previous transaction-related parameters is less than the updated demand quantity; if it is less than the updated demand quantity, determine the token set corresponding to the updated current transaction-related parameters as the second target token set, and determine the token transaction processing parameters corresponding to the second target token set; update the demand quantity based on the number of tokens in the second target token set; continue to update the elements in the data queue after the current transaction-related parameters to the current transaction-related parameters until the number of tokens in the updated current transaction-related parameters is greater than or equal to the updated demand quantity, determine the token set corresponding to the current transaction-related parameters as the third target token set, and determine the token transaction processing parameters corresponding to the third target token set based on the updated demand quantity.

[0086] Optionally, the token transaction processing parameters corresponding to the aforementioned target token set include the token transaction quantity; the step of determining the token transaction processing parameters corresponding to the first target token set includes: determining the token quantity corresponding to the first target token set as the token transaction quantity corresponding to the first target token set; the step of determining the token transaction processing parameters corresponding to the third target token set based on the updated demand quantity includes: determining the updated demand quantity as the token transaction quantity corresponding to the third target token set.

[0087] Optionally, the token transaction processing parameters corresponding to the target token set mentioned above may also include: the target token consumption quantity; the step of determining the token transaction processing parameters corresponding to the target token set may further include: calculating the target token consumption quantity of the second token corresponding to the target token set based on the token transaction quantity and exchange ratio corresponding to the target token set.

[0088] Optionally, the above method further includes: deleting the transaction-related parameters corresponding to the first target token set and the second target token set; and updating the token quantity corresponding to the third target token set based on the updated demand quantity.

[0089] Optionally, the above transaction-related parameters include: the number of tokens; before determining the target token set from multiple token sets, the above method further includes: calculating the cumulative result of the number of tokens in multiple token sets; if the cumulative result is less than the required number, returning a first message to the game server; the first message is used to indicate that the token transaction corresponding to the first game account has failed.

[0090] Optionally, the above transaction-related parameters also include: exchange ratio parameters; the above method also includes: if the cumulative result is greater than or equal to the required quantity, determining the initial token consumption quantity of the second token corresponding to the first game account based on the token quantity and exchange ratio parameters of multiple token sets; sending the initial token consumption quantity to the game server so that the game server deducts the second token matching the initial token consumption quantity from the first game account.

[0091] Optionally, the token transaction processing parameters corresponding to the above target token set may also include: the target token consumption quantity; the above method may also include: if the target token consumption quantity is different from the initial token consumption quantity, sending a second message to the game server, so that the game server deducts or issues a second token from the first game account based on the second message, which is consistent with the difference between the target token consumption quantity and the initial token consumption quantity.

[0092] Optionally, the above-mentioned token transaction processing parameters include: the second game account corresponding to the target token set and the amount of target tokens consumed; the step of sending the token transaction processing parameters to the game server further includes: sending the second game account corresponding to the target token set and the amount of target tokens consumed to the game server, so that the game server issues the second tokens corresponding to the amount of target tokens consumed to the second game account.

[0093] Furthermore, Figure 7 The electronic device shown also includes a bus 102 and a communication interface 103, with the processor 100, the communication interface 103 and the memory 101 connected via the bus 102.

[0094] The memory 101 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 103 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc. The bus 102 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 7The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0095] Processor 100 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 100 or by instructions in software form. The processor 100 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams of the invention in the embodiments of this invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the method invented in conjunction with the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a readily available storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 101, and the processor 100 reads the information from memory 101 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.

[0096] This embodiment also provides a machine-readable storage medium that stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions cause the processor to implement the token transaction method in the above-mentioned game.

[0097] The present invention provides a method, apparatus, and electronic device for token trading in a game, including a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments, for example: Determine the required quantity of the first token for the first game account; based on the transaction-related parameters and required quantities of multiple token sets, determine the target token set from the multiple token sets, and determine the token transaction processing parameters corresponding to the target token set; send the token transaction processing parameters to the game server, so that the game server issues the first token in the target token set that is in a pending transaction state to the first game account based on the token transaction processing parameters.

[0098] The above method determines the token transaction processing parameters for token exchange requests generated by game accounts by specifying the server based on the transaction-related parameters of the saved tradable tokens. This allows the game server to resolve the token exchange requests of game accounts based on the token transaction processing parameters, reducing the consumption of system computing performance and improving the token transaction efficiency of the game system.

[0099] Optionally, the transaction-related parameters of the above multiple token sets form a data queue; the transaction-related parameters of each token set are elements of the data queue; the steps of determining the target token set from the multiple token sets based on the transaction-related parameters and demand quantity of the multiple token sets, and determining the token transaction processing parameters corresponding to the target token set, include: determining the target token set from the multiple token sets based on the data queue and demand quantity, and determining the token transaction processing parameters corresponding to the target token set.

[0100] Optionally, the aforementioned transaction-related parameters include: exchange ratio parameters and set generation time parameters; the position of the transaction-related parameters of the token set in the data queue is negatively correlated with the exchange ratio parameters and positively correlated with the set generation time parameters; the aforementioned method further includes: obtaining the transaction-related parameters of the newly added token set; the newly added token set includes multiple tokens; updating the data queue based on the transaction-related parameters of the newly added token set; the transaction-related parameters of the newly added token set are elements of the updated data queue.

[0101] Optionally, the aforementioned transaction-related parameters include: the number of tokens; the step of determining a target token set from multiple token sets based on the data queue and the demand quantity, and determining the token transaction processing parameters corresponding to the target token set, includes: determining the first element in the data queue as the current transaction-related parameter; determining whether the number of tokens in the current transaction-related parameter is less than the demand quantity; if it is less than the demand quantity, determining the token set corresponding to the current transaction-related parameter as the first target token set, and determining the token transaction processing parameters corresponding to the first target token set; updating the demand quantity based on the number of tokens in the first target token set; updating the elements in the data queue that are after the current transaction-related parameter to the current transaction-related parameter; determining the updated current... Check if the number of tokens in the previous transaction-related parameters is less than the updated demand quantity; if it is less than the updated demand quantity, determine the token set corresponding to the updated current transaction-related parameters as the second target token set, and determine the token transaction processing parameters corresponding to the second target token set; update the demand quantity based on the number of tokens in the second target token set; continue to update the elements in the data queue after the current transaction-related parameters to the current transaction-related parameters until the number of tokens in the updated current transaction-related parameters is greater than or equal to the updated demand quantity, determine the token set corresponding to the current transaction-related parameters as the third target token set, and determine the token transaction processing parameters corresponding to the third target token set based on the updated demand quantity.

[0102] Optionally, the token transaction processing parameters corresponding to the aforementioned target token set include the token transaction quantity; the step of determining the token transaction processing parameters corresponding to the first target token set includes: determining the token quantity corresponding to the first target token set as the token transaction quantity corresponding to the first target token set; the step of determining the token transaction processing parameters corresponding to the third target token set based on the updated demand quantity includes: determining the updated demand quantity as the token transaction quantity corresponding to the third target token set.

[0103] Optionally, the token transaction processing parameters corresponding to the target token set mentioned above may also include: the target token consumption quantity; the step of determining the token transaction processing parameters corresponding to the target token set may further include: calculating the target token consumption quantity of the second token corresponding to the target token set based on the token transaction quantity and exchange ratio corresponding to the target token set.

[0104] Optionally, the above method further includes: deleting the transaction-related parameters corresponding to the first target token set and the second target token set; and updating the token quantity corresponding to the third target token set based on the updated demand quantity.

[0105] Optionally, the above transaction-related parameters include: the number of tokens; before determining the target token set from multiple token sets, the above method further includes: calculating the cumulative result of the number of tokens in multiple token sets; if the cumulative result is less than the required number, returning a first message to the game server; the first message is used to indicate that the token transaction corresponding to the first game account has failed.

[0106] Optionally, the above transaction-related parameters also include: exchange ratio parameters; the above method also includes: if the cumulative result is greater than or equal to the required quantity, determining the initial token consumption quantity of the second token corresponding to the first game account based on the token quantity and exchange ratio parameters of multiple token sets; sending the initial token consumption quantity to the game server so that the game server deducts the second token matching the initial token consumption quantity from the first game account.

[0107] Optionally, the token transaction processing parameters corresponding to the above target token set may also include: the target token consumption quantity; the above method may also include: if the target token consumption quantity is different from the initial token consumption quantity, sending a second message to the game server, so that the game server deducts or issues a second token from the first game account based on the second message, which is consistent with the difference between the target token consumption quantity and the initial token consumption quantity.

[0108] Optionally, the above-mentioned token transaction processing parameters include: the second game account corresponding to the target token set and the amount of target tokens consumed; the step of sending the token transaction processing parameters to the game server further includes: sending the second game account corresponding to the target token set and the amount of target tokens consumed to the game server, so that the game server issues the second tokens corresponding to the amount of target tokens consumed to the second game account.

[0109] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system and apparatus described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0110] Furthermore, in the description of the embodiments of the present invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in the present invention based on the specific circumstances.

[0111] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0112] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0113] Finally, it should be noted that the above embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for token trading in a game, characterized in that, The method is applied to a designated server; the designated server is connected to the game server; the designated server stores transaction-related parameters of multiple token sets provided by game accounts in the game server; each token set includes multiple first tokens in a pending transaction state; The transaction-related parameters are used at least to indicate the exchange ratio between the first token and the second token in the token set; the method includes: Determine the required quantity of first-game tokens for the first game account; Based on the transaction-related parameters of the multiple token sets and the required quantity, a target token set is determined from the multiple token sets, and the token transaction processing parameters corresponding to the target token set are determined. The token transaction processing parameters are sent to the game server so that the game server, based on the token transaction processing parameters, issues the first token in the target token set that is in a pending transaction state to the first game account.

2. The method according to claim 1, characterized in that, The transaction-related parameters of the multiple token sets form a data queue; the transaction-related parameters of each token set are elements of the data queue. The steps of determining a target token set from the multiple token sets based on transaction-related parameters of the multiple token sets and the required quantity, and determining the token transaction processing parameters corresponding to the target token set, include: Based on the data queue and the required quantity, a target token set is determined from the multiple token sets, and the token transaction processing parameters corresponding to the target token set are determined.

3. The method according to claim 2, characterized in that, The transaction-related parameters include: exchange ratio parameters and set generation time parameters; the position of the transaction-related parameters of the token set in the data queue is negatively correlated with the exchange ratio parameters and positively correlated with the set generation time parameters. The method further includes: Obtain the transaction-related parameters of the newly added token set; the newly added token set includes multiple tokens; The data queue is updated based on the transaction-related parameters of the newly added token set; the transaction-related parameters of the newly added token set are the elements of the updated data queue.

4. The method according to claim 2, characterized in that, The transaction-related parameters include: the number of tokens; The steps of determining a target token set from the plurality of token sets based on the data queue and the required quantity, and determining the token transaction processing parameters corresponding to the target token set, include: The first element in the data queue is determined as the parameter related to the current transaction. Determine whether the number of tokens in the current transaction-related parameters is less than the required quantity; If the number is less than the required quantity, the token set corresponding to the current transaction-related parameters is determined as the first target token set, and the token transaction processing parameters corresponding to the first target token set are determined. The required quantity is updated based on the number of tokens in the first target token set; Update the element in the data queue that is after the current transaction-related parameter to the current transaction-related parameter; Determine whether the number of tokens in the updated current transaction-related parameters is less than the updated required number; If the number is less than the updated required number, the token set corresponding to the updated current transaction-related parameters is determined as the second target token set, and the token transaction processing parameters corresponding to the second target token set are determined. The required quantity is updated based on the number of tokens in the second target token set; Continue executing the step of updating the elements in the data queue that are located after the current transaction-related parameters to the current transaction-related parameters, until the number of tokens in the updated current transaction-related parameters is greater than or equal to the updated demand quantity. Then, determine the token set corresponding to the current transaction-related parameters as the third target token set, and determine the token transaction processing parameters corresponding to the third target token set based on the updated demand quantity.

5. The method according to claim 4, characterized in that, The token transaction processing parameters corresponding to the target token set include the number of token transactions; The steps for determining the token transaction processing parameters corresponding to the first target token set include: The number of tokens corresponding to the first target token set is determined as the number of token transactions corresponding to the first target token set; The step of determining the token transaction processing parameters corresponding to the third target token set based on the updated demand quantity includes: The updated demand quantity is determined as the number of token transactions corresponding to the third target token set.

6. The method according to claim 4, characterized in that, The token transaction processing parameters corresponding to the target token set also include: the number of target tokens consumed; The step of determining the token transaction processing parameters corresponding to the target token set further includes: Based on the number of token transactions and the exchange ratio corresponding to the target token set, calculate the target token consumption quantity of the second token corresponding to the target token set.

7. The method according to claim 4, characterized in that, The method further includes: Delete the transaction-related parameters corresponding to the first target token set and the second target token set; The number of tokens corresponding to the third target token set is updated based on the updated demand quantity.

8. The method according to claim 1, characterized in that, The transaction-related parameters include: the number of tokens; Before determining the target token set from the plurality of token sets, the method further includes: Calculate the sum of the token counts for the multiple token sets; If the accumulated result is less than the required quantity, a first message is returned to the game server; the first message indicates that the token transaction corresponding to the first game account has failed.

9. The method according to claim 8, characterized in that, The transaction-related parameters also include: exchange ratio parameters; the method further includes: If the accumulated result is greater than or equal to the required quantity, the initial token consumption quantity of the second token corresponding to the first game account is determined based on the token quantity and exchange ratio parameters of the multiple token sets. The initial token consumption amount is sent to the game server so that the game server deducts a second token from the first game account that matches the initial token consumption amount.

10. The method according to claim 9, characterized in that, The token transaction processing parameters corresponding to the target token set also include: the target token consumption quantity; the method further includes: If the target token consumption amount differs from the initial token consumption amount, a second message is sent to the game server, so that the game server deducts or issues a second token from the first game account based on the second message, which matches the difference between the target token consumption amount and the initial token consumption amount.

11. The method according to claim 6, characterized in that, The token transaction processing parameters include: the second game account corresponding to the target token set and the amount of target tokens consumed; The step of sending the token transaction processing parameters to the game server further includes: The game server sends the second game account corresponding to the target token set and the target token consumption amount to the game server, so that the game server issues the second tokens corresponding to the target token consumption amount to the second game account.

12. A token trading device in a game, characterized in that, The device is installed on a designated server; the designated server is communicatively connected to the game server; the designated server stores transaction-related parameters of multiple token sets provided by game accounts in the game server; each token set includes multiple first tokens in a pending transaction state; The transaction-related parameters are used at least to indicate the exchange ratio between the first token and the second token in the token set; the device includes: The quantity demand determination module is used to determine the quantity of tokens required by the first game account. The transaction processing parameter determination module is used to determine a target token set from the multiple token sets based on the transaction-related parameters of the multiple token sets and the required quantity, and to determine the token transaction processing parameters corresponding to the target token set. The transaction processing parameter sending module is used to send the token transaction processing parameters to the game server, so that the game server, based on the token transaction processing parameters, issues the first token in the target token set that is in a pending transaction state to the first game account.

13. An electronic device, characterized in that, It includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the token trading method in the game as described in any one of claims 1-11.

14. A machine-readable storage medium, characterized in that, The machine-readable storage medium stores machine-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the token trading method in the game as described in any one of claims 1-11.