CN103399950B - A kind of apparatus and method for solving Web application memory occupation problem - Google Patents

A kind of apparatus and method for solving Web application memory occupation problem Download PDF

Info

Publication number
CN103399950B
CN103399950B CN201310360030.9A CN201310360030A CN103399950B CN 103399950 B CN103399950 B CN 103399950B CN 201310360030 A CN201310360030 A CN 201310360030A CN 103399950 B CN103399950 B CN 103399950B
Authority
CN
China
Prior art keywords
multimedia resource
page
module
community
multimedia
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.)
Active
Application number
CN201310360030.9A
Other languages
Chinese (zh)
Other versions
CN103399950A (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.)
Jiangsu Wisedu Information Co Ltd
Original Assignee
Jiangsu Wisedu Information 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 Jiangsu Wisedu Information Co Ltd filed Critical Jiangsu Wisedu Information Co Ltd
Priority to CN201310360030.9A priority Critical patent/CN103399950B/en
Publication of CN103399950A publication Critical patent/CN103399950A/en
Application granted granted Critical
Publication of CN103399950B publication Critical patent/CN103399950B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

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

Abstract

The invention discloses a kind of apparatus and method for solving Web application memory occupation problem, its major programme is by capture page navigation event, and when page navigation occurs, multimedia resource in history page is pointed to self-defining little resource file, this little resource file includes initial multimedia resource path information, when navigating to history page, then multimedia resource is pointed to the initial multimedia resource path being saved in little resource file.The multimedia resource of history page is replaced foundation on the basis of adding up page access number of times.Present invention utilizes browser kernel internal memory releasing mechanism, by substitute mode, former multimedia resource is lacked and quote basis, browser kernel is automatically releasable and lacks the multimedia resource quoting basis, thus releasing memory, final solution Web/Hybrid application memory occupation problem.Compared to amendment browser kernel, the present invention ensures the independence of browser kernel, robustness and integrality.

Description

