Method, device, electronic device and storage medium for processing virtual transactions in games

By dividing the message queues according to item types in the game server and processing virtual item transaction requests in parallel, the problem of transaction request accumulation during hot periods is solved and processing efficiency is improved.

CN114849243BActive Publication Date: 2025-10-10NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210609423.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-31
Publication Date
2025-10-10
Estimated Expiration
2042-05-31

AI Technical Summary

Technical Problem

During the hot period of the game process, when virtual item transaction requests flood into the backend server, the message queue accumulates, resulting in low request processing efficiency.

Method used

By dividing the message queues into different categories, virtual item transaction requests are distributed to different message queues according to the item type, and different types of transaction requests are processed in parallel to detect whether the transaction requirements can be met and complete the transaction.

Benefits of technology

This greatly reduces the accumulation of virtual item transaction requests in the message queue and improves the processing efficiency of transaction requests.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114849243B_ABST
    Figure CN114849243B_ABST
Patent Text Reader

Abstract

The application provides a processing method and device for virtual transactions in a game, an electronic device and a storage medium. A plurality of virtual item transaction requests are received. For each virtual item transaction request, the virtual item transaction request is distributed to an associated message queue according to an item type. Target virtual item transaction requests in a plurality of message queues are processed in parallel. Whether a transaction demand in each target virtual item transaction request can be satisfied is detected. For each target virtual item transaction request in which the transaction demand can be satisfied, a transaction in the target virtual item transaction request is completed. In the application, by dividing different message queues, the virtual item transaction requests are distributed to different message queues according to different item types. The virtual item transaction requests of different item types do not affect each other, greatly reducing the accumulation of virtual item transaction requests in a message queue, and helping to improve the processing efficiency of virtual item transaction requests.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of game transaction processing technology, and in particular to methods, devices, electronic devices, and storage media for processing virtual transactions in games. Background Art

[0002] During the game process, in order to ensure the smooth progress of game tasks or meet item purchase needs, players can obtain corresponding items through transactions in the game market provided in the game. The specific execution process can be that the player sends a virtual item transaction request to the background server through the client, and the background server processes the virtual item transaction request.

[0003] At present, during hot periods in the game process (when the game market is holding promotional activities or everyone needs to buy items during the period after the server is launched), a large number of virtual item transaction requests from different clients will flood into the background server. When the speed at which virtual item transaction requests enter the message queue is faster than the speed at which virtual item transaction requests go out, the virtual item transaction requests will accumulate in the message queue. A large number of virtual item transaction requests need to wait for a response, and the request processing efficiency is low. Summary of the Invention

[0004] In view of this, the purpose of this application is to provide a method, device, electronic device and storage medium for processing virtual transactions in games. By dividing different message queues, virtual item transaction requests are distributed to different message queues according to different item types. Virtual item transaction requests of different item types are processed in parallel without affecting each other, which greatly reduces the accumulation of virtual item transaction requests in a message queue and helps to improve the processing efficiency of virtual item transaction requests.

[0005] On the one hand, an embodiment of the present application provides a method for processing virtual transactions in a game, which is applied to a market information processing process in a server. The processing method includes:

[0006] Receive multiple virtual item transaction requests from different clients;

[0007] For each virtual item transaction request, according to the item type in the virtual item transaction request, the virtual item transaction request is distributed to a message queue associated with the item type;

[0008] Parallel processing of target virtual item transaction requests currently being processed in multiple message queues, and for each target virtual item transaction request, detecting whether the transaction requirements in the target virtual item transaction request can be satisfied based on untraded item information of untraded items in the system; the untraded items include remaining untraded items stored in the transaction warehouse and other virtual item transaction requests that have not yet been completed by other users;

[0009] For each target virtual item transaction request whose transaction requirements can be met, the transaction in the target virtual item transaction request is completed according to the requested item information in the target virtual item transaction request and the untraded item information, and the transaction result is sent to the client that sent the target virtual item transaction request.

[0010] In a possible implementation, before receiving multiple virtual item transaction requests sent by different clients, the processing method further includes:

[0011] When the server is started, multiple message queues are initialized according to multiple item types of virtual transaction items, and each message queue is associated with each item type.

[0012] In one possible implementation, when the untraded items include untraded remaining items stored in a trading warehouse, detecting, for each target virtual item trading request, whether the trading requirements in the target virtual item trading request can be met based on the untraded item information of the untraded items in the system, includes:

[0013] For each target virtual item transaction request, based on the transaction item type in the target virtual item transaction request, determining an item information queue associated with the transaction item type;

[0014] For each target virtual item transaction request, based on the transaction item quantity and transaction amount in the target virtual item transaction, as well as the remaining item quantity and item unit price recorded in the associated item information queue, it is detected whether the transaction requirements in the target virtual item transaction request can be met.

[0015] In a possible implementation, before receiving multiple virtual item transaction requests sent by different clients, the processing method further includes:

[0016] When the server is started, multiple item information queues are initialized according to multiple item types of virtual transaction items, and each item information queue is associated with each item type.

[0017] In a possible implementation, when the untraded items include other virtual item transaction requests of uncompleted transactions, the detecting, for each target virtual item transaction request, whether the transaction demand in the target virtual item transaction request can be satisfied according to the untraded item information of the untraded items in the system, includes:

[0018] The detecting, for each target virtual item transaction request, whether the transaction demand in the target virtual item transaction request can be satisfied, is based on the item transaction type, the item transaction category, and the item transaction purpose in the untraded item information of the untraded items in the system.

[0019] In a possible implementation, after the completing, for each target virtual item transaction request of which the transaction demand can be satisfied, the transaction in the target virtual item transaction request according to the request item information in the target virtual item transaction request and the untraded item information, the processing method further includes:

[0020] For each target virtual item transaction request currently processed in the message queue, the processing method further includes: calling a database, updating the information of the transaction item recorded in the database according to the transaction item quantity and the transaction object in the target virtual item transaction request, and continuing to process the virtual transaction request after the target virtual item transaction request in the message queue after determining that the updating of the database is successful.

[0021] In a possible implementation, during the updating of the information of the transaction item recorded in the database, the processing method further includes:

[0022] Calling any message queue other than the message queue in which the target virtual item transaction request is located, and processing the virtual item transaction request in the any message queue.

[0023] If it is determined that the updating of the database is successful, terminating the thread of processing the virtual item transaction request before the other message queue, returning the result of the successful transaction to the corresponding client, and calling an item processing process to process the target virtual item transaction request.

[0024] In a possible implementation, the processing method further includes:

[0025] For each target virtual item transaction request, if the transaction demand in the target virtual item transaction request cannot be satisfied, determining the item request in the target virtual item transaction as an untraded item for storage, and continuing to process the virtual transaction request after the target virtual item transaction request in the corresponding message queue.

[0026] In a possible implementation, the processing method further includes:

[0027] For each message queue, if the number of virtual item transaction requests in the message queue is greater than a preset threshold, different virtual item transaction requests are allocated to different transaction amount queues for processing according to the transaction amounts in the different virtual item transaction requests.

