Game data storage method, device, system and computer readable storage medium

CN115920413BActive Publication Date: 2026-10-16BEIJING PIXEL SOFTWARE TECH
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211655439.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-21
Publication Date
2026-10-16
Estimated Expiration
2042-12-21

AI Technical Summary

Technical Problem

由于Redis是缓存数据库,一旦出现服务器故障就可能出现部分数据丢失,造成玩家数据不一致的情况

Benefits of technology

[0044] Compared to existing technologies, the game data storage method, apparatus, system, and computer-readable storage medium provided in this invention receive player operation instructions from a client; execute logical operations on the player operation instructions to obtain target data; the target data represents the player data updated after the execution of the player operation instructions; when the target data meets storage conditions, it is sent to a database server for storage logic operations; the storage conditions represent whether the data needs to be stored; the storage result is responded to by the database server; based on the storage result, the game server's cache is updated, and a response is sent back to the client. This solution adopts a logical processing approach that divides game data, with the database server performing the storage logic operations. This improves the system performance of the game server and effectively ensures the reliability of game data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115920413B_ABST
    Figure CN115920413B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a game data storage method, device, system and computer readable storage medium, receiving a player operation instruction of a client; performing logical operation of the player operation instruction to obtain target data; the target data represents the player data updated after the execution of the player operation instruction; when the target data meets a storage condition, sending the target data to a database server for storage logic operation; the storage condition represents whether the data needs to be stored; responding to the storage result of the database server; according to the storage result, updating the cache of the game server, and responding to the client. The scheme adopts the logical processing mode of dividing game data, and the database server performs storage logic operation. Thus, the system performance of the game server is improved, and the reliability of the game data is effectively ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of game data management, and more specifically, to a game data storage method, apparatus, system, and computer-readable storage medium. Background Technology

[0002] Gaming is an indispensable form of entertainment in people's daily lives, including single-player games and online games. In massively multiplayer online games (MMORPGs), the storage of game data is crucial. When a server experiences an unexpected downtime, game data loss can occur. Therefore, how to store game data quickly, effectively, and reliably is of paramount importance for online games.

[0003] Currently, most game servers employ a combined storage approach, such as using MySQL and Redis together. Redis is used to cache frequently accessed data, improving the server's efficiency and performance. MySQL stores game data on disk, and its use in conjunction with Redis alleviates the workload on the MySQL database. However, since Redis is a caching database, server failures can lead to data loss and inconsistencies among players. Summary of the Invention

[0004] In view of this, the purpose of this invention is to provide a game data storage method, apparatus, system, and computer-readable storage medium, which enables a database server to perform storage logic operations by employing a logical processing method that partitions game data. This improves the system performance of the game server and effectively ensures the reliability of game data.

[0005] To achieve the above objectives, the technical solutions adopted in the embodiments of the present invention are as follows:

[0006] In a first aspect, the present invention provides a game data logic processing method, applied to a game server, the method comprising:

[0007] Receive player input commands from the client;

[0008] The logical operations of the player's operation instructions are executed to obtain target data; the target data represents the updated player data after the player's operation instructions are executed.

[0009] When the target data meets the storage conditions, the target data is sent to the database server for storage logic operations; the storage conditions indicate whether the data needs to be stored.

[0010] The response database server stores the results.

[0011] Based on the stored results, update the game server's cache and send a response to the client.

[0012] In an optional implementation, the step of sending the target data to the database server for storage logic operations when the target data meets the storage conditions includes:

[0013] Obtain the data type of the target data; the data type characterizes the importance of the target data.

[0014] Based on the data type, a storage strategy for the target data is determined; the storage strategy characterizes the timing of storing the target data; the storage timing characterizes the time when the target data undergoes storage logic operations.

[0015] According to the storage strategy, the target data is sent to the database server for storage logic operations.

[0016] In an optional implementation, the step of determining the storage strategy for the target data based on the data type includes:

[0017] When the data type is non-lossable, the storage strategy is set to immediate storage;

[0018] When the data type is partially lost, the storage strategy is set to timed storage.

[0019] In an optional implementation, the step of updating the game server's cache based on the stored result and sending a response back to the client includes:

[0020] When the storage result is successful, the target data is updated to the game server's cache, and the target data is sent to the client;