A kind of apparatus and method for solving Web application memory occupation problem
Technical field
The present invention relates to Web/Hybrid application.
Background technology
The exploitation of existing Mobile solution mainly has Three models: Web App, Native App and Hybrid App.Web App is system and the application of sing on web.Native App is the application program utilizing operating system native program to write.And Hybrid App is then Web App and the mixed mode of Native App, the application journey i.e. jointly built by native program and Web Sequence.Web App and Hybrid App is required for the front-end presentation tool based on browser kernel.General browser kernel is all There is the function of Brower History.The content that this function will browse, including document, picture etc. is cached, to reduce next time Access the flow use that same content is brought, alleviate server stress, improve surfing simultaneously.When spatial cache is inadequate Wait, use LRU (Least Recently Used) algorithm Free up Memory, in order to deposit new content and enter caching.In PC or notes In basis, this function of browser generally uses hard disk as caching medium;And (smart mobile phone or flat board are electric in a mobile device Brain), generally using internal memory as caching medium.The content that Web App and Hybrid App browses the most all contains substantial amounts of many matchmakers Body resource, such as picture, sound, video etc..This does not deposits using the hard disk of hundreds of G size as caching medium in PC or notebook In what problem.But internal memory will be there is as caching medium in the internal memory only having 2G or 1G or the most hundreds of M in mobile device The problem taken in a large number by these resources.Along with the passage of the time of use, memory consumption can be increasing, again less than releasing in time Putting, can cause such as applying response speed slack-off, even application is dodged and is moved back or the situation of machine of delaying.
Summary of the invention
Problem to be solved by this invention is to solve the problem of EMS memory occupation in Web/Hybrid application.
For solving the problems referred to above, the scheme that the present invention uses is as follows:
A kind of device for solving Web application memory occupation problem, provides including page events trapping module and multimedia Source replacement module;Described page events trapping module is used for capturing Web page navigation event and obtaining page data;Described Multimedia resource replacement module analyzes multimedia resource in history page when being used for Web page navigation event or exit event generation And self-defining community/multimedia resource file is pointed in its multimedia resource path.
Further, the described device being used for solving Web application memory occupation problem can also include community/multimedia resource File generating module and multimedia resource recovery module;Described community/multimedia resource file generation module is for dynamically generating bag Community/multimedia resource file containing initial multimedia resource path;Described multimedia resource recovery module is in Web page Community/multimedia resource literary composition when face navigation event occurs and when current page is history page, multimedia resource in the page pointed to Part is reduced into initial multimedia resource path.
Further, the described device for solving Web application memory occupation problem it can also include that resource replaces plan Slightly control module, described resource replacement policy control module is for judging whether to need the multimedia resource by history page to replace Change self-defining community/multimedia resource file into.Further, described resource replacement policy control module includes page access Frequency statistics module and resource Replacement Decision module;Described page access frequency statistics module is used for adding up page access Number;Described resource Replacement Decision module is replaced for judging whether to multimedia resource according to page access number of times.
A kind of method for solving Web application memory occupation problem, comprises the steps:
S1: capture Web page navigation event and acquisition page data;
When S2:Web page navigation event or the event that exits occur, multimedia resource by its many matchmakers in the analysis of history page Body resource path points to self-defining community/multimedia resource file.
Further, the described method being used for solving Web application memory occupation problem, it is also possible to comprise the steps:
S20: dynamically generate the community/multimedia resource file including initial multimedia resource path;
S3:Web page navigation event occurs to judge whether current page is history page;
When S4: current page is history page, the community/multimedia resource file that multimedia resource in the page points to is reduced into Initial multimedia resource path.
Further, the described method for solving Web application memory occupation problem, it can also include:
S21: judge whether to need the multimedia resource in history page replaces to self-defining community/multimedia resource literary composition Part.
Described step S21 includes:
S211: statistics page access number of times;
S212: judge whether to multimedia resource according to page access number of times and replace.
A kind of machine readable media, on this computer-readable recording medium, storage has instruction set, when this instruction set is performed so that This machine can perform the above-mentioned method for solving Web application memory occupation problem.
The technique effect of the present invention:
1, present invention utilizes browser kernel internal memory releasing mechanism, make former multimedia resource lack by the way of replacement Quote basis less so that browser kernel is automatically releasable and lacks the multimedia resource quoting basis, thus releasing memory, last solution Certainly Web/Hybrid application memory occupation problem.
2, the enforcement means framework of the present invention is outside browser kernel, compare with revise browser kernel solve internal memory account for By the method for problem, this invention ensures that the independence of browser kernel, robustness and integrality.
3, being multimedia resource due to present invention release, these resources typically require substantial amounts of memory source, and internal memory The little content of text of occupancy is retained rather than is merely discharged together by full content, and this delivery mode strengthens Consumer's Experience, application operating is more smooth, Consumer's Experience is the most comfortable.
4, the present invention can realize the combination of two kinds of internal memory release strategies.Based on the present invention, developer can depend on According to applying the internal memory release strategy of self specific adjusted rather than using lru algorithm monotonously, can be at browser kernel LRU Self-defined internal memory release strategy on the basis of algorithm, so that developer can develop more preferable Mobile solution.
Detailed description of the invention
Below the summary of the invention of the present invention is described in further details.
The invention mainly comprises five modules: page events trapping module, multimedia resource replacement module, community/multimedia provide Source file generation module, multimedia resource recovery module and resource replacement policy control module.In the case of simplest, it is only necessary to Two modules: page events trapping module, multimedia resource replacement module.Separately below between these modules and module Relation describes in detail.
1, page events trapping module
Page events trapping module is used for capturing Web page navigation event and obtaining page data.Here page navigation Event includes advancing, retreats, back to homepage, target goal address, exits the events such as navigation.In the input of this module is browser The page data carried in the page navigation event of core offer and page navigation event.It is output as the page in page navigation event Face data pass to multimedia resource replacement module and multimedia resource recovery module.Concrete handling process be referred to as Under:
Step11: receive browser kernel page navigation event and page data.
Step12: judge whether the page of historical viewings.If there is turning Step13, otherwise turn Step15.
Step13: by historical viewings page data transmission to by resource replacement policy control module.
Step14: after resource replacement policy control module analyzes and processes, it would be desirable to carry out the history page of resource replacement Data are transferred to multimedia resource replacement module, then are turned Step15 by after the process of multimedia resource replacement module.
Step15: judge that whether page navigation event is for exiting event.If the event that exits then terminates, otherwise turn Step16。
Step16: judge that current page is whether in the historical viewings page.If it is, these history page data are transmitted Process to multimedia resource recovery module.
Above-mentioned flow process shows that this module is replaced with multimedia resource replacement module, multimedia resource recovery module and resource Relation between strategic control module.Above-mentioned flow process is a kind of embodiment of this module, one skilled in the art will appreciate that also There is other embodiments, such as, above-mentioned Step14 can put into resource replacement policy control module and process.Simplest Under situation, above-mentioned Step13 can be made into " by historical viewings page data transmission to multimedia resource replacement module " and omit Subsequent step just can solve problem to be solved by this invention.
2, multimedia resource replacement module
Multimedia resource replacement module is used for Web page navigation event or exits when event occurs many in analysis history page Self-defining community/multimedia resource file is also pointed in its multimedia resource path by media resource." Web page navigation event or move back When outgoing event occurs " illustrate the relation between this module and page events trapping module, and capture at aforesaid page events Module has been described.The input of this module is page data, specifically Web page file.Output is amended Page data.Here multimedia resource refers to picture, audio frequency, video, even can be with other the number with bigger internal memory According to.Here self-defining community/multimedia resource file can be picture, the audio or video minimized.The most a size of 1 The picture file of × 1 or the audio or video file of only 1 second, even can also is that file that file size is 0 or Text.Community/multimedia resource file can be with predefined, it is also possible to dynamically generate.Multimedia resource replacement process mainly leads to Cross the multimedia resource searched in history page data to realize.Owing to Web page file is generally html file or XML file. Therefore this process is namely by specifically marking, such as in lookup html file or XML file<bgsound>,<img >,<embed>, the mark such as<object>.Such process belongs to prior art for a person skilled in the art, and it is specifically real The most not difficulty.
It should be noted that the input of this module can be single history page data, it is also possible to be multiple history page Data.
3, community/multimedia resource file generation module
Community/multimedia resource file generation module includes little many matchmakers of initial multimedia resource path for dynamically generating Body resource file.The input of this module is initial multimedia resource path.It is output as including initial multimedia resource path Community/multimedia resource file.The function of this module needs and multimedia resource recovery module synergy.Aforementioned multimedia resource Replacement module illustrating, community/multimedia resource file can be with predefined, it is also possible to dynamically generate.But " dynamically giving birth in this explanation Become " it is not equivalent to the implication in this module." comprise because the community/multimedia resource file generation module of this module refers exclusively to generate There is the community/multimedia resource file of initial multimedia resource path "." dynamically generate " and simply indicated that this module provides with multimedia Relation between the replacement module of source: this module is called by multimedia resource replacement module, output is by multimedia resource replacement module Use.The multimedia resource that this module makes multimedia resource replacement module replace in history page is community/multimedia resource file After, multimedia resource recovery module according to the initial multimedia resource path comprised in community/multimedia resource file again by history The page returns to the state before amendment.Therefore the community/multimedia resource file that this module generates is actually text, text Content be initial multimedia resource path.This document can't be processed owing to browser kernel is actual, the most such place Reason mode has no effect on the browser kernel process to file.
4, multimedia resource recovery module
Multimedia resource recovery module is used for when Web page navigation event occurs and when current page is history page will The community/multimedia resource file that in the page, multimedia resource points to is reduced into initial multimedia resource path.Its input is page number According to, it is output as amended page data." by page when Web page navigation event occurs and when current page is history page In face " indicate the call relation between this module and page events trapping module, and at aforesaid page events trapping module In have been described.The processing procedure of this module is identical with multimedia resource replacement module.But concrete content is different.Due to front Stating the multimedia resource pointed by the history page through processing for multimedia resource replacement module is local community/multimedia money Source file, and this community/multimedia resource file has comprised initial multimedia resource path.Therefore, the process data that this module is concrete Content be only by history page data point to community/multimedia resource file remodify into community/multimedia resource file In the initial multimedia resource path that comprises.
5, resource replacement policy control module
Resource replacement policy control module is used for judging whether to need to be replaced to by the multimedia resource in history page certainly The community/multimedia resource file of definition.The foundation judging whether replacement of resource replacement policy control module has a variety of, such as Aforesaid lru algorithm.Simplest situation is that the multimedia resource in all of history page replaces to self-defining little many matchmakers Body resource file.In this module, user can set self-defining rule and decide whether to be replaced.Such as user can Never replacing setting some webpage, and some webpages are dynamic page, image content always real-time change, such picture provides Source just retains not necessarily in history, can replace to community/multimedia resource file each time and release to realize maximized internal memory Put.User can also be realized by self-defining algorithm.Such as by adding up the access times of the page, then according to page access Number of times determines the need for replacing.Following embodiment describes this access times by the statistics page in detail and according to the page Access times determine the need for replacement and realize this functions of modules.
Under this embodiment, this module includes page access frequency statistics module and resource Replacement Decision module.The page is visited Ask that frequency statistics module is called by aforementioned page events trapping module.When browsers page navigation, page access frequency statistics The current page of browser directed is counted and preserves by module.Then resource Replacement Decision module judges according to page access number of times Whether carry out multimedia resource replacement.Concrete " judging whether to multimedia resource according to page access number of times replace " also has A variety of methods.Such as threshold method, page access number of times is less than a fixed number, is then replaced.For another example, to history page according to Page access number of times is ranked up, and most front 10 pages of page access number of times are not replaced, and other pages all replace Change.
In foregoing summary, each step of method is corresponding with each functional module aforesaid, and by its corresponding module Realize: step S1 correspondence page navigation event capturing module;Step S2 correspondence multimedia resource replacement module;Step S20 is corresponding Community/multimedia resource file generation module;Step S21 correspondence resource replacement policy control module;Multimedia money that step S4 is corresponding Source recovery module;Step S211 correspondence page access frequency statistics module, step S212 correspondence resource Replacement Decision module.Step S3 is corresponding aforesaid Step16.It will be appreciated by those skilled in the art that step S3 can also be real in multimedia resource recovery module Existing.Because each step of the method is described in aforesaid modules, it is not repeated.
It should be noted that in aforesaid technical scheme, the present invention is used for solving Web application memory occupation problem.This area Artisans understand that, it is suitable for solve Hybrid application memory occupation problem.Aforementioned invention problem to be solved And technique effect have also been made corresponding description.Therefore the present invention is used for solving Hybrid application memory occupation problem and falls within Protection scope of the present invention.