[0028] In a possible implementation, when the untraded items include other virtual item trading requests for which transactions have not been completed, after sending the transaction result to the client that sent the target virtual item trading request, the processing method further includes:

[0029] The transaction result is sent to other clients corresponding to other virtual item transaction requests that meet the transaction requirements.

[0030] On the other hand, an embodiment of the present application further provides a device for processing virtual transactions in a game, which is applied to a market information processing process in a server, and the device includes:

[0031] A transaction request receiving module, used to receive multiple virtual item transaction requests sent by different clients;

[0032] a transaction request distribution module for distributing each virtual item transaction request to a message queue associated with the item type according to the item type in the virtual item transaction request;

[0033] a transaction demand detection module for processing, in parallel, target virtual item transaction requests currently being processed in multiple message queues, and detecting, for each target virtual item transaction request, whether the transaction demand in the target virtual item transaction request can be satisfied based on untraded item information of untraded items in the system; the untraded items include remaining untraded items stored in the transaction warehouse and other virtual item transaction requests for which transactions have not yet been completed by other users;

[0034] The transaction request processing module is used to complete the transaction in each target virtual item transaction request whose transaction requirements can be met according to the requested item information and the untraded item information in the target virtual item transaction request, and send the transaction result to the client that sent the target virtual item transaction request.

[0035] In a third aspect, an embodiment of the present application further provides an electronic device comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the method for processing virtual transactions in the game as described above are performed.

[0036] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, executes the steps of the method for processing virtual transactions in the game as described above.

[0037] The present invention provides a method, device, electronic device and storage medium for processing virtual transactions in a game, which receives multiple virtual item transaction requests sent by different clients, distributes the virtual item transaction request to the associated message queue according to the type of the item being traded for each virtual item transaction request; processes the target virtual item transaction requests currently being processed in the multiple message queues in parallel, and detects whether the transaction requirements in the target virtual item transaction request can be met based on the information of untraded items in the system; completes the transaction in the target virtual item transaction request based on the requested item information and the untraded item information in the target virtual item transaction request, and sends the transaction result to the client that sent the target virtual item transaction request. In the embodiment of the present invention, by dividing different message queues, virtual item transaction requests are distributed to different message queues according to different item types, and virtual item transaction requests of different item types are processed in parallel without affecting each other, which greatly reduces the accumulation of virtual item transaction requests in a message queue and helps improve the processing efficiency of virtual item transaction requests.

[0038] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.

[0040] Figure 1 A flowchart of a method for processing virtual transactions in a game provided by an embodiment of the present application;

[0041] Figure 2 A flowchart of another method for processing virtual transactions in a game provided by an embodiment of the present application;

[0042] Figure 3 A schematic diagram of the processing flow of a virtual item transaction request provided in an embodiment of the present application;

[0043] Figure 4 This is one of the structural diagrams of a device for processing virtual transactions in a game provided by an embodiment of the present application;

[0044] Figure 5 This is a second structural diagram of a device for processing virtual transactions in a game provided by an embodiment of the present application;

[0045] Figure 6 This is a third structural diagram of a device for processing virtual transactions in a game provided by an embodiment of the present application;

[0046] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application for which protection is claimed, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, each other embodiment obtained by those skilled in the art without making creative work falls within the scope of protection of the present application.

[0048] First, we will introduce the application scenarios to which this application can be applied. This application can be applied to the field of game transaction processing technology. During the game process, in order to ensure the smooth progress of game tasks or to meet item purchase needs, players can obtain corresponding items through transactions in the game market provided by the game. The specific execution process can be that the player sends a virtual item transaction request to the backend server through the client, and the backend server processes the virtual item transaction request.

[0049] In order to solve the above problem, attempts are made to place different markets according to different maps of Massively Multiplayer Online (MMO) games (that is, the market server is built separately corresponding to the map server), but each market can be connected to avoid players flocking to the same market to cause a single point problem. However, due to the habit of terminal games, players will flock to a specific market. During the hot time of the game process (when the game market is holding promotional activities or everyone needs to buy items during the period when the server is just opened), there will still be a large number of virtual item transaction requests from different clients pouring into the processing process of the same market on the background server. When the speed at which virtual item transaction requests enter the message queue is greater than the speed at which virtual item transaction requests go out, it will cause virtual item transaction requests to accumulate in the message queue. A large number of virtual item transaction requests need to wait for a response, and the request processing efficiency is low.

[0050] Based on this, an embodiment of the present application provides a method for processing virtual transactions in a game to improve the processing efficiency of virtual item transaction requests.

[0051] See also Figure 1 , Figure 1 This is a flow chart of a method for processing virtual transactions in a game provided by an embodiment of the present application. Figure 1 As shown in , the method for processing virtual transactions in a game provided by an embodiment of the present application includes:

[0052] S101: Receive multiple virtual item transaction requests sent by different clients.

[0053] S102: For each virtual item transaction request, according to the item type in the virtual item transaction request, distribute the virtual item transaction request to a message queue associated with the item type.

[0054] S103. Parallel processing of target virtual item transaction requests currently being processed in multiple message queues. For each target virtual item transaction request, detecting whether the transaction requirements in the target virtual item transaction request can be met based on untraded item information of untraded items in the system; the untraded items include remaining untraded items stored in the transaction warehouse and other virtual item transaction requests that have not been completed by other users.

[0055] S104. For each target virtual item transaction request whose transaction requirements can be met, complete the transaction in the target virtual item transaction request based on the requested item information and the untraded item information in the target virtual item transaction request, and send the transaction result to the client that sent the target virtual item transaction request.

[0056] The method for processing virtual transactions in games provided by the embodiments of the present application divides different message queues and distributes virtual item transaction requests to different message queues according to different item types. Virtual item transaction requests of different item types are processed in parallel without affecting each other, which greatly reduces the accumulation of virtual item transaction requests in a message queue and helps to improve the processing efficiency of virtual item transaction requests.

[0057] The following describes the exemplary steps of the embodiment of the present application:

[0058] S101: Receive multiple virtual item transaction requests sent by different clients.

[0059] In an embodiment of the present application, during the game process, players may obtain the required items by trading with other players or purchasing items in the in-game market according to different game tasks or purchase needs. These need to be carried out in the market information processing process. At different time nodes (such as a period of time after the server is launched or when there is activity in the game market), the market information processing process will receive multiple virtual item transaction requests sent from different clients.

[0060] In one possible implementation, a client may send one or more virtual item transaction requests within the same time period. The virtual item transaction request includes information such as the type of items that players corresponding to different clients need to trade, the quantity of items, and the transaction amount that the players can pay.

[0061] For example, a virtual item transaction request sent by client A is "I hope to purchase N pieces of Y equipment with X game coins."

[0062] S102: For each virtual item transaction request, according to the item type in the virtual item transaction request, distribute the virtual item transaction request to a message queue associated with the item type.

[0063] In an embodiment of the present application, considering that the simultaneous influx of multiple virtual item transaction requests into a message queue may cause the request dequeueing speed in the message queue to be slower than the request enqueuing speed, resulting in congestion in the message queue and inability to process the multiple virtual item transaction requests in a timely manner, when the server starts, multiple message queues are initialized according to different item types to divide the processing flow of different types of items.

