CN104268104A - Game development memory control method and system - Google Patents

Game development memory control method and system Download PDF

Info

Publication number
CN104268104A
CN104268104A CN201410531033.9A CN201410531033A CN104268104A CN 104268104 A CN104268104 A CN 104268104A CN 201410531033 A CN201410531033 A CN 201410531033A CN 104268104 A CN104268104 A CN 104268104A
Authority
CN
China
Prior art keywords
memory
game
resource
internal memory
current
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
CN201410531033.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.)
Chongqing University of Post and Telecommunications
Original Assignee
Chongqing University of Post and Telecommunications
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 Chongqing University of Post and Telecommunications filed Critical Chongqing University of Post and Telecommunications
Priority to CN201410531033.9A priority Critical patent/CN104268104A/en
Publication of CN104268104A publication Critical patent/CN104268104A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/16Handling requests for interconnection or transfer for access to memory bus
    • G06F13/1605Handling requests for interconnection or transfer for access to memory bus based on arbitration
    • G06F13/1652Handling requests for interconnection or transfer for access to memory bus based on arbitration in a multiprocessor architecture
    • G06F13/1657Access to multiple memories

Abstract

The invention discloses a game development memory control method. The game development memory control method comprises starting a game for initialization and presetting an occupied maximum memory of the game; obtaining resources which need to be loaded; determining whether game scenes in the resources change or not; determining whether game data are static data or not; performing different substitution conversions according to the size of the current memory and the resources and substitute the current resource memory which is not used into an external memory to enable the current memory to be smaller than the maximum external memory. According to the game development memory control method, the new game scene area is divided into the static data and dynamic data to be stored in the memory to avoid the excessive memory and whether the current occupied memory is larger than an agreed memory peak value or not is determined before data loading, the memory data are substituted into the external memory through the different substitution conversions according to the different resources when the current memory exceeds, the memory hit ratio is high, and the game memory can be dynamically, flexibly and efficiently managed.

Description