Claims (6)

1. the device being used for solving Web application memory occupation problem, it is characterised in that it includes that page events captures mould Block, multimedia resource replacement module, community/multimedia resource file generation module and multimedia resource recovery module;The described page Event capturing module is used for capturing Web page navigation event and obtaining page data;Described multimedia resource replacement module is used Multimedia resource is analyzed in history page when event occurs and by its multimedia resource path in Web page navigation event or exit Point to self-defining community/multimedia resource file;Described community/multimedia resource file generation module includes for dynamically generating The community/multimedia resource file of initial multimedia resource path;Described multimedia resource recovery module is for leading in Web page The community/multimedia resource file pointed to by multimedia resource in the page when boat event occurs and when current page is history page is also Former one-tenth initial multimedia resource path.
2. the device for solving Web application memory occupation problem as claimed in claim 1, it is characterised in that it also includes Resource replacement policy control module, described resource replacement policy control module is for judging whether to need many in history page Media resource replaces to self-defining community/multimedia resource file.
3. the device for solving Web application memory occupation problem as claimed in claim 2, it is characterised in that described money Source replacement policy control module includes page access frequency statistics module and resource Replacement Decision module;Described page access frequency Rate statistical module is used for adding up page access number of times;Described resource Replacement Decision module is for judging according to page access number of times Whether carry out multimedia resource replacement.
4. the method being used for solving Web application memory occupation problem, it is characterised in that it comprises the steps:
S1: capture Web page navigation event and acquisition page data;
When S2:Web page navigation event or the event that exits occur, multimedia resource its multimedia is provided in the analysis of history page Source path points to self-defining community/multimedia resource file;Described self-defining community/multimedia resource file is dynamically generated and comprises There is the community/multimedia resource file of initial multimedia resource path;
S3:Web page navigation event occurs to judge whether current page is history page;
When S4: current page is history page, the community/multimedia resource file that multimedia resource in the page points to is reduced into original Multimedia resource path.
5. the method for solving Web application memory occupation problem as claimed in claim 4, it is characterised in that it also includes:
S21: judge whether to need to replace to the multimedia resource in history page self-defining community/multimedia resource file.
6. the method for solving Web application memory occupation problem as claimed in claim 5, it is characterised in that described step S21 includes:
S211: statistics page access number of times;
S212: judge whether to multimedia resource according to page access number of times and replace.
CN201310360030.9A 2013-08-19 2013-08-19 A kind of apparatus and method for solving Web application memory occupation problem Active CN103399950B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310360030.9A CN103399950B (en) 2013-08-19 2013-08-19 A kind of apparatus and method for solving Web application memory occupation problem

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310360030.9A CN103399950B (en) 2013-08-19 2013-08-19 A kind of apparatus and method for solving Web application memory occupation problem