[0064] Specifically, before receiving multiple virtual item transaction requests sent by different clients, the processing method further includes:

[0065] a1: When the server is started, multiple message queues are initialized according to multiple item types of virtual transaction items, and each message queue is associated with each item type.

[0066] In an embodiment of the present application, the number of initialized message queues may be the same as the number of item types, that is, as many queues as there are types of tradable items.

[0067] In a possible implementation, it is also possible to determine, based on the historical transaction information of various items in the game market, relatively popular items (with relatively high transaction times, transaction quantities, or transaction frequencies) and relatively unpopular items (with relatively low transaction times, transaction quantities, or transaction frequencies) during the transaction process, and initialize a separate message queue for the relatively popular items; while for relatively unpopular items, multiple types of items may initialize a message queue.

[0068] Specifically, the transaction quantity of different items in the market can be used as a basis for judgment, and a quantity threshold can be set according to the total transaction quantity of different markets. Items with a transaction quantity greater than the quantity threshold can be determined as popular items, while items with a transaction quantity less than the quantity threshold can be determined as unpopular items.

[0069] In one possible implementation, after receiving multiple virtual item transaction requests, for each virtual item transaction request, the item type of the transaction item is parsed from the virtual item transaction request, and the virtual item transaction request is distributed to message queues with consistent item types based on the item types associated with each message queue.

[0070] S103. Parallel processing of target virtual item transaction requests currently being processed in multiple message queues. For each target virtual item transaction request, detecting whether the transaction requirements in the target virtual item transaction request can be met based on untraded item information of untraded items in the system; the untraded items include remaining untraded items stored in the transaction warehouse and other virtual item transaction requests that have not been completed by other users.

[0071] In an embodiment of the present application, the entire market information processing process for multiple message queues is processed in parallel. When initializing the message queue in each message queue, a While True loop is set to check whether there are new virtual item transaction requests at all times, and at the same time control each message queue to continuously push out item transaction requests, and determine the item transaction requests currently pushed out by each message queue as the target virtual item transaction requests currently being processed.

[0072] In one possible implementation, for each target virtual item transaction request, it is necessary to match the target virtual item transaction request with the item information of untraded items in the current system to detect whether the transaction requirements in the target virtual item transaction request can be met, that is, whether the transaction proposed by the target virtual item transaction request can continue.

[0073] Specifically, untraded items include remaining untraded items stored in the transaction warehouse and other virtual item transaction requests that have not been completed by other users; other virtual item transaction requests are unmatched transaction requests sent by other clients except the client that sent the target virtual item transaction request.

[0074] It is worth noting that for different untraded items, there are certain judgment methods when detecting whether the trading requirements in the target virtual item request are met. The following will explain the steps for detecting whether the trading requirements in the target virtual item trading request can be met for different untraded items.

[0075] The first type: the untraded items include the remaining items that have not been traded and are stored in the trading warehouse:

[0076] Specifically, the step of "for each target virtual item transaction request, detecting whether the transaction requirements in the target virtual item transaction request can be met based on the untraded item information of untraded items in the system" includes:

[0077] b1: For each target virtual item transaction request, based on the transaction item type in the target virtual item transaction request, determine an item information queue associated with the transaction item type.

[0078] In the embodiment of the present application, not only are multiple message queues initialized according to the item type of the transaction item, but multiple item information queues storing item information of different items are also created in the memory according to the item type of different transaction items. This ensures that when the memory is called to match the target virtual item transaction request, matching is also performed according to different item types, and the processing of different item types does not affect each other.

[0079] Specifically, for a target virtual item transaction request, the target virtual item transaction request needs to be parsed to obtain the item type of the target virtual item transaction item, and then find the associated item information queue according to the item type to perform a subsequent matching process for the target virtual item transaction request.

[0080] In a possible implementation, before the step of “receiving multiple virtual item transaction requests sent by different clients”, the processing method further includes:

[0081] c1: When the server is started, multiple item information queues are initialized according to multiple item types of virtual transaction items, and each item information queue is associated with each item type.

[0082] In the embodiment of the present application, the method of initializing the item information queue is the same as the method of initializing the message queue, which will not be repeated here.

[0083] b2: For each target virtual item transaction request, based on the number of transaction items and the transaction amount in the target virtual item transaction, as well as the remaining quantity and unit price of the items recorded in the associated item information queue, check whether the transaction requirements in the target virtual item transaction request can be met.

[0084] In an embodiment of the present application, for each target virtual item transaction request, the transaction quantity and transaction amount included in the target virtual item transaction request are combined with the remaining quantity of items and the unit price of items recorded in the item information queue to detect whether the transaction requirements in the target virtual item transaction request can be met.

[0085] Specifically, the following steps are performed to detect whether the transaction requirements in the target virtual item transaction request can be met:

[0086] For each target virtual item transaction request, check whether the remaining quantity of the item is less than the transaction quantity;

[0087] For each target virtual item transaction request, if the remaining quantity of the item is not less than the quantity of the transaction item, check whether the transaction amount can purchase the quantity of the transaction item based on the unit price of the item;

[0088] For each target virtual item transaction request, if it is determined that the transaction amount can purchase the transaction item quantity, it is determined that the items stored in the transaction warehouse can meet the transaction requirements in the virtual item transaction request.

[0089] For example, the unit price of item A stored in the trading warehouse is 20 game coins and the inventory quantity is 4. The target virtual item trading request hopes to purchase 3 items A with 50 game coins. At this time, it is judged that the inventory quantity can meet the target virtual demand, but according to the unit price of item A, purchasing 3 items A requires 60 game coins, and the 50 game coins in the target virtual item trading request can only purchase 2 items A. Therefore, after judgment, it is determined that the trading demand in the target virtual item trading request cannot be met.

[0090] In a possible implementation, if it is determined that the transaction requirements in the target virtual item transaction request cannot be met, a second determination may be made based on other uncompleted virtual item transaction requests whether the transaction requirements of the target virtual item transaction request can be met.

[0091] The second type: The untraded items include other virtual item trading requests that have not yet completed transactions:

[0092] Specifically, the step of “for each target virtual item transaction request, detecting whether the transaction requirements in the target virtual item transaction request can be met based on the untraded item information of untraded items in the system” includes:

[0093] d1: For each target virtual item transaction request, check whether the transaction requirements in the target virtual item transaction request can be met based on the item transaction type, item transaction category, and item transaction purpose of the untraded item information of the untraded items in the system.

[0094] Specifically, when untraded items include other virtual item transaction requests that have not completed transactions, they can be matched based on the item transaction type, item transaction category, item transaction quantity, and item transaction unit price in the other item requests. As long as different virtual item transaction requests match each other, the match can be determined to be successful. The unit price of the transaction item during the transaction process is not necessarily consistent with the system regulations.

[0095] Specifically, the following steps are performed to detect whether the transaction requirements in the target virtual item transaction request can be met:

