CN101963953A - Cache optimization method for mobile rich media player - Google Patents

Cache optimization method for mobile rich media player Download PDF

Info

Publication number
CN101963953A
CN101963953A CN201010276370.XA CN201010276370A CN101963953A CN 101963953 A CN101963953 A CN 101963953A CN 201010276370 A CN201010276370 A CN 201010276370A CN 101963953 A CN101963953 A CN 101963953A
Authority
CN
China
Prior art keywords
character
rich media
buffer area
mobile
weights
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.)
Granted
Application number
CN201010276370.XA
Other languages
Chinese (zh)
Other versions
CN101963953B (en
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.)
Institute of Electronic and Information Engineering of Dongguan UESTC
Original Assignee
Institute of Electronic and Information Engineering of Dongguan UESTC
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 Institute of Electronic and Information Engineering of Dongguan UESTC filed Critical Institute of Electronic and Information Engineering of Dongguan UESTC
Priority to CN201010276370.XA priority Critical patent/CN101963953B/en
Publication of CN101963953A publication Critical patent/CN101963953A/en
Application granted granted Critical
Publication of CN101963953B publication Critical patent/CN101963953B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a cache optimization method for a mobile rich media player. In the method, a character cache region is set between the mobile rich media player and a local resource file to cache common character dot matrix information and width and height information of a character dot matrix; the mobile rich media player firstly searches a character needed to be displayed from the character cache region, if the character is present in the character cache region, the character dot matrix and the width and height information thereof stored in the character cache region are directly read and subjected to typesetting display; otherwise, the character dot matrix and the width and height information thereof are read and displayed from a local resource file. Therefore, the method has the advantages of avoiding frequently accessing the local resource file, reducing time consumption, avoiding redundant data, reducing memory overhead and simultaneously making the rendering speed of pages higher. In addition, the character replacement is performed according to total using times and latest using times, the principle of locality of a program can be reflected and the hit rate can be improved. Therefore, the character in the character cache region is optimized and the display speed of the character and the rendering speed of the page are further improved.

Description

