A game data synchronization method, game client and game server
Through dynamically generating configuration information, differential detection and data compression technology, combined with machine learning and AI analysis, the efficient, real-time and security of game data synchronization is achieved, and the server pressure, high bandwidth consumption and low flexibility in the existing technology is solved. The problem improves the gaming experience and security.
Patent Information
- Application Number
- CN202411321361.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2044-09-23
AI Technical Summary
When the existing game data synchronization method handles large-scale players and complex game logic, the server computing pressure is high, the network bandwidth is consumed, and the flexibility is low. It lacks intelligent analysis and optimization, and cannot meet the needs of instant feedback and dynamic adjustments. It is easy to Causing cheating problems.
The server dynamically generates and incrementally synchronizes game configuration and user data, and uses differential detection and data compression technology to reduce the transmission burden. The client and the server adopt compressed coding and multi-threaded asynchronous processing, and introduces machine learning models to realize adaptive hierarchical synchronization strategy. Combining AI analysis and deep learning for log analysis and abnormal detection, a hybrid chain game event recording system is built.
It improves data synchronization efficiency, reduces bandwidth usage, ensures real-time data updates, improves operation response speed, provides personalized intelligent decision-making suggestions, enhances game security, and prevents cheating.
Smart Images

Figure CN118831315B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of online games, and in particular relates to a game data synchronization method, a game client and a game server. Background Art
[0002] Traditional game data synchronization includes state synchronization and frame synchronization. State synchronization is to calculate the state information of the game world by the server and broadcast it to all clients. Although this method can ensure the consistency of the game state, it has significant disadvantages. For example, the server needs to bear a lot of computing pressure, especially when dealing with large-scale players and complex game logic; secondly, since each synchronization needs to transmit the complete game state information, the network bandwidth consumption is huge. Frame synchronization is a synchronization method that puts the game logic operation on the client. The server is only responsible for collecting and forwarding the player's operation instructions, and the client calculates the game logic according to these instructions. Although this method reduces the burden on the server, it is easy to cause cheating problems because the logic operation is performed on the client; when the network fluctuates greatly, the data inconsistency between clients is more prominent; when disconnecting and reconnecting, the client needs to recalculate from the first frame, resulting in a long recovery time.
[0003] For example, the patent with authorization announcement number CN102571695B discloses a data synchronization method and a game server, including: the server side obtains the current value of the input parameter of the business function from the client side, wherein the input parameter of the business function includes the basic parameters of the user using the client side; the server side obtains the output result of the business function according to the current value of the business function and the input parameter, and the output result includes the current business performance data of the game; when the client side starts the game, the server side sends the business performance data to the client side for the client side to display. The adoption of this technical solution prevents the server from being overloaded with data synchronization due to too many online users, and eliminates the possibility of users tampering with user game data using plug-ins in data synchronization.
[0004] For example, the patent with publication number CN115695452A discloses a method for multi-point settlement and data synchronization of a game server, including: setting a unified data sending interface and a data receiving interface on the server and the client respectively; when the player successfully logs in to the server, reading the first configuration table to obtain the settlement time point of each functional module of the server; whenever the settlement time point is reached, automatically reading the second configuration table to obtain the current set of settlement interfaces that need to be settled, and passing in the corresponding data for data settlement; the data sending interface packages the data returned by each settlement interface and sends it to the client; the data receiving interface calls the corresponding synchronization interface according to the second configuration table for data synchronization. This technical solution decouples the communication process and business processing logic in the existing data settlement and synchronization process, significantly improves the efficiency and performance of data synchronization, avoids the occurrence of data synchronization confusion, and has strong scalability.
[0005] The above existing technologies all have the following problems: 1) Business performance data is only sent when the client is started. For games that require real-time feedback and dynamic adjustment, it cannot meet the immediate needs of players and has the limitation of one-way synchronization; 2) Low flexibility and lack of intelligent analysis and optimization. Summary of the invention
[0006] In view of the shortcomings of the prior art, the present invention proposes a game data synchronization method, a game client and a game server, which dynamically generate and incrementally synchronize game configuration and user data through the server, and use difference detection and data compression technology to reduce the transmission burden; compression encoding and multi-threaded asynchronous processing technology are used between the client and the server to improve the operation response speed and processing efficiency; a machine learning model is introduced to implement an adaptive hierarchical synchronization strategy, and the synchronization strategy is dynamically adjusted according to data importance and network conditions; the client integrates AI analysis function, collects user behavior data and feeds back analysis results, and provides intelligent decision-making support; a hybrid chain game event recording system is constructed, and deep learning is combined for log analysis and anomaly detection, and real-time warning and response to security incidents are provided to ensure the safety and stability of the game environment.
[0007] To achieve the above object, the present invention provides the following technical solutions:
[0008] A game data synchronization method, comprising:
[0009] According to the game content update and user data change, the latest configuration information is dynamically generated to obtain the data to be synchronized. Through the improved difference detection algorithm, combined with the data compression library, the data to be synchronized is pushed to the client in the form of incremental state synchronization, so that the client receives and decompresses the incremental data packet from the server, and updates the local game state according to the incremental data packet. At the same time, the client collects the operation instructions entered by the user, compresses and encodes the operation instructions entered by the user, and sends the encoded instruction data to the server;
[0010] After receiving the encoded command data, it is placed in an asynchronous processing queue and processed in parallel using a multi-threaded approach. At the same time, the server uses a machine learning model to implement an adaptive hierarchical synchronization strategy based on the importance and urgency of the game data. The client and server dynamically adjust the synchronization level and data volume based on the current network bandwidth conditions, so that the client can collect the adjusted user behavior data and game status information, analyze them through AI algorithms, and feed back the analysis results to the server. At the same time, in specific game scenarios, an AI-assisted system is introduced to provide users with intelligent decision-making suggestions;
[0011] Based on AI analysis results and intelligent decision-making suggestions, a game event recording system based on the hybrid chain is built. The deep learning model is used to extract features and detect anomalies in the recorded game logs. If abnormal behavior is detected, the early warning mechanism is immediately triggered and security measures are taken. At the same time, a security event database is established;
[0012] The specific steps of the improved difference detection algorithm include:
[0013] S1.1: Analyze the historical change pattern of the data to be synchronized, use the data block segmentation strategy to segment the data to be synchronized into data blocks, and determine the initial data block size distribution. At the same time, start N parallel tasks, each task is responsible for calculating the rolling hash value of M data blocks. The formula is:
[0014] ;
[0015] in, represents the hash value of the i-th data block, and i ∈ [ 1 , M ] , Represents the hash value of the i+1th data block, represents the weight factor of the jth character in the i-th data block, represents the weight factor of the i-th data block, Indicates the value of the jth character in the i-th data block when the i-th data block is processed. represents the total index from the beginning of the data set to the jth character in the i-th data block, base represents the base of the hash function, The adjustment factor representing the base of the hash function. represents the adjusted hash base, m represents the modulus of the hash value, represents the adjustment factor of the modulus m, It indicates the value of the last data item in the i-th data block before processing the i+1-th data block. represents the adjustment factor of the i-th data block, It represents the hash value of the last character of the newly added i-th data block, mod represents modulus, and bs represents the basic size of the data block. Indicates the starting offset of the i-th data block, Indicates the actual length of the i-th data block;
[0016] S1.2: Summarize the hash values calculated by the N parallel tasks to form a hash value set of the entire data to be synchronized;
[0017] The specific steps of the improved difference detection algorithm also include:
[0018] S1.3: Compare the hash value of the data to be synchronized with the hash value of the old data. According to the comparison result, use the incremental hash index to quickly locate the difference data block, generate the difference data, and generate the incremental update package according to the difference data.
[0019] S1.4: Use the data compression library to compress the incremental update package, and transmit the compressed incremental update package to the client through the network. At the same time, monitor the network status and client feedback in real time, and adjust the transmission strategy as needed.
[0020] Specifically, the specific steps of S1.3 include:
[0021] S1.31: Obtain the stored or synchronized old data set, and receive the data set to be synchronized;
[0022] S1.32: Calculate the hash value of old data using the built-in hash function and the hash value of the data to be synchronized ;
[0023] like , the data to be synchronized has not changed and does not need to be synchronized;
[0024] like , when the synchronization data changes, the incremental hash index is used to locate the difference data block, and the difference data is extracted from the difference data block. At the same time, an incremental update package is generated based on the difference data.
[0025] Specifically, the specific steps of the adaptive hierarchical synchronization strategy include:
[0026] S3.1: Collect historical game data, network condition data, and user data changes to obtain historical data, and based on the historical data, obtain a pre-trained machine learning prediction model;
[0027] S3.2: Design a hierarchical synchronization framework, introduce user portraits and game scene recognition mechanisms, assign synchronization levels to different users and scenes, and each synchronization level corresponds to a certain amount of data. and synchronization frequency ,and n ∈ [ 1 , D ] , where n represents the synchronization level position index and D represents the number of synchronization levels.
[0028] Specifically, the specific steps of the adaptive hierarchical synchronization strategy also include:
[0029] S3.3: receiving the encoded instruction data and performing preprocessing, and inputting the preprocessed encoded instruction data into the machine learning prediction model to predict the synchronization level and data volume;
[0030] S3.4: Use network monitoring tools to measure data transmission rate, latency, and packet loss rate indicators to obtain real-time network condition data;
[0031] S3.5: The server dynamically adjusts the synchronization level and data volume based on the prediction results of the machine learning prediction model and real-time network condition data;
[0032] S3.6: Implement a prediction-feedback loop to regularly evaluate synchronization effectiveness and iteratively optimize the machine learning prediction model and adaptive hierarchical synchronization strategy.
[0033] Specifically, the data block segmentation strategy in S1.1 is dynamically adjusted according to the frequency of data changes in the region, and dynamic data blocks are set for each region. .
[0034] A game data synchronization method is used in an online game and is executed by a game client. The game data synchronization method includes:
[0035] Sending compressed and encoded instruction data to the server, so that after receiving the encoded instruction data, the server puts it into an asynchronous processing queue and processes the encoded instruction data in parallel using a multi-threaded manner. At the same time, the server uses a machine learning model to implement an adaptive hierarchical synchronization strategy based on the importance and urgency of the game data;
[0036] Dynamically adjust the synchronization level and data volume with the server according to the current network bandwidth conditions;
[0037] Collect the adjusted user behavior data and game status information, analyze them through AI algorithms, and feed the analysis results back to the server, so that the server can build a game event recording system based on the hybrid chain based on the AI analysis results and intelligent decision-making suggestions, and use deep learning models to extract features and detect anomalies in the recorded game logs. If abnormal behavior is detected, the early warning mechanism is immediately triggered and security measures are taken. At the same time, a security event database is established;
[0038] In specific game scenarios, an AI-assisted system is introduced to provide users with intelligent decision-making suggestions.
[0039] A game client, used in an online game, comprising:
[0040] A sending module sends the compressed and encoded instruction data to the server, so that after receiving the encoded instruction data, the server puts it into an asynchronous processing queue and processes the encoded instruction data in parallel using a multi-threaded method. At the same time, the server uses a machine learning model to implement an adaptive hierarchical synchronization strategy according to the importance and urgency of the game data;
[0041] A dynamic adjustment module dynamically adjusts the synchronization level and data volume with the server according to the current network bandwidth conditions;
[0042] The data collection module collects the adjusted user behavior data and game status information, analyzes them through AI algorithms, and feeds the analysis results back to the server, so that the server can build a game event recording system based on the hybrid chain based on the AI analysis results and intelligent decision-making suggestions, and use deep learning models to extract features and detect anomalies in the recorded game logs. If abnormal behavior is detected, the early warning mechanism is immediately triggered and security measures are taken. At the same time, a security event database is established;
[0043] The suggestion module introduces an AI-assisted system to provide users with intelligent decision-making suggestions in specific game scenarios.
[0044] A game server, used in an online game and connected to a client, comprising:
[0045] The data synchronization module dynamically generates the latest configuration information according to the game content update and user data change, obtains the data to be synchronized, and pushes the data to be synchronized to the client in the form of incremental state synchronization through the improved difference detection algorithm combined with the data compression library, so that the client receives and decompresses the incremental data packet from the server, and updates the local game state according to the incremental data packet. At the same time, the client collects the operation instructions input by the user, compresses and encodes the operation instructions input by the user, and sends the encoded instruction data to the server;
[0046] The adaptive synchronization strategy module, after receiving the encoded instruction data, puts it into the asynchronous processing queue and processes the encoded instruction data in parallel using a multi-threaded method. At the same time, the server uses a machine learning model to implement an adaptive hierarchical synchronization strategy based on the importance and urgency of the game data. The client and server dynamically adjust the synchronization level and data volume based on the current network bandwidth conditions, so that the client can collect the adjusted user behavior data and game status information, analyze it through the AI algorithm, and feed back the analysis results to the server. At the same time, in specific game scenarios, an AI-assisted system is introduced to provide users with intelligent decision-making suggestions;
[0047] The game event recording module builds a game event recording system based on the hybrid chain based on AI analysis results and intelligent decision-making suggestions. It uses a deep learning model to extract features and detect anomalies in recorded game logs. If abnormal behavior is detected, the early warning mechanism is immediately triggered and safety measures are taken. At the same time, a security event database is established.
[0048] Compared with the prior art, the present invention has the following beneficial effects:
[0049] 1. The present invention proposes a game data synchronization method, which realizes incremental synchronization by dynamically generating configuration information and utilizing difference detection and data compression technology, thereby improving the efficiency of data synchronization, reducing bandwidth occupancy, and ensuring real-time data update; efficient interaction between the server and the client, combined with multi-threaded asynchronous processing, enables operation instructions to be responded to instantly, and the gaming experience is smoother.
[0050] 2. The present invention proposes a game data synchronization method that incorporates intelligent synchronization strategies and AI analysis technology. It not only adaptively adjusts the synchronization level according to the importance and urgency of the data, but also uses AI algorithms to analyze user behavior and provide personalized intelligent decision-making suggestions; at the same time, the event recording system based on the hybrid chain and the deep learning anomaly detection mechanism enhance the security of the game and effectively prevent cheating. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 A schematic diagram of a method for synchronizing game data according to the present invention;
[0052] Figure 2 This is a principle flow chart of a game data synchronization method of the present invention;
[0053] Figure 3 A flowchart of pushing data to be synchronized in a method for synchronizing game data according to the present invention;
[0054] Figure 4 This is a flow chart of an adaptive hierarchical synchronization strategy for a game data synchronization method of the present invention. DETAILED DESCRIPTION
[0055] Example 1
[0056] See also Figure 1 and Figure 2 , an embodiment provided by the present invention: a method for synchronizing game data, the user data of the present application is information actively sent by the user or actively permitted to be collected through a public website, and the present application will not elaborate on this, and the present application includes the following steps:
[0057] According to the game content update and user data change, the latest configuration information is dynamically generated to obtain the data to be synchronized. Through the improved difference detection algorithm, combined with the data compression library, the data to be synchronized is pushed to the client in the form of incremental state synchronization, so that the client receives and decompresses the incremental data packet from the server, and updates the local game state according to the incremental data packet. At the same time, the client collects the operation instructions entered by the user, compresses and encodes the operation instructions entered by the user, and sends the encoded instruction data to the server;
[0058] Among them, game content updates include: new maps, new characters, and balance adjustments; user data changes include: player level, equipment, and achievements.
[0059] Furthermore, in the present invention, by using an improved difference detection algorithm combined with a data compression library, when the game state changes are pushed to the client in the form of incremental state synchronization, the improved difference detection algorithm can quickly and accurately identify the changes in the game state since the last synchronization, rather than transmitting the entire game state, thereby reducing the amount of data that needs to be transmitted, especially in scenarios where the game state changes frequently but most of the content remains unchanged; and the incremental state synchronization method only transmits the changed data, thereby reducing network transmission delays and bandwidth consumption.
[0060] After receiving the encoded command data, it is placed in an asynchronous processing queue and processed in parallel using a multi-threaded approach. At the same time, the server uses a machine learning model to implement an adaptive hierarchical synchronization strategy based on the importance and urgency of the game data. The client and server dynamically adjust the synchronization level and data volume based on the current network bandwidth conditions, so that the client can collect the adjusted user behavior data and game status information, analyze them through AI algorithms, and feed back the analysis results to the server. At the same time, in specific game scenarios, an AI-assisted system is introduced to provide users with intelligent decision-making suggestions;
[0061] Among them, the server defines the standards for the importance and urgency of game data by analyzing game logic, user experience, and the potential impact of data loss or delay.
[0062] Based on AI analysis results and intelligent decision-making suggestions, a game event recording system based on the hybrid chain is built. The deep learning model is used to extract features and detect anomalies in the recorded game logs. If abnormal behavior is detected, the early warning mechanism is immediately triggered and safety measures are taken. At the same time, a security event database is established.
[0063] Among them, game events include: rare item transactions, ranking changes; abnormal behaviors include: cheating, malicious attacks.
[0064] Example 2
[0065] See also Figure 3 and Figure 4 , the specific steps of the improved difference detection algorithm in this embodiment include:
[0066] S1.1: Analyze the historical change pattern of the data to be synchronized, use the data block segmentation strategy to segment the data to be synchronized into data blocks, and determine the initial data block size distribution. At the same time, start N parallel tasks, each task is responsible for calculating the rolling hash value of M data blocks. The formula is:
[0067] ;
[0068] in, represents the hash value of the i-th data block, and i ∈ [ 1 , M ] , Represents the hash value of the i+1th data block, represents the weight factor of the jth character in the i-th data block, Represents the weight factor of the i-th data block, which is used to adjust the contribution of characters at different positions in the hash value. It can be set dynamically based on the content characteristics or position importance within the data block. Indicates the value of the jth character in the i-th data block when the i-th data block is processed. It represents the total index from the beginning of the data set to the jth character in the i-th data block. Base represents the cardinality of the hash function. The value of base is dynamically adjusted by monitoring the hash collision rate or distribution uniformity. If the collision rate is too high, the value of base is increased. If the distribution is too sparse, the value of base is reduced. The adjustment factor representing the base of the hash function is used to dynamically adjust the base according to the characteristics of the data block. represents the adjusted hash base, m represents the modulus of the hash value, Represents the adjustment factor of the modulus m, which is used to optimize the distribution of hash values and reduce collisions. It indicates the value of the last data item in the i-th data block before processing the i+1-th data block. Represents the adjustment factor of the i-th data block, which is used to compensate for the hash value deviation caused by the change of data block boundary or content during rolling. It represents the hash value of the last character of the newly added i-th data block, mod represents modulus, and bs represents the basic size of the data block. Indicates the starting offset of the i-th data block, which is used to process non-continuous or overlapping data blocks. Indicates the actual length of the i-th data block.
[0069] It should be noted that in the present invention, The calculation formula is: 1) Introduce and , where the weight is introduced , which means that different weighted treatments are allowed for different locations or different data items, thereby increasing the flexibility of the hash function. The existence of allows the blocks to not be arranged consecutively from the beginning of the data set, further increasing the flexibility of processing; 2) by , which enables processing of blocks of variable length, and is useful for processing non-uniformly distributed data or dynamically changing data sets; 3) Use As position weights, it ensures that the order of data items is reflected in the hash value, thereby improving the discrimination of the hash function; 4) Modulo ensures that hash values stay within a manageable range, preventing overflow, and possibly introducing some form of looping or periodic behavior which helps reduce hash collisions.
[0070] against The calculation formula allows Efficiently calculate , without reprocessing the entire data block, which is beneficial for the need to continuously process a large number of data blocks, such as data streams or file chunks; specifically, 1) by and , dynamically adjust the impact of old and new data items on the hash value, thereby more finely controlling the behavior of the hash function, 2) in the expression Part of it is actually The effective part of is shifted to the left to make room for the new data item. This processing method reduces unnecessary calculations and improves efficiency. 3) Similarly, by taking the modulus of m, we ensure Staying within a fixed range is crucial for the stability and consistency of the hash function.
[0071] Furthermore, the data block segmentation strategy in S1.1 is dynamically adjusted according to the frequency of data changes in the region, and dynamic data blocks are set for each region. .
[0072] S1.2: Summarize the hash values calculated by the N parallel tasks to form a hash value set of the entire data to be synchronized;
[0073] S1.3: Compare the hash value of the data to be synchronized with the hash value of the old data. According to the comparison result, use the incremental hash index to quickly locate the difference data block, generate the difference data, and generate the incremental update package according to the difference data.
[0074] S1.4: Use the data compression library to compress the incremental update package, and transmit the compressed incremental update package to the client through the network. At the same time, monitor the network status and client feedback in real time, and adjust the transmission strategy as needed.
[0075] The specific steps of S1.3 include:
[0076] S1.31: Obtain the stored or synchronized old data set, and receive the data set to be synchronized;
[0077] S1.32: Calculate the hash value of old data using the built-in hash function and the hash value of the data to be synchronized ;
[0078] like , the data to be synchronized has not changed and does not need to be synchronized;
[0079] like , when the synchronization data changes, the incremental hash index is used to locate the difference data block, and the difference data is extracted from the difference data block. At the same time, an incremental update package is generated based on the difference data.
[0080] Furthermore, the process of extracting difference data includes:
[0081] (1) In the initial stage of data synchronization, an incremental hash index is constructed for the old data. The index should contain the hash value of each data block and the location information of the data block in the data set. The location information of the data block in the data set includes the offset or block number.
[0082] (2) Calculate a hash value for each data block in the data set to be synchronized, compare the hash value of the data block to be synchronized with the hash value in the incremental hash index, and identify data blocks with different hash values. These data blocks are differential data blocks;
[0083] (3) Use the location information stored in the incremental hash index to locate the location of the difference data block in the old data set, and at the same time, determine the location of the difference data block in the data set to be synchronized;
[0084] (4) Based on the located difference data blocks, the corresponding data is extracted from the data set to be synchronized.
[0085] The specific steps of the adaptive hierarchical synchronization strategy include:
[0086] S3.1: Collect historical game data, network condition data, and user data changes to obtain historical data, and based on the historical data, obtain a pre-trained machine learning prediction model;
[0087] S3.2: Design a hierarchical synchronization framework, introduce user portraits and game scene recognition mechanisms, assign synchronization levels to different users and scenes, and each synchronization level corresponds to a certain amount of data. and synchronization frequency ,and n ∈ [ 1 , D ] , where n represents the synchronization level position index, and D represents the number of synchronization levels;
[0088] Furthermore, the specific steps of S3.2 include:
[0089] S3.21: Define synchronization levels and standards:
[0090] 1) Determine the number of levels: Based on the game characteristics and network conditions, the number of synchronization levels is initially set to D;
[0091] 2) Set tier standards: Define the standards for data volume and synchronization frequency for each tier. For example, tier 1 represents the lowest data volume and lowest synchronization frequency, which is suitable for situations with extremely poor network conditions or low user device performance; tier D represents the highest data volume and highest synchronization frequency, which is suitable for situations with good network conditions and superior user device performance.
[0092] S3.22: Introducing user portrait and game scene recognition mechanism:
[0093] 1) Collect user data, including historical game data changes, device performance, and network usage habits, and use statistical analysis methods to process user data and build user portraits;
[0094] 2) Define different game scenes, such as combat, exploration, and dialogue, based on the game content, and use machine learning-based methods to identify the current game scene in real time.
[0095] S3.23: Assign synchronization levels:
[0096] 1) Develop a synchronization level allocation strategy based on user profiles and game scenarios. For example, for users with high activity and high device performance, a higher synchronization level may be allocated in the battle scenario; while for users with low activity and low device performance, a lower synchronization level may be allocated in the exploration scenario;
[0097] 2) During the game, the synchronization level is dynamically allocated based on the real-time identified user portraits and game scenarios.
[0098] S3.24: Synchronous framework implementation:
[0099] 1) Design the architecture of the layered synchronization framework, including the data layer, processing layer, and synchronization layer;
[0100] 2) Define the interfaces and data exchange formats between the various levels to ensure that data can be smoothly transferred between the various levels;
[0101] 3) According to the assigned synchronization level, implement the corresponding synchronization logic, including data packaging, sending, receiving, and parsing.
[0102] S3.3: receiving the encoded instruction data and preprocessing it, inputting the preprocessed encoded instruction data into the machine learning prediction model to predict the synchronization level and data volume, wherein the prediction process of the machine learning prediction model is the prior art content in this field, and is not the inventive solution of the present application, and is not described in detail here;
[0103] S3.4: Using a network monitoring tool to measure data transmission rate, delay and packet loss rate indicators to obtain real-time network condition data, wherein using a network monitoring tool to measure indicators is a prior art in the art and is not an inventive solution of the present application, and is not described in detail herein;
[0104] S3.5: The server dynamically adjusts the synchronization level and data volume based on the prediction results of the machine learning prediction model and real-time network condition data;
[0105] The dynamic adjustment rules are as follows: when bandwidth is tight, prioritize synchronization of critical and urgent data; when bandwidth is sufficient, increase the amount and frequency of synchronized data.
[0106] S3.6: Implement a prediction-feedback loop to regularly evaluate synchronization effectiveness and iteratively optimize the machine learning prediction model and adaptive hierarchical synchronization strategy.
[0107] Example 3
[0108] A game data synchronization method is used in an online game and is executed by a game client. The game data synchronization method includes:
[0109] Sending compressed and encoded instruction data to the server, so that after receiving the encoded instruction data, the server puts it into an asynchronous processing queue and processes the encoded instruction data in parallel using a multi-threaded manner. At the same time, the server uses a machine learning model to implement an adaptive hierarchical synchronization strategy based on the importance and urgency of the game data;
[0110] Dynamically adjust the synchronization level and data volume with the server according to the current network bandwidth conditions;
[0111] Collect the adjusted user behavior data and game status information, analyze them through AI algorithms, and feed the analysis results back to the server, so that the server can build a game event recording system based on the hybrid chain based on the AI analysis results and intelligent decision-making suggestions, and use deep learning models to extract features and detect anomalies in the recorded game logs. If abnormal behavior is detected, the early warning mechanism is immediately triggered and security measures are taken. At the same time, a security event database is established;
[0112] In specific game scenarios, an AI-assisted system is introduced to provide users with intelligent decision-making suggestions.
[0113] A game client, used in an online game, comprising:
[0114] A sending module sends the compressed and encoded instruction data to the server, so that after receiving the encoded instruction data, the server puts it into an asynchronous processing queue and processes the encoded instruction data in parallel using a multi-threaded method. At the same time, the server uses a machine learning model to implement an adaptive hierarchical synchronization strategy according to the importance and urgency of the game data;
[0115] A dynamic adjustment module dynamically adjusts the synchronization level and data volume with the server according to the current network bandwidth conditions;
[0116] The data collection module collects the adjusted user behavior data and game status information, analyzes them through AI algorithms, and feeds the analysis results back to the server, so that the server can build a game event recording system based on the hybrid chain based on the AI analysis results and intelligent decision-making suggestions, and use deep learning models to extract features and detect anomalies in the recorded game logs. If abnormal behavior is detected, the early warning mechanism is immediately triggered and security measures are taken. At the same time, a security event database is established;
[0117] The suggestion module introduces an AI-assisted system to provide users with intelligent decision-making suggestions in specific game scenarios.
[0118] A game server, used in an online game and connected to a client, comprising:
[0119] The data synchronization module dynamically generates the latest configuration information according to the game content update and user data change, obtains the data to be synchronized, and pushes the data to be synchronized to the client in the form of incremental state synchronization through the improved difference detection algorithm combined with the data compression library, so that the client receives and decompresses the incremental data packet from the server, and updates the local game state according to the incremental data packet. At the same time, the client collects the operation instructions input by the user, compresses and encodes the operation instructions input by the user, and sends the encoded instruction data to the server;
[0120] The adaptive synchronization strategy module, after receiving the encoded instruction data, puts it into the asynchronous processing queue and processes the encoded instruction data in parallel using a multi-threaded method. At the same time, the server uses a machine learning model to implement an adaptive hierarchical synchronization strategy based on the importance and urgency of the game data. The client and server dynamically adjust the synchronization level and data volume based on the current network bandwidth conditions, so that the client can collect the adjusted user behavior data and game status information, analyze it through the AI algorithm, and feed back the analysis results to the server. At the same time, in specific game scenarios, an AI-assisted system is introduced to provide users with intelligent decision-making suggestions;
[0121] The game event recording module builds a game event recording system based on the hybrid chain based on AI analysis results and intelligent decision-making suggestions. It uses a deep learning model to extract features and detect anomalies in recorded game logs. If abnormal behavior is detected, the early warning mechanism is immediately triggered and safety measures are taken. At the same time, a security event database is established.
[0122] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in the field may also change, modify, replace and modify the above-mentioned embodiments without departing from the purpose and scope of protection of the present invention, and all of these are within the protection of the present invention.
[0123] If the disclosed technical solution involves personal information, the product using the disclosed technical solution has clearly informed the personal information processing rules and obtained the individual's voluntary consent before processing the personal information. If the disclosed technical solution involves sensitive personal information, the product using the disclosed technical solution has obtained the individual's separate consent before processing the sensitive personal information, and at the same time meets the "explicit consent" requirement. For example, on personal information collection devices such as cameras, clear and prominent signs are set to inform that the personal information collection scope has been entered and personal information will be collected. If the individual voluntarily enters the collection scope, it is deemed that he or she agrees to the collection of his or her personal information; or on the device that processes personal information, when the personal information processing rules are notified by obvious signs / information, the individual's authorization is obtained through pop-up information or by asking the individual to upload his or her personal information; among them, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the type of personal information processed.
Claims
1. A game data synchronization method, characterized in that: Executed by the server, including: According to the game content update and user data change, the latest configuration information is dynamically generated to obtain the data to be synchronized. Through the improved difference detection algorithm, combined with the data compression library, the data to be synchronized is pushed to the client in the form of incremental state synchronization, so that the client receives and decompresses the incremental data packet from the server, and updates the local game state according to the incremental data packet. At the same time, the client collects the operation instructions entered by the user, compresses and encodes the operation instructions entered by the user, and sends the encoded instruction data to the server; After receiving the encoded command data, it is placed in an asynchronous processing queue and processed in parallel using a multi-threaded approach. At the same time, the server uses a machine learning model to implement an adaptive hierarchical synchronization strategy based on the importance and urgency of the game data. The client and server dynamically adjust the synchronization level and data volume based on the current network bandwidth conditions, so that the client can collect the adjusted user behavior data and game status information, analyze them through AI algorithms, and feed back the analysis results to the server. At the same time, in specific game scenarios, an AI-assisted system is introduced to provide users with intelligent decision-making suggestions; Based on AI analysis results and intelligent decision-making suggestions, a game event recording system based on the hybrid chain is built. The deep learning model is used to extract features and detect anomalies in the recorded game logs. If abnormal behavior is detected, the early warning mechanism is immediately triggered and security measures are taken. At the same time, a security event database is established; The specific steps of the improved difference detection algorithm include: S1.1: Analyze the historical change pattern of the data to be synchronized, use the data block segmentation strategy to segment the data to be synchronized into data blocks, and determine the initial data block size distribution. At the same time, start N parallel tasks, each task is responsible for calculating the rolling hash value of M data blocks. The formula is: ; in, represents the hash value of the i-th data block, and , Represents the hash value of the i+1th data block, represents the weight factor of the jth character in the i-th data block, represents the weight factor of the i-th data block, Indicates the value of the jth character in the i-th data block when the i-th data block is processed. represents the total index from the beginning of the data set to the jth character in the i-th data block, base represents the base of the hash function, The adjustment factor representing the base of the hash function. represents the adjusted hash base, m represents the modulus of the hash value, represents the adjustment factor of the modulus m, It indicates the value of the last data item in the i-th data block before processing the i+1-th data block. represents the adjustment factor of the i-th data block, It represents the hash value of the last character of the newly added i-th data block, mod represents modulus, and bs represents the basic size of the data block. Indicates the starting offset of the i-th data block, Indicates the actual length of the i-th data block; S1.2: Summarize the hash values calculated by the N parallel tasks to form a hash value set of the entire data to be synchronized; The specific steps of the improved difference detection algorithm also include: S1.3: Compare the hash value of the data to be synchronized with the hash value of the old data. According to the comparison result, use the incremental hash index to quickly locate the difference data block, generate the difference data, and generate the incremental update package according to the difference data. S1.4: Use the data compression library to compress the incremental update package, and transmit the compressed incremental update package to the client through the network. At the same time, monitor the network status and client feedback in real time, and adjust the transmission strategy as needed.
2. A method for synchronizing game data according to claim 1, characterized in that: The specific steps of S1.3 include: S1.31: Obtain the stored or synchronized old data set, and receive the data set to be synchronized; S1.32: Calculate the hash value of old data using the built-in hash function and the hash value of the data to be synchronized ; like , the data to be synchronized has not changed and does not need to be synchronized; like , when the synchronization data changes, the incremental hash index is used to locate the difference data block, and the difference data is extracted from the difference data block. At the same time, an incremental update package is generated based on the difference data.
3. A game data synchronization method as claimed in claim 2, characterized in that: The specific steps of the adaptive hierarchical synchronization strategy include: S3.1: Collect historical game data, network condition data, and user data changes to obtain historical data, and based on the historical data, obtain a pre-trained machine learning prediction model; S3.2: Design a hierarchical synchronization framework, introduce user portraits and game scene recognition mechanisms, assign synchronization levels to different users and scenes, and each synchronization level corresponds to a certain amount of data. and synchronization frequency ,and , where n represents the synchronization level position index and D represents the number of synchronization levels.
4. A method for synchronizing game data as claimed in claim 3, characterized in that: The specific steps of the adaptive hierarchical synchronization strategy also include: S3.3: receiving the encoded instruction data and performing preprocessing, and inputting the preprocessed encoded instruction data into the machine learning prediction model to predict the synchronization level and data volume; S3.4: Use network monitoring tools to measure data transmission rate, latency, and packet loss rate indicators to obtain real-time network condition data; S3.5: The server dynamically adjusts the synchronization level and data volume based on the prediction results of the machine learning prediction model and real-time network condition data; S3.6: Implement a prediction-feedback loop to regularly evaluate synchronization effectiveness and iteratively optimize the machine learning prediction model and adaptive hierarchical synchronization strategy.
5. A method for synchronizing game data as claimed in claim 4, characterized in that: The data block segmentation strategy in S1.1 is dynamically adjusted according to the frequency of data changes in the region, and dynamic data blocks are set for each region. .
6. A method for synchronizing game data, used in online games, characterized in that: Executed by the game client, the game data synchronization method includes: Sending compressed and encoded instruction data to the server, so that after receiving the encoded instruction data, the server puts it into an asynchronous processing queue and processes the encoded instruction data in parallel using a multi-threaded manner. At the same time, the server uses a machine learning model to implement an adaptive hierarchical synchronization strategy based on the importance and urgency of the game data; Dynamically adjust the synchronization level and data volume with the server according to the current network bandwidth conditions; Collect the adjusted user behavior data and game status information, analyze them through AI algorithms, and feed the analysis results back to the server, so that the server can build a game event recording system based on the hybrid chain based on the AI analysis results and intelligent decision-making suggestions, and use deep learning models to extract features and detect anomalies in the recorded game logs. If abnormal behavior is detected, the early warning mechanism is immediately triggered and security measures are taken. At the same time, a security event database is established; In specific game scenarios, an AI-assisted system is introduced to provide users with intelligent decision-making suggestions.
7. A game client, used in an online game, characterized in that: include: A sending module sends the compressed and encoded instruction data to the server, so that after receiving the encoded instruction data, the server puts it into an asynchronous processing queue and processes the encoded instruction data in parallel using a multi-threaded method. At the same time, the server uses a machine learning model to implement an adaptive hierarchical synchronization strategy according to the importance and urgency of the game data; A dynamic adjustment module dynamically adjusts the synchronization level and data volume with the server according to the current network bandwidth conditions; The data collection module collects the adjusted user behavior data and game status information, analyzes them through AI algorithms, and feeds the analysis results back to the server, so that the server can build a game event recording system based on the hybrid chain based on the AI analysis results and intelligent decision-making suggestions, and use deep learning models to extract features and detect anomalies in the recorded game logs. If abnormal behavior is detected, the early warning mechanism is immediately triggered and security measures are taken. At the same time, a security event database is established; The suggestion module introduces an AI-assisted system to provide users with intelligent decision-making suggestions in specific game scenarios.
8. A game server, used in online games and connected to a client, characterized in that: The server comprises: The data synchronization module dynamically generates the latest configuration information according to the game content update and user data change, obtains the data to be synchronized, and pushes the data to be synchronized to the client in the form of incremental state synchronization through the improved difference detection algorithm combined with the data compression library, so that the client receives and decompresses the incremental data packet from the server, and updates the local game state according to the incremental data packet. At the same time, the client collects the operation instructions input by the user, compresses and encodes the operation instructions input by the user, and sends the encoded instruction data to the server; The adaptive synchronization strategy module, after receiving the encoded instruction data, puts it into the asynchronous processing queue and processes the encoded instruction data in parallel using a multi-threaded method. At the same time, the server uses a machine learning model to implement an adaptive hierarchical synchronization strategy based on the importance and urgency of the game data. The client and server dynamically adjust the synchronization level and data volume based on the current network bandwidth conditions, so that the client can collect the adjusted user behavior data and game status information, analyze it through the AI algorithm, and feed back the analysis results to the server. At the same time, in specific game scenarios, an AI-assisted system is introduced to provide users with intelligent decision-making suggestions; The game event recording module builds a game event recording system based on the hybrid chain based on AI analysis results and intelligent decision-making suggestions. It uses a deep learning model to extract features and detect anomalies in recorded game logs. If abnormal behavior is detected, the early warning mechanism is immediately triggered and safety measures are taken. At the same time, a security event database is established.
