Game server data storage synchronization method and system

By storing game data in multiple distributed storage nodes and capturing and synchronizing database change information in real time, the data storage pressure and scalability of traditional game servers is solved, and efficient and stable data storage and synchronization are achieved.

CN119701325AInactive Publication Date: 2025-03-28XIAMEN GUANYING NETWORK TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510207253.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-25
Publication Date
2025-03-28
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

When traditional game servers face a large number of players online, the data storage pressure is huge, and the reading and writing speed bottleneck results in delayed game response, and poor scalability, making it difficult to quickly adapt to the needs of increased user numbers.

Method used

By sharding game data according to preset rules, it is stored in multiple distributed storage nodes, and each node stores some data shards. Monitor database operations in real time, capture changes information and encapsulate them into message sets, and send them to message queues. Each storage node obtains message sets from the queue for synchronous updates.

Benefits of technology

It realizes the balanced distribution of data, improves storage efficiency, reduces the pressure of stand-alone storage, and enhances the scalability of the system. It ensures timely and accurate acquisition and transmission of data change information, combined with transaction mechanism, ensures data consistency and integrity, and reduces game lags and data errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119701325A_ABST
    Figure CN119701325A_ABST
Patent Text Reader

Abstract

The invention is suitable for the field of data storage, and provides a game server data storage synchronization method and system, and the method comprises the steps: carrying out the fragmentation of game data according to a preset rule, and storing the fragmented game data in a plurality of distributed storage nodes; monitoring database operation of the game server in real time, and capturing change information of database addition, modification and deletion; encapsulating the captured change information into a message set, and sending the message set to a message queue; and each storage node obtains the message set from the message queue, extracts the data change information in the message set and synchronously updates the locally stored data, so that the balanced distribution of the data is realized through data fragmentation storage, the storage efficiency is improved, and the single-machine storage pressure is reduced. In the aspect of data synchronization, real-time data capture and message queue transmission ensure timely and accurate acquisition and transmission of data change information, and in combination with a transaction mechanism of data synchronization, data consistency and integrity are ensured, and game lagging and data errors are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of data processing, and in particular relates to a game server data storage synchronization method and system. Background Art

[0002] With the rapid development of online games, the number of game players has exploded, which has put extremely high demands on the data storage and synchronization capabilities of game servers. In the traditional game server architecture, data storage and synchronization face many challenges.

[0003] On the one hand, the massive amount of data generated by a large number of players online at the same time puts enormous pressure on data storage. Traditional single-machine storage methods are difficult to meet such large-scale data storage needs, and there are bottlenecks in the data reading and writing speed, which leads to game response delays and seriously affects the players' gaming experience. In addition, traditional game server data storage and synchronization methods perform poorly in terms of scalability. When the number of game users suddenly increases, it is difficult to quickly expand the storage and synchronization system to adapt to new needs, which increases operating costs and technical difficulties.

[0004] Therefore, there is an urgent need for a new game server data storage synchronization method and system to solve the above problems, improve the performance and stability of the game server, and provide players with a better gaming experience. Summary of the invention

[0005] The purpose of the present invention is to provide a game server data storage synchronization method and system, aiming to solve the problems raised in the above background technology.

[0006] The present invention is implemented in this way. On the one hand, a game server data storage synchronization method comprises:

[0007] The game data is sharded according to preset rules and stored in multiple distributed storage nodes, with each storage node storing part of the data shards;

[0008] Monitor the database operations of the game server in real time and capture the change information of database addition, modification and deletion;

[0009] Encapsulate the captured change information into a message set and send the message set to the message queue. The message queue stores and manages the message set according to the first-in-first-out principle.

[0010] Each storage node obtains a message set from the message queue, extracts the data change information in the message set, and synchronously updates the locally stored data.

[0011] As a further solution of the present invention, the game data is sharded according to a preset rule and stored in a plurality of distributed storage nodes, wherein each storage node stores a portion of the data shards, specifically comprising:

[0012] Obtain all player IDs and basic player data in the game, including character creation time and common login regions;

[0013] Use a hash algorithm to calculate the player ID and convert the player ID into a corresponding hash value;