[0096] For each target virtual item transaction request, analyzing the transaction requirements of the target virtual item transaction request, and determining the quantity of the transaction items and the transaction amount indicated by the transaction request;

[0097] For each target virtual item transaction request, checking whether there are other virtual item transaction requests in the system with the same transaction item quantity and transaction amount as the target virtual item transaction request;

[0098] For each target virtual item transaction request, if there are other virtual item transaction requests in the system with the same transaction item quantity and transaction amount as the target virtual item transaction request, detect whether the transaction purpose of the other virtual item transaction request is opposite to the transaction purpose of the target virtual item transaction request;

[0099] For each target virtual item transaction request, if the transaction purpose of the other virtual item transaction request is opposite to the transaction purpose of the target virtual item transaction request, it is determined that the other virtual item transaction requests stored in the system can meet the transaction requirements in the target virtual item transaction request.

[0100] For example, user X wants to purchase three items A for 50 game coins. In other virtual item transaction requests that have not been successfully completed, user W, who no longer needs item A, requests to sell three items A for 45 game coins. User W's request specifically wants to sell item A, and the unit price of item A is 15 game coins, which satisfies the target virtual item transaction request submitted by user X. In this case, after judgment, it is determined that the transaction requirement in the target virtual item transaction request can be met.

[0101] In a possible implementation, if it is determined that the transaction requirements in the target virtual item transaction request cannot be met, a second determination can be made based on the remaining untraded items stored in the transaction warehouse to determine whether the transaction requirements of the target virtual item transaction request can be met.

[0102] In a possible implementation, when it is determined that the target virtual item transaction request is unsuccessfully matched and cannot be processed temporarily, the target virtual item transaction request whose transaction requirements cannot be met needs to be temporarily stored so that it can be matched again after a new virtual item transaction request is received later.

[0103] Specifically, the processing request further includes:

[0104] f1: For each target virtual item transaction request, if the transaction requirements in the target virtual item transaction request cannot be met, the item request in the target virtual item transaction is determined as an untraded item and stored, and the virtual transaction requests after the target virtual item transaction request in the corresponding message queue are continued to be processed.

[0105] In a possible implementation, multiple target virtual item transaction requests whose transaction requirements cannot be satisfied may be temporarily stored in a cache.

[0106] In one possible implementation, for each message queue, for virtual item transaction requests in the message queue, it is necessary to wait until the previous virtual item transaction request is processed before processing the next virtual item transaction request. Storing the target virtual item transaction request whose transaction requirements cannot be met in the cache means that the currently processed target virtual item transaction request has been processed and the processing of the next virtual item transaction request can continue.

[0107] S104. For each target virtual item transaction request whose transaction requirements can be met, complete the transaction in the target virtual item transaction request based on the requested item information and the untraded item information in the target virtual item transaction request, and send the transaction result to the client that sent the target virtual item transaction request.

[0108] In an embodiment of the present application, for each target virtual item transaction request whose transaction requirements can be met, the transaction in the target virtual item transaction request is settled based on the requested item information and the untraded item information in the target virtual item transaction request, and the transaction result is sent to the client that sent the target virtual item transaction request.

[0109] Specifically, because the transaction requirement of the target virtual item transaction request can be satisfied, the returned transaction result at least includes prompt information indicating that the transaction is successful.

[0110] It is worth noting that in the case where the target virtual item transaction request is completed based on other virtual item transaction requests that have not been completed by other users, since two different clients are involved in the virtual item transaction process, the transaction results need to be sent separately to the client that made the target virtual item transaction request and the client that made the other virtual item transaction request.

[0111] Specifically, when the untraded items include other virtual item transaction requests for which transactions have not been completed, after the step of "sending the transaction result to the client that sent the target virtual item transaction request", the processing method further includes:

[0112] g1: Send the transaction result to other clients corresponding to other virtual item transaction requests that meet the transaction requirements.

[0113] Similarly, since it is a target virtual item transaction request whose transaction requirements can be satisfied, the returned transaction result at least includes prompt information indicating that the transaction is successful, and may also include identification information of the transaction object.

[0114] In the above example, if a virtual item transaction between user X and user W is successful and user X is the buyer, the transaction result received by user X's client may be "successfully purchased 3 items A from user W"; if user W is the seller, the transaction result received by user W's client may be "successfully sold 3 items A to user X."

[0115] In another possible implementation, the untraded items include remaining untraded items stored in a transaction warehouse. After a successful transaction, the items need to be sent from the transaction warehouse to the user.

[0116] It is worth noting that both item transfer transactions between different users and operations to remove corresponding items from the warehouse are handled through the item processing process, which is not the same process as the market information processing process that handles virtual item transaction requests. The two complement each other and interfere with each other.

[0117] In another possible implementation, for each target virtual item transaction request whose transaction requirements cannot be met, a corresponding transaction result also needs to be fed back to the corresponding user terminal.

[0118] Specifically, the transaction result at least includes prompt information of transaction failure and indicates that the virtual item transaction request has been stored and is waiting for matching.

[0119] In a possible implementation, when it is determined that the transaction requirements of the target virtual item transaction request can be met, it is also necessary to update the data in the database to synchronize the data stored in the database.

[0120] Specifically, after the step of "for each target virtual item transaction request whose transaction requirements can be satisfied, completing the transaction in the target virtual item transaction request based on the requested item information in the target virtual item transaction request and the untraded item information", the processing method further includes:

[0121] h1: For each target virtual item transaction request currently being processed by the message queue, call the database based on the transaction item quantity and transaction object in the target virtual item transaction request, update the transaction item information recorded in the database, and continue processing the virtual transaction requests after the target virtual item transaction request in the message queue after determining that the database update is successful.

[0122] In the embodiment of the present application, updating the database includes but is not limited to modifying the quantity of corresponding items in the transaction warehouse and modifying the quantity of items of different transaction objects.

[0123] For example, if a user requests to purchase 3 items Z, and the user's target virtual item transaction request is completed in the transaction warehouse, then the transaction quantity of item Z in the transaction warehouse in the database needs to be reduced by 3; if user M purchases 2 items C from user S, then the quantity of item C owned by user M needs to be increased by 2 in the database, and the quantity of item C owned by user S needs to be reduced by 2.

[0124] In another possible implementation, for each message queue, for virtual item transaction requests in the message queue, it is necessary to wait until the previous virtual item transaction request is processed before processing the next virtual item transaction request. In the case of a target virtual item transaction request whose transaction requirements can be met, after receiving the update success information fed back by the database, it means that the currently processed target virtual item transaction request has been processed and processing of the next virtual item transaction request can continue.

[0125] In one possible implementation, a database language (such as SQL) may be used to update the database (add, modify, delete, and other operations on the corresponding data in the database). When inserting data into the database, the function of scheduling the central processing unit (CPU) of the operating system is simulated, and the yield mechanism of Python is used to schedule the execution call stack of the thread.

[0126] It is worth noting that, since multiple different message queues process virtual item transaction requests concurrently, when one message queue is waiting for the database to return an update result, virtual item transaction requests in other message queues can continue to be executed.

