CN107291913B - Hypertext markup language webpage loading method and device - Google Patents

Hypertext markup language webpage loading method and device Download PDF

Info

Publication number
CN107291913B
CN107291913B CN201710499814.8A CN201710499814A CN107291913B CN 107291913 B CN107291913 B CN 107291913B CN 201710499814 A CN201710499814 A CN 201710499814A CN 107291913 B CN107291913 B CN 107291913B
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.)
Active
Application number
CN201710499814.8A
Other languages
Chinese (zh)
Other versions
CN107291913A (en
Inventor
陈娇
张文明
陈少杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yami Technology Guangzhou Co ltd
Original Assignee
Wuhan Douyu Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201710499814.8A priority Critical patent/CN107291913B/en
Priority to PCT/CN2017/107041 priority patent/WO2019000722A1/en
Publication of CN107291913A publication Critical patent/CN107291913A/en
Application granted granted Critical
Publication of CN107291913B publication Critical patent/CN107291913B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching

Abstract

The present invention relates to applicating developing technology field more particularly to hypertext markup language webpage loading methods and device, including obtaining web page resources address for the webpage based on hypertext markup language;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 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 network server using OkHttp frame, so as to establish data transmission pipe stream between network server and client;During reading the network resource data that data transmission pipe stream returns, 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 to request can be realized to carry out load caching to uncached Internet resources, improves load buffer efficiency, saves flow.

Description

Hypertext markup language webpage loading method and device
Technical field
The present invention relates to applicating developing technology field more particularly to hypertext markup language webpage loading methods and device.
Background technique
Hypertext markup language (HyperText Markup Language, HTML) is a kind of mark applied in webpage Remember language, can be realized the creation of webpage by the markup language.For the webpage using HTML creation, in order to reduce pair The frequency of physical data source access, improves runnability, and this kind of webpage will be buffered while load.
However, the prior art during loading html web page and being cached, needs to initiate to network server Network request twice, network request is respectively as follows: for the network request of webpage load and for the network of web cache twice for this Request, problem not low there is only load buffer efficiency, but also waste flow.
Summary of the invention
In view of the above problems, it proposes on the present invention overcomes the above problem or at least be partially solved in order to provide one kind State the hypertext markup language webpage loading method and device of problem.
The embodiment of the present invention provides a kind of hypertext markup language webpage loading method, is applied in client, the side Method includes:
For the webpage based on hypertext markup language, 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 It states 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 network server using OkHttp frame Network request, so as to establish data transmission pipe stream between the network server and the client;
During reading the network resource data that the data transmission pipe stream returns, to the network currently read Resource data synchronizes loaded and displayed, meanwhile, caching is synchronized to the network resource data currently read.
Preferably, the type of the webpage is HTML5.
Preferably, if the web page resources are uncached in the client, utilize OkHttp frame to network Server initiates network request, so as to establish data transmission pipe stream between the network server and the client, comprising:
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 for not allowing caching resource, 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 frame is utilized Frame initiates network request to network server, so as to establish data transmission pipe between the network server and the client Otherwise stream returns to sky, does not cache to the web page resources.
Preferably, 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, comprising:
Cache database include it is data cached in search whether that there are the web page resources addresses;
Wherein, if there are the web page resources address in the cache database, show that the web page resources have 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.
Preferably, it is described cache database include it is data cached in search whether that there are the web page resources addresses Before, the method also includes:
Obtained from the cache database it is described data cached, and by it is described it is data cached be stored in Map set in.
Preferably, the method also includes:
Obtain the cache-time for the web page resources being buffered in the client;
Judge whether the cache-time is more than the preset cache period;
If the cache-time is more than the preset cache period, the webpage being buffered in the client is provided It is deleted in source.
It is preferably, described that caching is synchronized to the network resource data currently read, comprising:
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 hypertext markup language webpage loading device, and described device includes:
Module is obtained, for obtaining web page resources address for the webpage based on hypertext markup language;
Judgment module judges the corresponding web page resources in the web page resources address for being based on the web page resources address Whether it has been buffered in the client;
Loading module is read from the client if being buffered in the client for the web page resources The web page resources and loaded and displayed;
Initiation module is requested, if uncached in the client for the web page resources, utilizes OkHttp frame Network request is initiated to network server, so as to establish data transmission pipe between the network server and the client Stream;
Cache module is loaded, for during reading the network resource data that the data transmission pipe stream returns, Loaded and displayed is synchronized to the network resource data currently read, meanwhile, to the network resource data currently read into Row synchronization caching.
The embodiment of the present invention also provides a kind of computer readable storage medium, is stored thereon with computer program, the program It is performed the steps of when being executed by processor
For the webpage based on hypertext markup language, 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 It states 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 network server using OkHttp frame Network request, so as to establish data transmission pipe stream between the network server and the client;
During reading the network resource data that the data transmission pipe stream returns, 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 storage are on a memory simultaneously The computer program that can be run on a processor, the processor perform the steps of when executing described program
For the webpage based on hypertext markup language, 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 It states 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 network server using OkHttp frame Network request, so as to establish data transmission pipe stream between the network server and the client;
During reading the network resource data that the data transmission pipe stream returns, 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 technical solutions in the embodiment of the present invention, have at least the following technical effects or advantages:
The application is directed to html web page, during loading html web page, first obtains web page resources address, then judges Whether the corresponding web page resources in web page resources address have been buffered in client local, if web page resources have been buffered in client sheet Ground then locally reads the web page resources and loaded and displayed from client, if web page resources are uncached in client local, utilizes OkHttp frame initiates network request to network server, so as to establish data transmission pipe between network server and client Stream, and during client reads the network resource data that data transmission pipe stream returns, 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 It needs primary network request can be realized and load caching is carried out to uncached Internet resources, improve load buffer efficiency, save Saved flow, simultaneously because initiate the network request using OkHttp frame, can automatic fitration fall duplicate network request.
Detailed description of the invention
By reading the following detailed description of the preferred embodiment, various other advantages and benefits are common for this field Technical staff will become clear.The drawings are only for the purpose of illustrating a preferred embodiment, and is not considered as to the present invention Limitation.And throughout the drawings, identical component is indicated with identical reference pattern.In the accompanying drawings:
Fig. 1 shows the flow chart of one of embodiment of the present invention hypertext markup language webpage loading method;
Fig. 2 shows the structure charts of one of embodiment of the present invention hypertext markup language webpage loading device;
Fig. 3 shows the entity structure schematic diagram of the computer equipment in the embodiment of the present invention.
Specific embodiment
Exemplary embodiments of the present disclosure are described in more detail below with reference to accompanying drawings.Although showing the disclosure in attached drawing Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here It is 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 It is fully disclosed to those skilled in the art.
The embodiment of the present application provides a kind of hypertext markup language webpage loading method, is applied in client, such as Fig. 1 institute Show, which comprises
Step 101: for the webpage based on hypertext markup language, obtaining web page resources address.
Step 102: being based on the web page resources address, whether to judge the corresponding web page resources in the web page resources address 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 frame to network Business device initiates network request, so as to establish data transmission pipe stream between the network server and the client.
Step 104: during reading the network resource data that the data transmission pipe stream returns, being read to current 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 loading html web page, first obtains web page resources address, then judges Whether the corresponding web page resources in web page resources address have been buffered in client local, if web page resources have been buffered in client sheet Ground then locally reads the web page resources and loaded and displayed from client, if web page resources are uncached in client local, utilizes OkHttp frame initiates network request to network server, so as to establish data transmission pipe between network server and client Stream, and during client reads the network resource data that data transmission pipe stream returns, 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 It needs primary network request can be realized and load caching is carried out to uncached Internet resources, improve load buffer efficiency, save Saved flow, simultaneously because initiate the network request using OkHttp frame, can automatic fitration fall duplicate network request.
In this application, the type of webpage can be HTML5.
The present processes can establish in BasicWebViewClient class, thus using should BasicWebViewClient class replaces WebViewClient in 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) then, execute step to realize acquisition to URL 102.A kind of preferred embodiment of step 102 includes:
Cache database include it is data cached in search whether that there are the web page resources addresses.
Wherein, cache database is located at client local, is stored in cache database and has been cached data cached, delays Deposit data includes URL, the web page resources of caching and corresponding relationship between the two, for example, include in cache database URL1, Corresponding first picture of URL1, URL2 and the corresponding second picture of URL2.The application passes through the caching that includes in cache database Search whether in data there are web page resources address, can determine web page resources corresponding with the web page resources address whether by Be buffered in client local, if cache database include it is data cached middle there are the web page resources address, show the webpage The corresponding web page resources of resource address be buffered in client local, if cache database include it is data cached in there is no should Web page resources address then shows that the corresponding web page resources in web page resources address are uncached in client local.
The application execute cache database include it is data cached in search whether there are the web page resources address it Before, it further comprises the steps of: and is obtained from the cache database described data cached, and data cached be stored in Map collection for described In conjunction.The application is by, from extracting and being stored in Map set in cache database, avoiding by data cached and searching net every time Page resource requires the problem for calling search efficiency brought by cache database low.
Further, in step 103, if the corresponding web page resources in web page resources address have been buffered in client local, 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 network server using OkHttp frame, so that the network server and the client Data transmission pipe stream is established between end.
In a preferred embodiment, it if the web page resources are uncached in the client, utilizes OkHttp frame initiates network request to network server, so as to establish data between the network server and the client Transmission pipeline stream, comprising:
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 for not allowing caching resource, 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 frame is utilized Frame initiates network request to network server, so as to establish data transmission pipe between the network server and the client Otherwise stream returns to sky, does not cache to the web page resources.
In the specific implementation process, if the corresponding web page resources in web page resources address are uncached in client local, sentence Whether the web page resources that break 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 caching blacklist, show that the web page resources have There is caching qualification, if web page resources belong to caching blacklist, shows that the web page resources do not have caching qualification, if web page resources It is not belonging to caching white list and is also not belonging to caching blacklist, then show that the web page resources do not have caching qualification.
For example, caching the second caching in blacklist if it is baidu that the first caching condition in caching white list, which is domain name, Condition is that suffix is JPG, and, it is PNG that the domain name of the first web page resources, which is baidu suffix, then the first web page resources have caching Qualification initiates network request to network server using OkHttp frame, and the domain name of the second web page resources is that baidu suffix is JPG, then the second web page resources do not have caching qualification, return to sky, do not cache to the second web page resources, third web page resources Domain name be google suffix be PNG, then third web page resources do not have caching qualification yet, return empty, do not provide to the second webpage Source is cached.
Further, the application initiates network request to network server using OkHttp frame, so that the network service Data transmission pipe stream is established between device and the client, data transmission pipe stream includes input channel stream (PipedInputStream) and output channel stream (PipedOutputStream), the application are real using data transmission pipe stream Direct communication between existing main thread and sub thread can be realized and show in 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 webpage for how many data in pipeline stream, and web page resources have loaded, and data cached also write-in finishes, Finally, will be in the data cached path cached and access time write-in cache database.
The hypertext markup language webpage loading method of the application further include:
Obtain the cache-time for the web page resources being buffered in the client;
Judge whether the cache-time is more than the preset cache period;
If the cache-time is more than the preset cache period, the webpage being buffered in the client is provided It is deleted in source.
In the specific implementation process, the attribute information for being buffered in the web page resources of client local can be in database caches It being found in list, the cache-time for being buffered in the web page resources of client local is the difference of access time and current time, If the difference of access time and current time is greater than the preset cache period, the web page resources for being buffered in client local are deleted It removes, if cache-time is not above the preset cache period, continues to retain, the preset cache period can be set to one day, one Week or one month.
It should be noted that the application is judging web page resources address after obtaining URL, and being based on web page resources address Whether corresponding web page resources have been buffered in front of client local, further include method: judge whether URL is normal URL, if It is then to execute subsequent load process of caching, if it is not, sky is then directly returned to, without loading process of caching.
Based on the same inventive concept, the embodiment of the present invention also provides a kind of hypertext markup language webpage loading device, such as Shown in Fig. 2, described device includes:
Module 201 is obtained, for obtaining web page resources address for the webpage based on hypertext markup language;
Judgment module 202 judges the corresponding webpage money in the web page resources address for being based on the web page resources address Whether source has been buffered in the client;
Loading module 203 is read from the client if being buffered in the client for the web page resources Take the web page resources and loaded and displayed;
Initiation module 204 is requested, if uncached in the client for the web page resources, utilizes OkHttp frame Frame initiates network request to network server, so as to establish data transmission pipe between the network server and the client Stream;
Cache module 205 is loaded, in the process for reading the network resource data that the data transmission pipe stream returns In, loaded and displayed is synchronized to the network resource data currently read, meanwhile, to the network resource data currently read Synchronize caching.
Preferably, the type of the webpage is HTML5.
Preferably, initiation module 204 is requested, is specifically used 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 for not allowing caching resource, 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 frame is utilized Frame initiates network request to network server, so as to establish data transmission pipe between the network server and the client Otherwise stream returns to sky, does not cache to the web page resources.
Preferably, judgment module 203, comprising:
Cache database include it is data cached in search whether that there are the web page resources addresses;
Wherein, if there are the web page resources address in the cache database, show that the web page resources have 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.
Preferably, described device further include:
Storage module, it is described data cached for being obtained from the cache database, and by the data cached storage Into Map set.
Preferably, the method also includes:
Time-obtaining module, for obtaining the cache-time for the web page resources being buffered in the client;
Period judgment module, for judging whether the cache-time is more than the preset cache period;
Removing module is buffered in the visitor to described if being more than the preset cache period for the cache-time Web page resources in the end of family are deleted.
Preferably, the load cache module, is specifically used for:
Web page resources address synchronization corresponding to the network resource data currently read is cached in cache database.
Based on the same inventive concept, the embodiment of the present invention also provides a kind of computer readable storage medium, is stored thereon with Computer program, the program perform the steps of when being executed by processor
For the webpage based on hypertext markup language, 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 It states 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 network server using OkHttp frame Network request, so as to establish data transmission pipe stream between the network server and the client;
During reading the network resource data that the data transmission pipe stream returns, 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 invention also provides a kind of computer equipments, as shown in figure 3, for ease of description, illustrate only with The relevant part of the embodiment of the present invention, it is disclosed by specific technical details, please refer to present invention method part.The calculating Machine equipment can be include mobile phone, tablet computer, PDA (Personal Digital Assistant, personal digital assistant), Any terminal devices such as POS (Point of Sales, point-of-sale terminal), vehicle-mounted computer, by taking computer equipment is mobile phone as an example:
Fig. 3 shows the block diagram of part-structure relevant to computer equipment provided in an embodiment of the present invention.With reference to figure 3, which includes: memory 301 and processor 302.It will be understood by those skilled in the art that being counted shown in Fig. 3 It calculates machine equipment structure and does not constitute the restriction to computer equipment, may include than illustrating more or fewer components or group Close certain components or different component layouts.
It is specifically introduced below with reference to each component parts of the Fig. 3 to computer equipment:
Memory 301 can be used for storing software program and module, and processor 302 is stored in memory 301 by operation Software program and module, thereby executing various function application and data processing.Memory 301 can mainly include storage journey Sequence area and storage data area, wherein storing program area can the (ratio of application program needed for storage program area, at least one function Such as sound-playing function, image player function) etc.;It storage data area can storing data (such as audio data, phone directory etc.) Deng.In addition, memory 301 may include high-speed random access memory, it can also include nonvolatile memory, 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, by running or executing the software being stored in memory 301 Program and/or module, and the data being stored in memory 301 are called, perform various functions and handle data.Optionally, Processor 302 may include one or more processing units;Preferably, processor 302 can integrate application processor and modulation /demodulation Processor, wherein the main processing operation system of application processor, user interface and application program etc., modem processor master Handle wireless communication.
In embodiments of the present invention, processor 302 included by the computer equipment can have following functions:
For the webpage based on hypertext markup language, 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 It states 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 network server using OkHttp frame Network request, so as to establish data transmission pipe stream between the network server and the client;
During reading the network resource data that the data transmission pipe stream returns, to the network currently read Resource data synchronizes loaded and displayed, meanwhile, caching is synchronized to the network resource data currently read.
In short, the application is directed to html web page, during loading html web page, web page resources address is first obtained, is connect Judge the corresponding web page resources in web page resources address whether be buffered in client local, 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 network server using OkHttp frame, so as to establish data transmission between network server and client Pipeline stream, and during client reads the network resource data that data transmission pipe stream returns, 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 It please only needs primary network request can be realized and load caching is carried out to uncached Internet resources, improve load caching effect Rate saves flow, simultaneously because initiate the network request using OkHttp frame, can automatic fitration fall duplicate network and ask It asks.
Algorithm and display are not inherently related to any particular computer, virtual system, or other device provided herein. Various general-purpose systems can also be used together with teachings based herein.As described above, it constructs required by this kind of system Structure be obvious.In addition, the present invention is also not directed to any particular programming language.It should be understood that can use various Programming language realizes summary of the invention described herein, and the description done above to language-specific is to disclose this hair Bright preferred forms.
In the instructions provided here, numerous specific details are set forth.It is to be appreciated, however, that implementation of the invention Example can be practiced without these specific details.In some instances, well known method, structure is not been shown in detail And technology, so as not to obscure the understanding of this specification.
Similarly, it should be understood that in order to simplify the disclosure and help to understand one or more of the various inventive aspects, Above in the description of 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 disclosed method should not be interpreted as reflecting the following intention: i.e. required to protect Shield the present invention claims features more more than feature expressly recited in each claim.More precisely, as following Claims reflect as, inventive aspect is all features less than single embodiment disclosed above.Therefore, Thus the claims for following specific embodiment are expressly incorporated in the specific embodiment, wherein each claim itself All as a separate embodiment of the present invention.
Those skilled in the art will understand that can be carried out adaptively to the module in the equipment in embodiment Change and they are arranged in one or more devices different from this embodiment.It can be the module or list in embodiment Member or component are combined into a module or unit or component, and furthermore they can be divided into multiple submodule or subelement or Sub-component.Other than such feature and/or at least some of process or unit exclude each other, it can use any Combination is to all features disclosed in this specification (including adjoint claim, abstract and attached drawing) and so disclosed All process or units of what method or apparatus are combined.Unless expressly stated otherwise, this specification is (including adjoint power Benefit require, abstract and attached drawing) disclosed in each feature can carry out generation with an alternative feature that provides the same, equivalent, or similar purpose It replaces.
In addition, it will be appreciated by those of skill in the art that although some embodiments in this include institute in other embodiments Including certain features rather than other feature, but the combination of the feature of different embodiment means 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 can in any combination mode come using.
Various component embodiments of the invention can be implemented in hardware, or to run on one or more processors Software module realize, or be implemented in a combination thereof.It will be understood by those of skill in the art that can be used in practice Microprocessor or digital signal processor (DSP) realize gateway according to an embodiment of the present invention, proxy server, in system Some or all components some or all functions.The present invention is also implemented as executing side as described herein Some or all device or device programs (for example, computer program and computer program product) of method.It is such It realizes that program of the 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 an internet website to obtain, and perhaps be provided on the carrier signal or with any other shape Formula provides.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and ability Field technique personnel can be designed alternative embodiment without departing from the scope of the appended claims.In the claims, Any reference symbol between parentheses should not be configured to limitations on claims.Word "comprising" does not exclude the presence of not Element or step listed in the claims.Word "a" or "an" located in front of the element does not exclude the presence of multiple such Element.The present invention can be by means of including the hardware of several different elements and being come by means of properly programmed computer real It is existing.In the unit claims listing several devices, several in these devices can be through the same hardware branch To embody.Word, second and the use of third etc. do not indicate any sequence.These words can be construed to title.