[0014] Based on the hash value range, map it to the corresponding distributed storage node;

[0015] The player's loaded data is stored in the corresponding storage node according to the mapping result, and the storage location index is recorded. The loaded data includes character information, equipment data, and game progress.

[0016] As a further solution of the present invention, the real-time monitoring of the database operation of the game server and capturing the change information of the addition, modification and deletion of the database specifically includes:

[0017] Start the log-based incremental capture tool in the database system to monitor the database operation log in real time, and set the real-time monitoring frequency and log level;

[0018] Analyze database operation logs in real time, identify different types of operation instructions such as adding, modifying, and deleting, and extract the data table name, field name, and specific data content involved in the operation instructions;

[0019] Extract operation instruction change information and form data change records;

[0020] Verify the integrity and accuracy of the extracted data change information.

[0021] As a further solution of the present invention, encapsulating the captured change information into a message set, sending the message set to a message queue, and storing and managing the message set in a message queue according to a first-in-first-out principle specifically includes:

[0022] Encapsulate the captured change information according to the preset message format;

[0023] According to the priority and data size of the change message, the corresponding message queue is selected from multiple distributed message queues for sending. If the sending fails, it will be retried and the sending log will be recorded;

[0024] Monitor the message queue status in real time. If the message queue is abnormal, clean up the messages or expand the queue resources.

[0025] As a further solution of the present invention, encapsulating the captured change information into a message set, sending the message set to a message queue, and storing and managing the message set in a message queue according to a first-in-first-out principle specifically includes:

[0026] Pull messages from the message queue regularly, obtain the messages to be processed in sequence based on the first-in-first-out principle of the message queue, and mark the obtained messages as "obtained";

[0027] Start a transaction in the local database of the storage node;

[0028] Update the locally stored data according to the data change information in the message;

[0029] After completing the data update operation, verify the transaction to check whether the update operation is successful. If the update operation is successful, commit the transaction. If the update operation fails, roll back the transaction, restore the data to the state before the update, and record the error log.

[0030] As a further solution of the present invention, on the other hand, a game server data storage synchronization system comprises:

[0031] Sharding module, used to shard game data according to preset rules;

[0032] A storage module is used to store data in multiple distributed storage nodes, each storage node stores part of the data shards;

[0033] Real-time monitoring module, used to monitor the database operation of the game server in real time;

[0034] Capture module, used to capture the change information of addition, modification and deletion of database;

[0035] The sending module is used to encapsulate the captured change information into a message set and send the message set to the message queue;

[0036] Storage management module, used for storing and managing message sets according to the first-in-first-out principle in message queues;

[0037] The acquisition module is used for each storage node to obtain a message set from the message queue;

[0038] An extraction module is used to extract data change information from a message set;

[0039] The synchronous update module is used to synchronously update the locally stored data.

[0040] As a further solution of the present invention, the slicing module specifically includes:

[0041] The acquisition unit is used to obtain all player IDs and basic player data in the game;

[0042] A hash algorithm unit, used to calculate the player ID using a hash algorithm and convert the player ID into a corresponding hash value;

[0043] A mapping unit, used to map a hash value range to a corresponding distributed storage node;

[0044] The storage unit is used to store the player loaded data into the corresponding storage node according to the mapping result and record the storage location index.

[0045] As a further solution of the present invention, the sending module specifically includes:

[0046] An encapsulation unit, used to encapsulate the captured change information according to a preset message format;

[0047] A sending unit is used to select a corresponding message queue from multiple distributed message queues for sending according to the priority and data size of the changed message;

[0048] Retry recording unit, used to retry if sending fails and record the sending log;

[0049] Real-time monitoring unit, used to monitor the message queue status in real time;

[0050] The message optimization unit is used to clean up messages or expand queue resources if the message queue is abnormal.

[0051] The present invention provides a game server data storage synchronization method and system. In terms of data storage, the method and system achieve balanced data distribution through data sharding storage, improve storage efficiency, reduce single-machine storage pressure, and enhance system scalability. In terms of data synchronization, real-time data capture and message queue transmission ensure timely and accurate acquisition and transmission of data change information. Combined with the transaction mechanism of data synchronization, data consistency and integrity are ensured, game freezes and data errors are reduced, and players are provided with a smooth and stable gaming experience, which improves the quality of game operations. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 The present invention is a main flow chart of a method for synchronizing data storage in a game server.