[0127] Specifically, in the process of updating the information of the transaction items recorded in the database, the processing method further includes:

[0128] i1: calling any other message queue except the message queue where the target virtual item transaction request is located, and processing the virtual item transaction request in any other message queue.

[0129] Specifically, when a database return is required, the call stack is cut out, the CPU execution permission is released, and the matching thread of other message queues continues to execute. This can make full use of the time waiting for the database to feedback the update results and improve the efficiency of request processing.

[0130] It is worth noting that the priority of the processing thread that calls the database to feedback the update results is higher than the matching thread of the message queue. Therefore, when it is determined that the database can return the update results, it is necessary to stop the current matching thread of the message queue and execute the thread that returns the database update results first.

[0131] i2: If it is determined that the database update is successful, terminate the thread processing the virtual item transaction request in the other message queue, return the transaction success result to the corresponding client, and call the item processing process to process the target virtual item transaction request.

[0132] In a possible implementation, after the target virtual item transaction request for which the database update is successful is completed, it is necessary to switch back to the matching thread of the unfinished message queue to continue the matching thread.

[0133] In a possible implementation, different message queues may be further processed according to the number of virtual item transaction requests in the message queues to further improve the efficiency of request processing.

[0134] See also Figure 2 , Figure 2This is a flow chart of another method for processing virtual transactions in a game provided by an embodiment of the present application. Figure 2 As shown in , the method for processing virtual transactions in a game provided by an embodiment of the present application includes:

[0135] S201: Receive multiple virtual item transaction requests sent by different clients.

[0136] S202: For each virtual item transaction request, according to the item type in the virtual item transaction request, distribute the virtual item transaction request to a message queue associated with the item type.

[0137] S203. Parallel processing of target virtual item transaction requests currently being processed in multiple message queues. For each target virtual item transaction request, detecting whether the transaction requirements in the target virtual item transaction request can be satisfied based on untraded item information of untraded items in the system; the untraded items include remaining untraded items stored in the transaction warehouse and other virtual item transaction requests for which transactions have not been completed by other users.

[0138] S204. For each target virtual item transaction request whose transaction requirements can be met, complete the transaction in the target virtual item transaction request based on the requested item information and the untraded item information in the target virtual item transaction request, and send the transaction result to the client that sent the target virtual item transaction request.

[0139] Among them, the description of S201 to S204 can refer to the description of S101 to S104, and can achieve the same technical effect, so it will not be repeated here.

[0140] S205. For each message queue, if the number of virtual item transaction requests in the message queue is greater than a preset threshold, assign different virtual item transaction requests to different transaction amount queues for processing according to the transaction amounts in the different virtual item transaction requests.

[0141] In an embodiment of the present application, for each message queue, if the item type processed in the message queue is still a relatively popular type, and the speed at which virtual item transaction requests in the message queue enter the message queue is greater than the speed at which virtual item transaction requests exit the message queue, resulting in the number of virtual item transaction requests accumulated in the message queue exceeding a preset threshold, it is necessary to further divide the virtual item transaction requests in the message queue to ensure that items of different factors do not interfere with each other's processing process.

[0142] Specifically, the virtual item transaction requests in the message queue may be divided again according to different item transaction amounts, so as to disperse the virtual item transaction requests in the queue and avoid a large accumulation of virtual item transaction requests.

[0143] In one possible implementation, different transaction amount intervals may be implemented, and each transaction amount interval may be associated with each transaction amount queue. Based on each virtual item transaction request, the transaction amount interval to which the transaction amount of each virtual item transaction request belongs may be determined, and the virtual item transaction requests in the message queue may be divided again.

[0144] It is worth noting that when different virtual item transaction requests in the same message queue are divided, it is no longer a single process that processes the requests, but a process in which multiple processes jointly process the requests.