The cache optimization method of a kind of mobile Rich Media player
Technical field
The invention belongs to Rich Media's technical field, more specifically say, relate to the cache optimization method of a kind of mobile Rich Media player
Background technology
At present along with the development of mobile Internet technology, also continue to bring out like the mushrooms after rain based on the mobile rich media applications of portable terminal, they bring great convenience for people's live and work.Meanwhile, along with increasing of mobile rich media applications, people are also more and more higher to the requirement of mobile Rich Media player capabilities, and the response time of mobile rich media applications, reaction velocity, fluency etc. become estimates an important indicator of using quality.
Run on the mobile Rich Media player of pc client owing to possess considerable hardware condition, can consider that almost the optimization of aspects such as buffer memory just can move more smoothly.Yet mobile Rich Media player if do not take effective optimization measure, is easy to cause mobile rich media applications to respond slowly, postpone obviously to influence user experience owing to be subjected to the restriction of aspects such as mobile terminal device processor and internal memory.
Common mobile Rich Media player is not when using buffer area, base application thereon can all read all character pattern information that need in the local resource file in the internal memory, and then the size of definite character pattern and be used for finally showing to page layout.Done two significant disadvantages like this:
1, all character patterns on the page is all read in the redundant data that internal memory can bring a lot of repeat character (RPT) information, bring great waste to memory source, this is very unpractical for constrained devices such as mobile phones, probably can cause the memory source approach exhaustion;
2, use required character all will be searched in character of every demonstration from the dot matrix of all characters of resource file lattice information, this will expend a large amount of time, will inevitably cause to use to show slowly.
In addition, the data that provide according to document, mobile phone games in the mobile rich media applications, cell phone reading, mobile phone searching, mobile phone browser have been listed in preceding four of used mobile phone application service nearly half a year of mobile Internet user, and a big chunk content is exactly a character in these application.Therefore, the character cache problem that solves mobile Rich Media player is the emphasis that solves response time, reaction velocity and fluency.
Summary of the invention
The objective of the invention is to overcome the deficiency of existing detection method, the cache optimization method of a kind of moving Rich Media player is proposed, to reduce memory cost effectively to mobile device, greatly accelerated the demonstration time and the response speed of Rich Media's player, thus make mobile rich media applications can be on portable terminals such as mobile phone smooth operation.
For achieving the above object, the cache optimization method of the moving Rich Media of the present invention player is characterized in that, may further comprise the steps:
(1), between mobile Rich Media player and local resource file, the character buffer area is set, being used for buffer memory moves Rich Media's player character pattern information commonly used; Simultaneously, the wide high information that also has character pattern in the character buffer;
(2), the mobile Rich Media player character of the required demonstration of search in the character buffer area at first, if this character has been arranged in the character buffer area, demonstration then directly reads out the character pattern of storing in the character buffer area, wide, high information and sets type; Otherwise, from the local resource file, read and show;
(3), the displacement of character buffer area character
One cache manager is set, be used for safeguarding the log sheet of the used character pattern information of Rich Media's player decides which character of replacing buffer memory, and this log sheet content comprises: the moment T2 of character key word K, total access times C1, moment T1, weights V when using for the first time, last computation weights, access times C2 in the cycle; When a character was requested, access times C2 added 1 respectively in pairing total access times C1 of this character and cycle, and T calculates the weights V of each character constantly, the pairing weights of so a certain character:
V=d*C1/(T-T1)+(1-d)*C2/(T-T2);(0≤d≤1)
Wherein d be one between 0 with the constant between 1, be used for total frequency of utilization of balance and frequency of utilization in the T-T2 cycle;
After weights V calculating was finished, the moment T2 of last computation weights was changed to T constantly, and access times C2 is changed to 0 in the cycle;
A threshold value p is set, if the weights V>p of certain character, then this character will be changed to buffer zone and be replaced that character with minimum weights.
Goal of the invention of the present invention is achieved in that
Owing to be subjected to the restriction of portable terminal hardware device, mobile Rich Media player capabilities is often relatively poor, at problems such as mobile rich media applications data volume are big, the committed memory space is many, the response time is long, the present invention proposes a kind of cache optimization method based on mobile Rich Media player, between mobile Rich Media player and local resource file, the character buffer area is set, is used for the commonly used character pattern information of buffer memory player and the wide high information of character pattern; Mobile Rich Media player is the character of the required demonstration of search in the character buffer area at first, if this character has been arranged in the character buffer area, demonstration then directly reads out the character pattern of storing in the character buffer area, wide, high information and set type; Otherwise, from the local resource file, read and show.Avoided like this visiting the local resource file continually, reduced time loss, simultaneously, also avoided the appearance of redundant data, reduction internal memory cost that can be to a certain degree.In addition,, so just can directly read the size of character, obtain, make the render speed of the page faster and avoided all going to carry out computing at every turn for having stored the wide high information of character pattern in the character buffer area.
Aspect the displacement of character buffer area character, the present invention is provided with a cache manager, be used for safeguarding the log sheet of the used character pattern information of player decides which character of replacing buffer memory, if the weights V>p of certain character, then this character will be changed to buffer zone and be replaced that character with minimum weights.The displacement of character is simultaneously with respect to total access times and nearest access times, therefore, this Replacement Strategy not only can reflect the program locality principle, and can improve hit rate, thereby optimize character buffer area character, further improved the render speed of the display speed and the page of character.
The present invention reduces memory cost to mobile device effectively by the mechanism that mobile Rich Media engine is increased page character buffer memory, demonstration time and response speed that greatly accelerate to use, thus the operation that mobile rich media applications is can be on portable terminals such as mobile phone smooth made.By relatively finding with the performance of mobile WEB players such as UCWEB, when opening a same Webpage, method of the present invention can reduce the demonstration time of the page really effectively, and also having proved thus increases the performance that page character caching mechanism can be optimized application.
Description of drawings
Fig. 1 is the graph of a relation of mobile Rich Media player, character buffer area and local resource file;
Fig. 2 is a character Hash table structural drawing;
Fig. 3 is the structural drawing of cache manager;
Fig. 4 has the character of NULI character buffer area on average to show the time comparison diagram.
Embodiment
Below in conjunction with accompanying drawing the specific embodiment of the present invention is described, so that those skilled in the art understands the present invention better.What need point out especially is that in the following description, when perhaps the detailed description of known function and design can desalinate main contents of the present invention, these were described in here and will be left in the basket.
Fig. 1 is the graph of a relation of mobile Rich Media player, character buffer area and local resource file.
In the present embodiment, as shown in Figure 1, between mobile Rich Media player and local resource file, the character buffer area is set, is used for buffer memory from the mobile player of the local resource file character pattern information commonly used and the wide high information of character pattern.
In the present embodiment, the character buffer area charcter topology thes contents are as follows:
typedef?struct_FONT
{
Void*data; / * character pattern information */
Int width; The wide * of/* character/
Int height; The high * of/* character/
}FONT;
Mobile Rich Media player is when playing, the character of the required demonstration of search in the character buffer area at first, if this character has been arranged in the character buffer area, demonstration then directly reads out the character pattern of storing in the character buffer area, wide, high information and sets type; Otherwise, from the local resource file, read and show.Avoided visiting the local resource file continually, reduced time loss, avoided the appearance of redundant data and reduced internal memory cost, made the render speed of the page faster simultaneously.
Fig. 2 is a character Hash table structural drawing;
In the present embodiment, as shown in Figure 2, in the character buffer of setting up, mobile Rich Media player is used always, promptly use the more and more frequent character of number of times to set up a Hash table, content comprises key word Key in the list item, relevant character ID chain list index, and it points to the lattice information of Key corresponding characters.Key word Key is representing the coding of character, as UTF-8, ASCII, Unicode etc.
At first check this table during mobile Rich Media player searches character buffer area, if the character of request is present among this table, then will be dot matrix, the character of character is wide by the chain list index of correspondence, information such as character height reads out, otherwise searching request will be submitted to the local resource file and search for once.
Because the character buffer area is stored in the limited internal memory, must limit to some extent buffer size, simultaneously, the purpose that also has of setting up the character buffer area is to improve the cache hit rate of using, the searching request of Rich Media's player will influence the content of storing in the character buffer area, to only store in the character buffer area and use the more and higher content of frequency, and the Replacement Strategy of a character buffer area character so just must be arranged, that is:
One cache manager is set, be used for safeguarding the log sheet of the used character pattern information of Rich Media's player decides which character of replacing buffer memory, this log sheet content comprises: in moment T2, the period T-T2 of character key word K, total access times C1, moment T1, weights V when using for the first time, last computation weights, and access times C2; When a character was requested, access times C2 added 1 respectively in pairing total access times C1 of this character and cycle, calculated the weights V of each character, the pairing weights of so a certain character constantly at T:
V=d*C1/(T-T1)+(1-d)*C2/(T-T2);(0≤d≤1)
Wherein d be one between 0 with the constant between 1, be used for total frequency of utilization of balance and frequency of utilization in the T-T2 cycle;
After weights V calculating was finished, the moment T2 of last computation weights was changed to T constantly, and access times C2 is changed to 0 in the cycle; A threshold value p is set, if the weights V>p of certain character, then this character will be changed to buffer zone and be replaced that character with minimum weights.
Above-mentioned character Replacement Strategy is simultaneously with respect to total access times and nearest access times, therefore, this strategy not only can reflect the program locality principle, and can improve hit rate, thereby optimize character buffer area character, further improved the render speed of the display speed and the page of character.
Fig. 3 is the structural drawing of cache manager
In the present embodiment, as shown in Figure 3, whole character buffer area is safeguarded cache manager by cache manager:
One character management module is used for accepting from the character request of Rich Media's player and finds the corresponding characters lattice information: at first inquire about corresponding content at the character buffer area, if exist, then directly take out from the character buffer area; If do not exist, then from the local resource file, obtain; Promptly realize step of the present invention (2);
One upgrades administration module, is used for the character pattern information of some cycles ground polling character buffer area and it is upgraded; Because character pattern information change probability is less, so make cache manager according to the long cycle character pattern information in the fresh character buffer area more.During renewal, cache manager searching character buffer area with the character pattern information updating that needs upgrade, can guarantee the correctness that character shows like this.
One displacement administration module is used for the maintenance log table, sets up the original character buffer area, according to the content in the Replacement Strategy SUB substitute character buffer area of step (3).
More than the cooperative cooperating of three modules guaranteed character data in the character buffer accurately and that in using character shows is convenient and swift.
Fig. 4 has the character of NULI character buffer area on average to show the time comparison diagram.
In this enforcement,
This paper is that example is tested with the S900C of mobile phone Dopod of Windows Mobile platform, and the performance parameter of this mobile phone is as shown in the table:
Figure BSA00000262473900061
Table 1
Experimentize according to following steps: use in programming respectively and the mobile Rich Media player of unused word when according with buffer memory with this mobile phone, ask same Webpage, this page demonstration time is noted respectively, withdraw from player then, ask so repeatedly 20 times, test result is noted.
As shown in Figure 4, the display efficiency of setting up behind the character buffer area is very considerable, and the display effect outline of the English page is better than the Chinese page, because the probability outline that English page cache is replaced is less than the Chinese page; The buffer memory effect is good more under the many more situation of character, because this moment, cache contents approached a stable status more.Along with the increasing of page character display, the prolongation of time and the progressively increasing of buffer memory capacity, the character buffer memory effect of engine will be more and more obvious, and finally reach a more satisfactory show state [, thereby optimize the overall performance that mobile Rich Media player shows greatly.
Although above the illustrative embodiment of the present invention is described; so that the technician of present technique neck understands the present invention; but should be clear; the invention is not restricted to the scope of embodiment; to those skilled in the art; as long as various variations appended claim limit and the spirit and scope of the present invention determined in, these variations are conspicuous, all utilize innovation and creation that the present invention conceives all at the row of protection.

Claims (3)

1. the cache optimization method of a mobile Rich Media player is characterized in that, may further comprise the steps:
(1), between mobile Rich Media player and local resource file, the character buffer area is set, being used for buffer memory moves Rich Media's player character pattern information commonly used; Simultaneously, the wide high information that also has character pattern in the character buffer;
(2), the mobile Rich Media player character of the required demonstration of search in the character buffer area at first, if this character has been arranged in the character buffer area, demonstration then directly reads out the character pattern of storing in the character buffer area, wide, high information and sets type; Otherwise, from the local resource file, read and show;
(3), the displacement of character buffer area character
One cache manager is set, be used for safeguarding the log sheet of the used character pattern information of Rich Media's player decides which character of replacing buffer memory, and this log sheet content comprises: the moment T2 of character key word K, total access times C1, moment T1, weights V when using for the first time, last computation weights, access times C2 in the cycle; When a character was requested, access times C2 added 1 respectively in pairing total access times C1 of this character and cycle, and T calculates the weights V of each character constantly, the pairing weights of so a certain character:
V=d*C1/(T-T1)+(1-d)*C2/(T-T2);(0≤d≤1)
Wherein d be one between 0 with the constant between 1, be used for total frequency of utilization of balance and frequency of utilization in the T-T2 cycle;
After weights V calculating was finished, the moment T2 of last computation weights was changed to T constantly, and access times C2 is changed to 0 in the cycle;
A threshold value p is set, if the weights V>p of certain character, then this character will be changed to buffer zone and be replaced that character with minimum weights.
2. the cache optimization method of mobile Rich Media according to claim 1 player is characterized in that described cache manager also comprises:
One character management module is used for accepting from the character request of Rich Media's player and finds the corresponding characters lattice information: at first inquire about corresponding content at the character buffer area, if exist, then directly take out from the character buffer area; If do not exist, then from the local resource file, obtain;
One upgrades administration module, is used for the character pattern information of some cycles ground polling character buffer area and it is upgraded; Because character pattern information change probability is less, so make cache manager according to the long cycle character pattern information in the fresh character buffer area more.During renewal, cache manager searching character buffer area with the character pattern information updating that needs upgrade, can guarantee the correctness that character shows like this.
3. the cache optimization method of mobile Rich Media according to claim 1 player, it is characterized in that, in the character buffer of setting up, a Hash table set up in the character of mobile Rich Media player, content comprises key word Key in the list item, relevant character ID chain list index, it points to the lattice information of Key corresponding characters, and key word Key is representing the coding of character;
At first check this table during mobile Rich Media player searches character buffer area, if the character of request is present among this table, then will be dot matrix, the character of character is wide by the chain list index of correspondence, the high information of character reads out, otherwise searching request will be submitted to the local resource file and search for once.
CN201010276370.XA 2010-09-08 2010-09-08 Cache optimization method for mobile rich media player Expired - Fee Related CN101963953B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201010276370.XA CN101963953B (en) 2010-09-08 2010-09-08 Cache optimization method for mobile rich media player

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201010276370.XA CN101963953B (en) 2010-09-08 2010-09-08 Cache optimization method for mobile rich media player

Publications (2)

Publication Number Publication Date
CN101963953A true CN101963953A (en) 2011-02-02
CN101963953B CN101963953B (en) 2012-05-23

Family

ID=43516826

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201010276370.XA Expired - Fee Related CN101963953B (en) 2010-09-08 2010-09-08 Cache optimization method for mobile rich media player

Country Status (1)

Country Link
CN (1) CN101963953B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102208180A (en) * 2011-06-02 2011-10-05 福建新大陆通信科技股份有限公司 Method for rapidly displaying vector font by set top box (STB)
CN104025030A (en) * 2011-12-30 2014-09-03 英特尔公司 Reducing the domain shader/tessellator invocations
TWI795181B (en) * 2022-01-20 2023-03-01 網路家庭國際資訊股份有限公司 Web server and method for increasing fluency of web page

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101425863A (en) * 2007-10-30 2009-05-06 中兴通讯股份有限公司 Mobile terminal for supporting rich media service
CN101627609A (en) * 2006-08-21 2010-01-13 诺基亚公司 Caching directives for a file delivery protocol
US20100100636A1 (en) * 2001-01-12 2010-04-22 Kiran Venkatesh Hegde Generating and Providing Rich Media Presentations Optimized for a Device over a Network

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100100636A1 (en) * 2001-01-12 2010-04-22 Kiran Venkatesh Hegde Generating and Providing Rich Media Presentations Optimized for a Device over a Network
CN101627609A (en) * 2006-08-21 2010-01-13 诺基亚公司 Caching directives for a file delivery protocol
CN101425863A (en) * 2007-10-30 2009-05-06 中兴通讯股份有限公司 Mobile terminal for supporting rich media service

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
《ICCNMC"03》 20031231 Zhihui Lv etc. Study of Main Technology in Rich Media Grid Delivery 1-5 1-3 , 2 *
《计算机辅助设计与图形学学报》 20100831 张骥先等 移动设备上富媒体场景渲染优化策略 1272-1278 1-3 第22卷, 第8期 2 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102208180A (en) * 2011-06-02 2011-10-05 福建新大陆通信科技股份有限公司 Method for rapidly displaying vector font by set top box (STB)
CN102208180B (en) * 2011-06-02 2013-04-17 福建新大陆通信科技股份有限公司 Method for rapidly displaying vector font by set top box (STB)
CN104025030A (en) * 2011-12-30 2014-09-03 英特尔公司 Reducing the domain shader/tessellator invocations
CN104025030B (en) * 2011-12-30 2017-08-29 英特尔公司 Reduce method, device and equipment that domain tinter/tessellator is called
TWI795181B (en) * 2022-01-20 2023-03-01 網路家庭國際資訊股份有限公司 Web server and method for increasing fluency of web page

Also Published As

Publication number Publication date
CN101963953B (en) 2012-05-23

Similar Documents

Publication Publication Date Title
CN105205014B (en) A kind of date storage method and device
US9244980B1 (en) Strategies for pushing out database blocks from cache
CN104298680B (en) Data statistical approach and data statistics device
CN104731974A (en) Dynamic page loading method based on big data stream type calculation
CN102662869B (en) Memory pool access method in virtual machine and device and finger
EP3161662B1 (en) Optimized browser render process
US8495286B2 (en) Write buffer for improved DRAM write access patterns
CN106681891A (en) Method and device for adjusting log levels in Java application system
US20110258202A1 (en) Concept extraction using title and emphasized text
CN106569960A (en) Last stage cache management method for mixed main store
US9158758B2 (en) Retrieval of prefix completions by way of walking nodes of a trie data structure
CN103150395A (en) Directory path analysis method of solid state drive (SSD)-based file system
CN103488523A (en) Page access method, page access device and server
CN106202224B (en) Search processing method and device
CN101963953B (en) Cache optimization method for mobile rich media player
CN104504076A (en) Method for implementing distributed caching with high concurrency and high space utilization rate
CN104166649B (en) Caching method and equipment for search engine
CN105138649A (en) Data search method and device and terminal
CN111858612B (en) Data accelerated access method and device based on graph database and storage medium
CN106201918A (en) A kind of method and system quickly discharged based on big data quantity and extensive caching
CN103841168A (en) Data copy updating method and metadata server
CN111026682B (en) Data access method and device of board card chip and computer readable storage medium
CN111459848B (en) File fragment sorting method and device, storage medium and electronic equipment
CN111061508B (en) Java card and performance optimization method thereof
CN110765237B (en) Document processing method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20120523

Termination date: 20120908