[0053] Figure 2 The invention discloses a flow chart of a game server data storage synchronization method in which game data is fragmented and stored in multiple distributed storage nodes according to preset rules, with each storage node storing part of the data fragments.

[0054] Figure 3The invention discloses a flowchart for real-time monitoring of database operations of a game server in a game server data storage synchronization method to capture change information of addition, modification and deletion of the database.

[0055] Figure 4 The invention discloses a flowchart in which captured change information is encapsulated into a message set in a game server data storage synchronization method and the message set is sent to a message queue. The message queue stores and manages the message set according to the first-in-first-out principle.

[0056] Figure 5 The invention discloses a flowchart in which captured change information is encapsulated into a message set in a game server data storage synchronization method and the message set is sent to a message queue. The message queue stores and manages the message set according to the first-in-first-out principle.

[0057] Figure 6 It is a main structure diagram of a game server data storage synchronization system.

[0058] Figure 7 The present invention is a structural block diagram of a sharding module in a game server data storage synchronization system.

[0059] Figure 8 The present invention is a structural block diagram of a sending module in a game server data storage synchronization system. DETAILED DESCRIPTION

[0060] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0061] The specific implementation of the present invention is described in detail below in conjunction with specific embodiments.

[0062] The present invention provides a game server data storage and synchronization method and system, which solves the technical problems in the background technology.

[0063] like Figure 1 FIG. 1 is a main flow chart of a game server data storage synchronization method provided by an embodiment of the present invention, wherein the game server data storage synchronization method comprises:

[0064] Step S100: Slice the game data according to preset rules and store them in multiple distributed storage nodes, with each storage node storing part of the data slicing;

[0065] Step S200: monitor the database operation of the game server in real time, and capture the change information of addition, modification and deletion of the database;

[0066] Step S300: Encapsulate the captured change information into a message set, and send the message set to a message queue. The message queue stores and manages the message set according to the first-in-first-out principle.

[0067] Step S400: Each storage node obtains a message set from a message queue, extracts data change information in the message set, and synchronously updates the locally stored data;

[0068] When this embodiment is applied, this method includes four core steps: data sharding storage, real-time data capture, message queue transmission and data synchronization. In the data sharding storage step, preset rules are formulated based on factors such as game data type, player ID or game area, and game data is sharded and stored in multiple distributed storage nodes. Specifically, the player ID and related basic data are first collected, the player ID is calculated by a hash algorithm to obtain a unique hash value, and then mapped to the corresponding storage node according to the hash value range. Finally, the player-related data is stored and indexed to achieve balanced distribution and efficient storage of data. Real-time data capture uses a log-based incremental capture tool to monitor the game server database operation in real time. After starting the tool and configuring the monitoring frequency and log level, the tool analyzes the operation log in real time, identifies operations such as adding, modifying, and deleting, extracts key change information and verifies it, ensures that the captured data change information is accurate, and provides a reliable basis for subsequent data synchronization. In the message queue transmission link, the captured data change information is encapsulated into a message with a message header, and the message header contains meta information such as message type, sending time, and data source. According to the message priority and data size, select the appropriate queue from multiple distributed message queues to send messages, use the message queue client to ensure transmission reliability, retry and record logs when sending fails, and the message queue monitors its own status in real time, automatically cleans up messages or expands resources when an exception occurs. During data synchronization, the storage node regularly pulls messages from the message queue, obtains and marks messages according to the first-in-first-out principle. Start a transaction in the local database, update the local data according to the data change information in the message, verify the transaction after the update is completed, commit the transaction to persist the data if successful, roll back the transaction and record the error log if failed, to ensure data consistency of each storage node.

[0069] like Figure 2 As shown, as a preferred embodiment of the present invention, the game data is sharded according to a preset rule and stored in multiple distributed storage nodes, and each storage node stores part of the data shards, specifically including:

