CN107291913A - HTML webpage loading method and device - Google Patents
HTML webpage loading method and device Download PDFInfo
- Publication number
- CN107291913A CN107291913A CN201710499814.8A CN201710499814A CN107291913A CN 107291913 A CN107291913 A CN 107291913A CN 201710499814 A CN201710499814 A CN 201710499814A CN 107291913 A CN107291913 A CN 107291913A
- Authority
- CN
- China
- Prior art keywords
- web page
- page resources
- client
- caching
- address
- 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
Links
- 238000011068 loading method Methods 0.000 title claims abstract description 23
- 230000005540 biological transmission Effects 0.000 claims abstract description 43
- 230000001360 synchronised effect Effects 0.000 claims abstract description 19
- 238000000034 method Methods 0.000 claims description 32
- 239000000872 buffer Substances 0.000 claims description 11
- 230000000977 initiatory effect Effects 0.000 claims description 7
- 238000004590 computer program Methods 0.000 claims description 6
- 238000004364 calculation method Methods 0.000 claims description 2
- 238000005516 engineering process Methods 0.000 abstract description 4
- 239000012160 loading buffer Substances 0.000 abstract description 4
- 230000006870 function Effects 0.000 description 7
- 238000012797 qualification Methods 0.000 description 6
- 230000008901 benefit Effects 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000001035 drying Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
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/955—Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
-
- 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 Transfer Between Computers (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present invention relates to applicating developing technology field, more particularly to HTML webpage loading method and device, including for the webpage based on HTML, web page resources address is obtained;Based on web page resources address, judge whether the corresponding web page resources in web page resources address have cached in the client;If web page resources have been cached in the client, web page resources and loaded and displayed are read from client;If web page resources are uncached in the client, network request is initiated to the webserver using OkHttp frameworks, so as to set up data transmission pipe stream between the webserver and client;During the network resource data that data transmission pipe stream is returned is read, loaded and displayed is synchronized to the network resource data currently read, caching is synchronized to the network resource data currently read.The application only needs primary network request to can be achieved to carry out loading caching to uncached Internet resources, improves loading buffer efficiency, saves flow.
Description
Technical field
The present invention relates to applicating developing technology field, more particularly to HTML webpage loading method and device.
Background technology
HTML (HyperText Markup Language, HTML) is a kind of mark applied in webpage
Remember language, the establishment of webpage can be realized by the markup language.For the webpage created using HTML, in order to reduce pair
The frequency that physical data source is accessed, improves runnability, and this kind of webpage will be buffered while loading.
However, prior art during html web page is loaded and cached, it is necessary to be initiated to the webserver
Network request twice, this twice network request be respectively:The network request loaded for webpage and the network for web cache
Request, does not only exist the problem of loading buffer efficiency is low, but also waste flow.
The content of the invention
In view of the above problems, it is proposed that the present invention so as to provide one kind overcome above mentioned problem or at least in part solve on
State the HTML webpage loading method and device of problem.
The embodiment of the present invention provides a kind of HTML webpage loading method, applied in client, the side
Method includes:
For the webpage based on HTML, web page resources address is obtained;
Based on the web page resources address, judge whether the corresponding web page resources in the web page resources address have been buffered in institute
State in client;
If the web page resources have been buffered in the client, the web page resources are read from the client simultaneously
Loaded and displayed;
If the web page resources are uncached in the client, net is initiated to the webserver using OkHttp frameworks
Network is asked, so as to set up data transmission pipe stream between the webserver and the client;
During the network resource data that the data transmission pipe stream is returned is read, to the network currently read
Resource data synchronizes loaded and displayed, meanwhile, caching is synchronized to the network resource data currently read.
It is preferred that, the type of the webpage is HTML5.
It is preferred that, if the web page resources are uncached in the client, using OkHttp frameworks to network
Server initiates network request, so as to data transmission pipe stream is set up between the webserver and the client, including:
If the web page resources are uncached in the client, judge whether the web page resources belong to caching respectively
White list and caching blacklist, wherein, the caching white list has the first caching condition for allowing caching resource, the caching
There is the second caching condition of caching resource that do not allow, the first caching condition is different from the second caching condition in blacklist;
If the web page resources belong to the caching white list and are not belonging to the caching blacklist, OkHttp frames are utilized
Frame initiates network request to the webserver, so as to set up data transmission pipe between the webserver and the client
Stream, otherwise, returns to sky, the web page resources is not cached.
It is preferred that, it is described to be based on the web page resources address, judge that the corresponding web page resources in the web page resources address are
It is no to be buffered in the client, including:
Cache database include it is data cached in search whether there is the web page resources address;
Wherein, if there is the web page resources address in the cache database, show that the web page resources have been cached
In the client, if the web page resources address is not present in the cache database, the web page resources are uncached
In the client.
It is preferred that, it is described cache database include it is data cached in search whether there is the web page resources address
Before, methods described also includes:
Obtain described data cached from the cache database, and by it is described it is data cached be stored in Map set in.
It is preferred that, methods described also includes:
Obtain the cache-time for the web page resources being buffered in the client;
Judge whether the cache-time exceedes the preset buffer memory cycle;
If the cache-time exceedes the preset buffer memory cycle, the webpage being buffered in the client is provided
Deleted in source.
It is preferred that, the network resource data to currently reading synchronizes caching, including:
Web page resources address synchronization corresponding to the network resource data currently read is cached in cache database.
The embodiment of the present invention also provides a kind of HTML webpage loading device, and described device includes:
Acquisition module, for for the webpage based on HTML, obtaining web page resources address;
Judge module, for based on the web page resources address, judging the corresponding web page resources in the web page resources address
Whether it has been buffered in the client;
Load-on module, if being buffered in for the web page resources in the client, reads from the client
The web page resources and loaded and displayed;
Initiation module is asked, if uncached in the client for the web page resources, OkHttp frameworks are utilized
Network request is initiated to the webserver, so as to set up data transmission pipe between the webserver and the client
Stream;
Cache module is loaded, for during the network resource data that the data transmission pipe stream is returned is read,
Loaded and displayed is synchronized to the network resource data currently read, meanwhile, the network resource data currently read is entered
Row synchronization caching.
The embodiment of the present invention also provides a kind of computer-readable recording medium, is stored thereon with computer program, the program
Following steps are realized when being executed by processor:
For the webpage based on HTML, web page resources address is obtained;
Based on the web page resources address, judge whether the corresponding web page resources in the web page resources address have been buffered in institute
State in client;
If the web page resources have been buffered in the client, the web page resources are read from the client simultaneously
Loaded and displayed;
If the web page resources are uncached in the client, net is initiated to the webserver using OkHttp frameworks
Network is asked, so as to set up data transmission pipe stream between the webserver and the client;
During the network resource data that the data transmission pipe stream is returned is read, to the network currently read
Resource data synchronizes loaded and displayed, meanwhile, caching is synchronized to the network resource data currently read.
The embodiment of the present invention also provides a kind of computer equipment, including memory, processor and stores on a memory simultaneously
The computer program that can be run on a processor, following steps are realized during the computing device described program:
For the webpage based on HTML, web page resources address is obtained;
Based on the web page resources address, judge whether the corresponding web page resources in the web page resources address have been buffered in institute
State in client;
If the web page resources have been buffered in the client, the web page resources are read from the client simultaneously
Loaded and displayed;
If the web page resources are uncached in the client, net is initiated to the webserver using OkHttp frameworks
Network is asked, so as to set up data transmission pipe stream between the webserver and the client;
During the network resource data that the data transmission pipe stream is returned is read, to the network currently read
Resource data synchronizes loaded and displayed, meanwhile, caching is synchronized to the network resource data currently read.
One or more of embodiment of the present invention technical scheme, has at least the following technical effects or advantages:
The application is directed to html web page, during html web page is loaded, and first obtains web page resources address, then judges
Whether the corresponding web page resources in web page resources address have been buffered in client locally, if web page resources have been buffered in client sheet
Ground, then locally read the web page resources and loaded and displayed from client, if web page resources are uncached local in client, utilizes
OkHttp frameworks initiate network request to the webserver, so as to set up data transmission pipe between the webserver and client
Stream, and during client reads the network resource data that data transmission pipe stream is returned, to the network currently read
Resource data synchronizes loaded and displayed, meanwhile, caching is synchronized to the network resource data currently read, the application is only
Need primary network request to can be achieved to carry out loading caching to uncached Internet resources, improve loading buffer efficiency, save
Saved flow, simultaneously because initiate the network request using OkHttp frameworks, can automatic fitration fall the network request of repetition.
Brief description of the drawings
By reading the detailed description of hereafter preferred embodiment, various other advantages and benefit is common for this area
Technical staff will be clear understanding.Accompanying drawing is only used for showing the purpose of preferred embodiment, and is not considered as to the present invention
Limitation.And in whole accompanying drawing, identical part is represented with identical reference pattern.In the accompanying drawings:
Fig. 1 shows a kind of flow chart of HTML webpage loading method in the embodiment of the present invention;
Fig. 2 shows a kind of structure chart of HTML webpage loading device in the embodiment of the present invention;
Fig. 3 shows the entity structure schematic diagram of the computer equipment in the embodiment of the present invention.
Embodiment
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although showing the disclosure in accompanying drawing
Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here
Limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure
Complete conveys to those skilled in the art.
The embodiment of the present application provides a kind of HTML webpage loading method, applied in client, such as Fig. 1 institutes
Show, methods described includes:
Step 101:For the webpage based on HTML, web page resources address is obtained.
Step 102:Based on the web page resources address, whether the corresponding web page resources in the web page resources address are judged
It is buffered in the client.
Step 103:If the web page resources have been buffered in the client, the net is read from the client
Page resource and loaded and displayed;If the web page resources are uncached in the client, taken using OkHttp frameworks to network
Business device initiates network request, so as to set up data transmission pipe stream between the webserver and the client.
Step 104:During the network resource data that the data transmission pipe stream is returned is read, to current reading
To network resource data synchronize loaded and displayed, meanwhile, caching is synchronized to the network resource data currently read.
The application is directed to html web page, during html web page is loaded, and first obtains web page resources address, then judges
Whether the corresponding web page resources in web page resources address have been buffered in client locally, if web page resources have been buffered in client sheet
Ground, then locally read the web page resources and loaded and displayed from client, if web page resources are uncached local in client, utilizes
OkHttp frameworks initiate network request to the webserver, so as to set up data transmission pipe between the webserver and client
Stream, and during client reads the network resource data that data transmission pipe stream is returned, to the network currently read
Resource data synchronizes loaded and displayed, meanwhile, caching is synchronized to the network resource data currently read, the application is only
Need primary network request to can be achieved to carry out loading caching to uncached Internet resources, improve loading buffer efficiency, save
Saved flow, simultaneously because initiate the network request using OkHttp frameworks, can automatic fitration fall the network request of repetition.
In this application, the type of webpage can be HTML5.
The present processes can be set up in BasicWebViewClient classes, should so as to utilize
BasicWebViewClient classes replace WebViewClient of the prior art, below will be to BasicWebViewClient
Loading procedure is described in detail inside class.
For step 101, it is possible, firstly, to be intercepted by shouldInterceptRequest in webpage to be loaded
Web page resources address (Uniform Resource Locator, URL), to realize the acquisition to URL, then, perform step
102.One kind of step 102 preferred embodiment includes:
Cache database include it is data cached in search whether there is the web page resources address.
Wherein, cache database is located at that client is local, be stored with cache database be cached it is data cached, delay
Deposit data includes the web page resources and corresponding relation between the two of URL, caching, for example, cache database include URL1,
Corresponding first pictures of URL1, URL2 and the corresponding second pictures of URL2.The application passes through the caching that is included in cache database
Search whether there is web page resources address in data, can determine web page resources corresponding with the web page resources address whether by
Client is buffered in locally, if data cached middle presence web page resources address that cache database is included, shows the webpage
The corresponding web page resources of resource address have been buffered in that client is local, if cache database include it is data cached in be not present should
Web page resources address, then show that the corresponding web page resources in web page resources address are uncached local in client.
The application perform cache database comprising search whether in data cached to exist the web page resources address it
Before, in addition to step:Obtain described data cached from the cache database, and data cached Map collection is stored in by described
In conjunction.The application from cache database by extracting data cached and being stored in Map set, it is to avoid each lookup net
The problem of search efficiency that page resource is required for calling data cached place to bring is low.
Further, in step 103, if the corresponding web page resources in web page resources address have been buffered in client locally,
The web page resources and loaded and displayed are locally read from client, if the corresponding web page resources in web page resources address are uncached in client
End is local, then network request is initiated to the webserver using OkHttp frameworks, so that the webserver and the client
Data transmission pipe stream is set up between end.
In a preferred embodiment, if the web page resources are uncached in the client, utilize
OkHttp frameworks initiate network request to the webserver, so as to set up data between the webserver and the client
Transmission pipeline stream, including:
If the web page resources are uncached in the client, judge whether the web page resources belong to caching respectively
White list and caching blacklist, wherein, the caching white list has the first caching condition for allowing caching resource, the caching
There is the second caching condition of caching resource that do not allow, the first caching condition is different from the second caching condition in blacklist;
If the web page resources belong to the caching white list and are not belonging to the caching blacklist, OkHttp frames are utilized
Frame initiates network request to the webserver, so as to set up data transmission pipe between the webserver and the client
Stream, otherwise, returns to sky, the web page resources is not cached.
In specific implementation process, if the corresponding web page resources in web page resources address are uncached local in client, sentence
Whether the disconnected web page resources belong to caching white list, while judging whether the web page resources belong to caching blacklist, cache white name
Single and caching blacklist may each be the set of domain name, in addition, caching white list has the first caching condition, caching blacklist tool
There is the second caching condition, the first caching condition is different with the second caching condition.
Specifically, if web page resources belong to caching white list and are not belonging to cache blacklist, show that the web page resources have
There is caching qualification, if web page resources belong to caching blacklist, show the web page resources without caching qualification, if web page resources
It is not belonging to caching white list to be also not belonging to cache blacklist, then shows the web page resources without caching qualification.
For example, if the first caching condition in caching white list is that domain name is baidu, second in caching blacklist caches
Condition is that suffix is JPG, and, the domain name of the first web page resources is that baidu suffix is PNG, then the first web page resources have caching
Qualification, initiates network request, the domain name of the second web page resources is that baidu suffix is using OkHttp frameworks to the webserver
JPG, then the second web page resources are without caching qualification, and return is empty, the second web page resources is not cached, the 3rd web page resources
Domain name be that google suffix is PNG, then the 3rd web page resources are also without caching qualification, return empty, the second webpage are not provided
Source is cached.
Further, the application initiates network request using OkHttp frameworks to the webserver, so that the network service
Data transmission pipe stream is set up between device and the client, data transmission pipe stream includes input channel stream
(PipedInputStream) and output channel stream (PipedOutputStream), the application is real using data transmission pipe stream
Existing direct communication between main thread and sub-line journey, can realize and be shown when downloading, specifically, read data transmission pipe
During flowing the network resource data returned, loaded and displayed is synchronized to the network resource data currently read, meanwhile,
Caching is synchronized to the network resource data currently read, for the process of synchronization caching, the application will currently be read
Web page resources address synchronization corresponding to the network resource data got is cached in cache database.In this application, data
How many content will be shown in pipeline stream in how many data, webpage, web page resources have been loaded, data cached also write-in is finished,
Finally, it will the data cached path cached and access time are write in cache database.
The HTML webpage loading method of the application also includes:
Obtain the cache-time for the web page resources being buffered in the client;
Judge whether the cache-time exceedes the preset buffer memory cycle;
If the cache-time exceedes the preset buffer memory cycle, the webpage being buffered in the client is provided
Deleted in source.
In specific implementation process, the attribute information for being buffered in the local web page resources of client can be in database caches
Found in list, the cache-time for being buffered in the local web page resources of client is the difference of access time and current time,
If the difference of access time and current time is more than the preset buffer memory cycle, the local web page resources of client will be buffered in and deleted
Remove, if cache-time is not above the preset buffer memory cycle, continue to retain, the preset buffer memory cycle could be arranged to one day, one
Week or one month.
It should be noted that the application is after URL is obtained, and web page resources address is being judged based on web page resources address
Corresponding web page resources whether be buffered in client it is local before, in addition to method:Whether judge URL is normal URL, if
It is then to perform subsequent load process of caching, if it is not, sky is then directly returned to, without loading process of caching.
Based on same inventive concept, the embodiment of the present invention also provides a kind of HTML webpage loading device, such as
Shown in Fig. 2, described device includes:
Acquisition module 201, for for the webpage based on HTML, obtaining web page resources address;
Judge module 202, for based on the web page resources address, judging the corresponding webpage money in the web page resources address
Whether source has been buffered in the client;
Load-on module 203, if being buffered in for the web page resources in the client, reads from the client
Take the web page resources and loaded and displayed;
Initiation module 204 is asked, if uncached in the client for the web page resources, OkHttp frames are utilized
Frame initiates network request to the webserver, so as to set up data transmission pipe between the webserver and the client
Stream;
Cache module 205 is loaded, for reading the process for the network resource data that the data transmission pipe stream is returned
In, loaded and displayed is synchronized to the network resource data currently read, meanwhile, to the network resource data currently read
Synchronize caching.
It is preferred that, the type of the webpage is HTML5.
It is preferred that, initiation module 204 is asked, specifically for:
If the web page resources are uncached in the client, judge whether the web page resources belong to caching respectively
White list and caching blacklist, wherein, the caching white list has the first caching condition for allowing caching resource, the caching
There is the second caching condition of caching resource that do not allow, the first caching condition is different from the second caching condition in blacklist;
If the web page resources belong to the caching white list and are not belonging to the caching blacklist, OkHttp frames are utilized
Frame initiates network request to the webserver, so as to set up data transmission pipe between the webserver and the client
Stream, otherwise, returns to sky, the web page resources is not cached.
It is preferred that, judge module 203, including:
Cache database include it is data cached in search whether there is the web page resources address;
Wherein, if there is the web page resources address in the cache database, show that the web page resources have been cached
In the client, if the web page resources address is not present in the cache database, the web page resources are uncached
In the client.
It is preferred that, described device also includes:
Storage module, for obtaining described data cached from the cache database, and by the data cached storage
Into Map set.
It is preferred that, methods described also includes:
Time-obtaining module, the cache-time for obtaining the web page resources being buffered in the client;
Cycle judge module, for judging whether the cache-time exceedes the preset buffer memory cycle;
Removing module, if exceeding the preset buffer memory cycle for the cache-time, the visitor is buffered in described
Web page resources in the end of family are deleted.
It is preferred that, the loading cache module, specifically for:
Web page resources address synchronization corresponding to the network resource data currently read is cached in cache database.
Based on same inventive concept, the embodiment of the present invention also provides a kind of computer-readable recording medium, is stored thereon with
Computer program, the program realizes following steps when being executed by processor:
For the webpage based on HTML, web page resources address is obtained;
Based on the web page resources address, judge whether the corresponding web page resources in the web page resources address have been buffered in institute
State in client;
If the web page resources have been buffered in the client, the web page resources are read from the client simultaneously
Loaded and displayed;
If the web page resources are uncached in the client, net is initiated to the webserver using OkHttp frameworks
Network is asked, so as to set up data transmission pipe stream between the webserver and the client;
During the network resource data that the data transmission pipe stream is returned is read, to the network currently read
Resource data synchronizes loaded and displayed, meanwhile, caching is synchronized to the network resource data currently read.
The embodiment of the present invention additionally provides a kind of computer equipment, as shown in figure 3, for convenience of description, illustrate only with
The related part of the embodiment of the present invention, particular technique details is not disclosed, refer to present invention method part.The calculating
Machine equipment can be include mobile phone, tablet personal computer, PDA (Personal Digital Assistant, personal digital assistant),
Any terminal device such as POS (Point of Sales, point-of-sale terminal), vehicle-mounted computer, so that computer equipment is mobile phone as an example:
Fig. 3 is illustrated that the block diagram of the part-structure related to computer equipment provided in an embodiment of the present invention.With reference to figure
3, the computer equipment includes:Memory 301 and processor 302.It will be understood by those skilled in the art that the meter shown in Fig. 3
Calculation machine equipment structure does not constitute the restriction to computer equipment, can include than illustrating more or less parts, or group
Close some parts, or different part arrangements.
Each component parts of computer equipment is specifically introduced with reference to Fig. 3:
Memory 301 can be used for storage software program and module, and processor 302 is stored in memory 301 by operation
Software program and module, so as to perform various function application and data processing.Memory 301 can mainly include storage journey
Sequence area and storage data field, wherein, the application program (ratio that storing program area can be needed for storage program area, at least one function
Such as sound-playing function, image player function) etc.;Storage data field can data storage (such as voice data, phone directory etc.)
Deng.In addition, memory 301 can include high-speed random access memory, nonvolatile memory can also be included, for example, at least
One disk memory, flush memory device or other volatile solid-state parts.
Processor 302 is the control centre of computer equipment, and the software in memory 301 is stored in by operation or execution
Program and/or module, and the data being stored in memory 301 are called, perform various functions and processing data.Optionally,
Processor 302 may include one or more processing units;It is preferred that, processor 302 can integrated application processor and modulation /demodulation
Processor, wherein, application processor mainly handles operating system, user interface and application program etc., modem processor master
Handle radio communication.
In embodiments of the present invention, the processor 302 included by the computer equipment can have following functions:
For the webpage based on HTML, web page resources address is obtained;
Based on the web page resources address, judge whether the corresponding web page resources in the web page resources address have been buffered in institute
State in client;
If the web page resources have been buffered in the client, the web page resources are read from the client simultaneously
Loaded and displayed;
If the web page resources are uncached in the client, net is initiated to the webserver using OkHttp frameworks
Network is asked, so as to set up data transmission pipe stream between the webserver and the client;
During the network resource data that the data transmission pipe stream is returned is read, to the network currently read
Resource data synchronizes loaded and displayed, meanwhile, caching is synchronized to the network resource data currently read.
In a word, the application is directed to html web page, during html web page is loaded, and first obtains web page resources address, connects
And judge whether the corresponding web page resources in web page resources address have been buffered in client locally, if web page resources have been buffered in client
End is local, then the web page resources and loaded and displayed are locally read from client, if web page resources are uncached local in client,
Network request is initiated to the webserver using OkHttp frameworks, so as to set up data transfer between the webserver and client
Pipeline stream, and during client reads the network resource data that data transmission pipe stream is returned, to what is currently read
Network resource data synchronizes loaded and displayed, meanwhile, caching is synchronized to the network resource data currently read, this Shen
Please only need primary network request to can be achieved to carry out loading caching to uncached Internet resources, improve loading caching effect
Rate, saves flow, simultaneously because initiate the network request using OkHttp frameworks, can automatic fitration fall the network of repetition please
Ask.
Algorithm and display be not inherently related to any certain computer, virtual system or miscellaneous equipment provided herein.
Various general-purpose systems can also be used together with based on teaching in this.As described above, construct required by this kind of system
Structure be obvious.In addition, the present invention is not also directed to any certain programmed language.It is understood that, it is possible to use it is various
Programming language realizes the content of invention described herein, and the description done above to language-specific is to disclose this hair
Bright preferred forms.
In the specification that this place is provided, numerous specific details are set forth.It is to be appreciated, however, that the implementation of the present invention
Example can be put into practice in the case of these no details.In some instances, known method, structure is not been shown in detail
And technology, so as not to obscure the understanding of this description.
Similarly, it will be appreciated that in order to simplify the disclosure and help to understand one or more of each inventive aspect, exist
Above in the description of the exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes
In example, figure or descriptions thereof.However, the method for the disclosure should be construed to reflect following intention:It is i.e. required to protect
The application claims of shield features more more than the feature being expressly recited in each claim.More precisely, such as following
Claims reflect as, inventive aspect is all features less than single embodiment disclosed above.Therefore,
Thus the claims for following embodiment are expressly incorporated in the embodiment, wherein each claim is in itself
All as the separate embodiments of the present invention.
Those skilled in the art, which are appreciated that, to be carried out adaptively to the module in the equipment in embodiment
Change and they are arranged in one or more equipment different from the embodiment.Can be the module or list in embodiment
Member or component be combined into a module or unit or component, and can be divided into addition multiple submodule or subelement or
Sub-component.In addition at least some in such feature and/or process or unit exclude each other, it can use any
Combination is disclosed to all features disclosed in this specification (including adjoint claim, summary and accompanying drawing) and so to appoint
Where all processes or unit of method or equipment are combined.Unless expressly stated otherwise, this specification (including adjoint power
Profit is required, summary and accompanying drawing) disclosed in each feature can or similar purpose identical, equivalent by offer alternative features come generation
Replace.
Although in addition, it will be appreciated by those of skill in the art that some embodiments in this include institute in other embodiments
Including some features rather than further feature, but not the combination of the feature of be the same as Example mean be in the scope of the present invention
Within and form different embodiments.For example, in the following claims, embodiment claimed it is any it
One mode can use in any combination.
The present invention all parts embodiment can be realized with hardware, or with one or more processor run
Software module realize, or realized with combinations thereof.It will be understood by those of skill in the art that can use in practice
Microprocessor or digital signal processor (DSP) are realized in gateway according to embodiments of the present invention, proxy server, system
Some or all parts some or all functions.The present invention is also implemented as being used to perform side as described herein
The some or all equipment or program of device (for example, computer program and computer program product) of method.It is such
Realizing the program of the present invention can store on a computer-readable medium, or can have the shape of one or more signal
Formula.Such signal can be downloaded from internet website and obtained, and either be provided or with any other shape on carrier signal
Formula is provided.
It should be noted that the present invention will be described rather than limits the invention for above-described embodiment, and ability
Field technique personnel can design alternative embodiment without departing from the scope of the appended claims.In the claims,
Any reference symbol between bracket should not be configured to limitations on claims.Word "comprising" is not excluded the presence of not
Element or step listed in the claims.Word "a" or "an" before element does not exclude the presence of multiple such
Element.The present invention can be by means of including the hardware of some different elements and coming real by means of properly programmed computer
It is existing.In if the unit claim of equipment for drying is listed, several in these devices can be by same hardware branch
To embody.Word, second and third use do not indicate that any order.These words can be construed to title.
Claims (10)
1. a kind of HTML webpage loading method, it is characterised in that applied in client, methods described includes:
For the webpage based on HTML, web page resources address is obtained;
Based on the web page resources address, judge whether the corresponding web page resources in the web page resources address have been buffered in the visitor
In the end of family;
If the web page resources have been buffered in the client, the web page resources are read from the client and are loaded
Display;
If the web page resources are uncached in the client, initiating network to the webserver using OkHttp frameworks please
Ask, so as to set up data transmission pipe stream between the webserver and the client;
During the network resource data that the data transmission pipe stream is returned is read, to the Internet resources currently read
Data synchronize loaded and displayed, meanwhile, caching is synchronized to the network resource data currently read.
2. the method as described in claim 1, it is characterised in that the type of the webpage is HTML5.
3. the method as described in claim 1, it is characterised in that if the web page resources are uncached in the client
In, then initiate network request to the webserver using OkHttp frameworks so that the webserver and the client it
Between set up data transmission pipe stream, including:
If the web page resources are uncached in the client, judge whether the web page resources belong to the white name of caching respectively
Single and caching blacklist, wherein, the caching white list has the first caching condition for allowing caching resource, the black name of caching
There is the second caching condition of caching resource that do not allow, the first caching condition is different from the second caching condition in single;
If the web page resources belong to the caching white list and are not belonging to the caching blacklist, using OkHttp frameworks to
The webserver initiates network request, so as to data transmission pipe stream is set up between the webserver and the client,
Otherwise, sky is returned, the web page resources are not cached.
4. the method as described in claim 1, it is characterised in that described to be based on the web page resources address, judges the webpage
Whether the corresponding web page resources of resource address have been buffered in the client, including:
Cache database include it is data cached in search whether there is the web page resources address;
Wherein, if there is the web page resources address in the cache database, show that the web page resources have been buffered in institute
State in client, if the web page resources address is not present in the cache database, the web page resources are uncached in institute
State in client.
5. method as claimed in claim 4, it is characterised in that in the data cached middle lookup included in cache database
Before the web page resources address, methods described also includes:
Obtain described data cached from the cache database, and by it is described it is data cached be stored in Map set in.
6. the method as described in claim 1, it is characterised in that methods described also includes:
Obtain the cache-time for the web page resources being buffered in the client;
Judge whether the cache-time exceedes the preset buffer memory cycle;
If the cache-time exceedes the preset buffer memory cycle, the web page resources being buffered in the client are entered
Row is deleted.
7. the method as described in claim 1, it is characterised in that the network resource data to currently reading is synchronized
Caching, including:
Web page resources address synchronization corresponding to the network resource data currently read is cached in cache database.
8. a kind of HTML webpage loading device, it is characterised in that described device includes:
Acquisition module, for for the webpage based on HTML, obtaining web page resources address;
Judge module, for whether based on the web page resources address, judging the corresponding web page resources in the web page resources address
It has been buffered in the client;
Load-on module, if being buffered in for the web page resources in the client, reads described from the client
Web page resources and loaded and displayed;
Initiation module is asked, if uncached in the client for the web page resources, using OkHttp frameworks to net
Network server initiates network request, so as to set up data transmission pipe stream between the webserver and the client;
Cache module is loaded, for during the network resource data that the data transmission pipe stream is returned is read, to working as
Before the network resource data that reads synchronize loaded and displayed, meanwhile, the network resource data currently read is carried out same
Step caching.
9. a kind of computer-readable recording medium, is stored thereon with computer program, it is characterised in that the program is held by processor
Following steps are realized during row:
For the webpage based on HTML, web page resources address is obtained;
Based on the web page resources address, judge whether the corresponding web page resources in the web page resources address have been buffered in the visitor
In the end of family;
If the web page resources have been buffered in the client, the web page resources are read from the client and are loaded
Display;
If the web page resources are uncached in the client, initiating network to the webserver using OkHttp frameworks please
Ask, so as to set up data transmission pipe stream between the webserver and the client;
During the network resource data that the data transmission pipe stream is returned is read, to the Internet resources currently read
Data synchronize loaded and displayed, meanwhile, caching is synchronized to the network resource data currently read.
10. a kind of computer equipment, including memory, processor and storage are on a memory and the meter that can run on a processor
Calculation machine program, it is characterised in that realize following steps during the computing device described program:
For the webpage based on HTML, web page resources address is obtained;
Based on the web page resources address, judge whether the corresponding web page resources in the web page resources address have been buffered in the visitor
In the end of family;
If the web page resources have been buffered in the client, the web page resources are read from the client and are loaded
Display;
If the web page resources are uncached in the client, initiating network to the webserver using OkHttp frameworks please
Ask, so as to set up data transmission pipe stream between the webserver and the client;
During the network resource data that the data transmission pipe stream is returned is read, to the Internet resources currently read
Data synchronize loaded and displayed, meanwhile, caching is synchronized to the network resource data currently read.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710499814.8A CN107291913B (en) | 2017-06-27 | 2017-06-27 | Hypertext markup language webpage loading method and device |
PCT/CN2017/107041 WO2019000722A1 (en) | 2017-06-27 | 2017-10-20 | Hypertext markup language webpage loading method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710499814.8A CN107291913B (en) | 2017-06-27 | 2017-06-27 | Hypertext markup language webpage loading method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107291913A true CN107291913A (en) | 2017-10-24 |
CN107291913B CN107291913B (en) | 2019-03-15 |
Family
ID=60098192
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710499814.8A Active CN107291913B (en) | 2017-06-27 | 2017-06-27 | Hypertext markup language webpage loading method and device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN107291913B (en) |
WO (1) | WO2019000722A1 (en) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109800370A (en) * | 2018-12-14 | 2019-05-24 | 平安普惠企业管理有限公司 | Display methods, device, computer equipment and the storage medium of Webpage |
CN109992428A (en) * | 2017-12-29 | 2019-07-09 | 北京京东尚科信息技术有限公司 | Data processing method and system |
CN111035927A (en) * | 2019-12-12 | 2020-04-21 | 珠海海鸟科技有限公司 | Resource management method and device and readable storage medium |
CN111427641A (en) * | 2020-02-27 | 2020-07-17 | 深圳壹账通智能科技有限公司 | Multi-language adaptation method, device, system, computer equipment and storage medium |
CN112214701A (en) * | 2020-10-14 | 2021-01-12 | 青岛海尔科技有限公司 | Page display method and system, storage medium and electronic device |
CN113094612A (en) * | 2021-04-08 | 2021-07-09 | 中国工商银行股份有限公司 | Method and device for loading webpage at client, electronic equipment and medium |
CN113626740A (en) * | 2021-06-30 | 2021-11-09 | 济南浪潮数据技术有限公司 | Client data refreshing method, device and equipment |
CN114827271A (en) * | 2022-04-26 | 2022-07-29 | 土巴兔集团股份有限公司 | Multi-level cache online control method and related device |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104536849A (en) * | 2015-01-20 | 2015-04-22 | 成都携恩科技有限公司 | Data backup method based on cloud computing |
CN105760405A (en) * | 2014-12-19 | 2016-07-13 | 阿里巴巴集团控股有限公司 | Methods and devices for obtaining network resource for loading web page and method and device for caching network resource |
US20160344831A1 (en) * | 2015-05-21 | 2016-11-24 | Google Inc. | Proxy service for content requests |
US20160350560A1 (en) * | 2015-06-01 | 2016-12-01 | Nxp B.V. | White-Box Cryptography Interleaved Lookup Tables |
CN106354879A (en) * | 2016-09-27 | 2017-01-25 | 北京奇虎科技有限公司 | Webpage caching method and device |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103455478A (en) * | 2012-05-21 | 2013-12-18 | 腾讯科技(深圳)有限公司 | Webpage access accelerating method and device |
CN105022750B (en) * | 2014-04-28 | 2019-05-10 | 腾讯科技(北京)有限公司 | Resource file loading method and device |
CN106022870A (en) * | 2016-05-16 | 2016-10-12 | 南京邮电大学 | Android purchase system based on geographical positional information |
CN106055720A (en) * | 2016-07-18 | 2016-10-26 | 北京小米移动软件有限公司 | Webpage displaying method and device |
CN106547833A (en) * | 2016-10-11 | 2017-03-29 | 乐视控股(北京)有限公司 | Web browser method and device |
CN106790687A (en) * | 2017-02-17 | 2017-05-31 | 和创(北京)科技股份有限公司 | Webpage display method, web data processing method and server |
-
2017
- 2017-06-27 CN CN201710499814.8A patent/CN107291913B/en active Active
- 2017-10-20 WO PCT/CN2017/107041 patent/WO2019000722A1/en active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105760405A (en) * | 2014-12-19 | 2016-07-13 | 阿里巴巴集团控股有限公司 | Methods and devices for obtaining network resource for loading web page and method and device for caching network resource |
CN104536849A (en) * | 2015-01-20 | 2015-04-22 | 成都携恩科技有限公司 | Data backup method based on cloud computing |
US20160344831A1 (en) * | 2015-05-21 | 2016-11-24 | Google Inc. | Proxy service for content requests |
US20160350560A1 (en) * | 2015-06-01 | 2016-12-01 | Nxp B.V. | White-Box Cryptography Interleaved Lookup Tables |
CN106354879A (en) * | 2016-09-27 | 2017-01-25 | 北京奇虎科技有限公司 | Webpage caching method and device |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109992428A (en) * | 2017-12-29 | 2019-07-09 | 北京京东尚科信息技术有限公司 | Data processing method and system |
CN109992428B (en) * | 2017-12-29 | 2022-06-07 | 北京京东尚科信息技术有限公司 | Data processing method and system |
CN109800370A (en) * | 2018-12-14 | 2019-05-24 | 平安普惠企业管理有限公司 | Display methods, device, computer equipment and the storage medium of Webpage |
CN111035927A (en) * | 2019-12-12 | 2020-04-21 | 珠海海鸟科技有限公司 | Resource management method and device and readable storage medium |
CN111427641A (en) * | 2020-02-27 | 2020-07-17 | 深圳壹账通智能科技有限公司 | Multi-language adaptation method, device, system, computer equipment and storage medium |
CN112214701A (en) * | 2020-10-14 | 2021-01-12 | 青岛海尔科技有限公司 | Page display method and system, storage medium and electronic device |
CN113094612A (en) * | 2021-04-08 | 2021-07-09 | 中国工商银行股份有限公司 | Method and device for loading webpage at client, electronic equipment and medium |
CN113626740A (en) * | 2021-06-30 | 2021-11-09 | 济南浪潮数据技术有限公司 | Client data refreshing method, device and equipment |
CN114827271A (en) * | 2022-04-26 | 2022-07-29 | 土巴兔集团股份有限公司 | Multi-level cache online control method and related device |
CN114827271B (en) * | 2022-04-26 | 2024-05-03 | 土巴兔集团股份有限公司 | Multi-level cache online control method and related device |
Also Published As
Publication number | Publication date |
---|---|
WO2019000722A1 (en) | 2019-01-03 |
CN107291913B (en) | 2019-03-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107291913B (en) | Hypertext markup language webpage loading method and device | |
CN103218434B (en) | A kind of method and apparatus loading static resource | |
CN102722563B (en) | Method and device for displaying page | |
CN102385594B (en) | The kernel control method of multi-core browser and device | |
CN101147145B (en) | Embedded web-based management method | |
JP5443513B2 (en) | Method and system for handling cookies across domains | |
US9690568B2 (en) | Client-side script bundle management system | |
CN102075570B (en) | Method for implementing HTTP (hyper text transport protocol) message caching mechanism based on keywords | |
CN102930058B (en) | A kind of method and apparatus realizing searching in the address field of browser | |
CN102930034B (en) | page loading system and method | |
CN110096660A (en) | Method, apparatus and electronic equipment for loading page picture | |
CN108366058A (en) | Method, apparatus, equipment and the storage medium for preventing advertisement operators flow from kidnapping | |
CN107992557A (en) | Static resource update method, device, storage medium and computer equipment | |
CN108932332A (en) | The loading method and device of static resource | |
CN107590145A (en) | A kind for the treatment of method and apparatus of page static resource | |
CN107807937A (en) | A kind of website SEO processing methods, apparatus and system | |
CN107343031A (en) | A kind of method, apparatus for automatically updating file, electronic equipment and storage medium | |
CN107305576A (en) | The pseudo- static treatment method and apparatus of the page | |
CN111881391B (en) | Static network resource preloading method, data model training method and device | |
CN110737853B (en) | Multi-platform display static page data synchronization method and B2B system | |
CN107105336A (en) | Data processing method and data processing equipment | |
CN108241689A (en) | Page resource acquisition methods, device and client device | |
CN106911735A (en) | Data capture method and device | |
CN106446075A (en) | Page request processing method and apparatus | |
CN108494728A (en) | Blacklist base establishing method, device, equipment and the medium for preventing flow from kidnapping |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20240129 Address after: Room 801, 85 Kefeng Road, Huangpu District, Guangzhou City, Guangdong Province Patentee after: Yami Technology (Guangzhou) Co.,Ltd. Country or region after: China Address before: 430000 East Lake Development Zone, Wuhan City, Hubei Province, No. 1 Software Park East Road 4.1 Phase B1 Building 11 Building Patentee before: WUHAN DOUYU NETWORK TECHNOLOGY Co.,Ltd. Country or region before: China |