Game server data storage, read method and system based on redis

A game server and data storage technology, applied in indoor games, video games, sports accessories, etc., can solve the problems of data cannot be saved, player data loss, etc., and achieve the effect of reducing the number of stored data

Inactive Publication Date: 2016-10-19
GUANGZHOU AIYOU INFORMATION TECH
View PDF6 Cites 9 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, when the game server crashes, there will be a period of time when the data cannot be saved, resulting in the loss of player data

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Game server data storage, read method and system based on redis
  • Game server data storage, read method and system based on redis
  • Game server data storage, read method and system based on redis

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0035] Such as figure 1 As shown, the embodiment of the present invention provides a redis-based game server data storage method, including the following steps:

[0036] S101, determine whether the player is logged in, if the player is logged in, execute S102, otherwise, enter the next loop;

[0037] S102, judging whether the player data is updated, if the player data is updated, then store the updated player data in the redis memory database, and at the same time, store the player username in the queue and the collection respectively, wherein the player username is in the The queue is stored in chronological order, and the same player user name can be repeatedly stored in the queue, the player user name is randomly stored in the set, and the same player user name name is stored in the set in a single non-repeatable manner; otherwise, enter the next cycle;

[0038] S103, check whether there is the player username in the queue according to the set time interval, if yes, retri...

Embodiment 2

[0052] Such as image 3 As shown, the embodiment of the present invention provides a redis-based game server data reading method, adopting the redis-based game server data storage method provided by the first embodiment above for data storage, including the following steps:

[0053] S201, determine whether the player is logged in, if the player is logged in, execute S202, otherwise, enter the next cycle;

[0054] S202, check whether the player data is cached in the redis memory database, if yes, then directly read the player data from the redis memory database; otherwise, read the player data from the relational database, and store the player data in the Redis memory database.

[0055] By adopting the above method, the times of reading data from the relational database can be reduced, and the efficiency of the database can be improved.

Embodiment 3

[0057] The embodiment of the present invention provides a redis-based game server data storage system, including:

[0058] Judgment module: used to judge whether the player is logged in, and also used to judge whether the player data is updated;

[0059] Retrieval module: used to check whether there is the player username in the queue according to the set time interval, and also used to retrieve the player username in the set;

[0060] Data storage module: used to store the updated player data in the redis memory database, and also to store the player data corresponding to the player username read from the redis memory database into the relational database;

[0061] Data reading module: used to read the player data corresponding to the player username from the redis memory database;

[0062] Queue: used to store player usernames for data updates, store the player usernames in chronological order, and store the same player usernames multiple times;

[0063] Collection: used t...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a game server data storage, read method and system based on redis and relates to the technical field of game server data storage and read. According to the game server data storage, read method and system based on redis provided by one embodiment of the invention, updated player data is timely stored in redis memory database to avoid cases of player data loss; besides, through storing the player user names with updated data in queues and sets, through searching player user names in queues and sets in set time interval, and storing player data corresponding to player user names in relational database at one time to reduce the times of data storage in relational database and to avoid influence on database efficiency and player experience.

Description

technical field [0001] The present invention relates to the technical field of game server data storage and reading, in particular to a redis-based game server data storage and reading method and system. Background technique [0002] When players are playing games, they frequently log in to the game, which requires frequent reading of database data; at the same time, during the game, player data is constantly updated, which requires frequent write-back of data to the database. When the number of players is large, the read and write operations of these databases will be very frequent, which will directly affect the efficiency of the database and the experience of some players, which may be accompanied by lag. [0003] At present, the frequency of writing data is mainly reduced by the way that the game server periodically writes data back to the database. However, when the game server crashes, there will be a period of time when the data cannot be saved, resulting in loss of ...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): A63F13/77
Inventor 李飞
Owner GUANGZHOU AIYOU INFORMATION TECH
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products