[0021] When the storage result is a failure, the target data on the game server is deleted, and the result of the player's operation command failing to execute is sent to the client.

[0022] Secondly, the present invention provides a game data storage operation method, applied to a database server, the method comprising:

[0023] Receive a storage request for game data from the game server; the storage request includes the target data to be stored;

[0024] Based on the target data, determine the target database table;

[0025] The target data is used to update the cache table using serial operations within a transaction framework; the cache table refers to the cache of the target database table.

[0026] Based on the cache table update result, the transaction framework automatically updates the target database table to obtain the storage result of the target data;

[0027] Based on the storage results, reply to the storage request from the game server.

[0028] In an optional implementation, the step of determining the target database table based on the target data includes:

[0029] Obtain the database table identifier corresponding to the target data, and determine the target database table corresponding to each database table identifier in the database.

[0030] In an optional implementation, the step of updating the cache table with the target data using serial operations of a transaction framework includes:

[0031] Retrieve the cache tables corresponding to all the target database tables respectively;

[0032] Using a transaction framework, the target data is serially updated to the corresponding cache table.

[0033] In an optional implementation, the step of automatically updating the target database table based on the update status of the cache table to obtain the storage result of the target data includes:

[0034] If the cache table update fails, the transaction framework automatically rolls back all the target data in the cache table, and the storage request for the target data fails.

[0035] If the cache table is updated successfully, the transaction framework will automatically update the cache table to the target database table, and the storage request for the target data will be successful.

[0036] Thirdly, the present invention provides a game server, comprising: a response module and a processing module;

[0037] The response module is used to receive player operation commands from the client;

[0038] The processing module is used to execute logical operations on the player's operation instructions to obtain target data; the target data represents the player data that has been updated after the player's operation instructions are executed; when the target data meets the storage conditions, the target data is sent to the database server for storage logic operations; the storage conditions represent whether the data needs to be stored; respond to the storage result of the database server; update the cache of the game server according to the storage result, and send a response back to the client.

[0039] Fourthly, the present invention provides a database server, comprising: a receiving module and a storage module;

[0040] The receiving module is used to receive a storage request for game data from the game server; the storage request includes the target data to be stored.

[0041] The storage module is used to determine the target database table based on the target data; update the cache table using the target data through serial operations of the transaction framework; the cache table refers to the cache of the target database table; based on the cache table update result, the transaction framework automatically updates the target database table to obtain the storage result of the target data; and respond to the storage request of the game server based on the storage result.

[0042] Fifthly, the present invention provides a game data storage system, the system comprising a game server and a database server, the game server being communicatively connected to the database server; the game server being used to execute any of the game data logic processing methods described in the foregoing embodiments; and the database server being used to execute any of the game data storage operation methods described in the foregoing embodiments.

[0043] In a sixth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the game data logic processing methods or any of the game data storage operation methods described in the foregoing embodiments.

[0044] Compared to existing technologies, the game data storage method, apparatus, system, and computer-readable storage medium provided in this invention receive player operation instructions from a client; execute logical operations on the player operation instructions to obtain target data; the target data represents the player data updated after the execution of the player operation instructions; when the target data meets storage conditions, it is sent to a database server for storage logic operations; the storage conditions represent whether the data needs to be stored; the storage result is responded to by the database server; based on the storage result, the game server's cache is updated, and a response is sent back to the client. This solution adopts a logical processing approach that divides game data, with the database server performing the storage logic operations. This improves the system performance of the game server and effectively ensures the reliability of game data.

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

[0046] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0047] Figure 1 The diagram illustrates an application scenario of the game data storage system provided in an embodiment of the present invention.

[0048] Figure 2 The diagram shows a flowchart of a game data logic processing method provided by an embodiment of the present invention.

[0049] Figure 3 It shows Figure 2 A flowchart illustrating one of the sub-steps of steps S103 and S105.

[0050] Figure 4 The diagram shows a flowchart of a game data storage operation method provided by an embodiment of the present invention.

[0051] Figure 5 It shows Figure 4 A flowchart illustrating one of the sub-steps of steps S203 and S204.

[0052] Figure 6 A schematic diagram of the structure of a game server provided by an embodiment of the present invention is shown.

[0053] Figure 7 A schematic diagram of the structure of a database server provided in an embodiment of the present invention is shown.