[0145] To more intuitively illustrate the processing of multiple message queues, see Figure 3 , Figure 3 A flowchart of a virtual item transaction request provided in an embodiment of the present application is shown in FIG. Figure 3 As shown in , when the server is started, the message queues under multiple market processes are initialized according to the item type ( Figure 3 Market process message queue 1, market process message queue 2 and market process message queue n) shown in , and initialize a cache ( Figure 3 The market process request cache shown in the figure is used to store unmet transaction requirements in virtual item transaction requests. After the client sends multiple virtual item transaction requests (the client in the figure can be one or a set of multiple clients, and the schematic diagram shows that the client sends multiple virtual item transaction requests at the same time), the multiple virtual item transaction requests are inserted into different message queues for parallel processing based on the item type in each virtual item transaction request. This ensures that the request processing processes of different item types do not affect each other, greatly reducing congestion in the message processing process.

[0146] The embodiment of the present application provides a method for processing virtual transactions in a game, which receives multiple virtual item transaction requests sent by different clients, and for each virtual item transaction request, distributes the virtual item transaction request to an associated message queue according to the type of item requested for transaction; processes the target virtual item transaction requests currently being processed in multiple message queues in parallel, and for each target virtual item transaction request, detects whether the transaction requirements in the target virtual item transaction request can be met based on the information of untraded items in the system; for each target virtual item transaction request whose transaction requirements can be met, completes the transaction in the target virtual item transaction request based on the requested item information and the untraded item information in the target virtual item transaction request, and sends the transaction result to the client that sent the target virtual item transaction request. In the embodiment of the present application, by dividing different message queues, virtual item transaction requests are distributed to different message queues according to different item types, and virtual item transaction requests of different item types are processed in parallel without affecting each other, which greatly reduces the accumulation of virtual item transaction requests in a message queue and helps to improve the processing efficiency of virtual item transaction requests.

[0147] Based on the same inventive concept, the embodiments of the present application also provide a device for processing virtual transactions in the game corresponding to the method for processing virtual transactions in the game. Since the principle of solving the problem by the device in the embodiments of the present application is similar to the method for processing virtual transactions in the game in the above-mentioned embodiments of the present application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.

[0148] See also Figures 4 to 6 , Figure 4 This is one of the structural diagrams of a device for processing virtual transactions in a game provided by an embodiment of the present application; Figure 5 This is a second structural diagram of a device for processing virtual transactions in a game provided by an embodiment of the present application; Figure 6 This is a third structural diagram of a device for processing virtual transactions in a game provided by an embodiment of the present application. Figure 4 As shown in , the processing device 400 for virtual transactions in the game includes:

[0149] The transaction request receiving module 401 is used to receive multiple virtual item transaction requests sent by different clients;

[0150] The transaction request distribution module 402 is configured to distribute each virtual item transaction request to a message queue associated with the item type according to the item type in the virtual item transaction request;

[0151] The transaction demand detection module 403 is configured to process a target virtual transaction request in a plurality of message queues in parallel, and for each target virtual transaction request, detect whether a transaction demand in the target virtual transaction request can be satisfied according to untransactioned virtual transaction information of untransactioned virtual transaction items in the system, wherein the untransactioned virtual transaction items include untransactioned virtual transaction items stored in a transaction warehouse and other virtual transaction items in other uncompleted transaction requests.

[0152] The transaction request processing module 404 is configured to, for each target virtual transaction request in which the transaction demand can be satisfied, complete a transaction in the target virtual transaction request according to request virtual transaction information in the target virtual transaction request and the untransactioned virtual transaction information, and send a transaction result to a client sending the target virtual transaction request.

[0153] In a possible implementation, as shown in Figure 5 The processing apparatus 400 further includes a message queue initialization module 405, which is configured to:

[0154] When the server is started, a plurality of message queues are initialized according to a plurality of virtual transaction item types, and each message queue is associated with each virtual transaction item type.

[0155] In a possible implementation, as shown in Figure 5 The processing apparatus 400 further includes an item queue initialization module 406, which is configured to:

[0156] When the server is started, a plurality of virtual transaction item information queues are initialized according to a plurality of virtual transaction item types, and each virtual transaction item information queue is associated with each virtual transaction item type.

[0157] In a possible implementation, as shown in Figure 5 The processing apparatus 400 further includes a database updating module 407, which is configured to:

[0158] For each target virtual transaction request currently processed in each message queue, a database is called according to a transaction item quantity and a transaction object in the target virtual transaction request, information of a transaction item recorded in the database is updated, and after it is determined that the database is successfully updated, a virtual transaction request after the target virtual transaction request in the message queue is processed.

[0159] In a possible implementation, as shown in Figure 5 The processing apparatus 400 further includes a message queue switching module 408, which is configured to:

[0160] Calling any other message queue except the message queue where the target virtual item transaction request is located to process the virtual item transaction request in any other message queue;

[0161] If it is determined that the database update is successful, the thread processing the virtual item transaction request in the other message queue is terminated, the result of the successful transaction is returned to the corresponding client, and the item processing process is called to process the target virtual item transaction request.

[0162] In one possible implementation, Figure 5 As shown, the processing device 400 further includes a transaction request storage module 409, and the transaction request storage module 409 is used to:

[0163] For each target virtual item transaction request, if the transaction requirements in the target virtual item transaction request cannot be met, the item request in the target virtual item transaction is determined as an untraded item and stored, and the virtual transaction requests after the target virtual item transaction request in the corresponding message queue are continued to be processed.

[0164] In one possible implementation, Figure 5 As shown, the processing device 400 further includes a transaction result sending module 410, and the transaction result sending module 410 is used to:

[0165] The transaction result is sent to other clients corresponding to other virtual item transaction requests that meet the transaction requirements.

[0166] In one possible implementation, Figure 6 As shown, the processing device 400 further includes a queue request allocation module 411, and the queue request allocation module 411 is used to:

[0167] For each message queue, if the number of target virtual item transaction requests in the message queue is greater than a preset number threshold, different virtual item transaction requests are allocated to different transaction amount queues for processing according to the transaction amounts in the different virtual item transaction requests.

[0168] In one possible implementation, when the untraded items include untraded remaining items stored in the trading warehouse, the trading demand detection module 403 is configured to detect, for each target virtual item trading request, whether the trading demand in the target virtual item trading request can be met based on the untraded item information of the untraded items in the system. The trading demand detection module 403 is configured to:

[0169] For each target virtual item transaction request, based on the transaction item type in the target virtual item transaction request, determining an item information queue associated with the transaction item type;

[0170] For each target virtual item transaction request, based on the transaction item quantity and transaction amount in the target virtual item transaction, as well as the remaining item quantity and item unit price recorded in the associated item information queue, it is detected whether the transaction requirements in the target virtual item transaction request can be met.

[0171] In one possible implementation, when the untraded items include other virtual item transaction requests for which transactions have not yet been completed, the transaction requirement detection module 403 is configured to detect, for each target virtual item transaction request, whether the transaction requirement in the target virtual item transaction request can be satisfied based on the untraded item information of the untraded items in the system. The transaction requirement detection module 403 is configured to:

[0172] For each target virtual item transaction request, whether the transaction requirements in the target virtual item transaction request can be met is detected based on the item transaction type, item transaction category, and item transaction purpose of the untraded item information of the untraded items in the system.

[0173] The embodiment of the present application provides a processing device for virtual transactions in a game, which receives multiple virtual item transaction requests sent by different clients, and for each virtual item transaction request, distributes the virtual item transaction request to an associated message queue according to the type of item requested for transaction; processes the target virtual item transaction requests currently being processed in multiple message queues in parallel, and for each target virtual item transaction request, detects whether the transaction requirements in the target virtual item transaction request can be met based on the information of untraded items in the system; for each target virtual item transaction request whose transaction requirements can be met, completes the transaction in the target virtual item transaction request based on the requested item information and the untraded item information in the target virtual item transaction request, and sends the transaction result to the client that sent the target virtual item transaction request. In the embodiment of the present application, by dividing different message queues, virtual item transaction requests are distributed to different message queues according to different item types, and virtual item transaction requests of different item types are processed in parallel without affecting each other, which greatly reduces the accumulation of virtual item transaction requests in a message queue and helps to improve the processing efficiency of virtual item transaction requests.

[0174] See also Figure 7 , Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 7As shown in , the electronic device 700 includes: a processor 710, a storage medium 720 and a bus 730. The storage medium 720 stores machine-readable instructions executable by the processor 710. When the electronic device runs a method for processing virtual transactions in a game as in the embodiment, the processor 710 communicates with the storage medium 720 via the bus 730. The processor 710 executes the machine-readable instructions. The processor 710 performs the preamble of the method item to perform the following steps:

[0175] Receive multiple virtual item transaction requests from different clients;

[0176] For each virtual item transaction request, according to the item type in the virtual item transaction request, the virtual item transaction request is distributed to the message queue associated with the item type;

[0177] Parallel processing of target virtual item transaction requests currently being processed in multiple message queues, and for each target virtual item transaction request, detecting whether the transaction requirements in the target virtual item transaction request can be satisfied based on untraded item information of untraded items in the system; the untraded items include remaining untraded items stored in the transaction warehouse and other virtual item transaction requests that have not yet been completed by other users;

[0178] For each target virtual item transaction request whose transaction requirements can be met, the transaction in the target virtual item transaction request is completed according to the requested item information in the target virtual item transaction request and the untraded item information, and the transaction result is sent to the client that sent the target virtual item transaction request.

[0179] In one feasible embodiment, the processor 710 is further configured to:

[0180] When the server is started, multiple message queues are initialized according to multiple item types of virtual transaction items, and each message queue is associated with each item type.

[0181] In one feasible embodiment, when the untraded items include untraded remaining items stored in the trading warehouse, the processor 710, when detecting, for each target virtual item trading request, whether the trading requirements in the target virtual item trading request can be met based on the untraded item information of the untraded items in the system, is configured to:

[0182] For each target virtual item transaction request, based on the transaction item type in the target virtual item transaction request, determining an item information queue associated with the transaction item type;

[0183] For each target virtual item transaction request, based on the transaction item quantity and transaction amount in the target virtual item transaction, as well as the remaining item quantity and item unit price recorded in the associated item information queue, it is detected whether the transaction requirements in the target virtual item transaction request can be met.

[0184] In one feasible embodiment, the processor 710 is further configured to:

[0185] When the server is started, multiple item information queues are initialized according to multiple item types of virtual transaction items, and each item information queue is associated with each item type.

[0186] In one feasible embodiment, when the untraded items include other virtual item trading requests that have not yet completed transactions, the processor 710 is configured to, for each target virtual item trading request, detect whether the trading requirements in the target virtual item trading request can be met based on the untraded item information of the untraded items in the system, the processor 710 is configured to:

[0187] For each target virtual item transaction request, whether the transaction requirements in the target virtual item transaction request can be met is detected based on the item transaction type, item transaction category, and item transaction purpose of the untraded item information of the untraded items in the system.

[0188] In one feasible embodiment, the processor 710 is further configured to:

[0189] For each target virtual item transaction request currently being processed by the message queue, the database is called according to the transaction item quantity and transaction object in the target virtual item transaction request, and the transaction item information recorded in the database is updated. After determining that the database update is successful, the virtual transaction request following the target virtual item transaction request in the message queue is continued to be processed.

[0190] In one feasible embodiment, the processor 710 is further configured to:

[0191] Using any other message queue except the message queue where the target virtual item transaction request is located, processing the virtual item transaction request in any other message queue;

[0192] The processor 710 is further configured to:

[0193] If it is determined that the database update is successful, the thread processing the virtual item transaction request in the other message queue is terminated, the result of the successful transaction is returned to the corresponding client, and the item processing process is called to process the target virtual item transaction request.

[0194] In one feasible embodiment, the processor 710 is further configured to:

[0195] For each target virtual item transaction request, if the transaction requirements in the target virtual item transaction request cannot be met, the item request in the target virtual item transaction is determined as an untraded item and stored, and the virtual transaction requests after the target virtual item transaction request in the corresponding message queue are continued to be processed.

[0196] In one feasible embodiment, the processor 710 is further configured to:

[0197] For each message queue, if the number of virtual item transaction requests in the message queue is greater than a preset threshold, different virtual item transaction requests are allocated to different transaction amount queues for processing according to the transaction amounts in the different virtual item transaction requests.

[0198] In one feasible embodiment, the processor 710 is further configured to:

[0199] The transaction result is sent to other clients corresponding to other virtual item transaction requests that meet the transaction requirements.

[0200] Through the above method, different message queues are divided, and virtual item transaction requests are distributed to different message queues according to different item types. Virtual item transaction requests of different item types are processed in parallel without affecting each other, which greatly reduces the accumulation of virtual item transaction requests in a message queue and helps to improve the processing efficiency of virtual item transaction requests. At the same time, since multiple message queues are processed in parallel, when a message queue is waiting for the database to update data, the matching thread of other message queues can continue to be executed, which can make full use of the time waiting for the database to feedback the update results, further improving the efficiency of request processing.

[0201] An embodiment of the present application further provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium. The computer program is executed when a processor is run, and the processor performs the following steps:

[0202] Receive multiple virtual item transaction requests from different clients;

[0203] For each virtual item transaction request, according to the item type in the virtual item transaction request, the virtual item transaction request is distributed to the message queue associated with the item type;

[0204] The target virtual item transaction request currently being processed in the plurality of message queues is processed in parallel, and for each target virtual item transaction request, whether the transaction demand in the target virtual item transaction request can be satisfied is detected according to the untraded item information of the untraded items in the system; the untraded items include the remaining items stored in the transaction warehouse and other virtual item transaction requests of other users that are not completed;

[0205] For each target virtual item transaction request in which the transaction demand can be satisfied, the transaction in the target virtual item transaction request is completed according to the request item information in the target virtual item transaction request and the untraded item information, and the transaction result is sent to the client that sent the target virtual item transaction request.

[0206] In a feasible implementation, before the plurality of virtual item transaction requests sent by different clients are received, the processing method further includes:

[0207] When the server is started, a plurality of message queues are initialized according to a plurality of item types of virtual transaction items, and each message queue is associated with each item type.

[0208] In a feasible implementation, when the untraded items include the remaining items stored in the transaction warehouse and not traded, whether the transaction demand in the target virtual item transaction request can be satisfied is detected according to the untraded item information of the untraded items in the system, including:

[0209] For each target virtual item transaction request, the item information queue associated with the transaction item type in the target virtual item transaction request is determined based on the transaction item type in the target virtual item transaction request;

[0210] For each target virtual item transaction request, whether the transaction demand in the target virtual item transaction request can be satisfied is detected based on the transaction item quantity and the transaction amount in the target virtual item transaction and the recorded item remaining amount and the item unit price in the associated item information queue.

[0211] In a feasible implementation, for each target virtual item transaction request, before the plurality of virtual item transaction requests sent by different clients are received, the processing method further includes:

[0212] When the server is started, a plurality of item information queues are initialized according to a plurality of item types of virtual transaction items, and each item information queue is associated with each item type.

[0213] In one feasible embodiment, when the untraded items include other virtual item trading requests for which transactions have not been completed, detecting, for each target virtual item trading request, whether the transaction requirements in the target virtual item trading request can be met based on the untraded item information of the untraded items in the system, includes:

[0214] For each target virtual item transaction request, whether the transaction requirements in the target virtual item transaction request can be met is detected based on the item transaction type, item transaction category, and item transaction purpose of the untraded item information of the untraded items in the system.

[0215] In a feasible embodiment, after completing the transaction in each target virtual item transaction request for which transaction requirements can be satisfied based on the requested item information in the target virtual item transaction request and the untraded item information, the processing method further includes:

[0216] For each target virtual item transaction request currently being processed by the message queue, the database is called according to the transaction item quantity and transaction object in the target virtual item transaction request, and the transaction item information recorded in the database is updated. After determining that the database update is successful, the virtual transaction request following the target virtual item transaction request in the message queue is continued to be processed.

[0217] In one feasible embodiment, during the process of updating the information of the transaction items recorded in the database, the processing method further includes:

[0218] Calling any other message queue except the message queue where the target virtual item transaction request is located to process the virtual item transaction request in any other message queue;

[0219] The processing method further comprises:

[0220] If it is determined that the database update is successful, the thread processing the virtual item transaction request in the other message queue is terminated, the result of the successful transaction is returned to the corresponding client, and the item processing process is called to process the target virtual item transaction request.

[0221] In a feasible embodiment, the treatment method further comprises:

[0222] For each target virtual item transaction request, if the transaction requirements in the target virtual item transaction request cannot be met, the item request in the target virtual item transaction is determined as an untraded item and stored, and the virtual transaction requests after the target virtual item transaction request in the corresponding message queue are continued to be processed.

[0223] In a feasible embodiment, the treatment method further comprises:

[0224] For each message queue, if the number of virtual item transaction requests in the message queue is greater than a preset threshold, different virtual item transaction requests are allocated to different transaction amount queues for processing according to the transaction amounts in the different virtual item transaction requests.

[0225] In a feasible embodiment, when the untraded items include other virtual item trading requests that have not yet completed transactions, after sending the transaction result to the client that sent the target virtual item trading request, the processing method further includes:

[0226] The transaction result is sent to other clients corresponding to other virtual item transaction requests that meet the transaction requirements.

[0227] Through the above method, different message queues are divided, and virtual item transaction requests are distributed to different message queues according to different item types. Virtual item transaction requests of different item types are processed in parallel without affecting each other, which greatly reduces the accumulation of virtual item transaction requests in a message queue and helps to improve the processing efficiency of virtual item transaction requests. At the same time, since multiple message queues are processed in parallel, when a message queue is waiting for the database to update data, the matching thread of other message queues can continue to be executed, which can make full use of the time waiting for the database to feedback the update results, further improving the efficiency of request processing.

[0228] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0229] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. There may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed may be through some communication interface, indirect coupling or communication connection of devices or units, which may be electrical, mechanical or other forms.