Claims (7)

1. a kind of hypertext markup language webpage loading method, which is characterized in that be applied in client, which comprises
For the webpage based on hypertext markup language, 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, network is initiated to network server using OkHttp frame and is asked It asks, so as to establish data transmission pipe stream between the network server and the client;
During reading the network resource data that the data transmission pipe stream returns, to the Internet resources currently read Data synchronize loaded and displayed, meanwhile, caching is synchronized to the network resource data currently read;
It is described to be 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 It states in client, comprising:
Cache database include it is data cached in search whether that there are the web page resources addresses;
Wherein, if there are the web page resources address in the cache database, show that the web page resources have been buffered in institute It states in client, if the web page resources address is not present in the cache database, the web page resources are uncached in institute It states in client;
If the web page resources are uncached in the client, net is initiated to network server using OkHttp frame Network request, so as to establish data transmission pipe stream between the network server and the client, comprising:
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 for not allowing caching resource, 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 frame to Network server initiates network request, so as to data transmission pipe stream is established between the network server and the client, Otherwise, sky is returned, the web page resources are not cached;
It is described cache database include it is data cached in search whether there are before the web page resources address, the side Method further include:
Obtained from the cache database it is described data cached, and by it is described it is data cached be stored in Map set in.
2. the method as described in claim 1, which is characterized in that the type of the webpage is HTML5.
3. the method as described in claim 1, which is characterized in that the method also includes:
Obtain the cache-time for the web page resources being buffered in the client;
Judge whether the cache-time is more than the preset cache period;
If the cache-time be more than the preset cache period, to the web page resources being buffered in the client into Row is deleted.
4. the method as described in claim 1, which is characterized in that described to be synchronized to the network resource data currently read Caching, comprising:
Web page resources address synchronization corresponding to the network resource data currently read is cached in cache database.
5. a kind of hypertext markup language webpage loading device, which is characterized in that described device includes:
Module is obtained, for obtaining web page resources address for the webpage based on hypertext markup language;
Whether judgment module judges the corresponding web page resources in the web page resources address for being based on the web page resources address It has cached in the client;
Loading module, if being buffered in the client for the web page resources, from the client described in reading Web page resources and loaded and displayed;
Initiation module is requested, if uncached in the client for the web page resources, utilizes OkHttp frame to net Network server initiates network request, so as to establish data transmission pipe stream between the network server and the client;
Cache module is loaded, for during reading the network resource data that the data transmission pipe stream returns, 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;
It is described to be 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 It states in client, comprising:
Cache database include it is data cached in search whether that there are the web page resources addresses;
Wherein, if there are the web page resources address in the cache database, show that the web page resources have been buffered in institute It states in client, if the web page resources address is not present in the cache database, the web page resources are uncached in institute It states in client;
If the web page resources are uncached in the client, net is initiated to network server using OkHttp frame Network request, so as to establish data transmission pipe stream between the network server and the client, comprising:
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 for not allowing caching resource, 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 frame to Network server initiates network request, so as to data transmission pipe stream is established between the network server and the client, Otherwise, sky is returned, the web page resources are not cached;
It is described cache database include it is data cached in search whether also to wrap there are before the web page resources address It includes:
Obtained from the cache database it is described data cached, and by it is described it is data cached be stored in Map set in.
6. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is held by processor It is performed the steps of when row
For the webpage based on hypertext markup language, 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 client In;
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, network is initiated to network server using OkHttp frame and is asked It asks, so as to establish data transmission pipe stream between the network server and the client;
During reading the network resource data that the data transmission pipe stream returns, to the Internet resources currently read Data synchronize loaded and displayed, meanwhile, caching is synchronized to the network resource data currently read;
It is described to be 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 It states in client, comprising:
Cache database include it is data cached in search whether that there are the web page resources addresses;
Wherein, if there are the web page resources address in the cache database, show that the web page resources have been buffered in institute It states in client, if the web page resources address is not present in the cache database, the web page resources are uncached in institute It states in client;
If the web page resources are uncached in the client, net is initiated to network server using OkHttp frame Network request, so as to establish data transmission pipe stream between the network server and the client, comprising:
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 for not allowing caching resource, 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 frame to Network server initiates network request, so as to data transmission pipe stream is established between the network server and the client, Otherwise, sky is returned, the web page resources are not cached;
It is described cache database include it is data cached in search whether also to wrap there are before the web page resources address It includes:
Obtained from the cache database it is described data cached, and by it is described it is data cached be stored in Map set in.
7. a kind of computer equipment including memory, processor and stores the meter that can be run on a memory and on a processor Calculation machine program, which is characterized in that the processor performs the steps of when executing described program
For the webpage based on hypertext markup language, 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 client In;
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, network is initiated to network server using OkHttp frame and is asked It asks, so as to establish data transmission pipe stream between the network server and the client;
During reading the network resource data that the data transmission pipe stream returns, to the Internet resources currently read Data synchronize loaded and displayed, meanwhile, caching is synchronized to the network resource data currently read;
It is described to be 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 It states in client, comprising:
Cache database include it is data cached in search whether that there are the web page resources addresses;
Wherein, if there are the web page resources address in the cache database, show that the web page resources have been buffered in institute It states in client, if the web page resources address is not present in the cache database, the web page resources are uncached in institute It states in client;
If the web page resources are uncached in the client, net is initiated to network server using OkHttp frame Network request, so as to establish data transmission pipe stream between the network server and the client, comprising:
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 for not allowing caching resource, 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 frame to Network server initiates network request, so as to data transmission pipe stream is established between the network server and the client, Otherwise, sky is returned, the web page resources are not cached;
It is described cache database include it is data cached in search whether also to wrap there are before the web page resources address It includes:
Obtained from the cache database it is described data cached, and by it is described it is data cached be stored in Map set in.
CN201710499814.8A 2017-06-27 2017-06-27 Hypertext markup language webpage loading method and device Active CN107291913B (en)

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 CN107291913A (en) 2017-10-24
CN107291913B true 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)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
CN112214701A (en) * 2020-10-14 2021-01-12 青岛海尔科技有限公司 Page display method and system, storage medium and electronic device
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 (2)