[0054] Figure 8 A partial structural diagram of a general-purpose manufacturing device is shown.

[0055] Icons: 10-Game data storage system; 100-Game server; 200-Database server; 110-Memory; 120-Processor; 130-Communication module; 101-Response module; 102-Processing module; 201-Receiving module; 202-Storage module. Detailed Implementation

[0056] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0057] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.

[0058] It should be noted that relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0059] Currently, large-scale online games typically use MySQL to store game data, but its read and write speeds are relatively slow. In high-concurrency business scenarios, MySQL can easily become a performance bottleneck, and Redis is usually used in conjunction with it as a cache for hot data. When game modifications are involved, Redis data is easily lost, ultimately leading to inconsistencies in player game data. To ensure data consistency, an additional data synchronization technology needs to be introduced, which significantly increases the complexity of the game storage system, thereby increasing its maintenance costs.

[0060] Based on this, embodiments of the present invention provide a game data storage method, apparatus, system, and computer-readable storage medium. The method involves receiving player operation instructions from a client; executing logical operations on the player operation instructions to obtain target data; the target data representing updated player data after the execution of the player operation instructions; when the target data meets storage conditions, sending the target data to a database server for storage logic operations; the storage conditions representing whether the data needs to be stored; responding to the storage result from the database server; updating the game server's cache based on the storage result; and sending a response back to the client. This solution employs a logical processing approach that divides game data, with the database server performing the storage logic operations. This improves the system performance of the game server and effectively ensures the reliability of game data.

[0061] The various embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0062] Please refer to Figure 1 , Figure 1This diagram illustrates an application scenario of the game data storage system provided in an embodiment of the present invention. For example... Figure 1 As shown, the game data storage system 10 includes a game server 100 and a database server 200. The game server 100 and the database server 200 are communicatively connected. The game server 100 can be used to execute steps S101 to S105 in the examples below to achieve the corresponding technical effects; similarly, the database server 200 can be used to execute steps S201 to S205 in the examples below to achieve the corresponding technical effects.

[0063] In this embodiment of the invention, the game server 100 executes the logical operations of player operation commands and sends the player game data to be stored to the database server 200 for storage logic operations. The database server 200 executes the storage logic operations of the player game data and uses a transaction framework to serially operate multiple database tables, reducing the complexity of operating the data tables and effectively avoiding data inconsistencies when operating multiple data tables. The coordinated use of the game server and the database server balances the performance and data reliability of the game system.

[0064] Specifically, the game server 100 and the database server 200 may be, but are not limited to, physical servers or physical or virtual computers that can provide the same functions as physical servers.

[0065] It should be noted that the database server 200 can be stateless and supports dynamic expansion, thus achieving good data disaster recovery.

[0066] The following embodiment of the present invention provides a possible implementation method for the game data logic processing process. Specifically... Figure 2 This is a flowchart illustrating a game data logic processing method provided in an embodiment of the present invention. The executing entity of this process can be the game server mentioned above. Please refer to... Figure 2 The method includes:

[0067] Step S101: Receive player operation commands from the client.

[0068] In this embodiment of the invention, after a player logs into the game, each action performed by the player in the game interface generates a player operation command, which is then sent by the client to the game server. Conversely, the game server receives the player operation commands sent by the client.

[0069] Step S102: Perform logical operations on the player's operation commands to obtain the target data.

[0070] The target data represents the player data that has been updated after the player's operation command is executed.

[0071] In this embodiment of the invention, after receiving a player's operation instruction, the game server can perform logical operations related to the instruction to obtain the latest player data after the player's operation.

[0072] Step S103: When the target data meets the storage conditions, the target data is sent to the database server for storage logic operations.

[0073] Among them, storage conditions characterize whether data needs to be stored.

[0074] In this embodiment of the invention, during gameplay, some player data is regenerated each time a player logs in, and this portion of player data does not need to be stored. However, some player data needs to be retrieved each time a player logs in, and this portion of player data needs to be stored. Player data requiring storage is sent to the database server for storage logic operations, while player data not requiring storage can be stored in a cache or temporary storage area and destroyed when the player logs out. This invention does not limit the scope of such storage.

[0075] Step S104: Response database server stores the results.

