CN104021203B - It is a kind of for accessing the method and device of webpage - Google Patents
It is a kind of for accessing the method and device of webpage Download PDFInfo
- Publication number
- CN104021203B CN104021203B CN201410270274.2A CN201410270274A CN104021203B CN 104021203 B CN104021203 B CN 104021203B CN 201410270274 A CN201410270274 A CN 201410270274A CN 104021203 B CN104021203 B CN 104021203B
- Authority
- CN
- China
- Prior art keywords
- webpage
- data
- content
- target
- memory
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/957—Browsing optimisation, e.g. caching or content distillation
- G06F16/9574—Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The embodiment of the invention discloses a kind of for accessing the method and device of webpage, is related to network communication technology field, this method comprises: obtaining the mark of target webpage;According to the mark of target webpage, it determines and is stored in the webpage information list of memory with the presence or absence of the corresponding webpage information of target webpage, wherein, webpage information list are as follows: in browser startup stage, it is generated according to the webpage information of part or all of webpage stored in hard disk, is included at least in webpage information: the storage address of the content-data of the mark of webpage and webpage in a hard disk;In webpage information list in the case where webpage information corresponding there are target webpage, the content-data of target webpage is obtained according to the corresponding webpage information of target webpage in webpage information list, and target webpage is shown according to content-data obtained.Webpage is accessed using scheme provided in an embodiment of the present invention, overhead is smaller, can be improved response speed and user experience effect when accessing webpage by browser.
Description
Technical field
It is the present invention relates to network communication technology field, in particular to a kind of for accessing the method and device of webpage.
Background technique
When user accesses webpage by browser, a certain webpage may be repeatedly accessed, if access the webpage every time,
The source code of webpage is obtained from network side, wastes network flow.For above situation, in the prior art, will generally access
The source code of webpage is stored into hard disk, when user accesses the webpage again, whether there is the webpage in inquiry hard disk first
Not out of date source code, and if it exists, the source code that the webpage is directly obtained from hard disk, without being somebody's turn to do again from network side
The source code of webpage.However, overhead is larger when inquiring data in a hard disk or frequently reading data, browser is easily reduced
Response speed influences user experience effect.
Summary of the invention
The embodiment of the invention discloses a kind of for accessing the method and device of webpage, accesses net by browser to improve
Response speed and user experience effect when page.
In order to achieve the above objectives, the embodiment of the invention discloses a kind of methods for accessing webpage, which comprises
Obtain the mark of target webpage;
According to the mark of the target webpage, determines and be stored in the webpage information list of memory with the presence or absence of the target
The corresponding webpage information of webpage, wherein the webpage information list are as follows: in browser startup stage, stored according in hard disk
Some or all of the webpage information of webpage generate, include at least in the webpage information: the mark of webpage and the content of webpage
The storage address of data in a hard disk;
In the webpage information list in the case where webpage information corresponding there are the target webpage, according to the mesh
The corresponding webpage information of mark webpage obtains the content-data of the target webpage, and according to content-data obtained displaying
Target webpage.
Optionally, in the webpage information list in the case where webpage information corresponding there is no the target webpage,
Further include:
The source code of the target webpage is obtained from web page server;
Parse the source code of the target webpage;
According to parsing result, the target webpage is shown.
Optionally, in the case where the webpage information list is generated according to part stored in hard disk webpage information,
Described before the source code that web page server obtains the target webpage, further includes:
According to the mark of the target webpage, the content-data of the corresponding webpage of webpage information list described in hard disk is determined
Except content-data in, if there are the corresponding content-datas of the target webpage;
If it is, obtaining the corresponding content-data of the target webpage, and according to content-data obtained displaying
Target webpage;
If it has not, obtaining the source code of the target webpage from web page server.
Optionally, after the source code of the parsing target webpage, further includes:
Using the source code of the source code of the target webpage or target webpage data obtained after parsing as described in
The content-data storage of target webpage is in memory.
Optionally, obtained after parsing in the source code by the source code of the target webpage or the target webpage
Data as the target webpage content-data storage in memory after, further includes:
The corresponding webpage information of the target webpage is updated to the webpage information list.
Optionally, obtained after parsing in the source code by the source code of the target webpage or the target webpage
Data as the target webpage content-data storage in memory before, further includes:
Whether detection free memory resource is less than preset threshold value;
If it is, rule is written according to preset file, hard disk is written into the content-data that webpage has been stored in memory, with
The memory source that the content-data of webpage occupies has been stored in releasing memory;
If it has not, the source code of the source code of the target webpage or target webpage data obtained after parsing are made
For the target webpage content-data storage in memory.
Optionally, described that rule is written according to preset file, the content-data that webpage has been stored in memory is written hard
Disk, to have stored the memory source that the content-data of webpage occupies in releasing memory, comprising:
Rule is written according to preset file, determines the content-data of the webpage of hard disk to be written;
Judge in hard disk with the presence or absence of content-data corresponding with identified content-data;
If it is, identified content-data expired time be later than in hard disk it is corresponding with identified content-data
In the case where the expired time of content-data, with corresponding with identified content-data in identified content-data replacement hard disk
Content-data;
If it has not, content-data determined by storing in a hard disk;
The memory source that content-data determined by discharging occupies.
Optionally, the preset file write-in rule, comprising:
The sequence of the time that webpage information is not used by memory from long to short;Or
The sequence of webpage information storage time from long to short in memory;Or
The correlation of webpage information and the target webpage has low to high sequence in memory;Or
Sequence of the webpage information apart from expired time from the near to the remote in memory.
Optionally, the content-data of the target webpage, comprising: the source code of target webpage or the source generation to target webpage
Code data obtained after parsing.
In order to achieve the above objectives, the embodiment of the invention discloses a kind of for accessing the device of webpage, and described device includes:
Banner obtains module, for obtaining the mark of target webpage;
Webpage information determining module determines the webpage information for being stored in memory for the mark according to the target webpage
It whether there is the corresponding webpage information of the target webpage in list, wherein the webpage information list are as follows: start in browser
Stage generates according to the webpage information of part or all of webpage stored in hard disk, includes at least in the webpage information: net
The mark of page and the content-data storage address in a hard disk of webpage;
First web page display module, for there are the corresponding webpage letters of the target webpage in the webpage information list
In the case where breath, the content-data of the target webpage is obtained according to the corresponding webpage information of the target webpage, and according to institute
The content-data of acquisition shows the target webpage.
It is optionally, described for accessing the device of webpage further include:
Source code obtains module, for obtaining the source code of the target webpage from web page server;
Source code parsing module, for parsing the source code of the target webpage;
Second web page display module, for showing the target webpage according to parsing result;
In the webpage information list in the case where webpage information corresponding there is no the target webpage, the webpage
Information determination module triggers the source code and obtains module, obtains source code.
Optionally, described for accessing the device of webpage further include: content-data determining module and third web page display mould
Block;
The content-data determining module is used in the webpage information list according to part stored in hard disk webpage
In the case that information generates, before the source code obtains module acquisition source code, according to the mark of the target webpage, really
Determine in the content-data except the content-data of the corresponding webpage of webpage information list described in hard disk, if there are the targets
The corresponding content-data of webpage shows target webpage if it is, triggering the third web page display module, if it has not, triggering institute
It states source code and obtains module, obtain source code;
The third web page display module, for obtaining the corresponding content-data of the target webpage, and according to being obtained
Content-data show the target webpage to user.
It is optionally, described for accessing the device of webpage further include:
Content-data storage module is used for after the source code parsing module analysis source code, by the target network
The source code data obtained after parsing of the source code or the target webpage of page are deposited as the content-data of the target webpage
It is stored in memory.
It is optionally, described for accessing the device of webpage further include:
Information list update module, for depositing the content-data of the target webpage in the content-data storage module
After being stored in memory, the corresponding webpage information of the target webpage is updated to the webpage information list.
Optionally, described for accessing the device of webpage further include: memory source detection module and memory source discharge mould
Block;
The memory source detection module, in the content-data storage module by the content number of the target webpage
According to before being stored in memory, whether detection free memory resource is less than preset threshold value, if it is, triggering the memory source
Release module, releasing memory resource, if it has not, triggering the content-data storage module, storage content data;
The memory source release module will store webpage for rule to be written according to preset file in memory
Hard disk is written in content-data, to have stored the memory source that the content-data of webpage occupies in releasing memory.
Optionally, the memory source release module, comprising: content-data determines that submodule, content-data judge submodule
Block, content-data replacement submodule, content-data storage submodule and memory source discharge submodule;
The content-data determines submodule, for rule to be written according to preset file, determines the net of hard disk to be written
The content-data of page;
The content-data judging submodule, for judging in hard disk with the presence or absence of corresponding with identified content-data
Content-data replaces content-data, if it has not, triggering the content number if it is, triggering the content-data replacement submodule
According to sub-module stored, storage content data;
The content-data replaces submodule, for being later than in hard disk and institute in the expired time of identified content-data
In the case where the expired time of the corresponding content-data of determining content-data, with identified content-data replacement hard disk in
The corresponding content-data of identified content-data;
The content-data storage submodule, for storing identified content-data in a hard disk;
The memory source discharges submodule, the memory source occupied for discharging identified content-data.
Optionally, the preset file write-in rule, comprising:
The sequence of the time that webpage information is not used by memory from long to short;Or
The sequence of webpage information storage time from long to short in memory;Or
The correlation of webpage information and the target webpage has low to high sequence in memory;Or
Sequence of the webpage information apart from expired time from the near to the remote in memory.
Optionally, the content-data of the target webpage, comprising: the source code of target webpage or the source generation to target webpage
Code data obtained after parsing.
As seen from the above, in scheme provided in an embodiment of the present invention, which is stored in memory, into
When row web page access, first according to the mark of target webpage, inquire corresponding with the presence or absence of target webpage in the webpage information list
Webpage information, and if it exists, the content-data of target webpage is obtained according to the webpage information in the webpage information list, and according to institute
The content-data of acquisition shows the target webpage.Compared with inquiring in a hard disk or reading data, inquires or read in memory
Data speed is very fast, and overhead is smaller, can be improved response speed and user experience when accessing webpage by browser
Effect.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with
It obtains other drawings based on these drawings.
Fig. 1 is provided in an embodiment of the present invention for accessing the first flow diagram of the method for webpage;
Fig. 2 is provided in an embodiment of the present invention for accessing second of flow diagram of the method for webpage;
Fig. 3 is provided in an embodiment of the present invention for accessing the third flow diagram of the method for webpage;
Fig. 4 is provided in an embodiment of the present invention for accessing the 4th kind of flow diagram of the method for webpage;
Fig. 5 is provided in an embodiment of the present invention for accessing the 5th kind of flow diagram of the method for webpage;
Fig. 6 is provided in an embodiment of the present invention for accessing the first structural schematic diagram of the device of webpage;
Fig. 7 is provided in an embodiment of the present invention for accessing second of structural schematic diagram of the device of webpage;
Fig. 8 is provided in an embodiment of the present invention for accessing the third structural schematic diagram of the device of webpage;
Fig. 9 is provided in an embodiment of the present invention for accessing the 4th kind of structural schematic diagram of the device of webpage;
Figure 10 is provided in an embodiment of the present invention for accessing the 5th kind of structural schematic diagram of the device of webpage.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
Fig. 1 is provided in an embodiment of the present invention for accessing the first flow diagram of the method for webpage, this method packet
It includes:
S101: the mark of target webpage is obtained.
For example, URL (the system for the target webpage that the mark of above-mentioned target webpage can input for user in text input area
One Resource Locator) etc..
S102: it according to the mark of target webpage, determines and is stored in the webpage information list of memory with the presence or absence of target network
The corresponding webpage information of page.
Wherein, above-mentioned webpage information, the content-data of mark and webpage including at least webpage, webpage information list can
With include: webpage mark and webpage content-data storage address in a hard disk, which can be
Browser startup stage generates according to the webpage information of part or all of webpage stored in hard disk.
Certain the application is not defined content included in webpage information and webpage information list.
The content-data of above-mentioned target webpage can be the source code of target webpage, be also possible to the source generation to target webpage
Code data obtained after parsing.
In addition, can also include the expired time of webpage in above-mentioned webpage information.In practical application, due to same
Banner can correspond to the web page source code of multiple and different versions, therefore, according to the mark of target webpage, query webpage information column
In table when webpage information corresponding with the presence or absence of target webpage, a plurality of webpage letter corresponding with the target webpage may be inquired
Breath, at this point, can further be screened again according to the expired time of webpage.
Those skilled in the art are it is understood that reading the overhead of data from memory will be much smaller than from hard
Disk reads the overhead of data, so, in a preferred embodiment of the invention, in order to improve the speed of reading data,
It can also include the content-data of webpage in above-mentioned webpage information list.
S103: in webpage information list in the case where webpage information corresponding there are target webpage, according to target webpage
Corresponding webpage information obtains the content-data of target webpage, and shows target webpage according to content-data obtained.
From the foregoing it will be appreciated that web data can be the source code of target webpage, it is also possible to the source code to target webpage
Data obtained after parsing.
If web data is the source code of target webpage, according to the corresponding webpage information of target webpage from memory or hard disk
After the middle source code for obtaining target webpage, which is parsed, and target webpage is shown according to parsing result.
If web data is to the source code of target webpage data obtained after parsing, according to the corresponding net of target webpage
Page information directly shows the target webpage to user after the web data for obtaining target webpage in memory or hard disk,
As it can be seen that if necessary to repeatedly access the target webpage process for obtaining web page source code from network side can be saved, and to webpage
The process that source code is parsed can accelerate webpage access speed.
As seen from the above, in scheme provided in this embodiment, webpage information list is stored in memory, is carrying out webpage
When access, first according to the mark of target webpage, inquire in the webpage information list with the presence or absence of the corresponding webpage letter of target webpage
Breath, and if it exists, the content-data of target webpage is obtained according to the webpage information in the webpage information list, and according to obtained
Content-data shows the target webpage.Compared with inquiring data in a hard disk, inquiry data speed is very fast in memory, and system
Expense is smaller, can be improved response speed and user experience effect when accessing webpage by browser.
Optionally, in above-mentioned S102, if the webpage information of target webpage, such as Fig. 2 are not present in webpage information list
It is shown, it can execute:
S104: the source code of target webpage is obtained from web page server.
The source code that target webpage is obtained from web page server can be and be visited by sending target webpage to web page server
Ask request, and receive web page server according to received target webpage access request feedback target webpage source code side
Formula is realized.
S105: the source code of target webpage is parsed.
S106: according to parsing result, target webpage is shown.
Optionally, in one particular embodiment of the present invention, referring to Fig. 3, if webpage information list is according to hard disk
In the information list that generates of stored webpage information, this method can also include:
S107: according to the mark of target webpage, determine the corresponding webpage of webpage information list in hard disk content-data it
In outer content-data, if there are the corresponding content-datas of target webpage, if it is, executing S108, otherwise, execute S104.
It,, can in webpage information list to guarantee that system operates normally in the case where memory source anxiety in practical application
Only to include the webpage information of stored part webpage in hard disk.Therefore, if do not found in webpage information list
The information of target webpage can also be searched again in a hard disk.
S108: the corresponding content-data of target webpage is obtained, and target webpage is shown according to content-data obtained.
As seen from the above, in scheme provided in this embodiment, even if only including in webpage information list stored in memory
Part has stored the webpage information of webpage in hard disk, still is able to be searched from hard disk, therefore, is consuming lesser memory
In the case where resource, the response speed and user experience effect when accessing webpage by browser can be improved.
Optionally, in one particular embodiment of the present invention, referring to fig. 4, after above-mentioned S104, can also include:
S109: using the source code of the source code of target webpage or target webpage data obtained after parsing as target webpage
Content-data storage in memory.
Those skilled in the art it is understood that by the content-data storage of target webpage in memory after,
The corresponding webpage information of the target webpage can also be updated to webpage information list, in order to which user accesses the target network again
Page.
It should be noted that being deposited in memory the case where the web data of target webpage is the source code of target webpage
The content-data for storing up target webpage can also execute after S104 obtains source code.
As seen from the above, in scheme provided in this embodiment, there is no target webpage is corresponding in webpage information list
In the case where webpage information, after the content-data that target webpage is obtained from network side, the target webpage is stored in memory
Content-data enriches the content-data of the webpage in memory, when user repeatedly accesses the target webpage, can quickly show
The target webpage.
Optionally, in one particular embodiment of the present invention, it referring to Fig. 5, before above-mentioned S109, can also wrap
It includes:
S110: whether detection free memory resource is less than preset threshold value, if it is, executing S111, otherwise, executes
S109。
Wherein, preset threshold value can be a specific memory numerical value, such as 300M, be also possible to a ratio value, such as
30%, i.e. 30% etc. of memory maximum capacity.
S111: being written rule according to preset file, hard disk is written in the content-data that webpage has been stored in memory, to release
It puts and has stored the memory source that the content-data of webpage occupies in memory.
Wherein, rule is written according to preset file, hard disk is written into the content-data that webpage has been stored in memory, to release
When putting the memory source for the content-data occupancy for having stored webpage in memory, rule first can be written according to preset file, really
The content-data of the webpage of fixed hard disk to be written;Judged in hard disk again with the presence or absence of content corresponding with identified content-data
Data;There are when corresponding content-data, the expired time of identified content-data be later than in hard disk with it is identified interior
In the case where the expired time for holding the corresponding content-data of data, in identified content-data replacement hard disk with it is identified
The corresponding content-data of content-data;There is no when corresponding content-data, identified content-data is stored in a hard disk;It releases
The memory source that content-data determined by putting occupies.
Wherein, preset file write-in rule may include:
The sequence of the time that webpage information is not used by memory from long to short;Or
The sequence of webpage information storage time from long to short in memory;Or
The correlation of webpage information and the target webpage has low to high sequence in memory;Or
Sequence of the webpage information apart from corresponding expired time from the near to the remote in memory.
Certainly, it is not limited in above-mentioned several memory source release rules in practical application, it can basis in practical application
Concrete condition determines, for example, webpage information occupies in releasing memory in such a way that above-mentioned several memory release rules combine
Memory source etc..
In addition, those skilled in the art in memory it is envisioned that by having deposited referring to the embodiment that Fig. 4 is provided
After the content-data write-in hard disk for storing up webpage, the webpage information in webpage information list can be updated, accordingly in order to user's application
This method accesses webpage.
As seen from the above, in scheme provided in this embodiment, in the case where memory source anxiety, according to preset file
Write-in rule stores the content-data of webpage stored in memory into hard disk, to guarantee that system operates normally.
Fig. 6 is provided in an embodiment of the present invention for accessing the first structural schematic diagram of the device of webpage, the device packet
Include: banner obtains module 601, webpage information determining module 602 and the first web page display module 603.
Wherein, banner obtains module 601, for obtaining the mark of target webpage;
Webpage information determining module 602 determines the webpage letter for being stored in memory for the mark according to the target webpage
It ceases and whether there is the corresponding webpage information of the target webpage in list, wherein the webpage information list are as follows: opened in browser
It in the dynamic stage, is generated according to the webpage information of part or all of webpage stored in hard disk, is included at least in the webpage information:
The storage address of the content-data of the mark of webpage and webpage in a hard disk;
First web page display module 603, for there are the corresponding nets of the target webpage in the webpage information list
In the case where page information, the content-data of the target webpage, and root are obtained according to the corresponding webpage information of the target webpage
The target webpage is shown according to content-data obtained.
Specifically, the content-data of the target webpage, comprising: the source code of target webpage or the source generation to target webpage
Code data obtained after parsing.
As seen from the above, in scheme provided in this embodiment, webpage information list is stored in memory, is carrying out webpage
When access, first according to the mark of target webpage, inquire in the webpage information list with the presence or absence of the corresponding webpage letter of target webpage
Breath, and if it exists, the content-data of target webpage is obtained according to the webpage information in the webpage information list, and according to obtained
Content-data shows the target webpage.Compared with inquiring data in a hard disk, inquiry data speed is very fast in memory, and system
Expense is smaller, can be improved response speed and user experience effect when accessing webpage by browser.
Optionally, in one particular embodiment of the present invention, referring to Fig. 7, the apparatus may include: source code obtains mould
Block 604, source code parsing module 605 and the second web page display module 606.
Wherein, source code obtains module 604, for obtaining the source code of the target webpage from web page server;
Source code parsing module 605, for parsing the source code of the target webpage;
Web page display submodule 606, for showing the target webpage according to parsing result;
In the webpage information list in the case where webpage information corresponding there is no the target webpage, the webpage
Information determination module 602 triggers the source code and obtains module 604, obtains source code.
Optionally, in one particular embodiment of the present invention, referring to Fig. 8, which can also include: that content-data is true
Cover half block 607 and third web page display module 608.
Wherein, content-data determining module 607 is used in the webpage information list according to part stored in hard disk
In the case that the webpage information of webpage generates, before the source code obtains the acquisition source code of module 604, according to the target
The mark of webpage determines in the content-data except the content-data of the corresponding webpage of webpage information list described in hard disk, is
No there are the corresponding content-datas of the target webpage, if it is, triggering the third web page display module 608, show target
Webpage obtains source code if it has not, triggering the source code obtains module 604;
Third web page display module 608, for obtaining the corresponding content-data of the target webpage, and according to obtained
Content-data shows the target webpage to user.
As seen from the above, in scheme provided in this embodiment, even if only including in webpage information list stored in memory
Part has stored the webpage information of webpage in hard disk, still is able to be searched from hard disk, therefore, is consuming lesser memory
In the case where resource, the response speed and user experience effect when accessing webpage by browser can be improved.
Optionally, in one particular embodiment of the present invention, referring to Fig. 9, which can also include: that content-data is deposited
Store up module 609.
Wherein, content-data storage module 609 is used for after 605 analysis source code of source code parsing module, will
The source code of the source code of the target webpage or target webpage data obtained after parsing are as the target webpage
Content-data storage is in memory.
Preferably, the device can also include: information list update module (not shown).
Wherein, information list update module, for will be in the target webpage in the content-data storage module 609
After appearance data are stored in memory, the corresponding webpage information of the target webpage is updated to the webpage information list.
As seen from the above, in scheme provided in this embodiment, there is no target webpage is corresponding in webpage information list
In the case where webpage information, after the content-data that target webpage is obtained from network side, the target webpage is stored in memory
Content-data enriches the content-data of the webpage in memory, when user repeatedly accesses the target webpage, can quickly show
The target webpage.
Optionally, in one particular embodiment of the present invention, referring to Figure 10, which can also include: memory source
Detection module 610 and memory source release module 611.
Wherein, memory source detection module 610, in the content-data storage module 607 by the target webpage
Content-data storage in memory before, detection free memory resource whether be less than preset threshold value, if it is, triggering described in
Memory source release module 611, releasing memory resource, if it has not, triggering the content-data storage module 609, storage content
Data;
Memory source release module 611 will store in webpage for rule to be written according to preset file in memory
Hold data and hard disk is written, to have stored the memory source that the content-data of webpage occupies in releasing memory.
Specifically, memory source release module 611 may include: that content-data determines submodule, content-data judgement
Module, content-data replacement submodule, content-data storage submodule and memory source discharge submodule (not shown).
Wherein, content-data determines submodule, for rule to be written according to preset file, determines the net of hard disk to be written
The content-data of page;
Content-data judging submodule, for judging in hard disk with the presence or absence of content corresponding with identified content-data
Data are replaced content-data, are deposited if it has not, triggering the content-data if it is, triggering the content-data replacement submodule
Store up submodule, storage content data;
Content-data replaces submodule, for being later than in hard disk and determining in the expired time of identified content-data
The corresponding content-data of content-data expired time in the case where, with identified content-data replacement hard disk in really
The corresponding content-data of fixed content-data;
Content-data storage submodule, for storing identified content-data in a hard disk;
Memory source discharges submodule, the memory source occupied for discharging identified content-data.
Specifically, preset file write-in rule may include:
The sequence of the time that webpage information is not used by memory from long to short;Or
The sequence of webpage information storage time from long to short in memory;Or
The correlation of webpage information and the target webpage has low to high sequence in memory;Or
Sequence of the webpage information apart from expired time from the near to the remote in memory.
As seen from the above, in scheme provided in this embodiment, in the case where memory source anxiety, according to preset file
Write-in rule stores the content-data of webpage stored in memory into hard disk, to guarantee that system operates normally.
For device embodiment, since it is substantially similar to the method embodiment, related so being described relatively simple
Place illustrates referring to the part of embodiment of the method.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality
Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation
In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to
Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those
Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment
Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that
There is also other identical elements in process, method, article or equipment including the element.
Those of ordinary skill in the art will appreciate that all or part of the steps in realization above method embodiment is can
It is completed with instructing relevant hardware by program, the program can store in computer-readable storage medium,
The storage medium designated herein obtained, such as: ROM/RAM, magnetic disk, CD.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all
Any modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present invention
It is interior.
Claims (18)
1. a kind of method for accessing webpage, which is characterized in that the described method includes:
Obtain the mark of target webpage;
According to the mark of the target webpage, determines and be stored in the webpage information list of memory with the presence or absence of the target webpage
Corresponding webpage information, wherein the webpage information list are as follows: in browser startup stage, according to portion stored in hard disk
Divide or the webpage information of whole webpages generates, include at least in the webpage information: the mark of webpage, the content-data of webpage exist
The expired time of storage address and webpage in hard disk;
In the webpage information list in the case where webpage information corresponding there are the target webpage, according to the target network
The corresponding webpage information of page obtains the content-data of the target webpage, and shows the target according to content-data obtained
Webpage.
2. the method according to claim 1, wherein the target network is not present in the webpage information list
In the case where the corresponding webpage information of page, further includes:
The source code of the target webpage is obtained from web page server;
Parse the source code of the target webpage;
According to parsing result, the target webpage is shown.
3. according to the method described in claim 2, it is characterized in that, in the webpage information list according to stored in hard disk
In the case that part webpage information generates, described before the source code that web page server obtains the target webpage, also wrap
It includes:
According to the mark of the target webpage, except the content-data for determining the corresponding webpage of webpage information list described in hard disk
Content-data in, if there are the corresponding content-datas of the target webpage;
If it is, obtaining the corresponding content-data of the target webpage, and the target is shown according to content-data obtained
Webpage;
If it has not, obtaining the source code of the target webpage from web page server.
4. according to the method in claim 2 or 3, which is characterized in that the parsing target webpage source code it
Afterwards, further includes:
Using the source code of the source code of the target webpage or target webpage data obtained after parsing as the target
The content-data storage of webpage is in memory.
5. according to the method described in claim 4, it is characterized in that, described by the source code of the target webpage or the mesh
Mark webpage source code data obtained after parsing as the target webpage content-data storage in memory after, also wrap
It includes:
The corresponding webpage information of the target webpage is updated to the webpage information list.
6. according to the method described in claim 4, it is characterized in that, described by the source code of the target webpage or the mesh
Mark webpage source code data obtained after parsing as the target webpage content-data storage in memory before, also wrap
It includes:
Whether detection free memory resource is less than preset threshold value;
If it is, rule is written according to preset file, hard disk is written into the content-data that webpage has been stored in memory, with release
The memory source that the content-data of webpage occupies has been stored in memory;
If it has not, using the source code of the source code of the target webpage or target webpage data obtained after parsing as institute
The content-data storage of target webpage is stated in memory.
7. according to the method described in claim 6, it is characterized in that, it is described according to preset file be written rule, will be in memory
The content-data write-in hard disk of webpage has been stored, to have stored the memory source that the content-data of webpage occupies in releasing memory,
Include:
Rule is written according to preset file, determines the content-data of the webpage of hard disk to be written;
Judge in hard disk with the presence or absence of content-data corresponding with identified content-data;
If it is, the expired time in identified content-data is later than in hard disk content corresponding with identified content-data
In the case where the expired time of data, in corresponding with identified content-data in identified content-data replacement hard disk
Hold data;
If it has not, content-data determined by storing in a hard disk;
The memory source that content-data determined by discharging occupies.
8. method according to claim 6 or 7, which is characterized in that the preset file write-in rule, comprising:
The sequence of the time that webpage information is not used by memory from long to short;Or
The sequence of webpage information storage time from long to short in memory;Or
The correlation of webpage information and the target webpage has low to high sequence in memory;Or
Sequence of the webpage information apart from expired time from the near to the remote in memory.
9. the method according to claim 1, wherein the content-data of the target webpage, comprising: target webpage
Source code or to the source code of target webpage data obtained after parsing.
10. a kind of for accessing the device of webpage, which is characterized in that described device includes:
Banner obtains module, for obtaining the mark of target webpage;
Webpage information determining module determines the webpage information list for being stored in memory for the mark according to the target webpage
In whether there is the corresponding webpage information of the target webpage, wherein the webpage information list are as follows: browser start rank
Section is generated according to the webpage information of part or all of webpage stored in hard disk, is included at least in the webpage information: webpage
Mark, the content-data storage address in a hard disk of webpage and the expired time of webpage;
First web page display module, for there are the corresponding webpage informations of the target webpage in the webpage information list
In the case of, obtain the content-data of the target webpage according to the corresponding webpage information of the target webpage, and according to being obtained
Content-data show the target webpage.
11. device according to claim 10, which is characterized in that described device further include:
Source code obtains module, for obtaining the source code of the target webpage from web page server;
Source code parsing module, for parsing the source code of the target webpage;
Second web page display module, for showing the target webpage according to parsing result;
In the webpage information list in the case where webpage information corresponding there is no the target webpage, the webpage information
Determining module triggers the source code and obtains module, obtains source code.
12. device according to claim 11, which is characterized in that described device further include: content-data determining module and
Third web page display module;
The content-data determining module is used in the webpage information list according to part stored in hard disk webpage information
In the case where generation, before the source code obtains module acquisition source code, according to the mark of the target webpage, determine hard
In content-data except the content-data of the corresponding webpage of webpage information list described in disk, if there are the target webpages
Corresponding content-data shows target webpage, if it has not, triggering the source if it is, triggering the third web page display module
Code obtains module, obtains source code;
The third web page display module, for obtaining the corresponding content-data of the target webpage, and according to obtained interior
Hold data and shows the target webpage to user.
13. device according to claim 11 or 12, which is characterized in that described device further include:
Content-data storage module is used for after the source code parsing module analysis source code, by the target webpage
The source code of source code or target webpage data obtained after parsing as the target webpage content-data storage in
In memory.
14. device according to claim 13, which is characterized in that described device further include:
Information list update module, for the content-data storage module by the content-data storage of the target webpage in
After in memory, the corresponding webpage information of the target webpage is updated to the webpage information list.
15. device according to claim 13, which is characterized in that described device further include: memory source detection module and
Memory source release module;
The memory source detection module, for depositing the content-data of the target webpage in the content-data storage module
Before being stored in memory, whether detection free memory resource is less than preset threshold value, if it is, triggering the memory source release
Module, releasing memory resource, if it has not, triggering the content-data storage module, storage content data;
The memory source release module will store the content of webpage for rule to be written according to preset file in memory
Hard disk is written in data, to have stored the memory source that the content-data of webpage occupies in releasing memory.
16. device according to claim 15, which is characterized in that the memory source release module, comprising: content-data
Determine submodule, content-data judging submodule, content-data replacement submodule, content-data storage submodule and memory source
Discharge submodule;
The content-data determines submodule, for rule to be written according to preset file, determines the webpage of hard disk to be written
Content-data;
The content-data judging submodule, for judging in hard disk with the presence or absence of content corresponding with identified content-data
Data are replaced content-data, are deposited if it has not, triggering the content-data if it is, triggering the content-data replacement submodule
Store up submodule, storage content data;
The content-data replaces submodule, for being later than in hard disk and determining in the expired time of identified content-data
The corresponding content-data of content-data expired time in the case where, with identified content-data replacement hard disk in really
The corresponding content-data of fixed content-data;
The content-data storage submodule, for storing identified content-data in a hard disk;
The memory source discharges submodule, the memory source occupied for discharging identified content-data.
17. device according to claim 15 or 16, which is characterized in that the preset file write-in rule, comprising:
The sequence of the time that webpage information is not used by memory from long to short;Or
The sequence of webpage information storage time from long to short in memory;Or
The correlation of webpage information and the target webpage has low to high sequence in memory;Or
Sequence of the webpage information apart from expired time from the near to the remote in memory.
18. device according to claim 10, which is characterized in that the content-data of the target webpage, comprising: target network
Page source code or to the source code of target webpage data obtained after parsing.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410270274.2A CN104021203B (en) | 2014-06-17 | 2014-06-17 | It is a kind of for accessing the method and device of webpage |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410270274.2A CN104021203B (en) | 2014-06-17 | 2014-06-17 | It is a kind of for accessing the method and device of webpage |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104021203A CN104021203A (en) | 2014-09-03 |
CN104021203B true CN104021203B (en) | 2019-07-12 |
Family
ID=51437957
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410270274.2A Active CN104021203B (en) | 2014-06-17 | 2014-06-17 | It is a kind of for accessing the method and device of webpage |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104021203B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106066868B (en) * | 2016-05-27 | 2019-12-03 | 北京小米移动软件有限公司 | Webpage loading method and device |
CN108345614A (en) * | 2017-01-23 | 2018-07-31 | 易族智汇(北京)科技有限公司 | A kind of device based on memory storage and display webpage |
CN107864173A (en) * | 2017-06-26 | 2018-03-30 | 平安普惠企业管理有限公司 | Terminal page caching method, system and readable storage medium storing program for executing |
CN114374557A (en) * | 2022-01-07 | 2022-04-19 | 挂号网(杭州)科技有限公司 | Webpage data requesting method and device, electronic equipment and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103294718A (en) * | 2012-02-29 | 2013-09-11 | 腾讯科技(深圳)有限公司 | Method and device for web page cache management |
CN103455478A (en) * | 2012-05-21 | 2013-12-18 | 腾讯科技(深圳)有限公司 | Webpage access accelerating method and device |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102591963A (en) * | 2011-12-30 | 2012-07-18 | 奇智软件(北京)有限公司 | Method and device for controlling webpage content loading |
CN102629234B (en) * | 2012-01-18 | 2015-01-21 | 物联微电子(常熟)有限公司 | Fast retrieval method for data of built-in Flash of single chip microcomputer |
CN103077119A (en) * | 2012-12-31 | 2013-05-01 | 记忆科技(深圳)有限公司 | Data processing system and method |
CN104899208A (en) * | 2014-03-05 | 2015-09-09 | 腾讯科技(深圳)有限公司 | Caching method and apparatus for browser |
-
2014
- 2014-06-17 CN CN201410270274.2A patent/CN104021203B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103294718A (en) * | 2012-02-29 | 2013-09-11 | 腾讯科技(深圳)有限公司 | Method and device for web page cache management |
CN103455478A (en) * | 2012-05-21 | 2013-12-18 | 腾讯科技(深圳)有限公司 | Webpage access accelerating method and device |
Also Published As
Publication number | Publication date |
---|---|
CN104021203A (en) | 2014-09-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8392446B2 (en) | System and method for providing vector terms related to a search query | |
CN104021203B (en) | It is a kind of for accessing the method and device of webpage | |
WO2008019206A3 (en) | Macro programming for resources | |
CN107590275B (en) | Data query method and device | |
CN110162292A (en) | Voice broadcast method and device | |
CN102970348B (en) | Network application method for pushing, system and network application server | |
JP2014528136A (en) | Net data collection method and system | |
CN103078945A (en) | Method and system for processing browser crash data | |
CN106033428B (en) | The selection method of uniform resource locator and the selection device of uniform resource locator | |
CN108595697A (en) | Webpage integrated approach, apparatus and system | |
CN102402563A (en) | Network information screening method and device | |
CN110365810A (en) | Domain name caching method, device, equipment and storage medium based on web crawlers | |
US20100250516A1 (en) | Method and apparatus for web crawling | |
CN105653678A (en) | Data chart subscription method and data chart subscription system | |
JP2008158589A (en) | Updated information notification device, and updated information notification program | |
CN110955855B (en) | Information interception method, device and terminal | |
US9529896B2 (en) | Hierarchical online-content filtering device and method | |
CN102902792A (en) | List page recognition system and method | |
CN102982143A (en) | Searching method for network novel and browsing device | |
CN103077186A (en) | Fault data processing device and method | |
CN107807993B (en) | Method and device for realizing webpage history recording function | |
CN102929948A (en) | List page identification system and method | |
CN103246662B (en) | The treating method and apparatus of area data content in Webpage | |
CN103793509A (en) | Picture capturing method and device | |
CN103064873A (en) | Webpage quality data obtaining method and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP03 | Change of name, title or address | ||
CP03 | Change of name, title or address |
Address after: 100041 Beijing, Shijingshan District Xing Xing street, building 30, No. 3, building 2, A-0071 Patentee after: Beijing cheetah Mobile Technology Co., Ltd. Address before: 100041 Beijing city Shijingshan District Badachu high tech Park West Wells Road No. 3 Building No. 3 1100A Patentee before: SHELL INTERNET (BEIJING) SECURITY TECHNOLOGY CO., LTD. |