A kind of development of games internal memory control method and system
Technical field
The present invention relates to development of games field, the internal memory control method of particularly a kind of development of games and system.
Background technology
In development of games field particularly big game exploitation, Memory control technology one is directly subordinate to central difficult point, for this reason different game developers has different disposal routes, and great majority game is not controlled internal memory of rough formula, cause a game to take the too many resource of system, thus bring bad experience to user.
Therefore a kind of dynamic, flexible, efficient management game internal memory method and system are needed.
Summary of the invention
In view of this, technical matters to be solved by this invention is to provide a kind of development of games internal memory control method and system, dynamic, flexible, the efficient management game internal memory of the method.
An object of the present invention proposes a kind of development of games internal memory control method; Two of object of the present invention proposes a kind of development of games memory control system.
An object of the present invention is achieved through the following technical solutions:
A kind of development of games internal memory control method provided by the invention, comprises the following steps:
S1: start game and carry out initialization, default game takies maximum memory;
S2: obtain the resource needing to load, judge whether the scene of game in resource changes, if not, then do not need to carry out internal memory loading, terminate algorithm;
S3: if then judge whether game data is static data, if not, then need not load immediately, terminates algorithm;
S4: if judge whether current memory exceedes maximum memory, if so, then carry out different displacements according to resource and convert, and by first for the internal memory of current for a part untapped resource line replacement to external memory, makes current memory be less than maximum memory, enter step S5; If not, then step S5 is entered;
S5: resource is loaded into internal memory.
Further, described displacement converts and adopts FIFO replacement algorithm.
Further, described displacement converts and adopts LRU replacement algorithm.
Two of object of the present invention is achieved through the following technical solutions:
A kind of development of games memory control system provided by the invention, comprises initialization module, scene of game judge module, scene of game selection module, internal memory judge module, displacement conversion module, load-on module;
Described initialization module, carry out initialization for starting game, default game takies maximum memory;
Described scene of game judge module, for obtaining the resource of needs loading and judging whether the game scene of game in resource changes;
Described scene of game selects module, for loading static data;
Described internal memory judge module, for judging whether current memory exceedes maximum memory;
Described displacement conversion module, converts for carrying out different displacements according to resource, and first for the internal memory of current for a part untapped resource line replacement is loaded data to external memory or when current memory is less than maximum memory.
Further, described displacement converts and adopts FIFO replacement algorithm.
Further, described displacement converts and adopts LRU replacement algorithm.
Beneficial effect of the present invention is: development of games internal memory control method provided by the invention, controls in a controlled scope.When entering a new scene of game at every turn, first needed for game, be divided into static data and dynamic data two class, can, by the data that can not use at once stored in internal memory, avoid internal memory too high like this; At every turn before loading data, can judge whether current memory occupancy is greater than arranged internal memory peak value, if current memory exceeds, then can use different Resource exchange algorithms that its internal storage data is replaced external memory according to different resources, for different resource types, some meetings adopt FIFO (first in first out) replacement algorithm, some meetings adopt LRU (not using at most) replacement algorithm, reach the hit rate that internal memory is higher like this, dynamic, flexible, efficient management game internal memory, provide good Consumer's Experience to game player.
Accompanying drawing explanation
In order to make the object, technical solutions and advantages of the present invention clearly, below in conjunction with accompanying drawing, the present invention is described in further detail, wherein:
The development of games internal memory control method process flow diagram that Fig. 1 provides for the embodiment of the present invention;
The development of games memory control system schematic diagram that Fig. 2 provides for the embodiment of the present invention.
Embodiment
Hereinafter with reference to accompanying drawing, the preferred embodiments of the present invention are described in detail.Should be appreciated that preferred embodiment only in order to the present invention is described, instead of in order to limit the scope of the invention.
The development of games internal memory control method process flow diagram that Fig. 1 provides for the embodiment of the present invention, as shown in the figure: a kind of development of games internal memory control method provided by the invention, comprises the following steps:
S1: start game and carry out initialization, default game takies maximum memory;
S2: obtain the resource needing to load, judge whether the scene of game in resource changes, if not, then do not need to carry out internal memory loading, terminate algorithm; Scene there occurs change and just has the request continuing to load resource, and each loading according to judging static data, must judge that exceeding this step of internal memory carries out, and so just can guarantee that internal memory maintains a controlled range all the time;
S3: if then judge whether game data is static data, if not, then need not load immediately, terminates algorithm; Static data represents the data that this scene of game is necessary, and dynamic data is not then certain data needed, and may be next scene needs, so dynamic data can load below as required, but static data must load;
S4: if judge whether current memory exceedes maximum memory, if so, then carry out different displacements according to resource and convert, and by first for the internal memory of current for a part untapped resource line replacement to external memory, makes current memory be less than maximum memory, enter step S5; If not, then step S5 is entered;
S5: resource is loaded into internal memory.
Described displacement converts and adopts FIFO replacement algorithm.
FIFO (FirstInFirstOut) algorithm and fifo algorithm, this algorithm eliminates the resource entering internal memory at first, namely selects residence time resource at most in internal memory to be eliminated, until memory size satisfies condition.This algorithm realization is simple
Described displacement converts and adopts LRU replacement algorithm.
Namely LRU (LeastRecentlyUsed) algorithm does not use replacement algorithm at most, is to call in the service condition after internal memory according to resource to carry out decision-making.Due to unpredictable each resource service condition in the future, " nearest past " being similar to as " in the near future " can only be utilized.This algorithm gives each resource one access field, has been used for the time t of record resource experience since last time uses, and when eliminating a resource, select t value in resource maximum, namely untapped resource is eliminated at most recently.
Described maximum memory will be preset according to different hardware situation.
The development of games memory control system schematic diagram that Fig. 2 provides for the embodiment of the present invention, as shown in the figure, a kind of development of games memory control system provided by the invention, comprises initialization module, scene of game judge module, scene of game selection module, internal memory judge module, displacement conversion module, load-on module;
Described initialization module, carry out initialization for starting game, default game takies maximum memory;
Described scene of game judge module, for obtaining the resource of needs loading and judging whether the game scene of game in resource changes;
Described scene of game selects module, for loading static data;
Described internal memory judge module, for judging whether current memory exceedes maximum memory;
Described displacement conversion module, converts for carrying out different displacements according to resource, and first for the internal memory of current for a part untapped resource line replacement is loaded data to external memory or when current memory is less than maximum memory.
Described displacement converts and adopts FIFO replacement algorithm.
Described displacement converts and adopts LRU replacement algorithm.
Default EMS memory occupation peak-peak in the present embodiment is 500M.Now citing is described as follows:
When entering a new scene, according to demand, judge to obtain three static datas, be respectively 10M, 300M, 100M; Dynamic data three is respectively 100M, 200M, 30M;
Leading loading first static data 10M, 10M<500M, so directly load;
Load the static data 300M of second, 300M+10M<500M, so directly load;
Load the 3rd static data 100M, 10M+300M+100M<500M, so directly load.
When entering another new scene of game, rejudge Static and dynamic data, upper step dynamic data three dynamic datas wherein have two to be converted to static data, are wherein respectively 30,200M.
Leading loading first static data 10M+300M+100M+30M<500M, so directly load;
Load second static data 10M+300M+100M+30M+200M>500M, exceed internal memory setting peak value, adopt internal memory replacement algorithm for this reason;
Resource belongs to common resources, takes FIFO first in first out replacement algorithm, and when two resources are paid the bill in displacement, 100M+30M+200M<500M satisfies condition, so by two 10M, 300M displace above;
If again enter new scene or need new memory request, the step before repetition.
What finally illustrate is, above embodiment is only in order to illustrate technical scheme of the present invention and unrestricted, although by referring to the preferred embodiments of the present invention, invention has been described, but those of ordinary skill in the art is to be understood that, various change can be made to it in the form and details, and not depart from the spirit and scope of the present invention that appended claims limits.