[0076] Step S105: Based on the stored results, update the game server's cache and send a response back to the client.

[0077] In this embodiment of the invention, the target data to be stored is sent to the database server for storage logic operations. When the game server receives the storage result from the database server, it updates the game server's cache according to the storage result and sends the response data of the player's operation command to the client.

[0078] In summary, the game data logic processing method provided in this embodiment of the invention receives player operation instructions from the client; executes logical operations on the player operation instructions to obtain target data; the target data represents the player data updated after the execution of the player operation instructions; when the target data meets the storage conditions, it is sent to the database server for storage logic operations; the storage conditions represent whether the data needs to be stored; the storage result is responded to by the database server; based on the storage result, the game server's cache is updated, and a response is sent back to the client. This solution adopts a method of dividing game data into logical processing steps, with the database server performing the storage logic operations. This improves the system performance of the game server and effectively ensures the reliability of game data.

[0079] Optionally, in practical applications, the data type of each type of player data can be pre-defined based on its application scenario and importance; for example, this can be pre-defined before the game leaves the factory. Figure 2 Based on this, please refer to Figure 3The sub-steps of step S103 may include:

[0080] Step S1031: Obtain the data type of the target data.

[0081] Among them, the data type represents the importance of the target data.

[0082] In this embodiment of the invention, the data type of each type of player data can be pre-defined according to the game type and specific content. For example, important game assets such as player equipment, items, and gold coins that are not frequently updated can be pre-defined as non-lossable; player information or game assets that are updated at any time, such as player coordinates and weapons / ammunition, can be pre-defined as partially lossable; and data such as player stamina and trees in the game scene can be pre-defined as lossable.

[0083] Step S1032: Determine the storage strategy for the target data based on the data type.

[0084] Among them, storage strategy represents the timing of storing target data; storage timing represents the time when the target data is stored logically.

[0085] In this embodiment of the invention, player stamina, for example, is regenerated when a player logs back into the game. This player data is potentially lost and can be optionally not stored. For target data that needs to be stored, the timing of the storage logic operation is determined based on the data type.

[0086] Step S1033: According to the storage policy, the target data is sent to the database server for storage logic operations.

[0087] In this embodiment of the invention, player data is categorized into data types based on the importance and update frequency of the target data, and different storage strategies are adopted for storing different data types. When the target data reaches its storage time, the game server sends the target data to the database server for storage logic operations.

[0088] Specifically, in one possible example, the game server can send target data to the database server via Remote Procedure Call (RPC). The RPC mechanism used in this embodiment of the invention is a self-developed implementation based on the Asio network library and C++20 coroutines, supporting protocols including but not limited to: Protobuffer, MessagePack, and JSON. Leveraging the characteristic of coroutines that can suspend at any stage of function execution, the RPC mechanism can chain together the processing logic deployed on the game server and the database server to form a complete processing procedure for player operation commands.

[0089] Optionally, in practical applications, it is recommended to store important player data immediately after updating. However, storing frequently updated data immediately will affect the performance of the game server. To balance system performance and data reliability, a timed storage method can be used for storage logic operations. Figure 3 Step S1032 may include:

[0090] When the data type is non-lossable, set the storage strategy to store immediately;

[0091] When the data type is partially lost, the storage strategy is set to timed storage.

[0092] In this embodiment of the invention, when the data type is non-lossable, the target data may be important player data that requires immediate storage logic operations; therefore, the storage strategy is set to immediate storage. When the data type is partially lossable, the target data may be frequently changing player data. To avoid impacting system performance, the target data can be updated to the game server's cache, and a storage period can be set to perform storage logic operations periodically. This storage strategy ensures that if the game server experiences an abnormal downtime, important player data will not be lost, while frequently changing player data can be restored to its last stored state.

[0093] Optionally, in practical applications, database server operations may fail when storing target data. Figure 2 Based on this, please refer to Figure 3 The sub-steps of step S105 may include:

[0094] If the storage result is successful, proceed to step S1051; if the storage result is unsuccessful, proceed to step S1052.

[0095] Step S1051: Update the target data to the game server's cache and send the target data to the client.

[0096] Step S1052: Delete the target data on the game server and send the result of the player's operation command failing to execute to the client.

