CN109885395A - A kind of game configuration table load Memory Optimize Method and device - Google Patents

A kind of game configuration table load Memory Optimize Method and device Download PDF

Info

Publication number
CN109885395A
CN109885395A CN201910032632.9A CN201910032632A CN109885395A CN 109885395 A CN109885395 A CN 109885395A CN 201910032632 A CN201910032632 A CN 201910032632A CN 109885395 A CN109885395 A CN 109885395A
Authority
CN
China
Prior art keywords
game configuration
database
game
memory
data
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
CN201910032632.9A
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.)
Zhuhai Kingsoft Online Game Technology Co Ltd
Chengdu Xishanju Interactive Entertainment Technology Co Ltd
Original Assignee
Zhuhai Kingsoft Online Game Technology Co Ltd
Chengdu Xishanju Interactive Entertainment 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 Zhuhai Kingsoft Online Game Technology Co Ltd, Chengdu Xishanju Interactive Entertainment Technology Co Ltd filed Critical Zhuhai Kingsoft Online Game Technology Co Ltd
Priority to CN201910032632.9A priority Critical patent/CN109885395A/en
Publication of CN109885395A publication Critical patent/CN109885395A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present invention relates to a kind of game configuration table load Memory Optimize Method and devices, belong to game performance optimization field.Method therein is the following steps are included: read game configuration list file, acquisition table information and game configuration data, the table information include table name, column name and column data type;Corresponding database table is created to all game configuration list files, the mapping of database table Yu game configuration table is established according to table information;Modifying game configuration data acquisition modes is to obtain from database lookup;Dependent game configuration data is searched from database table as needed is loaded onto memory.Technical solution of the present invention stores the game configuration data in game configuration list file by local data base, without loading all game configuration list files in game, only need the configuration data in the database file in on-demand reading disk, while meeting reading speed, the occupied memory overhead of game configuration table can be greatly reduced.

Description