[0230] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0231] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0232] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0233] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The scope of protection of the present application is not limited thereto. Although the present application has been described in detail with reference to the above-mentioned embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above-mentioned embodiments within the technical scope disclosed in the present application, or perform equivalent replacements for some of the technical features thereof. These modifications, changes, or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A method for processing virtual transactions in a game, characterized in that: A market information processing process is applied to a server, wherein the market information processing process includes multiple message queues initialized according to the item type of the virtual transaction item; the processing method includes: Receive multiple virtual item transaction requests from different clients; For each virtual item transaction request, according to the item type in the virtual item transaction request, the virtual item transaction request is distributed to a message queue associated with the item type, so that multiple virtual item transaction requests are distributed to different message queues according to different item types, and virtual item transaction requests of different item types are processed in parallel; Parallel processing of target virtual item transaction requests currently being processed in multiple message queues, and for each target virtual item transaction request, detecting whether the transaction requirements in the target virtual item transaction request can be satisfied based on untraded item information of untraded items in the system; the untraded items include remaining untraded items stored in the transaction warehouse and other virtual item transaction requests that have not yet been completed by other users; For each target virtual item transaction request whose transaction requirements can be met, the transaction in the target virtual item transaction request is completed according to the requested item information in the target virtual item transaction request and the untraded item information, and the transaction result is sent to the client that sent the target virtual item transaction request.