[0097] In one possible implementation, once the target data is successfully stored, it can be updated in the game server's cache. The target data and the result of the player's successful execution of the operation command are then sent to the client and displayed on the client's screen. Cached target data on the game server facilitates faster access for subsequent player requests, improving the game server's performance.

[0098] In another possible embodiment, if the target data storage fails, the target data generated on the game server needs to be deleted to avoid data inconsistency. The result of the player's failed operation command is then sent to the client and displayed to the player on the client's screen.

[0099] Accordingly, the database server solution will be introduced below. Please refer to... Figure 4 , Figure 4 This is a flowchart illustrating a game data storage operation method provided in an embodiment of the present invention. The executing entity of this process can be the database server mentioned above. The method includes:

[0100] Step S201: Receive a request from the game server to store game data.

[0101] The storage request includes the target data to be stored.

[0102] In this embodiment of the invention, it is assumed that the game server sends the target data to be stored to the database server via RPC for storage logic operations. The database server retrieves the target data to be stored from the received storage request and performs the storage logic operations.

[0103] Step S202: Determine the target database table based on the target data.

[0104] In this embodiment of the invention, the target data may require operations on the same database table or multiple database tables. Based on the target data, the database table to be operated on is determined; this is the target database table.

[0105] Step S203: Use the transaction framework to perform serial operations and update the cache table with the target data.

[0106] Here, the cache table refers to the cache of the target database table.

[0107] In this embodiment of the invention, assuming that the target data involves multiple database table operations, a transaction framework can be used to perform serial operations to update the target data to the cache table.

[0108] Specifically, in one possible example, before updating the database table cache with the target data, a validity check needs to be performed based on the current database table data and the target data. After the validity check passes, a low-speed logical operation of the database operation is performed, and finally the result of the low-speed logical operation is written to the cache table.

[0109] In step S204, based on the update result of the cache table, the transaction framework automatically updates the target database table to obtain the storage result of the target data.

[0110] In this embodiment of the invention, when multiple database table operations are involved, there may be cases where some cached tables of the target data are updated successfully, while others fail to update; or there may be cases where all cached tables are updated successfully or fail. The transaction framework automatically updates the target database table based on the cache update results, ultimately obtaining the stored result of the target data.

[0111] Step S205: Based on the storage result, reply to the game server's storage request.

[0112] In this embodiment of the invention, the database server sends the storage result to the game server as a response to the storage request for the target data.

[0113] In summary, the game data storage operation method provided by this invention receives a storage request for game data from a game server; the storage request includes target data to be stored; based on the target data, a target database table is determined; a cache table is updated using the target data through serial operations using a transaction framework; the cache table refers to the cache of the target database table; based on the cache table update result, the transaction framework automatically updates the target database table to obtain the storage result of the target data; and based on the storage result, the storage request is replied to from the game server. This solution uses a transaction framework to serially operate on multiple database tables, reducing the complexity of operating on data tables and effectively avoiding data inconsistencies when operating on multiple data tables.

[0114] Optionally, in practical applications, each database table is assigned a unique identifier, such as an ID or name, for easy querying or management. Figure 4 Based on this, please refer to Figure 5 The sub-steps of step S202 may include:

[0115] Step S2021: Obtain the database table identifier corresponding to the target data, and determine the target database table corresponding to each database table identifier in the database.

[0116] In this embodiment of the invention, a database table in the database is uniquely identified by a database table identifier, and the corresponding database table is determined by the database table identifier. Therefore, when creating a database table, a database table identifier with a unified address needs to be assigned to the newly created database table.

[0117] It should be noted that the database storing the target data can be a local database or a distributed database. This application does not limit the specific storage method of the target data.

[0118] As one possible implementation method, such as using TcaplusDB as the database, TcaplusDB has features such as a cache + localization integrated architecture, petabyte-level storage, millisecond-level latency, lossless horizontal scaling, and complex data structures, which can be well compatible with game business and ensure efficient and reliable storage of game data.

[0119] Specifically, when operating on multiple data tables, the original TcaplusDB interface required asynchronous calls to each database table. Only after one database table completed its asynchronous operation and returned could the next database table be accessed. This asynchronous calling method had a complex logic processing procedure and a high probability of errors. Furthermore, if the database server crashed or malfunctioned while operating on multiple database tables, it would lead to data inconsistencies in the game.