A kind of game configuration table load Memory Optimize Method and device
Technical field
The present invention relates to a kind of game configuration table load Memory Optimize Method and devices, belong to game performance optimization field.
Background technique
In this day and age, mobile phone games have become a pith of people's entertainment.
With mobile phone games increasingly severe, the logic configuration data in mobile phone games is more and more.These configuration datas It is stored on mobile phone usually in the form of tables of data.Then in game running, these tables of data can all be read memory In.However some configuration datas just can need to use under AD HOC or specific grade, therefore by all game configurations Data are fully loaded in memory, cause temporary unwanted configuration data to waste partial memory space, in game configuration number In the case where more, these allocation lists occupy a large amount of memory, influence the EMS memory occupation of game, influence the property of game indirectly Energy.
Summary of the invention
The present invention provides a kind of game configuration table load Memory Optimize Method and device, and game configuration data is stored in tool In the local data base for having quick reading performance, database file is stored in disk, when needing using certain configuration datas, It is searched from database and only loads the configuration data needed to memory, avoid being fully loaded to occupying excessive memory in memory Expense.
Technical solution of the present invention first aspect is that a kind of game configuration table loads Memory Optimize Method, the method includes Following steps:
Game configuration list file is read, table information is obtained and game configuration data, the table information includes table name, column name Claim and column data type;
Corresponding database table is created to all game configuration list files, database table is established according to table information and is matched with game Set the mapping of table;
Modifying game configuration data acquisition modes is to obtain from database lookup;
Dependent game configuration data is searched from database table as needed is loaded onto memory.
Further, the game configuration list file is Excel list file, and the game configuration data includes at least a line.
Further, when creating database table, unique ID is distributed for every a line game configuration data, and by unique mark Know major key of the ID as database table.
Further, the step according to table information creating database table and is established in the mapping with game configuration table, data The title of library table is corresponding with the table name of game configuration table, corresponding according to the field name and column name of library table, the field of database table Type is corresponding with the column data type of game configuration table.
Further, the step is loaded onto memory from lookup dependent game configuration data in database table as needed, Its corresponding unique ID is obtained according to the current desired configuration data of game, and is added according to unique ID from database lookup It is loaded onto memory.
Technical solution of the present invention second aspect is that a kind of game configuration table loads internal memory optimization device, comprising:
Allocation list read module obtains table information and game configuration data, the table for reading game configuration list file Information includes table name, column name and column data type;
Database module is established for creating corresponding database table to all game configuration list files according to table information The mapping of database table and game configuration table;
Memory loads configuration module, is to obtain from database lookup for modifying game configuration data acquisition modes;
Memory loading module is loaded onto memory for searching dependent game configuration data from database table as needed.
Further, the database module includes: major key definition module, for when creating database table, being every a line Game configuration data distributes unique ID, and using the unique ID as the major key of database table.
Further, the database module further include: mapping block, for establishing reflecting for database table and game configuration table Relationship is penetrated, the mapping relations include: that the title of database table is corresponding with the table name of game configuration table, according to the field name of library table Corresponding with column name, the field type of database table and the column data type of game configuration table are corresponding.
The technical solution of the present invention third aspect is a kind of computer installation, including memory, processor and being stored in is deposited On reservoir and the computer program that can run on a processor, the processor realize such as above-mentioned technology when executing described program The game configuration table of scheme first aspect loads the step of Memory Optimize Method.
Technical solution of the present invention fourth aspect is a kind of computer readable storage medium, stores computer journey thereon Sequence realizes that the game configuration table such as above-mentioned technical proposal first aspect loads memory when the computer program is executed by processor The step of optimization method.
The invention has the benefit that
The game configuration data in game configuration list file is stored by local data base, is owned in game without load Game configuration list file, it is only necessary to the configuration data in database file in on-demand reading disk meets reading speed Meanwhile the occupied memory overhead of game configuration table can be greatly reduced.
Detailed description of the invention
Fig. 1 show the overview flow chart of game configuration table load Memory Optimize Method according to the present invention;
Fig. 2 show a kind of game configuration table load internal memory optimization schematic device of embodiment according to the present invention.
Specific embodiment
It is carried out below with reference to technical effect of the embodiment and attached drawing to design of the invention, specific structure and generation clear Chu, complete description, to be completely understood by the purpose of the present invention, scheme and effect.
It should be noted that the "an" of singular used in the disclosure, " described " and "the" are intended to include Most forms, unless the context clearly indicates other meaning.In addition, unless otherwise defined, all skills used herein Art and scientific term are identical as the normally understood meaning of those skilled in the art.Term used in the description herein It is intended merely to description specific embodiment, is not intended to be limiting of the invention.Provided in this article any and all examples or The use of exemplary language (" such as ", " such as ") is intended merely to that the embodiment of the present invention is better described, and unless in addition wants It asks, otherwise the scope of the present invention will not be applied and be limited.
Memory Optimize Method, this method packet are loaded with reference to a kind of Fig. 1 game configuration table for showing embodiment of the present invention Include following steps:
Game configuration list file is read, table information is obtained and game configuration data, the table information includes table name, column name Claim and column data type;
Corresponding database table is created to all game configuration list files, database table is established according to table information and is matched with game Set the mapping of table;
Modifying game configuration data acquisition modes is to obtain from database lookup;
Dependent game configuration data is searched from database table as needed is loaded onto memory.
Specifically, database can be existing various databases, such as MySQL, Oracle, SQLite etc., due to Used in mobile phone, here using it is more small and exquisite, be more suitable the simpler SQLite database of embedded development, database structure; One complete SQLite database is stored in a single cross-platform disk file, when use will not occupy how much Memory overhead.It is a kind of that specific step is as follows:
A unity3D game engineering is established, includes several allocation lists, such as the entitled weapon of table 1 in the game engineering Table, the entitled dress designing table of table 2 are manufactured, two tables are the part configuration data table of two kinds of living skills in game:
ID Classification Title Formula Grade Technical ability book price
1001 Weapon manufacture The small water cannon of pneumatics Clay 3 1 900
1002 Weapon manufacture Shake fractional motor Stone sand 3+ down 3 2 1500
1003 Weapon manufacture Thunder and lightn big gun Quartz sand 2+ long fine hair 3 3 2100
Table 1
ID Classification Title Formula Grade Technical ability book price
2001 Dress designing Casual shorts Coarse wool 2+ rouleau wool 3 1 600
2002 Dress designing Bermuda Shorts Down 2+ rouleau wool 3+ uncut jade stone 1 2 1000
2003 Dress designing Camouflage color sack trousers Long fine hair 2+ rouleau wool 3+ fluorite 1 3 1400
Table 2
1) local data library component sqlite is integrated into game item;
2) the every data line of allocation list in game all distributes a unique ID;
3) each of game allocation list is all created to the database table of same title;
4) using the ID of allocation list as the major key of corresponding database table;
5) allocation list data are read to be changed to read corresponding data from database table.
If certain player has only learnt the living skill of weapon manufacture, the living skill of dress designing is not learnt, then such as Fruit uses game configuration list file as game configuration data carrier, and all game configuration tables can be loaded into memory by game; Therefore all data in table are transferred to stored in SQLite database by we, since there are database additions and deletions to change look into Deng function Can, at this time use database as game configuration data carrier, when the player carries out game, game is only needed from database In find data in weapon manufacture table, be loaded into memory, and the data in dress designing table can be without load; So that memory overhead reduces, game performance is improved.
Internal memory optimization device is loaded with reference to a kind of Fig. 2 game configuration table for showing embodiment of the present invention, comprising:
Allocation list read module obtains table information and game configuration data, the table for reading game configuration list file Information includes table name, column name and column data type;
Database module is established for creating corresponding database table to all game configuration list files according to table information The mapping of database table and game configuration table;
Memory loads configuration module, is to obtain from database lookup for modifying game configuration data acquisition modes;
Memory loading module is loaded onto memory for searching dependent game configuration data from database table as needed.
Further, the database module includes: major key definition module, for when creating database table, being every a line Game configuration data distributes unique ID, and using the unique ID as the major key of database table.
Further, the database module further include: mapping block, for establishing reflecting for database table and game configuration table Relationship is penetrated, the mapping relations include: that the title of database table is corresponding with the table name of game configuration table, according to the field name of library table Corresponding with column name, the field type of database table and the column data type of game configuration table are corresponding.
It should be appreciated that the embodiment of the present invention can be by computer hardware, the combination of hardware and software or by depositing The computer instruction in non-transitory computer-readable memory is stored up to be effected or carried out.Standard volume can be used in the method Journey technology-includes that the non-transitory computer-readable storage media configured with computer program is realized in computer program, In configured in this way storage medium computer is operated in a manner of specific and is predefined --- according in a particular embodiment The method and attached drawing of description.Each program can with the programming language of level process or object-oriented come realize with department of computer science System communication.However, if desired, the program can be realized with compilation or machine language.Under any circumstance, which can be volume The language translated or explained.In addition, the program can be run on the specific integrated circuit of programming for this purpose.
In addition, the operation of process described herein can be performed in any suitable order, unless herein in addition instruction or Otherwise significantly with contradicted by context.Process described herein (or modification and/or combination thereof) can be held being configured with It executes, and is can be used as jointly on the one or more processors under the control of one or more computer systems of row instruction The code (for example, executable instruction, one or more computer program or one or more application) of execution, by hardware or its group It closes to realize.The computer program includes the multiple instruction that can be performed by one or more processors.
Further, the method can be realized in being operably coupled to suitable any kind of computing platform, wrap Include but be not limited to PC, mini-computer, main frame, work station, network or distributed computing environment, individual or integrated Computer platform or communicated with charged particle tool or other imaging devices etc..Each aspect of the present invention can be to deposit The machine readable code on non-transitory storage medium or equipment is stored up to realize no matter be moveable or be integrated to calculating Platform, such as hard disk, optical reading and/or write-in storage medium, RAM, ROM, so that it can be read by programmable calculator, when Storage medium or equipment can be used for configuration and operation computer to execute process described herein when being read by computer.This Outside, machine readable code, or part thereof can be transmitted by wired or wireless network.When such media include combining microprocessor Or other data processors realize steps described above instruction or program when, invention as described herein including these and other not The non-transitory computer-readable storage media of same type.When game configuration table according to the present invention loads internal memory optimization side When method and technology program, the invention also includes computers itself.
Computer program can be applied to input data to execute function as described herein, to convert input data with life At storing to the output data of nonvolatile memory.Output information can also be applied to one or more output equipments as shown Device.In the preferred embodiment of the invention, the data of conversion indicate physics and tangible object, including the object generated on display Reason and the particular visual of physical objects are described.
The above, only presently preferred embodiments of the present invention, the invention is not limited to above embodiment, as long as It reaches technical effect of the invention with identical means, all within the spirits and principles of the present invention, any modification for being made, Equivalent replacement, improvement etc., should be included within the scope of the present invention.Its technical solution within the scope of the present invention And/or embodiment can have a variety of different modifications and variations.