Claims (6)

1. a development of games internal memory control method, is characterized in that: comprise the following steps:
S1: start game and carry out initialization, default game takies maximum memory;
S2: obtain the resource needing to load, judge whether the scene of game in resource changes, if not, then do not need to carry out internal memory loading, terminate algorithm;
S3: if then judge whether game data is static data, if not, then need not load immediately, terminates algorithm;
S4: if judge whether current memory exceedes maximum memory, if so, then carry out different displacements according to resource and convert, and by first for the internal memory of current for a part untapped resource line replacement to external memory, makes current memory be less than maximum memory, enter step S5; If not, then step S5 is entered;
S5: resource is loaded into internal memory.
2. development of games internal memory control method according to claim 1, is characterized in that: described displacement converts and adopts FIFO replacement algorithm.
3. development of games internal memory control method according to claim 1, is characterized in that: described displacement converts and adopts LRU replacement algorithm.
4. a development of games memory control system, is characterized in that: comprise initialization module, scene of game judge module, scene of game selection module, internal memory judge module, displacement conversion module and load-on module;
Described initialization module, carry out initialization for starting game, default game takies maximum memory;
Described scene of game judge module, for obtaining the resource of needs loading and judging whether the scene of game in resource changes;
Described scene of game selects module, for loading static data;
Described internal memory judge module, for judging whether current memory exceedes maximum memory;
Described displacement conversion module, converts for carrying out different displacements according to resource, and first for the internal memory of current for a part untapped resource line replacement is loaded data to external memory or when current memory is less than maximum memory.
5. development of games memory control system according to claim 4, is characterized in that: described displacement converts and adopts FIFO replacement algorithm.
6. development of games memory control system according to claim 4, is characterized in that: described displacement converts and adopts LRU replacement algorithm.
CN201410531033.9A 2014-10-10 2014-10-10 Game development memory control method and system Pending CN104268104A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410531033.9A CN104268104A (en) 2014-10-10 2014-10-10 Game development memory control method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410531033.9A CN104268104A (en) 2014-10-10 2014-10-10 Game development memory control method and system

Publications (1)

Publication Number Publication Date
CN104268104A true CN104268104A (en) 2015-01-07

Family

ID=52159627

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410531033.9A Pending CN104268104A (en) 2014-10-10 2014-10-10 Game development memory control method and system