[0120] In this embodiment of the invention, to reduce the complexity of logical processing and ensure data consistency, the original interface of TcaplusDB is optimized and encapsulated using Lua scripts and coroutines, forming the transaction framework involved in this embodiment. Each time a database table operation is performed, the transaction framework automatically suspends the current operation and waits for it to complete before executing the next operation. The entire process is a serial, synchronous operation, which better aligns with the developer's logical thinking and reduces the probability of errors. Simultaneously, to ensure data consistency across multiple database table operations, the transaction framework automatically writes the updated data from multiple database tables into the database at once.

[0121] Optionally, in practical applications, the target data to be stored may involve operations on multiple database tables. To ensure data consistency, the target data is written to a cache, and then a transaction framework is used for unified scheduling. Figure 4 Based on this, please refer to Figure 5 The sub-steps of step S203 may include:

[0122] Step S2031: Obtain the cache tables corresponding to all target database tables respectively.

[0123] In this embodiment of the invention, to ensure data consistency across multiple target database tables, a corresponding cache table can be created for each target database table. During the target data storage process, the data in the cache table may differ from the data in the database. However, after storage, the data in the cache table must remain consistent with the data in the database; otherwise, data inconsistency will occur, ultimately preventing players from playing the game normally.

[0124] Step S2032: Using a transaction framework, the target data is serially updated to the corresponding cache table.

[0125] In this embodiment of the invention, a transaction framework is used to update the target data belonging to the data table identifier to the corresponding cache table based on the data table identifier of the target data.

[0126] Optionally, in practical applications, to ensure the consistency of game data, after the target data storage operation is completed, it is necessary to ensure the data consistency between the database cache table and the database. Figure 4 Based on this, please refer to Figure 5 The sub-steps of step S204 may include:

[0127] If the cache table update fails, proceed to step S2041; if the cache table update succeeds, proceed to step S2042.

[0128] In step S2041, the transaction framework automatically rolls back all target data in the cache table, and the storage request for the target data fails.

[0129] In this embodiment of the invention, when updating the database cache table fails, the transaction framework will automatically roll back all target data in the cache table, update the data in the cache table to the previous data consistency point, and ensure data consistency across multiple database tables, as well as data consistency between the database cache table and the database.

[0130] In step S2042, the transaction framework automatically updates the cache table to the target database table, and the storage request for the target data is successful.

[0131] In this embodiment of the invention, after the database cache table is successfully updated, the transaction framework automatically saves the target data in the cache table to the database. Since the data in the cache table is the same as that in the database, when the game server accesses the game data again, the database server can directly return the data in the cache table, thereby improving the performance of the database server.

[0132] To more clearly illustrate the game data storage method provided in the embodiments of the present invention, an exemplary description is given in conjunction with the logical processing flow and storage flow of game data storage.

[0133] As one implementation method, let's take the example of a player consuming items to synthesize equipment. The player initiates a request to synthesize equipment on the client, and the client sends the synthesization command to the game server. The game server receives the synthesization command from the client.

[0134] First, the game server checks the validity of the equipment crafting command, such as whether the player's level meets the level requirement and whether the number of items required to craft the equipment is sufficient. The specific checks to be performed depend on the characteristics of the game itself, and this application does not specify them.

[0135] Secondly, the game server executes the logical calculations for crafting equipment, a process that includes low-speed operations such as consuming items and crafting equipment. These operations are then sent to the database server via RPC.

[0136] Secondly, upon receiving operation requests for consuming items and crafting equipment, the data server, during slow-speed operations, involves updating the item and equipment database tables in TcaplusDB using a transaction framework. This ensures that all operations during equipment crafting either succeed entirely or fail entirely and roll back, preventing situations where player item consumption is delayed while equipment is not crafted. The stored game data is then sent to the game server.

[0137] Finally, based on the received game data storage results, the game server continues to perform high-speed logic operations, such as updating the player's game data cache and notifying the client to play the composite animation.

[0138] Figure 6 This is a schematic diagram of the structure of a game server provided in an embodiment of the present invention. This game server can be used to execute various steps of the game data logic processing method described in the above example to achieve the corresponding functions. Please refer to... Figure 6 The game server 100 includes a response module 101 and a processing module 102.

[0139] The response module 101 is used to receive player operation commands from the client.