Claims (10)

1. a kind of game configuration table loads Memory Optimize Method, which is characterized in that the described method comprises the following steps:
Read game configuration list file, obtain table information and game configuration data, the table information include table name, column name and Column data type;
Corresponding database table is created to all game configuration list files, database table and game configuration table are established according to table information Mapping;
Modifying game configuration data acquisition modes is to obtain from database lookup;
Dependent game configuration data is searched from database table as needed is loaded onto memory.
2. game configuration table according to claim 1 loads Memory Optimize Method, it is characterised in that: the game configuration table File is Excel list file, and the game configuration data includes at least a line.
3. game configuration table according to claim 1 loads Memory Optimize Method, it is characterised in that: creation database table When, unique ID is distributed for every a line game configuration data, and using the unique ID as the major key of database table.
4. game configuration table according to claim 1 loads Memory Optimize Method, it is characterised in that: the step is according to table Information creating database table is simultaneously established in the mapping with game configuration table, the title of database table and the table name of game configuration table It is corresponding, the field type of database table and the column data type pair of game configuration table corresponding according to the field name and column name of library table It answers.
5. game configuration table according to claim 1 loads Memory Optimize Method, it is characterised in that: the step is according to need It to be loaded onto memory from dependent game configuration data is searched in database table, it is obtained according to the current desired configuration data of game Corresponding unique ID, and memory is loaded onto from database lookup according to unique ID.
6. a kind of game configuration table loads internal memory optimization device characterized by comprising
Allocation list read module obtains table information and game configuration data, the table information for reading game configuration list file Including table name, column name and column data type;
Database module establishes data according to table information for creating corresponding database table to all game configuration list files The mapping of library table and game configuration table;
Memory loads configuration module, is to obtain from database lookup for modifying game configuration data acquisition modes;
Memory loading module is loaded onto memory for searching dependent game configuration data from database table as needed.
7. game configuration table according to claim 6 loads internal memory optimization device, which is characterized in that the database module Include:
Major key definition module, for distributing unique ID for every a line game configuration data, and will when creating database table Major key of the unique ID as database table.
8. game configuration table according to claim 6 loads internal memory optimization device, which is characterized in that the database module Further include:
Mapping block, for establishing the mapping relations of database table Yu game configuration table, the mapping relations include: database table Title it is corresponding with the table name of game configuration table, the field type of database table corresponding according to the field name and column name of library table It is corresponding with the column data type of game configuration table.
9. a kind of computer installation, can run on a memory and on a processor including memory, processor and storage Computer program, which is characterized in that the processor realizes side as described in any one in claim 1-5 when executing described program Method step.
10. a kind of computer readable storage medium, stores computer program thereon, the computer program is executed by processor Shi Shixian the method according to claim 1 to 5 step.
CN201910032632.9A 2019-01-14 2019-01-14 A kind of game configuration table load Memory Optimize Method and device Pending CN109885395A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910032632.9A CN109885395A (en) 2019-01-14 2019-01-14 A kind of game configuration table load Memory Optimize Method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910032632.9A CN109885395A (en) 2019-01-14 2019-01-14 A kind of game configuration table load Memory Optimize Method and device