2. The processing method according to claim 1, characterized in that Before receiving multiple virtual item transaction requests sent by different clients, the processing method further includes: When the server is started, multiple message queues are initialized according to multiple item types of virtual transaction items, and each message queue is associated with each item type.

3. The processing method according to claim 1, characterized in that When the untraded items include untraded remaining items stored in the trading warehouse, detecting, for each target virtual item trading request, whether the trading requirements in the target virtual item trading request can be met based on the untraded item information of the untraded items in the system, includes: For each target virtual item transaction request, based on the transaction item type in the target virtual item transaction request, determining an item information queue associated with the transaction item type; For each target virtual item transaction request, based on the transaction item quantity and transaction amount in the target virtual item transaction, as well as the remaining item quantity and item unit price recorded in the associated item information queue, it is detected whether the transaction requirements in the target virtual item transaction request can be met.

4. The processing method according to claim 3, characterized in that Before receiving multiple virtual item transaction requests sent by different clients, the processing method further includes: When the server is started, multiple item information queues are initialized according to multiple item types of virtual transaction items, and each item information queue is associated with each item type.

5. The processing method according to claim 1, characterized in that When the untraded items include other virtual item trading requests for which transactions have not been completed, detecting, for each target virtual item trading request, whether the transaction requirements in the target virtual item trading request can be met based on the untraded item information of the untraded items in the system, includes: For each target virtual item transaction request, whether the transaction requirements in the target virtual item transaction request can be met is detected based on the item transaction type, item transaction category, and item transaction purpose of the untraded item information of the untraded items in the system.

6. The processing method according to claim 1, characterized in that After completing the transaction in each target virtual item transaction request for which transaction requirements can be satisfied, based on the requested item information in the target virtual item transaction request and the untraded item information, the processing method further includes: For each target virtual item transaction request currently being processed by the message queue, the database is called according to the transaction item quantity and transaction object in the target virtual item transaction request, and the transaction item information recorded in the database is updated. After determining that the database update is successful, the virtual transaction request following the target virtual item transaction request in the message queue is continued to be processed.

7. The processing method according to claim 6, characterized in that In the process of updating the information of the transaction items recorded in the database, the processing method further includes: Calling any other message queue except the message queue where the target virtual item transaction request is located to process the virtual item transaction request in any other message queue; If it is determined that the database update is successful, the thread processing the virtual item transaction request in the other message queue is terminated, the result of the successful transaction is returned to the corresponding client, and the item processing process is called to process the target virtual item transaction request.

8. The processing method according to claim 1, characterized in that The processing method further comprises: For each target virtual item transaction request, if the transaction requirements in the target virtual item transaction request cannot be met, the item request in the target virtual item transaction is determined as an untraded item and stored, and the virtual transaction requests after the target virtual item transaction request in the corresponding message queue are continued to be processed.

9. The processing method according to claim 1, characterized in that: The processing method further comprises: For each message queue, if the number of virtual item transaction requests in the message queue is greater than a preset threshold, different virtual item transaction requests are allocated to different transaction amount queues for processing according to the transaction amounts in the different virtual item transaction requests.

10. The processing method according to claim 1, characterized in that: When the untraded items include other virtual item transaction requests that have not yet completed transactions, after sending the transaction result to the client that sent the target virtual item transaction request, the processing method further includes: The transaction result is sent to other clients corresponding to other virtual item transaction requests that meet the transaction requirements.

11. A device for processing virtual transactions in a game, characterized in that: A market information processing process applied to a server, wherein the market information processing process includes multiple message queues initialized according to the item type of the virtual transaction item; the processing device includes: A transaction request receiving module, used to receive multiple virtual item transaction requests sent by different clients; a transaction request dispatching module configured to dispatch each virtual item transaction request to a message queue associated with the item type in accordance with the item type in the virtual item transaction request, thereby dispatching multiple virtual item transaction requests to different message queues according to different item types and processing virtual item transaction requests of different item types in parallel; a transaction demand detection module for processing, in parallel, target virtual item transaction requests currently being processed in multiple message queues, and detecting, for each target virtual item transaction request, whether the transaction demand in the target virtual item transaction request can be satisfied based on untraded item information of untraded items in the system; the untraded items include remaining untraded items stored in the transaction warehouse and other virtual item transaction requests for which transactions have not yet been completed by other users; The transaction request processing module is used to complete the transaction in each target virtual item transaction request whose transaction requirements can be met according to the requested item information and the untraded item information in the target virtual item transaction request, and send the transaction result to the client that sent the target virtual item transaction request.

12. An electronic device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor. When the electronic device is running, the processor and the storage medium communicate via the bus, and the processor executes the machine-readable instructions to perform the steps of the method for processing virtual transactions in a game as described in any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which, when executed by a processor, executes the steps of the method for processing virtual transactions in a game according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • KR20220008681A