[0140] The processing module 102 is used to perform logical operations on player operation commands to obtain target data; the target data represents the player data that has been updated after the player operation command is executed; when the target data meets the storage conditions, the target data is sent to the database server for storage logic operations; the storage conditions represent whether the data needs to be stored; the module responds to the database server for the storage result; based on the storage result, the module updates the game server's cache and sends a response back to the client.

[0141] Optionally, the response module 101 can be specifically used to perform... Figure 3 Step S101, to achieve the corresponding technical effect.

[0142] Optionally, the processing module 102 can be specifically used to perform... Figure 3 Steps S102, S1031, S1032, S1033, S104, S1051, and S1052 are used to achieve the corresponding technical effects.

[0143] Figure 7This is a schematic diagram of a database server provided in an embodiment of the present invention. This database server can be used to execute various steps of the game data storage operation method described in the above example to achieve the corresponding functions. Please refer to... Figure 7 The database server 200 includes a receiving module 201 and a storage module 202.

[0144] The receiving module 201 is used to receive a storage request for game data from the game server; the storage request includes the target data to be stored.

[0145] Storage module 202 is used to determine the target database table based on the target data; use the transaction framework to serially update the cache table with the target data; the cache table refers to the cache of the target database table; based on the update result of the cache table, the transaction framework automatically updates the target database table to obtain the storage result of the target data; and based on the storage result, respond to the storage request of the game server.

[0146] Optionally, the receiving module 201 can be specifically used to perform... Figure 3 Step S201, to achieve the corresponding technical effect.

[0147] Optionally, the storage module 202 can be specifically used to perform... Figure 3 Steps S2021, S2031, S2032, S2041, S2042 and S205 are used to achieve the corresponding technical effects.

[0148] Regarding the game server 100 involved in the above embodiments, a possible implementation is given below. For details, please refer to... Figure 8 This is a partial structural diagram of a general-purpose manufacturing device. The game server 100 can be a physical server, or a physical or virtual computer that provides the same functions as the physical server. The game server 100 includes a memory 110, a processor 120, and a communication module 130. The memory 110, processor 120, and communication module 130 are electrically connected directly or indirectly to each other to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.

[0149] The memory 110 is used to store programs or data. The memory 110 may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc.

[0150] The processor 120 is used to read / write data or programs stored in the memory 110 and perform corresponding functions. For example, when a computer program stored in the memory 110 is executed by the processor 120, the game data logic processing method disclosed in the above embodiments can be implemented.

[0151] The communication module 130 is used to establish a communication connection between the game server 100 and other communication terminals via the network, and to send and receive data via the network.

[0152] It should be understood that, Figure 8 The structure shown is only a schematic diagram of the game server 100. The game server 100 may also include components such as... Figure 8 The more or fewer components shown, or having the same Figure 8 The different configurations shown. Figure 8 The components shown can be implemented using hardware, software, or a combination thereof.

[0153] The database server 200 involved in the above embodiments can adopt the same or similar component structure as the game server 100 to implement the game data storage operation methods disclosed in the above embodiments. Further details will not be provided here.

[0154] This invention also provides a computer-readable storage medium storing a computer program thereon. When executed by a processor 120, the computer program implements the page creation method disclosed in the above embodiments, including a game data logic processing method and a game data storage operation method.

[0155] In summary, the game data storage method, apparatus, system, and computer-readable storage medium provided in these embodiments of the invention employ a logical processing approach that partitions game data, with the database server performing the storage logic operations. This improves the system performance of the game server and effectively ensures the reliability of the game data.

[0156] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative; for example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0157] In addition, the functional modules in the various embodiments of the present invention can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

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

[0159] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for processing game data logic, characterized in that, Applied to a game server, the method includes: Receive player input commands from the client; The logical operations of the player's operation instructions are executed to obtain target data; the target data represents the updated player data after the player's operation instructions are executed. When the target data meets the storage conditions, the target data is sent to the database server for storage logic operations. The database server then determines the target database table based on the target data, retrieves the corresponding cache tables for each target database table, and uses a transaction framework to serially and synchronously update the target data to the corresponding cache tables. Based on the cache table update results, the transaction framework automatically updates the target database table to obtain the storage result of the target data. The storage conditions indicate whether the data needs to be stored; the cache table refers to the cache of the target database table. The response is to the stored results of the database server; Based on the stored results, update the game server's cache and send a response to the client.

