CN112791415A - Game data storage method and device - Google Patents

Game data storage method and device Download PDF

Info

Publication number
CN112791415A
CN112791415A CN202110114455.6A CN202110114455A CN112791415A CN 112791415 A CN112791415 A CN 112791415A CN 202110114455 A CN202110114455 A CN 202110114455A CN 112791415 A CN112791415 A CN 112791415A
Authority
CN
China
Prior art keywords
data
log
storage
game
database
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110114455.6A
Other languages
Chinese (zh)
Inventor
丁黔伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou magic explosion network technology Co.,Ltd.
Original Assignee
Guangzhou Xinyuan Interactive Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Xinyuan Interactive Technology Co ltd filed Critical Guangzhou Xinyuan Interactive Technology Co ltd
Priority to CN202110114455.6A priority Critical patent/CN112791415A/en
Publication of CN112791415A publication Critical patent/CN112791415A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/70Game security or game management aspects
    • A63F13/77Game security or game management aspects involving data related to game devices or game servers, e.g. configuration data, software version or amount of memory
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/50Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by details of game servers
    • A63F2300/55Details of game data or player data management
    • A63F2300/552Details of game data or player data management for downloading to client devices, e.g. using OS version, hardware or software profile of the client device

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Business, Economics & Management (AREA)
  • Computer Security & Cryptography (AREA)
  • General Business, Economics & Management (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method for storing game data, which comprises the following steps: monitoring whether the player data in the game changes; if the player data changes, recording a data storage log; judging whether a preset data storage time point is reached; if the preset data saving time point is reached, writing player data into a database for saving, and deleting the data saving log after saving; and if the preset data storage time point is not reached and the game server is abnormally quitted, restarting the game server, writing the player data in the data storage log into a database for storage, and deleting the data storage log after storage. The invention also discloses a game data storage device for realizing the storage method. The invention ensures that the data is not lost and improves the safety and reliability of the player data.

Description

Game data storage method and device
Technical Field
The invention relates to the field of electronic games, in particular to a method and a device for storing game data.
Background
The game server architecture is generally divided into a single-process single-thread architecture, a single-process multi-thread architecture and a multi-process single-thread architecture. Due to the requirements of expansibility, fault tolerance and the like, most game servers select a multi-process single-thread architecture. A multi-process, single-threaded architecture game server typically consists of game processes, db (database) processes, and databases. When a player logs in a game server, a game process initiates a reading request to a DB process to read data, the DB process immediately returns the data when the player data is cached, otherwise, the DB process initiates a reading request to a database to read the player data and establish caching, and returns the data to the game process. For the data saving process, when player data need saving after changing, the game process inserts the data needed saving into the queue to be stored, sets the preset saving time, when the saving time is up, the data in the queue to be saved is sent to the DB process, the DB process combines the saving data into the data buffer, marks the data needed saving, sets the preset saving time, when the DB process is up, the marked data needed saving is sent to the database for saving, and the complete data saving process is completed.
The game server data processing scheme is generally divided into instant disk storage and timed disk storage. For games such as chess and card games, leisure games, customs games and the like, the playing method and the system are relatively few, and the interaction with a game server is less, because the data change frequency of a single player in the game process is not high, and the instant stock mode can be used. For games such as action games and MMORPG (massively multiplayer online role playing games), a timing disk storage mode is generally adopted to reduce the pressure of a game server and a database during disk storage and improve the number of players of the game server because the data change frequency of each player is high in the game process. When the game server quits abnormally, the timed disk storage mode can cause data loss during the period from the last successful disk storage to the abnormal occurrence due to the loss of memory data, thus causing the inconsistency of the return file and partial data, and ensuring the safety and reliability of player data for the player.
Disclosure of Invention
In order to overcome the above disadvantages and shortcomings of the prior art, the present invention provides a method for storing game data, which ensures the security and reliability of player data.
Another object of the present invention is to provide a game data storage device for implementing the above game data storage method.
The purpose of the invention is realized by the following technical scheme:
a method for saving game data, comprising the steps of:
monitoring whether the player data in the game changes;
if the player data changes, recording a data storage log;
judging whether a preset data storage time point is reached;
if the preset data saving time point is reached, writing player data into a database for saving, and deleting the data saving log after saving;
and if the preset data storage time point is not reached and the game server is abnormally quitted, restarting the game server, writing the player data in the data storage log into a database for storage, and deleting the data storage log after storage.
Preferably, if the player data changes for a plurality of times without reaching a preset data saving time point, a plurality of data saving logs are recorded so as to correspond to the player data changing for a plurality of times one by one.
Preferably, the step of recording the data storage log comprises:
the data processing step of the game process module comprises the following steps:
incrementing the player data by a data version number;
generating a first log serial number;
recording a data storage log in a first log file;
inserting a save record containing the changed player data, the data version number, and the first log stream number into a pending save queue;
when the storage time of the preset storage queue reaches, sending the storage record to a DataBase process module;
data processing steps of the DataBase process module:
judging whether the data version number is larger than the data version number in the cache or not;
if so, generating a second log serial number, and recording a disk-saving diary containing the second log serial number and the changed player data into a second diary file;
and recording the changed player data and the second log serial number in a cache, and marking the cache as data needing to be stored in a disk.
Preferably, the method for saving game data further includes the following steps:
when the DataBase process module finishes processing one disk storage record, returning success to the game process module, and inserting a log with a processed first log serial number into the tail part of the first log file by the game process module; deleting the first log file when all first log serial numbers in the first log file have been processed.
Preferably, the method for saving game data further includes the following steps:
when the storage time of the preset storage queue is not reached, judging whether the storage queue has set the storage time of the preset storage queue;
and if the preset disk storage time of the disk storage queue is not set, setting the preset disk storage time according to the current load condition of the game server.
Preferably, the method for saving game data further includes the following steps:
when the storage time of the preset storage queue is not reached, the player data is changed, and the following steps are carried out:
incrementing the player data by a data version number;
generating a first log serial number;
recording a data storage log in a first log file;
inserting the changed player data, the data version number, and the first log sequence number into a pending disk queue.
Preferably, the method for saving game data further includes the following steps:
after the preset storage time of the storage queue is up, the player data is changed, a new first journal file is generated, and the following steps are carried out:
incrementing the player data by a data version number;
generating a first log serial number;
recording a data storage log in a first log file;
inserting the changed player data, the data version number, and the first log sequence number into a pending disk queue.
Preferably, the method for saving game data further includes the following steps: and after receiving a batch of disk storage records, the DataBase process module judges whether preset data disk storage time is set, otherwise, the preset data disk storage time is set according to the current load condition of the game server.
Preferably, the method for saving game data further includes the following steps: and generating a new storage record before the preset data storage time is reached, and repeating the data processing steps of the DataBase process module.
Preferably, the method for saving game data further includes the following steps: and after the preset data storage time is up, generating a new storage record, generating a new second diary file by the DataBase process module, and repeating the data processing steps of the DataBase process module.
Preferably, the writing of the player data at the preset data saving time point into the database for saving and the deleting of the data saving log after saving are specifically:
the DataBase process module generates a current disk storage table, records a second log serial number corresponding to each cache in the current disk storage table, cleans the second log serial number information in the cache, assembles the cache into a disk storage request corresponding to the DataBase, and sends the disk storage request to the DataBase;
and after the operation of each disk storage request is completed, the DataBase returns success to the DataBase process module, the DataBase process module finds out a second log serial number corresponding to each disk storage request in the existing disk storage table, inserts the processed log of each second log serial number at the tail of the second diary file, and deletes the corresponding second diary file after all second log serial numbers corresponding to the second diary file are processed.
Preferably, the method for saving game data writes the player data in the data saving log into a database for saving, and deletes the data saving log after saving, specifically:
firstly, starting a DataBase process module, checking whether a second diary file exists, if so, loading the disk log files in sequence, removing the disk log file record corresponding to the processed second log serial number, and then performing identical data deduplication processing according to the data version number to obtain a recovered second diary file; for each disk-saving log in the recovered second diary file, checking whether the data exists in a cache, if not, loading the data from the database into the cache, if so, checking whether the data version number recorded by the disk-saving log file of the data is larger than the data version number recorded by the cache, if so, updating the cache, inserting a second log serial number into the cache, and marking the second log serial number as the data needing disk-saving processing; otherwise, discarding the piece of data; after all the disk storage log files are processed, disk storage is immediately carried out; and deleting the recovered second diary file after the storage is successful.
Preferably, the method for saving game data further includes the following steps:
after the DataBase process module is started, starting a game process module, checking whether a first journal file exists or not by the game process module, and if so, loading the first journal file in sequence; removing the log file record of the data storage disc corresponding to the processed first log serial number, and performing the duplicate removal processing on the same data according to the data version number to obtain a recovered first log file; inserting a save record containing the changed player data, the data version number, and the first log stream number into a pending save queue; and after all the first journal files are processed, immediately sending the disk storage records to a DataBase process module, and deleting the recovered first journal files.
The game data storage device for realizing the game data storage method comprises a game progress module, a DataBase progress module and a DataBase;
the game process module comprises
The logic business module is used for calling the game data processing module when the player data changes;
the game data processing module is used for loading changed player data, increasing the data version number of the player data and packaging data operation;
the first data storage log module is used for generating and storing a data storage diary of the game process;
the DataBase process module comprises
The data base data processing module is used for receiving data from the game data processing module, processing data disk storage logs, reading data from a DataBase and caching the data; when data needs to be stored, the data is written into a database;
a second data storage log module; a data-saving diary for generating and storing DataBase processes;
the game data processing module is respectively connected with the first data disk storage log module and the DataBase data processing module; the DataBase data processing module is connected with the second data storage disk log module.
Preferably, the game data processing module and the DataBase data processing module are mutually called.
Preferably, the game data processing module and the DataBase data processing module are communicated in an RPC mode.
Compared with the prior art, the invention has the following advantages and beneficial effects:
the game data saving method of the invention adopts a data saving log mechanism, when the player data changes, a data saving log is recorded immediately, the timing saving count is reached, the timing saving is executed, and after the saving succeeds, the corresponding data saving log is deleted. When the game server is abnormally quitted and restarted before the disk storage point arrives, the data is recovered from the data disk storage log and stored in the disk storage log in the presence of the data disk storage log, and the log is deleted after the execution is finished, so that the data is not lost, and the safety and reliability of the player data are improved.
Drawings
Fig. 1 is a block diagram showing the components of a game data storage apparatus according to an embodiment of the present invention.
Fig. 2 is a flowchart of a data saving process in a game data saving method according to an embodiment of the present invention.
Fig. 3 is a flowchart of a data base process data recovery process in the method for saving game data according to the embodiment of the present invention.
Fig. 4 is a flowchart of a game progress data recovery process in a method for saving game data according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to examples, but the embodiments of the present invention are not limited thereto.
Examples
As shown in fig. 1, a game server according to an embodiment of the present invention, that is, a disk saving device for implementing a disk saving method of game data according to the present invention, includes a game progress module, a DataBase progress module, and a DataBase; the game process module comprises a logic service module, a game data processing module and a first data disk storage log module; the DataBase process module includes a DB (DataBase) data processing module and a second data disk log module.
The specific functions of each module are as follows:
and the logic service module is used for calling the game data processing module when the player data changes. The logic service module is used as the main logic processing of the game server, and comprises various specific functions, such as: login, equipment, checkpoint, activity, etc. And the game data processing module is used for storing the data after the data operation.
And the game data processing module is used for loading the changed player data, increasing the data version number of the player data and packaging the data operation. The game data processing module mainly provides encapsulation for data operation, including data reading, serialization and deserialization, full data storage, dirty data storage and the like; the data processing module is mainly called by the logic service module and is communicated with the DB data processing module.
And the first data disk storage log module is used for generating and storing a data disk storage diary of the game process, and is also used for deleting the disk storage log after the disk storage is successful and recovering the data after the game server is abnormally restarted. This module is called by the game data processing module and the DB data processing module.
The DB data processing module is used for receiving data from the game data processing module, processing the data storage log, reading data from a database and caching the data; when data needs to be stored, the data is written into a database; the module is used as a bridge between a database and a game data processing module, usually exists as an independent process, and can also be called as a module in a single-process game server.
A second data storage log module; a data-saving diary for generating and storing DataBase processes;
the game data processing module is respectively connected with the first data disk log storage module and the DB data processing module; the DB data processing module is connected with the second data storage disk log module; in the single-process architecture, the game data processing module and the DB data processing module are mutually called; in the multi-process architecture, the game data processing module and the DB data processing module communicate in an RPC (remote Procedure call) mode.
The game data storage method of the embodiment comprises the following steps:
monitoring whether the player data in the game changes;
if the player data changes, recording a data storage log;
judging whether a preset data storage time point is reached;
if the preset data saving time point is reached, writing player data into a database for saving, and deleting the data saving log after saving;
and if the preset data storage time point is not reached and the game server is abnormally quitted, restarting the game server, writing the player data in the data storage log into a database for storage, and deleting the data storage log after storage.
And if the player data change for multiple times without reaching the preset data storage time point, recording a plurality of data storage logs so as to correspond to the player data changed for multiple times one by one.
Specifically, with reference to the game data saving device of the present embodiment, as shown in fig. 2 to 4, the game data saving method of the present embodiment includes:
(1) data storage process
The data processing step of the game process module comprises the following steps:
the logic service module operates the data object and calls a data storage interface of the game data processing module when data change occurs;
the storage interface of the game data processing module increases the data version number of the player data;
the game data processing module calls a log writing interface of the first data disk storage log module to generate a first log serial number;
recording a data storage log in a first log file;
inserting a save record containing the changed player data, the data version number, and the first log stream number into a pending save queue;
when the storage time of the preset storage queue is not reached, judging whether the storage queue has set the storage time of the preset storage queue; if the preset disk storage queue disk storage time is not set, setting the preset disk storage time according to the current load condition of the game server, wherein the preset disk storage time is generally 5 to 10 seconds;
when the preset disk storage queue disk storage time is up, the game data processing module combines with the data and then sends the disk storage record to a storage interface of a DB data processing module of the DataBase process module;
data processing steps of the DataBase process module:
the DB data processing module judges whether the data version number is larger than the data version number in the cache or not;
if so, generating a second log serial number, and recording a disk-saving diary containing the second log serial number and the changed player data into a second diary file;
recording the changed player data and the second log serial number in a cache, and marking the cache as data needing disk storage processing;
the DB data processing module returns success to the game data processing module after processing one disk storage record, and the game data processing module inserts a log with a processed first log serial number at the tail part of the first log file; deleting the first log file when all first log serial numbers in the first log file have been processed;
after receiving a batch of disk storage records, the DB data processing module judges whether preset data disk storage time is set or not, otherwise, the DB data processing module sets the preset data disk storage time according to the current load condition of the game server, wherein the preset data disk storage time is generally 5 to 10 seconds;
if the preset data saving time point is reached, the player data is written into the database for saving, and the data saving log is deleted after saving, wherein the specific operation process is as follows:
the DB data processing module generates an existing storage table, records a second log serial number corresponding to each cache in the existing storage table, cleans the second log serial number information in the cache, assembles the cache into a storage request corresponding to the database, and sends the storage request to the database;
and after the operation of each disk storage request is completed, the database returns success to the DB data processing module, the DB data processing module finds out a second log serial number corresponding to each disk storage request in the existing disk storage table, inserts the processed log of each second log serial number at the tail part of the second log file, and deletes the corresponding second log file after all the second log serial numbers corresponding to the second log file are processed.
(2) Data recovery procedure
(2-1) DataBase Process data recovery Process
If the preset data saving time point is not reached and the game server is abnormally quitted, restarting the game server, writing the player data in the data saving log into a database for saving, and deleting the data saving log after saving, wherein the specific operations are as follows:
starting a DB data processing module, checking whether a second diary file exists, if so, loading the disk-storing log files in sequence, removing the disk-storing log file record corresponding to the processed second log serial number, and then performing identical data deduplication processing according to the data version number to obtain a recovered second diary file; for each saved log file in the recovered second log file, checking whether the data exists in a cache, if not, loading the data from a database into the cache, if so, checking whether a data version number recorded by the saved log file of the data is larger than a data version number recorded by the cache, if so, updating the cache, inserting a second log serial number into the cache, and marking the second log serial number as the data needing saving processing; otherwise, discarding the piece of data; after all the disk storage log files are processed, disk storage is immediately carried out; deleting the recovered second diary file after the storage is successful;
(2-1) Game progress data recovery Process
After the DB data processing module is started and data recovery is finished, starting a game data processing module, and checking whether a first journal file exists or not by the game data processing module, if so, loading the first journal file in sequence; removing the log file record of the data storage disc corresponding to the processed first log serial number, and performing the duplicate removal processing on the same data according to the data version number to obtain a recovered first log file; inserting a save record containing the changed player data, the data version number, and the first log stream number into a pending save queue; after all the first journal files are processed, immediately sending the stored disk records to a storage interface of a DB data processing module, and deleting the recovered first journal files; after the game data processing module processes all data storage logs, the data recovery logic is completed, and a normal service logic request is formally received.
Particularly, in the data processing step of the game progress module in the data saving process, when the saving time of the preset saving queue is not reached, the player data is changed, and the following steps are carried out:
incrementing the player data by a data version number;
generating a first log serial number;
recording a data storage log in a first log file;
inserting the changed player data, the data version number, and the first log sequence number into a pending disk queue.
After the preset storage time of the storage queue is up, the player data is changed, a new first journal file is generated, and the following steps are carried out:
incrementing the player data by a data version number;
generating a first log serial number;
recording a data storage log in a first log file;
inserting the changed player data, the data version number, and the first log sequence number into a pending disk queue.
In particular, in the data processing step of the DataBase process module of the data saving process, a new saving record is generated before the predetermined data saving time is reached, and the data processing step of the DataBase process module is repeated.
And after the preset data storage time is up, generating a new storage record, generating a new second diary file by the DataBase process module, and repeating the data processing steps of the DataBase process module.
The data storage log writing method of the embodiment of the invention can also select other schemes:
1. memory and file mapping are carried out in mmap mode, and the method has the advantages that: and the kernel memory is directly operated, so that the system function call is reduced. The disadvantages are as follows: the operating system crashes and there is a potential for data loss.
2. The shared memory mode is close to mmap, but the pure memory mode, such as APC or Memcache, is used, the efficiency is optimal, but the pure memory mode cannot be saved to a disk.
The above two and similar modified designs also belong to the protection scope of the scheme.
The above embodiments are preferred embodiments of the present invention, but the present invention is not limited to the above embodiments, and any other changes, modifications, substitutions, combinations, and simplifications which do not depart from the spirit and principle of the present invention should be construed as equivalents thereof, and all such changes, modifications, substitutions, combinations, and simplifications are intended to be included in the scope of the present invention.

Claims (16)

1. A method for saving game data, comprising the steps of:
monitoring whether the player data in the game changes;
if the player data changes, recording a data storage log;
judging whether a preset data storage time point is reached;
if the preset data saving time point is reached, writing player data into a database for saving, and deleting the data saving log after saving;
and if the preset data storage time point is not reached and the game server is abnormally quitted, restarting the game server, writing the player data in the data storage log into a database for storage, and deleting the data storage log after storage.
2. The method for storing game data according to claim 1, wherein if the player data is changed a plurality of times without reaching a preset data storage time point, a plurality of data storage logs are recorded so as to correspond one-to-one to the plurality of changed player data.
3. The method for depositing game data according to claim 1, wherein the step of recording the data deposit log comprises:
the data processing step of the game process module comprises the following steps:
incrementing the player data by a data version number;
generating a first log serial number;
recording a data storage log in a first log file;
inserting a save record containing the changed player data, the data version number, and the first log stream number into a pending save queue;
when the storage time of the preset storage queue reaches, sending the storage record to a DataBase process module;
data processing steps of the DataBase process module:
judging whether the data version number is larger than the data version number in the cache or not;
if so, generating a second log serial number, and recording a disk-saving diary containing the second log serial number and the changed player data into a second diary file;
and recording the changed player data and the second log serial number in a cache, and marking the cache as data needing to be stored in a disk.
4. The method for storing game data according to claim 3, further comprising the steps of: when the DataBase process module finishes processing one disk storage record, returning success to the game process module, and inserting a log with a processed first log serial number into the tail part of the first log file by the game process module; deleting the first log file when all first log serial numbers in the first log file have been processed.
5. The method for storing game data according to claim 3, further comprising the steps of:
when the storage time of the preset storage queue is not reached, judging whether the storage queue has set the storage time of the preset storage queue;
and if the preset disk storage time of the disk storage queue is not set, setting the preset disk storage time according to the current load condition of the game server.
6. The method for storing game data according to claim 3, further comprising the steps of:
when the storage time of the preset storage queue is not reached, the player data is changed, and the following steps are carried out:
incrementing the player data by a data version number;
generating a first log serial number;
recording a data storage log in a first log file;
inserting the changed player data, the data version number, and the first log sequence number into a pending disk queue.
7. The method for storing game data according to claim 3, further comprising the steps of:
after the preset storage time of the storage queue is up, the player data is changed, a new first journal file is generated, and the following steps are carried out:
incrementing the player data by a data version number;
generating a first log serial number;
recording a data storage log in a first log file;
inserting the changed player data, the data version number, and the first log sequence number into a pending disk queue.
8. The method for storing game data according to claim 3, further comprising the steps of: and after receiving a batch of disk storage records, the DataBase process module judges whether preset data disk storage time is set or not, and otherwise, the preset data disk storage time is set according to the current load condition of the game server.
9. The method for storing game data according to claim 3, further comprising the steps of: and generating a new storage record before the preset data storage time is reached, and repeating the data processing steps of the DataBase process module.
10. The method for storing game data according to claim 3, further comprising the steps of: and after the preset data storage time is up, generating a new storage record, generating a new second diary file by the DataBase process module, and repeating the data processing steps of the DataBase process module.
11. The method for saving game data according to claim 3, wherein the step of saving the player data at the predetermined data saving time point in the database and the step of deleting the data saving log after saving are further performed by:
the DataBase process module generates a current disk storage table, records a second log serial number corresponding to each cache in the current disk storage table, cleans the second log serial number information in the cache, assembles the cache into a disk storage request corresponding to the DataBase, and sends the disk storage request to the DataBase;
and after the operation of each disk storage request is completed, the DataBase returns success to the DataBase process module, the DataBase process module finds out a second log serial number corresponding to each disk storage request in the existing disk storage table, inserts the processed log of each second log serial number at the tail of the second diary file, and deletes the corresponding second diary file after all second log serial numbers corresponding to the second diary file are processed.
12. The method for saving game data according to claim 3, wherein the step of writing the player data in the data saving log into a database for saving is performed, and the step of deleting the data saving log after saving is performed, specifically:
firstly, starting a DataBase process module, checking whether a second diary file exists, if so, loading the disk log files in sequence, removing the disk log file record corresponding to the processed second log serial number, and then performing identical data deduplication processing according to the data version number to obtain a recovered second diary file; for each saved log file in the recovered second log file, checking whether the data exists in a cache, if not, loading the data from a database into the cache, if so, checking whether a data version number recorded by the saved log file of the data is larger than a data version number recorded by the cache, if so, updating the cache, inserting a second log serial number into the cache, and marking the second log serial number as the data needing saving processing; otherwise, discarding the piece of data; after all the disk storage log files are processed, disk storage is immediately carried out; and deleting the recovered second diary file after the storage is successful.
13. The method for storing game data according to claim 11, further comprising the steps of:
after the DataBase process module is started, starting a game process module, checking whether a first journal file exists or not by the game process module, and if so, loading the first journal file in sequence; removing the log file record of the data storage disc corresponding to the processed first log serial number, and performing the duplicate removal processing on the same data according to the data version number to obtain a recovered first log file; inserting a save record containing the changed player data, the data version number, and the first log stream number into a pending save queue; and after all the first journal files are processed, immediately sending the disk storage records to a DataBase process module, and deleting the recovered first journal files.
14. A game data storage device for implementing the game data storage method according to any one of claims 1 to 13, comprising a game progress module, a DataBase progress module, and a DataBase;
the game process module comprises
The logic business module is used for calling the game data processing module when the player data changes;
the game data processing module is used for loading changed player data, increasing the data version number of the player data and packaging data operation;
the first data storage log module is used for generating and storing a data storage diary of the game process;
the DataBase process module comprises
The data base data processing module is used for receiving data from the game data processing module, processing data disk storage logs, reading data from a DataBase and caching the data; when data needs to be stored, the data is written into a database;
a second data storage log module; a data-saving diary for generating and storing DataBase processes;
the game data processing module is respectively connected with the first data disk storage log module and the DataBase data processing module; the DataBase data processing module is connected with the second data storage disk log module.
15. The apparatus for saving game data according to claim 14, wherein the game data processing module and the DataBase data processing module are called each other.
16. The apparatus for saving game data according to claim 14, wherein the game data processing module and the DataBase data processing module communicate with each other in an RPC manner.
CN202110114455.6A 2021-01-26 2021-01-26 Game data storage method and device Pending CN112791415A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110114455.6A CN112791415A (en) 2021-01-26 2021-01-26 Game data storage method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110114455.6A CN112791415A (en) 2021-01-26 2021-01-26 Game data storage method and device

Publications (1)

Publication Number Publication Date
CN112791415A true CN112791415A (en) 2021-05-14

Family

ID=75812290

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110114455.6A Pending CN112791415A (en) 2021-01-26 2021-01-26 Game data storage method and device

Country Status (1)

Country Link
CN (1) CN112791415A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114748875A (en) * 2022-05-20 2022-07-15 一点灵犀信息技术(广州)有限公司 Data saving method, device, equipment, storage medium and program product

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105404824A (en) * 2015-11-11 2016-03-16 成都比特信安科技有限公司 Asynchronous data slow encryption system and method
CN107967360A (en) * 2017-12-22 2018-04-27 广东雅达电子股份有限公司 A kind of real-time data base file memory method
CN109646947A (en) * 2018-12-05 2019-04-19 网易(杭州)网络有限公司 Deposit method, apparatus, equipment and the storage medium of game data
CN110975279A (en) * 2019-11-27 2020-04-10 网易(杭州)网络有限公司 Game data processing method and device, game server and storage medium
CN112256485A (en) * 2020-10-30 2021-01-22 网易(杭州)网络有限公司 Data backup method, device, medium and computing equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105404824A (en) * 2015-11-11 2016-03-16 成都比特信安科技有限公司 Asynchronous data slow encryption system and method
CN107967360A (en) * 2017-12-22 2018-04-27 广东雅达电子股份有限公司 A kind of real-time data base file memory method
CN109646947A (en) * 2018-12-05 2019-04-19 网易(杭州)网络有限公司 Deposit method, apparatus, equipment and the storage medium of game data
CN110975279A (en) * 2019-11-27 2020-04-10 网易(杭州)网络有限公司 Game data processing method and device, game server and storage medium
CN112256485A (en) * 2020-10-30 2021-01-22 网易(杭州)网络有限公司 Data backup method, device, medium and computing equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114748875A (en) * 2022-05-20 2022-07-15 一点灵犀信息技术(广州)有限公司 Data saving method, device, equipment, storage medium and program product

Similar Documents

Publication Publication Date Title
US5638508A (en) Method and a system for processing a log record
US5043871A (en) Method and apparatus for database update/recovery
US7139927B2 (en) Journaling and recovery method of shared disk file system
JP3877519B2 (en) System recovery method, computer system for implementing the method, and recording medium recording the processing program
JP4916892B2 (en) Log information management system and method for transaction processing
CN111125040B (en) Method, device and storage medium for managing redo log
CN106777126B (en) Data online migration method supporting heterogeneous time sequence database
CN110941502A (en) Message processing method, device, storage medium and equipment
CN111538463A (en) Method for realizing memory database persistence
CN112791415A (en) Game data storage method and device
CN113076220A (en) Data processing method and device, electronic equipment and computer readable medium
CN114116665A (en) Method for parallel writing transaction log in database to improve processing efficiency
CN117632991A (en) Method and system for acquiring database change data
US6978400B2 (en) Method, apparatus and computer program for reducing the amount of data checkpointed
CN114077517A (en) Data processing method, equipment and system
CN114780489A (en) Method and device for realizing distributed block storage bottom layer GC
JPS58223857A (en) Operation of calculator
CN114490802A (en) Time sequence data management method, device and equipment and readable storage medium
CN112463032A (en) Performance optimization method, system and device for deduplication module of storage system
CN110908821A (en) Method, device, equipment and storage medium for task failure management
US20030033440A1 (en) Method of logging message activity
CN110399098A (en) A kind of data processing method and electronic equipment
CN115658624B (en) Metadata writing method and system for coping with unstable time interval of system
CN103294570B (en) A kind of backup method of internal storage data and device
US11429628B2 (en) Transaction grouping for overwrite merge

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20220223

Address after: 510000 room c208-8, room 226, No. 1331, Nanzhou Road, Haizhu District, Guangzhou City, Guangdong Province

Applicant after: Guangzhou magic explosion network technology Co.,Ltd.

Address before: 510000 unit 1801, 1802, 1803, 1804, 1805, 1806, 1807, room 101, No. 1166, Xingang East Road, Haizhu District, Guangzhou City, Guangdong Province (office only)

Applicant before: Guangzhou Xinyuan Interactive Technology Co.,Ltd.

TA01 Transfer of patent application right