A game data storage method and system
By optimizing the game data upload strategy through an adaptive waiting interval mechanism and data priority sorting, the impact of network latency on game operation was resolved, improving player experience and the timeliness of data upload.
Patent Information
- Application Number
- CN202510317248.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-18
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2045-03-18
AI Technical Summary
In existing technologies, the fixed upload interval method for game data can lead to excessive network latency when network latency is high, affecting game operation time and impacting the player experience.
An adaptive waiting interval mechanism is adopted to calculate the data upload strategy based on the network status of the game client. Data is uploaded only after the adaptive waiting interval ends. The data upload order is optimized by combining the priority and data volume of high-frequency and low-frequency data.
It reduces the impact of data upload on network latency, improves the smoothness of game operation and player experience, and ensures the timely upload of game data.
Smart Images

Figure CN120053989B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of game data processing, and particularly relates to a game data storage method and system. BACKGROUND
[0002] In order to realize timely recording of network game data, in the prior art, the game data that has changed is usually uploaded to a server for storage at a fixed upload interval, for example, the patent with the application number CN201911186711.1 discloses related content.
[0003] However, this upload method does not take into account the network status of the device running the game client. When the network delay is large, if large-scale game data is still uploaded, the network delay will be too large, the probability of occurrence of the time of game operation will be affected, and the player experience will be affected. SUMMARY
[0004] The purpose of the present application is to disclose a game data storage method and system to solve the technical problems proposed in the background art.
[0005] In order to achieve the above purpose, the present application provides the following technical scheme:
[0006] In a first aspect, the present application provides a game data storage method, comprising:
[0007] S1, the client downloads game data from the server;
[0008] S2, the client obtains data that has changed in the game data;
[0009] S3, the client uploads the data that has changed to the server for storage;
[0010] In which, uploading the data that has changed to the server for storage comprises:
[0011] S31, after obtaining the data that has changed, calculating an adaptive waiting interval;
[0012] S32, after the adaptive waiting interval ends, uploading the data that has changed 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 state data, backpack data and position data;
[0015] The low-frequency data includes character basic information data, game preference setting data, guild data, copy state data and social relationship data.
[0016] Optionally, the changed data in the game data is acquired, including:
[0017] The fixed period is used to determine whether the various types of data in the game data are changed.
[0018] Optionally, the adaptive waiting interval is calculated, including:
[0019] The adaptive waiting interval is calculated according to the following formula:
[0020]
[0021] waitT represents the adaptive waiting interval, N represents the number of network delays acquired in the time interval [t cal -Tp, t cal ], t cal represents the time when the adaptive waiting interval is calculated, Tp represents the first time length, latency i represents the i th network delay acquired in 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 in the time interval [t cal -Tp, t cal ], clickcmp represents the comparison value of the set number of clicks, Tbs represents the second time length, and a is the control weight.
[0022] Optionally, the following method is used to determine whether the adaptive waiting interval is ended:
[0023] The current time tn is acquired periodically;
[0024] Whether the time length between tf and tn is equal to the adaptive waiting interval is calculated, and if so, the adaptive waiting interval is ended; tf represents the time when the adaptive waiting interval is calculated.
[0025] Optionally, the changed data is uploaded to the server for storage, including:
[0026] The upload priority coefficient of each changed data is calculated respectively;
[0027] According to the order from high to low of the upload priority coefficient, each changed data is uploaded to the server in turn, and the changed data is stored by the server.
[0028] Optionally, the calculation formula of the upload priority coefficient is:
[0029]
[0030] uplpri j upload priority coefficient of the jth type of changed data, class j priority of the jth type of changed data, class max maximum value of priorities of all types of changed data, delay j upload interval of the jth type of changed data; delay max maximum value of upload intervals of all types of changed data; datas j data amount of the jth type of changed data, datas max maximum value of data amounts of all types of changed data, w1, w2 and w3 respectively represent weights of the priority, the upload interval and the amount.
[0031] Optionally, the calculation formula of the upload interval is:
[0032] dealy j =nw k -nw k-1
[0033] nw k and nw k-1 respectively represent the time of uploading the jth type of changed data for the kth time and the (k-1)th time, and the kth time of uploading is the nearest uploading time to the current time.
[0034] In a second aspect, the present application provides a game data storage system, comprising a client and a server.
[0035] The client is configured to download game data from the server.
[0036] The client is configured to acquire changed data in the game data.
[0037] The client is configured to upload the changed data to the server for storage.
[0038] The uploading of the changed data to the server for storage comprises:
[0039] After the changed data is acquired, an adaptive waiting interval is calculated.
[0040] After the adaptive waiting interval ends, the changed data is uploaded to the server for storage.
[0041] Beneficial effects:
[0042] Compared with the prior art, the game client of the application can perform the uploading operation of the data based on the adaptive waiting interval in addition to uploading only the changed data when uploading the data to the server, so as to adaptively generate the uploading strategy according to the network state of the device running the game client, reduce the uploading amount of the data as much as possible, reduce the probability of the event that the uploading has a greater impact on the network delay, and enable the player to have a better game experience. BRIEF DESCRIPTION OF DRAWINGS
[0043] In order to more clearly illustrate the technical solutions of the embodiments of the application, the following will briefly introduce the drawings needed to be used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative labor.
[0044] Figure 1 A schematic diagram of a game data storage method of the application.
[0045] Figure 2 A schematic diagram of a game data storage system of the application. DETAILED DESCRIPTION
[0046] The technical solutions in the embodiments of the application will be described clearly and completely below with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are only some embodiments of the application, not all the embodiments. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative labor are within the protection scope of the application.
[0047] The application provides a game data storage method, comprising:
[0048] S1, the client downloads game data from the server;
[0049] In this step, the downloading of the game data is generally performed after starting the game client.
[0050] S2, the client acquires changed data in the game data;
[0051] S3, the client uploads the changed data to the server for storage;
[0052] The uploading of the changed data to the server for storage comprises:
[0053] S31, after acquiring the changed data, an adaptive waiting interval is calculated;
[0054] S32, after the adaptive waiting interval ends, upload the changed data to the server for storage.
[0055] The game client of the application can perform the uploading operation of the data based on the adaptive waiting interval in addition to uploading only the changed data when uploading the data to the server, thereby being able to adaptively generate the uploading strategy according to the network state of the device running the game client, being able to maintain the technicality of the data uploading as much as possible while reducing the uploading amount of the data and the probability of occurrence of the event that the uploading has a greater impact on the network delay, and enabling the player to have a better game experience.
[0056] Optionally, the game data includes high-frequency data and low-frequency data.
[0057] The high-frequency data refers to the content related to the instant action, state, interaction, etc. of the player, and has a higher update frequency; and the low-frequency data refers to the content related to the long-term progress of the game, the state of the player account, etc., and has a lower update frequency.
[0058] Optionally, the high-frequency data includes character state data, backpack data and position data.
[0059] The low-frequency data includes character basic information data, game preference setting data, guild data, copy state data and social relationship data.
[0060] Specifically, the character state data includes the orientation, speed, blood volume, energy, state effect (such as poisoning, dizziness, etc.), attack action, attack target, damage value, etc. of the player.
[0061] The position data includes the coordinates of the player.
[0062] The backpack data includes the data of the equipment in the backpack.
[0063] The character basic information data includes the character name, level and avatar, etc. The game preference setting data includes the game window display style, etc.
[0064] The guild data includes the level of the guild that the player joins, the name of the guild, etc.
[0065] The copy state data includes the name of the copy that the player has finished.
[0066] The social relationship data includes the friend list of the player, etc.
[0067] Optionally, the changed data in the game data is obtained, including:
[0068] The fixed period is adopted to respectively determine whether the various types of data of the game data are changed.
[0069] For example, the fixed period can be 0.5 seconds. By periodically comparing, the changed data, such as the coordinates of the role, is obtained.
[0070] Optionally, the adaptive waiting interval is calculated, comprising:
[0071] The adaptive waiting interval is calculated according to the following formula:
[0072]
[0073] waitT represents the adaptive waiting interval, N represents the number of network delays obtained in the time interval [t cal -Tp, t cal ], t cal represents the time when the adaptive waiting interval is calculated, Tp represents the first set time length, latency i represents the i th network delay obtained in 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 in the time interval [t cal -Tp, t cal ], clickcmp represents the comparison value of the set number of clicks, Tbs represents the second set time length, and a is the control weight.
[0074] If uploading and downloading use the same network bandwidth, and uploading occupies a large amount of bandwidth, the bandwidth for downloading will be limited, thereby causing the increase of the download delay. Especially in the case of small uplink bandwidth, uploading data will have a more obvious impact on the download speed. The adaptive waiting interval of the present application is related to the average value of the network delay and the number of clicks of the player. If the average value of the network delay is smaller, and the number of clicks of the player is larger, the adaptive waiting interval is smaller. If the average value of the network delay is larger, and the number of clicks of the player is smaller, the adaptive waiting interval is larger. Thus, the adaptive uploading of game data based on the network state is realized, which can effectively reduce the impact on the network delay of the game. In addition, the present application not only calculates the adaptive waiting interval based on the average value of the network delay, because this will cause the role in the game to be in a static state, still using a larger waiting interval, obviously this will affect the timely uploading of the changed data, therefore, the present application adds the number of clicks in a certain time interval to calculate the waiting interval, which can more actively upload the changed data when the player inputs less operation instructions, that is, the state change of the game role is smaller, thereby ensuring the timely uploading of the changed game data, and improving the security of the game data.
[0075] In the present application, the first time length set can be 30 seconds.
[0076] In the present application, the network delay can be detected every fixed time length, for example, once every 1 second.
[0077] In the present application, the preset network delay comparison value can be 1000 ms.
[0078] In the present application, the number of clicks of the player can be the number of clicks of the mouse, or the number of clicks on the screen when the touch screen is operated.
[0079] In the present application, the comparison value of the number of clicks can be 1000.
[0080] In the present application, the second time length set can be 2 seconds.
[0081] In the present application, the control weight can be 0.65.
[0082] Optionally, the following method is used to determine whether the adaptive waiting interval ends:
[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 yes, it indicates that the adaptive waiting interval ends; tf represents the time when the adaptive waiting interval is calculated.
[0085] In the present application, the current time tn can be obtained periodically, for example, once every 0.1 second.
[0086] Through periodic acquisition, it can be determined in time whether the adaptive waiting interval has ended.
[0087] Optionally, the data that changes is uploaded to the server for storage, including:
[0088] The upload priority coefficient of each kind of data that changes is calculated respectively;
[0089] According to the order from high to low of the upload priority coefficient, each kind of data that changes is uploaded to the server in turn, and the server stores the data that changes.
[0090] The present application is not to directly upload the data that changes, but also considers the upload order of the data, and the data with higher priority degree is more preferentially uploaded, which can more effectively ensure the normal operation of the game and reduce the influence of network delay on the game.
[0091] Optionally, the calculation formula of the upload priority coefficient is:
[0092]
[0093] uplpri j upload priority coefficient of changed data of the jth type, class j priority of changed data of the jth type, class max maximum value of priorities of changed data of all types, delay j upload interval of changed data of the jth type; delay max maximum value of upload intervals of changed data of all types; datas j data amount of changed data of the jth type, datas max maximum value of data amounts of changed data of all types, w1, w2 and w3 respectively represent weights of priority, upload interval and amount.
[0094] The upload priority coefficient of the application comprehensively considers the priority, the upload interval and the data amount. For changed data of a type, if the priority is higher, the upload interval is larger and the data amount is less, the corresponding upload priority coefficient is larger. Such a calculation manner can ensure that the transmission order of data with higher comprehensive priority is earlier, and can more effectively ensure the timely upload of game data.
[0095] In addition to considering the priority, the application also considers the upload interval and the data amount. If the upload interval is larger, it indicates that the transmission order of the data in the last upload process is later. Therefore, the application improves the priority of such data in this upload, thereby avoiding the situation that data with close original priority cannot be timely transmitted due to large upload priority coefficient caused by large data amount, and effectively reduces the difference between the transmission orders of various types of data with close original priority. In addition, by considering the data amount, more types of data can be uploaded in priority, thereby ensuring the correctness of most game data.
[0096] In the application, the weight of the priority can be 0.5, the weight of the upload interval can be 0.3, and the weight of the amount can be 0.2.
[0097] Optionally, the calculation formula of the upload interval is:
[0098] dealy j =nw k -nw k-1
[0099] nw k and nw k-1respectively represent the time of the jth type of changed data uploaded for the kth time and the (k-1)th time, and the kth time is the nearest upload to the current time.
[0100] The upload interval of the application is the difference between the time of the nearest two uploads. That is, the current upload is the (k+1)th upload.
[0101] Optionally, each type of changed data is uploaded to the server in turn according to the upload priority coefficient from high to low, including:
[0102] The upload network speed is calculated based on the adaptive waiting interval.
[0103] Each type of changed data is uploaded to the server in turn according to the upload priority coefficient from high to low based on the upload network speed.
[0104] The application calculates the upload network speed through the adaptive waiting interval, so that the upload network speed can be adapted to the network state, and the influence of data upload on game operation is more effectively reduced.
[0105] Optionally, the upload network speed is calculated based on the adaptive waiting interval, including:
[0106] Let uplspd represent the upload network speed, then:
[0107]
[0108] spdrs represents a pre-set network speed.
[0109] The upload network speed of the application is related to the adaptive waiting interval. The larger the adaptive waiting interval, the smaller the upload network speed, and the smaller the influence on network delay.
[0110] In the application, the pre-set network speed can be 512 kb / s.
[0111] As Figure 2 The application 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 changed data in the game data.
[0114] The client is used to upload the changed data to the server for storage.
[0115] The changed data is uploaded to the server for storage, including:
[0116] After obtaining the changed data, the adaptive waiting interval is calculated.
[0117] After the end of the adaptive waiting interval, the changed data is uploaded to the server for storage.
[0118] The preferred embodiments of the application disclosed above are only used to illustrate the present application. The preferred embodiments are not meant to limit the present application to any particular detailed embodiments. Obviously, many modifications and variations are possible in light of the above teachings. The preferred embodiments were chosen and described in order to provide the best illustration of the principles of the application and its practical application, and to thereby enable others skilled in the art to best utilize the application. The present application is therefore to be limited only by the claims and the full scope of equivalents, and equivalents thereof.
Claims
1. A game data storage method, characterized by, The method comprises the following steps: S1, the client downloads game data from the server; S2, the client obtains changed data in the game data; S3, the client uploads the changed data to the server for storage; The step of uploading the changed data to the server for storage comprises: S31, after obtaining the changed data, an adaptive waiting interval is calculated; S32, after the adaptive waiting interval ends, the changed data is uploaded to the server for storage; The step of calculating the adaptive waiting interval comprises: The adaptive waiting interval is calculated according to the following formula: waitT represents an adaptive waiting interval, N represents the number of network delays obtained within the time interval [t cal -Tp,t cal ], t cal represents the time at which the adaptive waiting interval is started to be calculated, Tp represents a first preset time length, latency i represents the i-th network delay obtained within the time interval [t cal -Tp,t cal ], latency cmp represents a 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 a preset comparison value of the number of clicks, Tbs represents a second preset time length, and a is a control weight.
2. The game data storage method of claim 1, wherein, The game data comprises high-frequency data and low-frequency data.
3. The game data storage method of claim 2, wherein, The high-frequency data comprises character state data, backpack data and position data; The low-frequency data comprises character basic information data, game preference setting data, guild data, copy state data and social relationship data.
4. The game data storage method of claim 1, wherein The step of obtaining changed data in the game data comprises: The fixed period is used to determine whether the various types of data in the game data change.
5. The game data storage method of claim 1, wherein, The following method is used to determine whether the adaptive waiting interval ends: tn is obtained periodically; Whether the time length between tf and tn is equal to the adaptive waiting interval is calculated, if yes, the adaptive waiting interval ends; tf represents the time when the adaptive waiting interval is calculated.
6. The game data storage method of claim 1, wherein, The step of uploading the changed data to the server for storage comprises: The uploading priority coefficient of each changed data is calculated respectively; According to the uploading priority coefficient from high to low, each changed data is uploaded to the server in sequence, and the server stores the changed data.
7. The game data storage method of claim 6, wherein, The calculation formula of the uploading priority coefficient is: uplpri j upload priority coefficient of changed data of the jth type, class j priority of changed data of the jth type, class max maximum value of priorities of changed data of all types, delay j upload interval of changed data of the jth type; delay max maximum value of upload intervals of changed data of all types; datas j data amount of changed data of the jth type, datas max maximum value of data amounts of changed data of all types, w1, w2, and w3 respectively represent weights of the priority, the upload interval, and the amount.
8. The game data storage method of claim 7, wherein, The calculation formula of the uploading interval is: dealy j = nw k -nw k-1 nw k and nw k-1 respectively represent the time of uploading the jth type of changed data for the kth time and the (k-1)th time, the kth time of uploading being the closest to the current time.
9. A game data storage system characterized by, The method comprises the following steps: The client is used to download game data from the server; The client is used to obtain changed data in the game data; The client is used to upload the changed data to the server for storage; The step of uploading the changed data to the server for storage comprises: After obtaining the changed data, an adaptive waiting interval is calculated; After the adaptive waiting interval ends, the changed data is uploaded to the server for storage; The step of calculating the adaptive waiting interval comprises: The adaptive waiting interval is calculated according to the following formula: waitT represents an adaptive waiting interval, N represents the number of network delays obtained within the time interval [t cal -Tp,t cal ], t cal represents the time at which the adaptive waiting interval is started to be calculated, Tp represents a first set time length, latency i represents the i-th network delay obtained within the time interval [t cal -Tp,t cal ], latency cmp represents a 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 a set click number comparison value, Tbs represents a second set time length, and a is a control weight.
Citation Information
Patent Citations
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