[0070] Step S101: Obtain all player IDs and basic player data in the game, including character creation time and frequently logged-in regions;

[0071] Step S102: Calculate the player ID using a hash algorithm to convert the player ID into a corresponding hash value;

[0072] Step S103: Based on the hash value range, map it to the corresponding distributed storage node;

[0073] Step S104: storing the player's loaded data in the corresponding storage node according to the mapping result, and recording the storage location index, wherein the loaded data includes character information, equipment data, and game progress;

[0074] When this embodiment is applied, first, player information is collected to comprehensively obtain basic data such as the ID of all players in the game, the time when the character was created, and the commonly used login areas, so as to provide a detailed basis for subsequent calculations. Next, the player ID is calculated using a pre-selected hash algorithm, which can convert the player ID into a unique hash value, ensuring that each player corresponds to a unique calculation result, laying the foundation for balanced data distribution. Subsequently, the hash value range is mapped to the corresponding distributed storage node, and the storage location of each player's data is accurately determined by setting the hash value interval. Finally, the player-related character information, equipment data, game progress and other data are stored in the corresponding node according to the mapping results, and the storage location index is recorded, which greatly improves the efficiency of data query and reading. Through this series of sub-steps, reasonable sharding and efficient storage of game data are achieved, which effectively alleviates the storage pressure of a single machine and improves the overall data management capabilities of the system.

[0075] like Figure 3 As shown, as a preferred embodiment of the present invention, the real-time monitoring of the database operation of the game server and capturing the change information of the addition, modification and deletion of the database specifically includes:

[0076] Step S201: Start a log-based incremental capture tool in the database system to monitor the database operation log in real time, and set the real-time monitoring frequency and log level;

[0077] Step S202: Analyze the database operation log in real time, identify different types of operation instructions such as adding, modifying, and deleting, and extract the data table name, field name, and specific data content involved in the operation instruction;

[0078] Step S203: extracting operation instruction change information to form a data change record;

[0079] Step S204: verifying the integrity and accuracy of the extracted data change information;

[0080] When this embodiment is applied, a log-based incremental capture tool is started in the game server database system, and the monitoring frequency and log level are configured to ensure that the database operation log can be monitored comprehensively and carefully without missing any important information. Subsequently, the capture tool analyzes the operation log in real time, analyzes and identifies different types of operations such as adding, modifying, and deleting data, and accurately extracts the data table name, field name, and specific data content involved in the operation. Next, for these identified operations, key change information is extracted, such as complete records of new data, comparison of data before and after modification, and identification of deleted data, to form a detailed record of data changes. Finally, the extracted change information is checked for integrity and accuracy by calculating checksums, comparing database metadata, etc., effectively preventing erroneous data from entering subsequent processes, and providing a reliable data source for data synchronization.

[0081] like Figure 4 As shown, as a preferred embodiment of the present invention, the captured change information is encapsulated into a message set, the message set is sent to a message queue, and the message queue stores and manages the message set according to the first-in-first-out principle, specifically including:

[0082] Step S301: Encapsulate the captured change information according to a preset message format;

[0083] Step S302: According to the priority and data size of the change message, a corresponding message queue is selected from multiple distributed message queues for sending. If the sending fails, a retry is performed and a sending log is recorded;

[0084] Step S303: monitor the message queue status in real time, and if the message queue is abnormal, clean up the message or expand the queue resources;

[0085] It should be understood that, first, the captured data change information is encapsulated according to the preset message format, and a message header containing meta-information such as message type, sending time, and data source is added to facilitate the receiving end to quickly identify and process. Then, based on factors such as message priority and data size, a suitable queue is intelligently selected from multiple distributed message queues. For example, messages with high real-time requirements select queues with fast responses, and messages with large data volumes select queues with large storage capacity. Afterwards, the message queue client is used to send the encapsulated message to the selected queue to ensure transmission reliability, and retries and logs when the transmission fails. At the same time, the message queue monitors its own status in real time. Once it finds that messages are piled up or the queue load is abnormal, it automatically cleans up the message or expands the queue resources to ensure that the message can always be processed normally, and to achieve stable transmission of data change information in a complex environment.