2. The game data logic processing method according to claim 1, characterized in that, The step of sending the target data to the database server for storage logic operations when the target data meets the storage conditions includes: Obtain the data type of the target data; the data type characterizes the importance of the target data. Based on the data type, a storage strategy for the target data is determined; the storage strategy characterizes the timing of storing the target data; the storage timing characterizes the time when the target data undergoes storage logic operations. According to the storage strategy, the target data is sent to the database server for storage logic operations.

3. The game data logic processing method according to claim 2, characterized in that, The step of determining the storage strategy for the target data based on the data type includes: When the data type is non-lossable, the storage strategy is set to immediate storage; When the data type is partially lost, the storage strategy is set to timed storage.

4. The game data logic processing method according to claim 1, characterized in that, The step of updating the game server's cache based on the stored results and sending a response back to the client includes: When the storage result is successful, the target data is updated to the game server's cache, and the target data is sent to the client; When the storage result is a failure, the target data on the game server is deleted, and the result of the player's operation command failing to execute is sent to the client.

5. A method for storing game data, characterized in that, Applied to a database server, the method includes: The system receives a storage request for game data from the game server; the storage request includes target data to be stored; the target data represents player data that has been updated after the execution of player operation commands; Based on the target data, determine the target database table; Retrieve the cache tables corresponding to all the target database tables respectively; The target data is serially and synchronously updated to the corresponding cache table using a transaction framework; the cache table refers to the cache of the target database table. Based on the cache table update result, the transaction framework automatically updates the target database table to obtain the storage result of the target data; Based on the storage results, reply to the storage request from the game server.

6. The game data storage operation method according to claim 5, characterized in that, The step of determining the target database table based on the target data includes: Obtain the database table identifier corresponding to the target data, and determine the target database table corresponding to each database table identifier in the database.

7. The game data storage operation method according to claim 5, characterized in that, The step of automatically updating the target database table based on the cache table update result to obtain the storage result of the target data includes: If the cache table update fails, the transaction framework automatically rolls back all the target data in the cache table, and the storage request for the target data fails. If the cache table is updated successfully, the transaction framework will automatically update the cache table to the target database table, and the storage request for the target data will be successful.

8. A game server, characterized in that, include: Response module and processing module; The response module is used to receive player operation commands from the client; The processing module is used to perform logical operations on the player's operation instructions to obtain target data; the target data represents the player data that has been updated after the player's operation instructions are executed. When the target data meets the storage conditions, the target data is sent to the database server for storage logic operations, so that the database server determines the target database table based on the target data, obtains the cache table corresponding to all the target database tables respectively, and uses the transaction framework to serially and synchronously update the target data to the corresponding cache table. Based on the cache table update result, the transaction framework automatically updates the target database table to obtain the storage result of the target data. The storage conditions indicate whether the data needs to be stored; The cache table refers to the cache of the target database table; The response is to the stored results of the database server; Based on the stored results, update the game server's cache and send a response to the client.

9. A database server, characterized in that, include: Receive module and storage module; The receiving module is used to receive storage requests for game data from the game server; The storage request includes the target data to be stored; The target data represents the player data that has been updated after the player's operation command is executed; The storage module is used to determine the target database table based on the target data; Obtain the cache tables corresponding to all the target database tables; use a transaction framework to serially and synchronously update the target data to the corresponding cache tables; the cache table refers to the cache of the target database tables; Based on the cache table update result, the transaction framework automatically updates the target database table to obtain the storage result of the target data; based on the storage result, it replies to the storage request of the game server.

10. A game data storage system, characterized in that, The system includes a game server and a database server, and the game server is communicatively connected to the database server; the game server is used to execute the game data logic processing method as described in any one of claims 1-4; the database server is used to execute the game data storage operation method as described in any one of claims 5-7.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the game data logic processing method as described in any one of claims 1-4 or the game data storage operation method as described in any one of claims 5-7.

Citation Information

Patent Citations

  • Game data processing method and device, game server and game system

    CN108744504A

  • Data processing method, server, system and computer readable program medium

    CN110898434A

  • Game data processing method and device, game server and storage medium

    CN110975279A