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
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
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...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com