[0086] like Figure 5As shown, as a preferred embodiment of the present invention, the captured change information is encapsulated into a message set, the message set is sent to a message queue, and the message queue stores and manages the message set according to the first-in-first-out principle, specifically including:

[0087] Step S401: Pull messages from the message queue regularly, obtain the messages to be processed in sequence based on the first-in-first-out principle of the message queue, and mark the obtained messages as "obtained";

[0088] Step S402: Open a transaction in the local database of the storage node;

[0089] Step S403: updating the locally stored data according to the data change information in the message;

[0090] Step S404: After completing the data update operation, verify the transaction to check whether the update operation is successful. If the update operation is successful, commit the transaction. If the update operation fails, roll back the transaction to restore the data to the state before the update and record an error log.

[0091] When this embodiment is applied, first, the storage node regularly pulls messages from the message queue, obtains them in sequence according to the first-in-first-out principle and marks them as "obtained" to prevent duplicate processing. Next, a transaction is started in the local database to ensure the atomicity of data synchronization operations, that is, either all are successfully executed or all are rolled back to maintain data integrity and consistency. Subsequently, based on the data change information in the message, update operations such as inserting new data, modifying existing data, and deleting expired data are performed on the local storage data, strictly following the transaction requirements. Finally, after the update operation is completed, the transaction is verified, and if successful, the transaction is committed to persist the data; if errors such as data conflicts and update failures occur, the transaction is rolled back and the error log is recorded to restore the data to the state before the update, thereby ensuring a high degree of consistency in the data of each storage node, providing solid data support for the stable operation of the game.

[0092] like Figure 6 As shown, as another preferred embodiment of the present invention, on the other hand, a game server data storage synchronization system comprises:

[0093] The sharding module 100 is used to shard the game data according to preset rules;

[0094] Storage module 200, used for storing in multiple distributed storage nodes, each storage node storing part of the data shards;

[0095] A real-time monitoring module 300 is used to monitor the database operation of the game server in real time;

[0096] Capture module 400, used to capture the change information of addition, modification and deletion of the database;

[0097] The sending module 500 is used to encapsulate the captured change information into a message set and send the message set to a message queue;

[0098] Storage management module 600, used for storing and managing message sets in a message queue according to the first-in-first-out principle;

[0099] The acquisition module 700 is used for each storage node to acquire a message set from a message queue;

[0100] An extraction module 800 is used to extract data change information from a message set;

[0101] The synchronous update module 900 is used to synchronously update the locally stored data.

[0102] When this embodiment is applied, the sharding module 100 shards the game data according to preset rules, the storage module 200 stores the data in multiple distributed storage nodes, each storage node stores part of the data shards, the real-time monitoring module 300 monitors the database operation of the game server in real time, the capture module 400 captures the change information of the addition, modification and deletion of the database, the sending module 500 encapsulates the captured change information into a message set, and sends the message set to the message queue, the storage management module 600 is used for the message queue to store and manage the message set according to the first-in-first-out principle, the acquisition module 700 is used for each storage node to obtain the message set from the message queue, the extraction module 800 extracts the data change information in the message set, and the synchronous update module 900 synchronously updates the locally stored data.

[0103] like Figure 7 As shown, as another preferred embodiment of the present invention, the slicing module 100 specifically includes:

[0104] An acquisition unit 101 is used to acquire all player IDs and basic player data in the game;

[0105] A hash algorithm unit 102, used to calculate the player ID using a hash algorithm and convert the player ID into a corresponding hash value;

[0106] A mapping unit 103, used to map the hash value range to a corresponding distributed storage node;

[0107] The storage unit 104 is used to store the player loading data into the corresponding storage node according to the mapping result and record the storage location index.

[0108] When this embodiment is applied, the acquisition unit 101 acquires all player IDs and basic player data in the game, the hash algorithm unit 102 uses a hash algorithm to calculate the player ID, and converts the player ID into a corresponding hash value. Based on the hash value range, the mapping unit 103 maps it to the corresponding distributed storage node, and the storage unit 104 stores the player's loaded data in the corresponding storage node according to the mapping result, and records the storage location index.