Country Status (1)

Country Link
CN (1) CN104268104A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106502793A (en) * 2016-10-21 2017-03-15 搜游网络科技(北京)有限公司 A kind of concocting method of game resource and equipment
CN110134650A (en) * 2019-04-28 2019-08-16 深圳市腾讯网域计算机网络有限公司 A kind of file loading method, device, equipment and storage medium
CN113082705A (en) * 2021-05-08 2021-07-09 腾讯科技(上海)有限公司 Game scene switching method and device, computer equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5761727A (en) * 1996-04-02 1998-06-02 United Microelectronics Corporation Control apparatus for a memory architecture using dedicated and shared memory segments
CN103927130A (en) * 2014-03-14 2014-07-16 山东大学 Uniform internal and external memory architecture based on MMU (memory management unit)

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5761727A (en) * 1996-04-02 1998-06-02 United Microelectronics Corporation Control apparatus for a memory architecture using dedicated and shared memory segments
CN103927130A (en) * 2014-03-14 2014-07-16 山东大学 Uniform internal and external memory architecture based on MMU (memory management unit)

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
胡耀华: ""基于BREW手机游戏的内存管理研究"", 《工程地质计算机应用》 *
赵占伟 等: ""基于内存池的应用程序级页面置换算法"", 《计算机与现代化》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106502793A (en) * 2016-10-21 2017-03-15 搜游网络科技(北京)有限公司 A kind of concocting method of game resource and equipment
CN110134650A (en) * 2019-04-28 2019-08-16 深圳市腾讯网域计算机网络有限公司 A kind of file loading method, device, equipment and storage medium
WO2020220971A1 (en) * 2019-04-28 2020-11-05 腾讯科技(深圳)有限公司 File loading method and apparatus, electronic device, and storage medium
US11907164B2 (en) 2019-04-28 2024-02-20 Tencent Technology (Shenzhen) Company Limited File loading method and apparatus, electronic device, and storage medium
CN113082705A (en) * 2021-05-08 2021-07-09 腾讯科技(上海)有限公司 Game scene switching method and device, computer equipment and storage medium
CN113082705B (en) * 2021-05-08 2023-09-15 腾讯科技(上海)有限公司 Game scene switching method, game scene switching device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
US10114749B2 (en) Cache memory system and method for accessing cache line
CN107770758A (en) The bluetooth of Baffle Box of Bluetooth returns even method, Baffle Box of Bluetooth and storage medium
CN104158911A (en) Server cluster-oriented control method and system
CN106162219A (en) Video cloud stores the method and system of the video of method and system, preview cloud storage
CN105183565A (en) Computer and service quality control method and device
CN104683408A (en) Method and system for OpenStack cloud computing management platform to build virtual machine instance
CN104239153A (en) Method and device for balancing multi-core CPU load
CN103236989A (en) Cache control method, devices and system in content delivery network
CN104268104A (en) Game development memory control method and system
CN108494788A (en) Transmission method, data transmission device and the computer readable storage medium of data
CN103729236A (en) Method for limiting resource using limit of cloud computing users
WO2016197458A1 (en) Traffic control method and apparatus
WO2014016916A1 (en) Communication device and relay device
CN103336670B (en) A kind of method and apparatus data block being distributed automatically based on data temperature
CN102591594B (en) Data processing method and equipment
CN102375893A (en) Distributed file system and method for establishing duplicate copy
CN109756372B (en) Elastic expansion method and device for telecommunication charging system
CN106936867A (en) The response method and device of a kind of service request
CN104202349B (en) The method of scheduling distributed buffer resources, Apparatus and system
CN103870206A (en) Caching data receiving and reading method and device and router cache device
CN102739531B (en) Flow shaping method and traffic shaping device
CN116700953A (en) Node power consumption adjusting method and device, electronic equipment and storage medium
CN103207843A (en) Data line width dynamically-configurable cache structure design method
CN110650546A (en) File transmission method, device, storage medium and terminal
CN102279821B (en) Method and system for transmitting DDR (double data rate) controller port command

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20150107