Game data storage method and system
By using an adaptive wait interval method when uploading game data, adjusting the upload strategy according to the network status of the device, the problem of uploading game data affecting game operations when the network delay is large is solved, and the player experience is improved.
Patent Information
- Application Number
- CN202510317248.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-18
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2045-03-18
AI Technical Summary
In the case of large network delays in the prior art, the upload of game data will lead to excessive network delays, affecting game operations and player experience.
The game data is uploaded using the adaptive wait interval method, the waiting interval is calculated based on the network status of the device, and the data is uploaded after the waiting interval is over.
Through the adaptive waiting interval strategy, the impact of data upload on network delay is reduced, and the smoothness of game operations and player experience is improved.
Smart Images

Figure CN120053989A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of game data processing, and in particular to a game data storage method and system. Background Art
[0002] In order to achieve the timely recording of online game data, in the prior art, the changed game data is usually uploaded to the server for storage at a fixed upload interval. For example, the patent with the application number CN201911186711.1 discloses relevant content.
[0003] However, this upload method does not consider the network status of the device running the game client. When the network latency is relatively large, if a large amount of game data is still uploaded, it will increase the probability of excessive network latency and affect the occurrence probability of the time of game operation, thus affecting the player experience. Summary of the Invention
[0004] The purpose of the present invention is to disclose a game data storage method and system to solve the technical problems raised in the background art.
[0005] To achieve the above object, the present invention provides the following technical solutions:
[0006] In the first aspect, the present invention provides a game data storage method, including:
[0007] S1, the client downloads game data from the server;
[0008] S2, the client obtains the changed data in the game data;
[0009] S3, the client uploads the changed data to the server for storage;
[0010] Among them, uploading the changed data to the server for storage includes:
[0011] S31, after obtaining the changed data, calculate the adaptive waiting interval;
[0012] S32, after the end of the adaptive waiting interval, upload the changed data to the server for storage.
[0013] Optionally, the game data includes high-frequency data and low-frequency data.
[0014] Optionally, the high-frequency data includes character status data, backpack data, and location data;
[0015] The low-frequency data includes character basic information data, game preference setting data, guild data, dungeon status data, and social relationship data.
[0016] Optionally, obtain the data that has changed in the game data, including:
[0017] Judging whether the data of various types of game data has changed respectively at fixed intervals.
[0018] Optionally, calculate the adaptive waiting interval, including:
[0019] Calculate the adaptive waiting interval according to the following formula:
[0020]
[0021] waitT represents the adaptive waiting interval, N represents the number of network delays obtained within the time interval [t cal -Tp, t cal , t cal represents the moment when the adaptive waiting interval starts to be calculated, Tp represents the set first duration, latency i represents the i-th network delay obtained within the time interval [t cal -Tp, t cal , latency cmp represents the preset network delay comparison value; clickN represents the number of clicks of the player within the time interval [t cal -Tp, t cal , clickcmp represents the comparison value of the set number of clicks, Tbs represents the set second duration, and α is the control weight.
[0022] Optionally, judge whether the adaptive waiting interval ends in the following way:
[0023] Periodically obtain the current moment tn;
[0024] Calculate whether the time length between tf and tn is equal to the adaptive waiting interval. If so, it means the adaptive waiting interval ends; tf represents the moment when the adaptive waiting interval is calculated.
[0025] Optionally, upload the changed data to the server for storage, including:
[0026] Calculate the upload priority coefficient of each type of changed data respectively;
[0027] Upload each type of changed data to the server in descending order of the upload priority coefficient, and the server stores the changed data.
[0028] Optionally, the calculation formula of the upload priority coefficient is:
[0029]
[0030] uplpri j Indicates the upload priority coefficient of the data that has changed for the j-th type, class j Indicates the priority of the data that has changed for the j-th type, class max Indicates the maximum value of the priorities of the data that has changed for all types, delay j Indicates the upload interval of the data that has changed for the j-th type; delay max Indicates the maximum value of the upload intervals of the data that has changed for all types; datas j Indicates the data volume of the data that has changed for the j-th type, datas max Indicates the maximum value of the data volumes of the data that has changed for all types, w 1 , w 2 and w 3 respectively represent the weights of priority, upload interval, and quantity.
[0031] Optionally, the calculation formula for the upload interval is:
[0032] dealy j = nw k - nw k-1
[0033] nw k and nw k-1 respectively represent the moments of the k-th and (k - 1)-th uploads of the data that has changed for the j-th type. The k-th upload is the one closest to the current moment.
[0034] Second aspect, the present invention provides a game data storage system, including a client and a server;
[0035] The client is used to download game data from the server;
[0036] The client is used to obtain the data that has changed in the game data;
[0037] The client is used to upload the data that has changed to the server for storage;
[0038] Among them, uploading the data that has changed to the server for storage includes:
[0039] After obtaining the data that has changed, calculate the adaptive waiting interval;
[0040] After the adaptive waiting interval ends, upload the data that has changed to the server for storage.
[0041] Beneficial effects:
[0042] Compared with the prior art, when the game client of the present invention uploads data to the server, in addition to only uploading the changed data, it also performs the data upload operation based on the adaptive waiting interval, so as to be able to adaptively generate an upload strategy according to the network state of the device running the game client, and can reduce the amount of data uploaded while maintaining the technicality of data upload as much as possible, and reduce the probability of events that have a greater impact on network latency caused by upload, so that players can have a better gaming experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can obtain other drawings based on these drawings without creative efforts.
[0044] Figure 1 It is a schematic diagram of a game data storage method of the present invention.
[0045] Figure 2 It is a schematic diagram of a game data storage system of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0046] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts fall within the protection scope of the present invention.
[0047] The present invention provides a game data storage method, including:
[0048] S1, the client downloads game data from the server;
[0049] In this step, generally after the game client is started, the game data is downloaded.
[0050] S2, the client obtains the changed data in the game data;
[0051] S3, the client uploads the changed data to the server for storage;
[0052] Among them, uploading the changed data to the server for storage includes:
[0053] S31, after obtaining the changed data, calculate the adaptive waiting interval;
[0054] S32. After the adaptive waiting interval ends, upload the changed data to the server for storage.
[0055] When the game client of the present invention uploads data to the server, in addition to only uploading the changed data, it also performs the data upload operation based on the adaptive waiting interval, so as to be able to adaptively generate an upload strategy according to the network state of the device running the game client, and can reduce the amount of data uploaded while maintaining the technicality of data upload as much as possible, and reduce the probability of events that have a greater impact on network latency during upload, enabling players to have a better gaming experience.
[0056] Optionally, the game data includes high-frequency data and low-frequency data.
[0057] High-frequency data refers to content related to the player's immediate actions, status, interactions, etc., with a higher update frequency; low-frequency data refers to content related to the long-term progress of the game, the player's account status, etc., with a lower update frequency.
[0058] Optionally, the high-frequency data includes character status data, backpack data, and location data;
[0059] The low-frequency data includes character basic information data, game preference setting data, guild data, dungeon status data, and social relationship data.
[0060] Specifically, the character status data includes the player's orientation, speed, health, energy, status effects (such as poisoning, dizziness, etc.), attack actions, attack targets, damage values, etc.
[0061] The location data includes the player's coordinates.
[0062] The backpack data includes the data of the equipment in the backpack.
[0063] The character basic information data includes the character name, level, avatar, etc. The game preference setting data includes the game window display style, etc.
[0064] The guild data includes the level of the guild the player joined, the name of the guild, etc.
[0065] The dungeon status data includes the names of the dungeons the player has completed.
[0066] The social relationship data includes the player's friend list, etc.
[0067] Optionally, obtaining the changed data in the game data includes:
[0068] Judging whether the data of various types of game data has changed respectively at fixed intervals.
[0069] For example, the fixed period can be 0.5 seconds. By periodically making comparisons, data that has changed is obtained, such as the coordinates of a character.
[0070] Optionally, calculating an adaptive waiting interval includes:
[0071] Calculating the adaptive waiting interval according to the following formula:
[0072]
[0073] waitT represents the adaptive waiting interval, N represents the number of network delays obtained within the time interval [t cal -Tp, t cal , t cal represents the moment when the calculation of the adaptive waiting interval starts, Tp represents the set first duration, latency i represents the i-th network delay obtained within the time interval [t cal -Tp, t cal , latency cmp represents the preset network delay comparison value; clickN represents the number of clicks of the player within the time interval [t cal -Tp, t cal , clickcmp represents the comparison value of the set number of clicks, Tbs represents the set second duration, and α is the control weight.
[0074] If the same network bandwidth is used for uploading and downloading, and a large amount of bandwidth is occupied by uploading, the bandwidth for downloading will be restricted, resulting in an increase in download latency. Especially in the case of a small uplink bandwidth, uploading data will have a more obvious impact on the download speed. The adaptive waiting interval of the present invention is related to the average value of network delays and the number of clicks of the player. If the average value of network delays is smaller and the number of clicks of the player is larger, the adaptive waiting interval is smaller. If the average value of network delays is larger and the number of clicks of the player is smaller, the adaptive waiting interval is larger. Thus, adaptive uploading of game data based on the network state is achieved, which can effectively reduce the impact on the network latency of the game. In addition, the present invention does not calculate the adaptive waiting interval only based on the average value of network delays, because this will result in a large waiting interval still being used when the character in the game is in a stationary state, which will obviously affect the timely uploading of the changed data. Therefore, the present invention calculates the waiting interval by adding the number of clicks within a certain time interval. When the number of operation instructions input by the player is smaller, that is, when the state change of the game character is smaller, the changed data is uploaded more actively, thus ensuring the timely uploading of the changed game data and improving the security of game data.
[0075] In the present invention, the set first duration can be 30 seconds.
[0076] In the present invention, the network latency can be detected at fixed intervals, for example, once every 1 second.
[0077] In the present invention, the preset network latency comparison value can be 1000 ms.
[0078] In the present invention, the number of clicks of the player can be the number of clicks of the mouse or the number of times the screen is clicked during a touch screen operation.
[0079] In the present invention, the comparison value of the number of clicks can be 1000.
[0080] In the present invention, the set second duration can be 2 seconds.
[0081] In the present invention, the control weight can be 0.65.
[0082] Optionally, the following method is used to determine whether the adaptive waiting interval has ended:
[0083] Periodically obtain the current time tn;
[0084] Calculate whether the time length between tf and tn is equal to the adaptive waiting interval. If so, it means that the adaptive waiting interval has ended; tf represents the time when the adaptive waiting interval is calculated.
[0085] In the present invention, periodically obtaining the current time tn can be to obtain the current time once every 0.1 second.
[0086] By periodically obtaining, it is possible to timely determine whether the adaptive waiting interval has ended.
[0087] Optionally, the changed data is uploaded to the server for storage, including:
[0088] Calculate the upload priority coefficient of each type of changed data respectively;
[0089] In the order from high to low of the upload priority coefficient, each type of changed data is uploaded to the server in turn, and the server stores the changed data.
[0090] The present invention does not directly upload the changed data, but also considers the upload order of the data. The data with higher comprehensive priority can be uploaded first, which can more effectively ensure the normal operation of the game and reduce the impact of network latency on the game.
[0091] Optionally, the calculation formula of the upload priority coefficient is:
[0092]
[0093] uplpri j Indicates the upload priority coefficient of the data that has changed for the j-th type, class j Indicates the priority of the data that has changed for the j-th type, class max Indicates the maximum value of the priorities of the data that has changed for all types, delay j Indicates the upload interval of the data that has changed for the j-th type; delay max Indicates the maximum value of the upload intervals of the data that has changed for all types; datas j Indicates the data volume of the data that has changed for the j-th type, datas max Indicates the maximum value of the data volumes of the data that has changed for all types, w 1 、w 2 and w 3 Respectively represent the weights of priority, upload interval, and quantity.
[0094] The upload priority coefficient of the present invention comprehensively considers from aspects such as priority, upload interval, and data volume. For the data that has changed for a certain type, if its priority is higher, the upload interval is larger, and the data volume is smaller, then its corresponding upload priority coefficient is larger. Such a calculation method can preferentially ensure that the transmission order of the data with a higher comprehensive priority degree is more forward, and can more effectively ensure the timely upload of game data.
[0095] In addition to considering the priority, the present invention also considers the upload interval and the data volume. If the upload interval is larger, it means that the upload order of this type of data is more backward in the recent upload process. Therefore, in this upload, the present invention improves the priority degree of such data, so as to avoid that due to the data volume, the data with a similar original priority degree always has a large upload priority coefficient and cannot be transmitted in time, effectively reducing the difference in the upload order between various types of data with a similar original priority degree. In addition, by considering the data volume, more types of data can be preferentially uploaded, and the correctness of most game data can be preferentially ensured.
[0096] In the present invention, the weight of the priority can be 0.5, the weight of the upload interval can be 0.3, and the weight of the quantity can be 0.2.
[0097] Optionally, the calculation formula for the upload interval is:
[0098] dealy j =nw k -nw k-1
[0099] nwk and nw k-1 respectively represent the moments of the k-th and (k - 1)-th uploads of the changed data of the j-th type. The k-th upload is the most recent upload from the current moment.
[0100] The upload interval of the present invention is the difference between the moments of the two most recent uploads. That is, the current upload is the (k + 1)-th upload.
[0101] Optionally, according to the order of the upload priority coefficients from high to low, each type of changed data is uploaded to the server in turn, including:
[0102] Calculating the upload network speed based on the adaptive waiting interval;
[0103] Based on the upload network speed, each type of changed data is uploaded to the server in turn according to the order of the upload priority coefficients from high to low.
[0104] The present invention calculates the upload network speed through the adaptive waiting interval, so that the upload network speed can adapt to the network state and more effectively reduce the impact of data upload on game operations.
[0105] Optionally, calculating the upload network speed based on the adaptive waiting interval includes:
[0106] Let uplspd represent the upload network speed, then:
[0107]
[0108] spdrs represents the pre-set network speed.
[0109] The upload network speed of the present invention is related to the adaptive waiting interval. The larger the adaptive waiting interval, the smaller the upload network speed and the smaller the impact on network latency.
[0110] In the present invention, the pre-set network speed can be 512 kb / s.
[0111] Such as Figure 2 , the present invention also provides a game data storage system, including a client and a server;
[0112] The client is used to download game data from the server;
[0113] The client is used to obtain the changed data in the game data;
[0114] The client is used to upload the changed data to the server for storage;
[0115] Among them, uploading the changed data to the server for storage includes:
[0116] After obtaining the changed data, calculate the adaptive waiting interval;
[0117] After the end of the adaptive waiting interval, upload the changed data to the server for storage.
[0118] The preferred embodiments of the present invention disclosed above are only used to help explain the present invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and variations can be made according to the content of this specification. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the present invention, so that those skilled in the art can understand and utilize the present invention well. The present invention is only limited by the claims and their full scope and equivalents.
Claims
1. A method for storing game data, characterized in that: include: S1, the client downloads game data from the server; S2, the client obtains the changed data in the game data; S3, the client uploads the changed data to the server for storage; The changed data is uploaded to the server for storage, including: S31, after acquiring the changed data, calculating the adaptive waiting interval; S32, after the adaptive waiting interval ends, uploading the changed data to the server for storage.
2. A method for storing game data according to claim 1, characterized in that: Game data includes high-frequency data and low-frequency data.
3. A method for storing game data according to claim 2, characterized in that: High-frequency data includes character status data, backpack data, and location data; Low-frequency data includes character basic information data, game preference data, guild data, copy status data and social relationship data.
4. A method for storing game data according to claim 1, characterized in that: Get the data that has changed in the game data, including: A fixed period is used to determine whether various types of game data have changed.
5. A method for storing game data according to claim 1, characterized in that: Calculate the adaptive wait interval, including: The adaptive waiting interval is calculated according to the following formula: waitT represents the adaptive waiting interval, N represents the time interval [t cal -Tp,t cal The number of network delays obtained within ], t cal Indicates the time when the adaptive waiting interval is calculated, Tp indicates the first duration set, latency i Indicates that in the time interval [t cal -Tp,t cal ] The i-th network delay obtained in cmp Indicates the preset network delay comparison value; clickN indicates that in the time interval [t cal -Tp,t cal ] is the number of clicks of the player, clickcmp represents the comparison value of the set number of clicks, Tbs represents the set second time length, and α is the control weight.
6. A method for storing game data according to claim 1, characterized in that: The following method is used to determine whether the adaptive waiting interval has ended: Periodically obtain the current time tn; Calculate whether the time length between tf and tn is equal to the adaptive waiting interval. If so, it means that the adaptive waiting interval ends; tf represents the time when the adaptive waiting interval is calculated.
7. A method for storing game data according to claim 1, characterized in that: Upload the changed data to the server for storage, including: Calculate the upload priority coefficient of each type of changed data respectively; In the order of upload priority coefficient from high to low, each type of changed data is uploaded to the server in turn, and the server stores the changed data.
8. A method for storing game data according to claim 7, characterized in that: The calculation formula for the upload priority coefficient is: uplpri j Indicates the upload priority coefficient of the jth type of changed data, class j Indicates the priority of the jth type of changed data, class max Indicates the maximum priority of all types of changed data, delay j Indicates the upload interval of the jth type of changed data; delay max Indicates the maximum upload interval of all types of changed data; datas j Indicates the amount of data of the jth type that has changed, datas max Indicates the maximum amount of data of all types that have changed, w1, w2, and w3 represent the weights of priority, upload interval, and quantity, respectively.
9. A method for storing game data according to claim 8, characterized in that: The calculation formula for the upload interval is: dealy j =nw k -nw k-1 nw k and nw k-1 They respectively represent the time when the j-th type of changed data is uploaded for the kth and k-1th times, and the kth upload is the upload closest to the current time.
10. A game data storage system, characterized in that: Includes client and server; The client is used to download game data from the server; The client is used to obtain the data that has changed in the game data; The client is used to upload the changed data to the server for storage; The changed data is uploaded to the server for storage, including: After obtaining the changed data, calculate the adaptive waiting interval; After the adaptive waiting interval ends, the changed data is uploaded to the server for storage.
Citation Information
Patent Citations
Multi-avatar location synchronization system, method and device, electronic equipment and storage medium
CN107124416A
Game data processing method and device, game server and storage medium
CN110975279A
Method and device for storing game data
CN112791415A
Game picture rendering method and device based on data synchronization period
CN116617659A
Cloud gaming adaptive synchronization mechanism
EP3903896A1