[0109] like Figure 8 As shown, as another preferred embodiment of the present invention, the sending module 500 specifically includes:

[0110] The encapsulation unit 501 is used to encapsulate the captured change information according to a preset message format;

[0111] A selection and sending unit 502 is used to select a corresponding message queue from multiple distributed message queues for sending according to the priority and data size of the changed message;

[0112] A retry recording unit 503 is used to retry if the sending fails and record the sending log;

[0113] A real-time monitoring unit 504, used to monitor the message queue status in real time;

[0114] The message optimization unit 505 is used to clean up messages or expand queue resources if the message queue is abnormal.

[0115] When this embodiment is applied, the encapsulation unit 501 encapsulates the captured change information according to the preset message format, and the selection and sending unit 502 selects the corresponding message queue from multiple distributed message queues for sending according to the priority and data size of the change message. If the sending fails, the retry recording unit 503 retries and records the sending log. The real-time monitoring unit 504 monitors the message queue status in real time. If the message queue is abnormal, the message optimization unit 505 cleans up the message or expands the queue resources.

[0116] In the above embodiment of the present invention, a game server data storage synchronization method is provided, and a game server data storage synchronization system is provided. The method includes four core steps: data sharding storage, real-time data capture, message queue transmission and data synchronization. In the data sharding storage step, preset rules are formulated based on factors such as game data type, player ID or game area, and the game data is sharded and stored in multiple distributed storage nodes. Specifically, the player ID and related basic data are first collected, the player ID is calculated by a hash algorithm to obtain a unique hash value, and then mapped to the corresponding storage node according to the hash value range, and finally the player-related data is stored and indexed to achieve balanced distribution and efficient storage of data. Real-time data capture uses a log-based incremental capture tool to monitor the game server database operation in real time. After starting the tool and configuring the monitoring frequency and log level, the tool analyzes the operation log in real time, identifies operations such as adding, modifying, and deleting, extracts key change information and verifies it, ensures that the captured data change information is accurate, and provides a reliable basis for subsequent data synchronization. In the message queue transmission link, the captured data change information is encapsulated into a message with a message header, and the message header contains meta information such as message type, sending time, and data source. According to the message priority and data size, a suitable queue is selected from multiple distributed message queues to send messages. The message queue client is used to ensure transmission reliability. When the transmission fails, the message queue is retried and the log is recorded. At the same time, the message queue monitors its own status in real time, and automatically cleans up messages or expands resources when an exception occurs. During data synchronization, the storage node regularly pulls messages from the message queue, obtains and marks messages according to the first-in-first-out principle. A transaction is started in the local database, and the local data is updated according to the data change information in the message. After the update is completed, the transaction is verified. If successful, the transaction is submitted to persist the data. If failed, the transaction is rolled back and the error log is recorded to ensure the data consistency of each storage node; in terms of data storage, this method and system realizes balanced distribution of data through data sharding storage, improves storage efficiency, reduces single-machine storage pressure, and enhances system scalability. In terms of data synchronization, real-time data capture and message queue transmission ensure timely and accurate acquisition and transmission of data change information. Combined with the transaction mechanism of data synchronization, data consistency and integrity are ensured, game freezes and data errors are reduced, and players are provided with a smooth and stable game experience, improving the quality of game operation.

[0117] In order to load the above-mentioned method and system and enable it to run smoothly, the system, in addition to the various modules mentioned above, may also include more or fewer components than described above, or a combination of certain components, or different components, for example, it may include input and output devices, network access devices, buses, processors and memories, etc.

[0118] The processor may be a central processing unit, or other general-purpose processors, digital signal processors, application-specific integrated circuits, off-the-shelf programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the system, and various interfaces and lines are used to connect various parts.

[0119] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0120] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.

[0121] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for synchronizing game server data storage, characterized in that: The method comprises: The game data is sharded according to preset rules and stored in multiple distributed storage nodes, with each storage node storing part of the data shards; Monitor the database operations of the game server in real time and capture the change information of database addition, modification and deletion; The captured change information is encapsulated into a message set, and the message set is sent to the message queue. The message queue stores and manages the message set according to the first-in-first-out principle. Each storage node obtains a message set from the message queue, extracts the data change information in the message set, and synchronously updates the locally stored data.