Publications (1)

Publication Number Publication Date
CN109885395A true CN109885395A (en) 2019-06-14

Family

ID=66925968

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910032632.9A Pending CN109885395A (en) 2019-01-14 2019-01-14 A kind of game configuration table load Memory Optimize Method and device

Country Status (1)

Country Link
CN (1) CN109885395A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111752994A (en) * 2020-06-24 2020-10-09 完美世界(北京)软件科技发展有限公司 Game digital asset management method, system, storage medium and computing device
CN112206531A (en) * 2020-10-19 2021-01-12 珠海金山网络游戏科技有限公司 Game creation method and device
CN112231104A (en) * 2020-10-19 2021-01-15 珠海金山网络游戏科技有限公司 Game data processing method and device
CN112698877A (en) * 2019-10-21 2021-04-23 上海哔哩哔哩科技有限公司 Data processing method and system
CN112691382A (en) * 2021-01-15 2021-04-23 腾讯科技(深圳)有限公司 Resource processing method, device and computer readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104601562A (en) * 2015-01-04 2015-05-06 福建天晴数码有限公司 Interactive method and system of game server and database
US20160045830A1 (en) * 2012-07-26 2016-02-18 Zynga Inc. Adaptive Task Assignment for Online Games that Uses Player Profiles
CN108647283A (en) * 2018-05-04 2018-10-12 武汉灵动在线科技有限公司 A kind of configuration of game data is quick to be generated and analytic method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160045830A1 (en) * 2012-07-26 2016-02-18 Zynga Inc. Adaptive Task Assignment for Online Games that Uses Player Profiles
CN104601562A (en) * 2015-01-04 2015-05-06 福建天晴数码有限公司 Interactive method and system of game server and database
CN108647283A (en) * 2018-05-04 2018-10-12 武汉灵动在线科技有限公司 A kind of configuration of game data is quick to be generated and analytic method

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112698877A (en) * 2019-10-21 2021-04-23 上海哔哩哔哩科技有限公司 Data processing method and system
CN112698877B (en) * 2019-10-21 2023-07-14 上海哔哩哔哩科技有限公司 Data processing method and system
CN111752994A (en) * 2020-06-24 2020-10-09 完美世界(北京)软件科技发展有限公司 Game digital asset management method, system, storage medium and computing device
CN111752994B (en) * 2020-06-24 2024-04-16 完美世界(北京)软件科技发展有限公司 Game digital asset management method, system, storage medium and computing device
CN112206531A (en) * 2020-10-19 2021-01-12 珠海金山网络游戏科技有限公司 Game creation method and device
CN112231104A (en) * 2020-10-19 2021-01-15 珠海金山网络游戏科技有限公司 Game data processing method and device
CN112206531B (en) * 2020-10-19 2022-08-26 珠海金山数字网络科技有限公司 Game creation method and device
CN112231104B (en) * 2020-10-19 2024-04-09 珠海金山数字网络科技有限公司 Game data processing method and device
CN112691382A (en) * 2021-01-15 2021-04-23 腾讯科技(深圳)有限公司 Resource processing method, device and computer readable storage medium
CN112691382B (en) * 2021-01-15 2023-02-28 腾讯科技(深圳)有限公司 Resource processing method, device and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN109885395A (en) A kind of game configuration table load Memory Optimize Method and device
CN110168529B (en) Data storage method, device and storage medium
CN105487864A (en) Method and device for automatically generating code
CN106202548A (en) Date storage method, lookup method and device
CN106873949A (en) Code generating method and its device
CN105446979A (en) Data mining method and node
CN102043789A (en) Method and device for updating data table
CN106933836B (en) Data storage method and system based on sub-tables
CN103902702A (en) Data storage system and data storage method
CN106557307A (en) The processing method and processing system of business datum
CN102760096A (en) Test data generation method, unit testing method and unit testing system
CN103164393B (en) Report form formula disposal route and system
CN104133765A (en) Test case sending method and test case server of network activities
CN103116641B (en) Obtain method and the collator of the statistics of sequence
CN115345390A (en) Behavior trajectory prediction method and device, electronic equipment and storage medium
CN110020333A (en) Data analysing method and device, electronic equipment, storage medium
CN109657060B (en) Safety production accident case pushing method and system
Wang et al. Research on Hybrid Real‐Time Picking Routing Optimization Based on Multiple Picking Stations
CN102364475A (en) System and method for sequencing search results based on identity recognition
CN104714983B (en) The generation method and device of distributed index
CN117407921A (en) Differential privacy histogram release method and system based on must-connect and don-connect constraints
CN106980673A (en) Main memory database table index updating method and system
CN116954815A (en) Resource scheduling method and device, computer equipment and computer readable storage medium
CN112800242B (en) Pedigree mining method, pedigree mining device, electronic equipment and computer-readable storage medium
Arunkumar et al. Discrete event simulation for increasing productivity in digital manufacturing

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20190614

RJ01 Rejection of invention patent application after publication