* Cited by examiner, † Cited by third party
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
CN106354879A (en) * 2016-09-27 2017-01-25 北京奇虎科技有限公司 Webpage caching method and device

Family Cites Families (9)

* Cited by examiner, † Cited by third party
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
CN104536849B (en) * 2015-01-20 2017-10-20 成都携恩科技有限公司 A kind of data back up method based on cloud computing
US20160344831A1 (en) * 2015-05-21 2016-11-24 Google Inc. Proxy service for content requests
US10505709B2 (en) * 2015-06-01 2019-12-10 Nxp B.V. White-box cryptography interleaved lookup tables
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

Patent Citations (2)

* Cited by examiner, † Cited by third party
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
CN106354879A (en) * 2016-09-27 2017-01-25 北京奇虎科技有限公司 Webpage caching method and device

Also Published As

Publication number Publication date
WO2019000722A1 (en) 2019-01-03
CN107291913A (en) 2017-10-24

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
CN106528432B (en) The construction method and device of test scene data bury a test method
CN102722563B (en) Method and device for displaying page
CA2878207C (en) Evaluating application compatibility
CN105095280B (en) Browser caching method and device
CN105022750B (en) Resource file loading method and device
US9690568B2 (en) Client-side script bundle management system
CN107463613A (en) Page loading method and device
CN110096660B (en) Method and device for loading page pictures and electronic equipment
CN104572777B (en) Webpage loading method and device based on UIWebView component
US8516041B1 (en) Pre-fetching asynchronously requested content
KR20160024293A (en) Method and apparatus for reducing page load time in a communication system
CN108932332A (en) The loading method and device of static resource
CN110442815B (en) Page generation method, system, device and computer readable storage medium
CN103152367A (en) Cache dynamic maintenance updating method and system
CN111881394B (en) Request processing method and system for application middle layer
CN107807937B (en) Website SEO processing method, device and system
CN111881391B (en) Static network resource preloading method, data model training method and device
CN108256014A (en) Page display method and device
CN113742551A (en) Dynamic data capture method based on script and puppeteer
CN109325192A (en) A kind of method and apparatus of the anti-shielding of advertisement
KR20060080180A (en) Method of caching data assets
CN109284428A (en) Data processing method, device and storage medium
CN110020297A (en) A kind of loading method of web page contents, apparatus and system

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.

Guo jiahuodiqu after: Zhong Guo

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.

Guo jiahuodiqu before: Zhong Guo