2. The game server data storage synchronization method according to claim 1 is characterized in that: The game data is sharded according to preset rules and stored in multiple distributed storage nodes, and each storage node stores part of the data shards, specifically including: Obtain all player IDs and basic player data in the game, including character creation time and common login regions; Use a hash algorithm to calculate the player ID and convert the player ID into a corresponding hash value; Based on the hash value range, map it to the corresponding distributed storage node; The player's loaded data is stored in the corresponding storage node according to the mapping result, and the storage location index is recorded. The loaded data includes character information, equipment data, and game progress.

3. The game server data storage synchronization method according to claim 1, characterized in that: The real-time monitoring of the database operation of the game server and capturing the change information of the addition, modification and deletion of the database specifically include: Start the log-based incremental capture tool in the database system to monitor the database operation log in real time, and set the real-time monitoring frequency and log level; Analyze database operation logs in real time, identify different types of operation instructions such as adding, modifying, and deleting, and extract the data table name, field name, and specific data content involved in the operation instructions; Extract operation instruction change information and form data change records; Verify the integrity and accuracy of the extracted data change information.

4. The game server data storage synchronization method according to claim 1, characterized in that: The captured change information is encapsulated into a message set, and the message set is sent to a message queue. The message queue stores and manages the message set according to the first-in-first-out principle. Specifically, the following steps are performed: Encapsulate the captured change information according to the preset message format; According to the priority and data size of the change message, the corresponding message queue is selected from multiple distributed message queues for sending. If the sending fails, it will be retried and the sending log will be recorded; Monitor the message queue status in real time. If the message queue is abnormal, clean up the messages or expand the queue resources.

5. The game server data storage and synchronization method according to claim 1, characterized in that: The captured change information is encapsulated into a message set, and the message set is sent to a message queue. The message queue stores and manages the message set according to the first-in-first-out principle. Specifically, the following steps are performed: Pull messages from the message queue regularly, obtain the messages to be processed in sequence based on the first-in-first-out principle of the message queue, and mark the obtained messages as "obtained"; Start a transaction in the local database of the storage node; Update the locally stored data according to the data change information in the message; After completing the data update operation, verify the transaction to check whether the update operation is successful. If the update operation is successful, commit the transaction. If the update operation fails, roll back the transaction, restore the data to the state before the update, and record the error log.

6. A game server data storage synchronization system, characterized in that: Applying the game server data storage and synchronization method according to any one of claims 1 to 5, the system comprises: Sharding module, used to shard game data according to preset rules; A storage module is used to store data in multiple distributed storage nodes, each storage node stores part of the data shards; Real-time monitoring module, used to monitor the database operation of the game server in real time; Capture module, used to capture the change information of addition, modification and deletion of database; The sending module is used to encapsulate the captured change information into a message set and send the message set to the message queue; Storage management module, used for storing and managing message sets according to the first-in-first-out principle in message queues; The acquisition module is used for each storage node to obtain a message set from the message queue; An extraction module is used to extract data change information from a message set; The synchronous update module is used to synchronously update the locally stored data.

7. The game server data storage synchronization system according to claim 6, characterized in that: The sharding module specifically includes: The acquisition unit is used to obtain all player IDs and basic player data in the game; A hash algorithm unit, used to calculate the player ID using a hash algorithm and convert the player ID into a corresponding hash value; A mapping unit, used to map a hash value range to a corresponding distributed storage node; The storage unit is used to store the player loaded data into the corresponding storage node according to the mapping result and record the storage location index.

8. The game server data storage synchronization system according to claim 6, characterized in that: The sending module specifically includes: An encapsulation unit, used to encapsulate the captured change information according to a preset message format; A sending unit is used to select a corresponding message queue from multiple distributed message queues for sending according to the priority and data size of the changed message; Retry recording unit, used to retry if sending fails and record the sending log; Real-time monitoring unit, used to monitor the message queue status in real time; The message optimization unit is used to clean up messages or expand queue resources if the message queue is abnormal.