Publications (2)

Publication Number Publication Date
CN103399950A CN103399950A (en) 2013-11-20
CN103399950B true CN103399950B (en) 2016-08-31

Family

ID=49563578

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310360030.9A Active CN103399950B (en) 2013-08-19 2013-08-19 A kind of apparatus and method for solving Web application memory occupation problem

Country Status (1)

Country Link
CN (1) CN103399950B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103995884A (en) * 2014-05-29 2014-08-20 北京中电普华信息技术有限公司 Hybrid application page switching method and system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
NO325628B1 (en) * 2006-09-20 2008-06-30 Opera Software Asa Procedure, computer program, transcoding server and computer system to modify a digital document
CN101221580A (en) * 2008-01-03 2008-07-16 中兴通讯股份有限公司 Method for improving page layout display performance of embedded browser
CN102479249A (en) * 2010-11-26 2012-05-30 中国科学院声学研究所 Method for eliminating cache data of memory of embedded browser
CN102867041B (en) * 2012-09-03 2015-07-22 东莞宇龙通信科技有限公司 Terminal and storage space management method

Also Published As

Publication number Publication date
CN103399950A (en) 2013-11-20

Similar Documents

Publication Publication Date Title
CN105224444B (en) Log generation method and device
CN110109844A (en) System conformance in the classification of distributive image process device
CN109684575A (en) Processing method and processing device, storage medium, the computer equipment of web data
DE112013002069T5 (en) High Power Link Coherence Protocol
WO2015006237A1 (en) Method and device for displaying a web page
CN106817388A (en) The system that virtual machine, host obtain the method, device and access data of data
CN104782136A (en) Processing video data in a cloud
CN103258058B (en) Page display method and system and browser
JP2019194902A (en) Information processing method, device, system, and storage medium
CN106878370A (en) The update method and equipment of a kind of local cache
CN110196759A (en) Distributed transaction processing method and device, storage medium and electronic device
CN108682010A (en) Processing method, processing equipment, client and the server of vehicle damage identification
CN103095807A (en) Method and system of displaying video download progress of front-end equipment in real time
CN110427864B (en) Image processing method and device and electronic equipment
CN103399950B (en) A kind of apparatus and method for solving Web application memory occupation problem
CN107729541A (en) A kind of data processing method, device and computer-readable recording medium
CN104067308A (en) Object selection in an image
CN116419049A (en) Image processing method, image processing system, device and electronic equipment
CN107391163A (en) page data loading method, device and application in mobile terminal
CN112434746A (en) Pre-labeling method based on hierarchical transfer learning and related equipment thereof
CN106970872A (en) Information buries point methods and device
CN108885621A (en) For accelerating the content caching of load time
CN107515724A (en) For the method and apparatus for the input and output for reproducing storage system
CN107766486A (en) Method, apparatus, computer-readable recording medium and the storage control of randomly drawing sample data
CN106547906A (en) Content of pages generation method, device and terminal

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 211100, No. 100, general road, Jiangning Economic Development Zone, Jiangsu, Nanjing

Applicant after: JIANGSU WISEDU EDUCATION INFORMATION TECHNOLOGY CO., LTD.

Address before: 211100, No. 100, general road, Jiangning Economic Development Zone, Jiangsu, Nanjing

Applicant before: Jiangsu Wisedu Information Technology Co., Ltd.

CB03 Change of inventor or designer information

Inventor after: Guo Chao

Inventor after: Yu Jinghua

Inventor after: Liao Jun

Inventor after: Chen Ying

Inventor after: Yan Min

Inventor after: Yang Yarong

Inventor after: Yang Hua

Inventor before: Chen Ying

Inventor before: Yan Min

Inventor before: Yang Yarong

Inventor before: Yang Hua

COR Change of bibliographic data
C14 Grant of patent or utility model
GR01 Patent grant
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20131120

Assignee: Jiangsu Zhituo Education Technology Co., Ltd.

Assignor: Jiangsu Wisedu Information Co., Ltd.

Contract record no.: 2018320000365

Denomination of invention: Device and method for solving Web application memory usage problem

Granted publication date: 20160831

License type: Exclusive License

Record date: 20181210

EE01 Entry into force of recordation of patent licensing contract