CN104462231B - The method, apparatus and system of webpage rendering - Google Patents

The method, apparatus and system of webpage rendering Download PDF

Info

Publication number
CN104462231B
CN104462231B CN201410642767.4A CN201410642767A CN104462231B CN 104462231 B CN104462231 B CN 104462231B CN 201410642767 A CN201410642767 A CN 201410642767A CN 104462231 B CN104462231 B CN 104462231B
Authority
CN
China
Prior art keywords
file
html file
client
html
server
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
CN201410642767.4A
Other languages
Chinese (zh)
Other versions
CN104462231A (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.)
Qax Technology Group Inc
Original Assignee
Beijing Qianxin 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 Beijing Qianxin Technology Co Ltd filed Critical Beijing Qianxin Technology Co Ltd
Priority to CN201410642767.4A priority Critical patent/CN104462231B/en
Publication of CN104462231A publication Critical patent/CN104462231A/en
Application granted granted Critical
Publication of CN104462231B publication Critical patent/CN104462231B/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/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

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 invention discloses the method, apparatus and system of a kind of rendering of webpage, are related to Internet technical field, solve the problems, such as that webpage rendering speed is excessively slow.The method comprise the steps that when carrying out webpage rendering, user end to server reports the file identification of hypertext markup language html file, so that server judges whether network side has the update file of html file according to file identification;If server judges that network side does not have the update file of html file, client receives the offline render instruction that server issues;Client reads the html file stored in local data base according to offline render instruction;Client renders webpage according to the html file of reading.Present invention is mainly used for the Fast renderings of webpage.

Description

The method, apparatus and system of webpage rendering
Technical field
The present invention relates to Internet technical fields, more particularly to the method, apparatus and system of a kind of rendering of webpage.
Background technique
Usual browser generally requires the hypertext markup language to network side requested webpage when carrying out webpage rendering (Hypertext Markup Language, abbreviation HTML) file, cascading style list (Cascading Style Sheets, Abbreviation CSS) and scripting language (JavaScript, abbreviation JS) etc..Wherein, web document is carried in html file, determines webpage The data content of middle display;CSS is for providing the layout architecture (such as position and size of input frame) of webpage;JS is then used to add The human-computer interaction function of screening page.
In existing webpage render process, browser needs to obtain above-mentioned three kinds of files respectively, browser with The data volume of network side interaction is larger, when network side server processing capacity is limited or network bandwidth anxiety, webpage rendering Speed can be slack-off, generates the longer waiting time.
Summary of the invention
In view of this, being able to solve webpage rendering speed the invention proposes the method, apparatus and system of a kind of rendering of webpage Spend slow problem.
First aspect according to the present invention, the present invention provides a kind of methods of webpage rendering, comprising:
When carrying out webpage rendering, user end to server reports the file identification of hypertext markup language html file, So that server judges whether network side has the update file of html file according to file identification;
If server judges that network side does not have the update file of html file, client reception server issues offline Render instruction;
Client reads the html file stored in local data base according to offline render instruction;
Client renders webpage according to the html file of reading.
The second aspect according to the present invention, the present invention also provides a kind of methods of webpage rendering, comprising:
When client carries out webpage rendering, server receives the hypertext markup language html file that client reports File identification;
Server judges whether received file identification is identical as the file identification of the newest html file of network side;
If received file identification is identical as the file identification of the newest html file of network side, server is under client Send out render instruction offline, instruction client renders webpage according to the html file in local data base.
In terms of third according to the present invention, the present invention also provides a kind of device of webpage rendering, the usual positions of the device In client, comprising:
Reporting unit, for reporting the text of hypertext markup language html file to server when carrying out webpage rendering Part mark, so that server judges whether network side has the update file of html file according to file identification;
Receiving unit, for judging that network side does not have html file according to the file identification that reporting unit reports when server Update file when, receive the offline render instruction that issues of server;
Reading unit, for reading the HTML stored in local data base according to the received offline render instruction of receiving unit File;
Processing unit, the html file for being read according to reading unit render webpage.
The 4th aspect according to the present invention, the present invention also provides a kind of device of webpage rendering, the usual positions of the device In server, comprising:
Receiving unit, for receiving the hypertext markup language that client reports when client carries out webpage rendering The file identification of html file;
Judging unit, for judging the file identification of the received file identification of receiving unit Yu the newest html file of network side It is whether identical;
Issuance unit, for judging the files-designated of received file identification Yu the newest html file of network side when judging unit It is sensible to issue offline render instruction to client simultaneously, indicate client according to the html file in local data base to webpage It is rendered.
The 5th aspect according to the present invention, the present invention also provides a kind of system of webpage rendering, which includes visitor Family end and server, wherein client includes device as described in the preceding third aspect, and server is comprising such as institute in terms of first 4th The device stated.
By above-mentioned technical proposal, the method, apparatus and system of webpage rendering provided in an embodiment of the present invention can be by taking The mode that business device is compared according to the file identification of html file, judges whether network side has the update text of the html file Part, in the case where no update file, offline render instruction that client can be issued according to server is from local data base It is middle to read the html file stored before this, to be rendered to webpage.Compared with prior art, the present invention can be avoided every time Html file all is obtained from server when rendering webpage, client off-line pair can be made in the case where html file does not update Webpage is rendered.Since without the data to server request html file, the speed of webpage rendering is not by Netowrk tape Wide or server handling ability limitation, can be greatly improved the speed of webpage rendering.
The above description is only an overview of the technical scheme of the present invention, in order to better understand the technical means of the present invention, And it can be implemented in accordance with the contents of the specification, and in order to allow above and other objects of the present invention, feature and advantage can It is clearer and more comprehensible, the followings are specific embodiments of the present invention.
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, the same reference numbers will be used to refer to the same parts.In the accompanying drawings:
Fig. 1 shows the process of the method for the webpage rendering provided in an embodiment of the present invention for being mainly used for client-side Figure;
Fig. 2 shows the processes of the method for the webpage rendering provided in an embodiment of the present invention for being mainly used for server-side Figure;
The structure that Fig. 3 shows the device of the webpage rendering provided in an embodiment of the present invention for being mainly used for client-side is shown It is intended to;
The structure that Fig. 4 shows the device of the webpage rendering provided in an embodiment of the present invention for being mainly used for server-side is shown It is intended to;
Fig. 5 shows a kind of schematic diagram of the system of webpage rendering provided in an embodiment of the present invention.
Specific embodiment
It is described more fully the exemplary embodiment of the disclosure below with reference to accompanying drawings.Although showing this public affairs in attached drawing The exemplary embodiment opened, it being understood, however, that may be realized in various forms the disclosure without the implementation that should be illustrated here Example is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the model of the disclosure It encloses and is fully disclosed to those skilled in the art.
To solve the problems, such as that webpage rendering speed is excessively slow, the embodiment of the present invention provides a kind of method of webpage rendering, the party Method is mainly used for client-side, as shown in Figure 1, this method comprises:
101, user end to server reports the file identification of hypertext markup language html file.
Html file is the language being most widely used on current network, and constitutes the dominant language of web document. The descriptive text that html file is made of HTML command, HTML command can be with comment, figure, animation, sound, tables With link etc..Under normal conditions, html file can be read by a variety of web browser clients, so that rendering has figure The webpage of the visual informations such as piece, text.In the prior art, it is hard to be stored in the server being distributed in all over the world for these html files On disk, user can remotely obtain different html files by transport protocol.In actual life, when user is clear on the internet Look at webpage when, acquisition and rendering to html file is completed by some clients (usually various browser clients), it is raw At Webpage.
In the prior art, no matter whether html file has update file, and client is wanted every time when carrying out webpage rendering Html file is obtained from server.Method provided in an embodiment of the present invention does not directly acquire the html file on server, but Have judges the step of whether html file updates in advance.As step 101 reports to server the file identification of html file. The file identification of the file identification for the html file that server reports client html file corresponding with network side side carries out It compares, judges whether network side has the update file of the html file.
File identification mentioned here can then be assigned for uniquely tagged html file once html file has update file It gives a new file identification and gives update file.File identification can be generated and assigned to different html files by system, It can be by the file identification of the different html file of programmer's self-defining as needed.
102, client receives the offline render instruction that server issues.
If the html file that network side does not update, client is in the file identification for reporting html file to server Afterwards, it will receive the offline render instruction that server issues.The instruction generally includes the type or property of the operation to be completed, such as reads Access according to, make addition and subtraction or output data etc., be also used to indicate the position of operation object.Offline render instruction in the present embodiment In addition to instruction client reads data for being also used to indicate to client from where and reading the data other than rendering webpage.
103, client reads the html file stored in local data base according to offline render instruction.
After client receives the offline render instruction that server issues, parsing is completed to instruction and according in instruction Content executes relevant operation.In the present embodiment, HTML that client can be stored from local data base according to offline render instruction The html file of needs is read in file.This process read be according to the file identification of html file in the local database Corresponding html file is found, i.e. the identical html file of reading file identification.
Local data base mentioned here is independently of server, and not by the shadow of the factors such as network environment or network bandwidth It rings.The local data base is hewed out in local storage (such as local hard drive or local memory) exclusively for corresponding client One piece of independent memory space can only store corresponding data information for the client, other client lacks of competence read the visitor Data information in the local data base at family end.The client can be under off-line state to the data in own local database Information, which is increased, deleted and retrieved etc., to be managed and controlled.Data information in the local data base does not repeat usually, data Structure not only can guarantee the correctness of data but also can prevent the abnormal interaction between different clients from making independently of other clients With.
104, client renders webpage according to the html file of reading.
After client reads the identical html file of file identification from local data base, start according to html file Webpage is rendered.Html file marks the various pieces in webpage to be shown by label symbol.Such as HTML text Record has label symbol in part<html>with</html>, respectively indicate the beginning and end of this document;Label symbol<head>and </head>respectively indicate the beginning and end of file header;Label symbol<body>with</body>respectively indicate text Beginning and end.Client to the rendering of webpage is explained and shows by way of reading the label symbol in html file Its content marked will not indicate its mistake to the label for writing error, and does not stop it and explain implementation procedure, and programmer can only Error reason and error position are analyzed by display effect.Corresponding different client, might have same label symbol Not exactly the same explanation, thus the webpage of its rendering might have different display effects.
The method of webpage provided in an embodiment of the present invention rendering, can by server according to the file identification of html file into The mode that row compares, judges whether network side has the update file of the html file, in the case where no update file, client The offline render instruction that can be issued according to server is held to read the html file stored before this from local data base, thus right Webpage is rendered.Compared with prior art, HTML text all is obtained from server when the present invention can be avoided rendering webpage every time Part can make client off-line render webpage in the case where html file does not update.Due to being not necessarily to server The data of html file are requested, therefore the speed of webpage rendering is not limited by network bandwidth or server handling ability, it can be with The speed of webpage rendering is greatly improved.
Further, it corresponds to the above method, the embodiment of the present invention also provides a kind of method of webpage rendering, the party Method is mainly used for server-side, to echo with the method for above-mentioned client-side.As shown in Fig. 2, this method comprises:
201, server receives the file identification for the hypertext markup language html file that client reports.
Client carry out webpage rendering when, client need to obtain the html file of related web page and to html file into Row is explained, to complete the rendering to webpage, web displaying is made to go out complete content.In the prior art, since html file is logical It is often stored in server hard disc, therefore client obtains html file and just must remotely be obtained by way of transport protocol, This process will receive the limitation of network bandwidth or server handling ability.
In embodiments of the present invention, the step 101 in corresponding above-mentioned client-side method, when carrying out webpage rendering, Server can first receive the file identification for the html file that client reports, so as to server by this document identify and network side The file identification of corresponding html file be compared, judge whether network side has the update file of the html file.
202, server judges whether received file identification is identical as the file identification of the newest html file of network side.
Since a file identification uniquely indicates a html file, if html file has update file, after updating Html file can regain a new file identification, therefore server can be judged by way of comparing file identification Whether html file has update file, if the file identification of corresponding html file is identical, client need not be from server The html file is obtained, server process resource can be saved in this way, improves the speed for obtaining html file.If corresponding HTML The file identification of file is different, then client obtains the newest html file from server.
203, server issues offline render instruction to client.
After received file identification is compared server with the file identification of the newest html file of network side, if connecing The file identification of receipts is identical as the file identification of the newest html file of network side, then client can be corresponding from obtaining elsewhere Html file.At this point, server can indicate the subsequent acquisition operation of client executing.In the actual process, server can To issue offline render instruction to client, which is used to indicate the HTML text that client obtains needs from local data base Part is for rendering webpage.
The method of webpage provided in an embodiment of the present invention rendering, can by server according to the file identification of html file into The mode that row compares, judges whether network side has the update file of the html file, in the case where no update file, client The offline render instruction that can be issued according to server is held to read the html file stored before this from local data base, thus right Webpage is rendered.Compared with prior art, HTML text all is obtained from server when the present invention can be avoided rendering webpage every time Part can make client off-line render webpage in the case where html file does not update.Due to being not necessarily to server The data of html file are requested, therefore the speed of webpage rendering is not limited by network bandwidth or server handling ability, it can be with The speed of webpage rendering is greatly improved.
Further, as method and server-side to above-mentioned client-side method refinement and extension, this Embodiment is described in detail as follows for the different situations in implementation process.Client in following examples is browser, Html file is HTML5 file, and local data base is the WebSQL database based on HTML5.WebSQL database is to browse JS file can be used to operate structured query language (Structured Query Language, letter in device simulated database Claim SQL) read-write of complete paired data.WebSQL storage space of database is big, can not only be to simple key value or simple object (such as application program setting or Application Status) is stored, and storage organization is free, while can also be to trifling number It is handled according to relationship, is highly suitable as the database being locally stored.It is of course also possible to using Webstorage or Localstorage as local data base, the present embodiment to this with no restriction.
In the actual process, browser may repeat to open certain webpages, these webpages are usually all deposited as caching Storage is in local data base WebSQL.But browser can also open some new web pages not accessed before, as browser head When secondary some webpage of opening, the html file information of the webpage will not be stored in local WebSQL database.Browser at this time The html file can only be obtained from server, which could be rendered.Therefore, server is initially opened certain in browser The html file directly can be issued to browser when a webpage, browser stores it in local after receiving the html file WebSQL database in, the HTML can be read when rendering the webpage again so that browser is subsequent from WebSQL database File, without being obtained to server side.
When browser is again turned on some webpage, when being stored with last rendering webpage in local WebSQL database Html file, since the html file is possible to carry out update, browser is obtained there are two types of the sources of html file, One is obtaining from server side, one is obtain from local WebSQL database.At this point, browser can be according to service The instruction of device obtains html file.Therefore browser can first report the file identification of the html file to server, for service This document is identified and is compared with the file identification of the newest html file of the webpage of network side by device, judges the html file Whether update file is had.If file identification is different, illustrate that the html file has been updated, server issues this to browser The update file of html file, browser render webpage according to the update file.If file identification is identical, illustrate The secondary html file for rendering the webpage can also continue to using browser can obtain HTML text from WebSQL database Part.At this point, the browser offline render instruction that server issues based on the received reads HTML text from WebSQL database Part.
The newest html file of the webpage of the file identification that browser reports and network side is judged in above-mentioned server In the different situation of file identification, step 204 server can be executed after above-mentioned steps 202 and issue HTML to client The update file of file, browser receive the update file for the html file that server issues in addition to for rendering webpage Outside, it is also necessary to be stored in local WebSQL database.Here there are two kinds of situations for storage, and one is retain original HTML text The storage of part, one is the storages for covering former html file, i.e., are replaced former html file, only retain in database newest Html file.
When using the storage mode for retaining former html file, it is necessary to the new oldState of html file is distinguished, It can may determine that the new oldState of html file by time order and function by the way of adding timestamp at this time.According to this Kind storage mode, it is necessary to discharge the data in WebSQL database, over time so that WebSQL database can accommodate More new datas.Certainly, it is also to discharge legacy data according to the timestamp of data when discharging data, retains newest number According to.
When using the storage mode for covering former html file, the update file of html file can replace WebSQL data Old html file in library only retains some webpage or a newest HTML text of certain class same web page in WebSQL database Part.When being replaced preservation, the file of a unit smaller than update file can be replaced according to the ID independent increment of file, Storing in WebSQL database so is all exactly the newest html file of webpage.Illustratively, if last rendering Taobao The HTML-TB3 file in WebSQL database is used when homepage, after Taobao's homepage carries out correcting, browser renders net Newest HTML-TB4 file is got when page, HTML-TB3 text can be override automatically when being saved HTML-TB4 file Part makes only to retain newest HTML-TB4 file in WebSQL database.
Above-mentioned html file have update file when, update degree can also have a variety of situations, some files update compared with It is more, and the update of some files is less.In practical applications, webpage html file can only update in a small amount in most cases, such as In file in the change of a Codabar code or file search box block change.When these are changed lesser update file by server When being all handed down to browser, the sub-fraction file fragment only changed to play a crucial role in entire file, for this File more news in a small amount, can be handled in such a way that html file is divided into different blocks.
It in practical applications, can be different blocks according to function and Type division by the content of entire html file, Such as search column block, picture block, text block, window block and toolbar block.Each block has a HTML text Part segment, correspondingly, these html file segments can also be endowed a mark, referred to as HTML fragment is identified.Here HTML Fragment identification is for distinguishing different html file pieces as the effect of the file identification of above-mentioned html file and property Section, i.e. different blocks in differentiation webpage.
When html file, which has, updates file, the text on the correspondence netpage search column in html file may be only had updated Part segment.Therefore, as the above-mentioned mode for handling entire html file as a whole, when browser is to service After device reports the HTML fragment of each block of webpage to identify, the HTML fragment that server reports these is identified and network side HTML fragment mark is compared, it is found that only one HTML fragment mark changes, this HTML fragment changed mark Corresponding is exactly the update file fragment on netpage search column.The html file segment of update is only handed down to browsing by server Device, other html file segments not updated can be obtained from WebSQL database.
Browser is when rendering webpage, in addition to mainly explaining to html file, it is also necessary to utilize CSS file And/or JS file makes webpage that richer layout architecture and/or human-computer interaction function be presented.As html file, CSS file It also will be updated with JS file, update status is similar with the update status of above-mentioned html file, can also there is a small amount of update.Equally , browser to server in addition to that can report the file identification of entire CSS file or the file identification of entire JS file, for clothes When business device judges whether these files have update file, browser can also report each code in CSS file or JS file The code snippet of segment identifies, so that server judges whether network side has the more new film of code snippet according to code snippet mark Section.If these code snippets mark changes, server issues the more new segment of code snippet to browser.
In practical applications, if html file, CSS file and JS file etc. have, when updating file, server can divide The update file for not issuing different class files to browser, causes the number issued more.Therefore, based on this several class file in generation The characteristics of some formats in code editing process, the present embodiment can by CSS file and/or JS file (CSS update file and/ Or JS updates file) it edits in the update file of html file, it forms Embedded HTML and updates file, in this way in server When issuing HTML update file, so that it may disposably issue CSS file and/or JS file together, reduce and send the documents under server The number of part.Illustratively, when being embedded in an external JS script file in html file, it can use HTML<script>mark Label are inserted into one section of JS:<script type=" text/javascript ">document.write in html page ("Hello World!")</script>.
Certainly, being embedded in html file can be entire CSS file and/or entire JS file, be also possible to CSS file And/or the code snippet in JS file, the HTML that server issues, which updates, may include CSS and/or JS update file in file, Also CSS and/or JS more new segment be may include.
Above-mentioned file identification, code snippet mark and HTML fragment mark include but is not limited to timestamp, fileversion number, The distribution of file key assignments, identity ID and MD5, either system or programming personnel are according to the mark of programming rule self-defining Know, as long as the files such as HTML, CSS, JS, file fragment and code snippet can be represented uniquely.
Html file is divided into different blocks and is reported and issued by the embodiment of the present invention, so that server only issues The more new segment of html file can be substantially reduced the data volume that server issues, while can be by CSS file and/or JS file It is issued together in (file fragment or code snippet) write-in html file, the number that server issues can be substantially reduced, these realities The mode of applying can rationally utilize the process resource of server, improve the speed of webpage rendering.
Further, as an implementation of the above method, the embodiment of the invention also provides a kind of webpage rendering device, The device is usually located at client, or has data interaction relationship independently of client but between client, on realizing State method.As shown in figure 3, the device includes: reporting unit 31, receiving unit 32, reading unit 33 and processing unit 34, In,
Reporting unit 31, for reporting hypertext markup language html file to server when carrying out webpage rendering File identification, so that server judges whether network side has the update file of html file according to file identification;
Receiving unit 32, for judging that network side does not have HTML according to the file identification that reporting unit 31 reports when server When the update file of file, the offline render instruction that server issues is received;
Reading unit 33 stores in local data base for being read according to the received offline render instruction of receiving unit 32 Html file;
Processing unit 34, the html file for being read according to reading unit 33 render webpage.
Further, the device further include:
Storage unit 35;
The receiving unit 32 is also used to when being rendered for the first time to webpage, receives the html file that server issues;
The storage unit 35 is used for the received html file of receiving unit 32 storage to local data base.
Further, which is used for when server judges that network side has the update file of html file, connects Receive the update file for the html file that server issues;
The processing unit 34 is for rendering webpage according to the received update file of receiving unit 32.
Further, which is used to receive the update text for the html file that server issues in receiving unit 32 After part, the html file in local data base is replaced according to file is updated.
Further, which is also used to report the HTML fragment of html file segment to identify.
Further, which is also used to report code piece in cascading style list CSS and/or scripting language JS The code snippet mark of section, so that server judges whether network side has the more new film of code snippet according to code snippet mark Section;
The receiving unit 32 is also used to when server judges that network side has the more new segment of code snippet, receives server The more new segment issued.
Further, which is also used to read CSS and/or JS from the received update file of receiving unit 32 More new segment.
The device of webpage provided in an embodiment of the present invention rendering, can by server according to the file identification of html file into The mode that row compares, judges whether network side has the update file of the html file, in the case where no update file, client The offline render instruction that can be issued according to server is held to read the html file stored before this from local data base, thus right Webpage is rendered.Compared with prior art, HTML text all is obtained from server when the present invention can be avoided rendering webpage every time Part can make client off-line render webpage in the case where html file does not update.Due to being not necessarily to server The data of html file are requested, therefore the speed of webpage rendering is not limited by network bandwidth or server handling ability, it can be with The speed of webpage rendering is greatly improved.
It is reported and is issued in addition, html file is divided into different blocks by the embodiment of the present invention, so that server The more new segment for only issuing html file, can be substantially reduced the data volume that server issues, at the same can by CSS file and/or It is issued together in JS file (file fragment or code snippet) write-in html file, the number that server issues can be substantially reduced, These embodiments can rationally utilize the process resource of server, improve the speed of webpage rendering.
Further, as an implementation of the above method, corresponding to the above device, the embodiment of the invention also provides A kind of device of webpage rendering, which is usually located at server, or has data independently of server but between server Interactive relation, to realize the above method.As shown in figure 4, the device includes: receiving unit 41, judging unit 42 and issues Unit 43, wherein
Receiving unit 41, for receiving the hypertext markup language that client reports when client carries out webpage rendering The file identification of html file;
Judging unit 42, for judging the file of the received file identification of receiving unit 41 Yu the newest html file of network side It identifies whether identical;
Issuance unit 43, for judging the text of received file identification Yu the newest html file of network side when judging unit 42 When part mark is identical, offline render instruction is issued to client, indicates client according to the html file pair in local data base Webpage is rendered.
Further, which is used for when client renders webpage for the first time, issues to client Html file, so that client stores html file to local data base.
Further, which is used to judge that network side has the update file of html file when judging unit 42 When, the update file of html file is issued to client, and webpage is rendered so that client updates file based on the received.
Further, which is also used to receive the HTML fragment mark of html file segment.
Further, which is also used to receive the cascading style list CSS and/or script language that client reports Say the code snippet mark of code snippet in JS;
The judging unit 42, which is also used to be identified according to the received code snippet of receiving unit 41, judges whether network side has generation The more new segment of chip segment;
The issuance unit 43 is also used to when judging unit 42 judges that network side has the more new segment of code snippet, to client End issues more new segment.
Further, the device further include:
Writing unit 44 updates in file for the more new segment of CSS and/or JS to be written to;
The issuance unit 43 is used to issue the update that the more new segment of CSS and/or JS is written in writing unit 44 to client File.
The device of webpage provided in an embodiment of the present invention rendering, can by server according to the file identification of html file into The mode that row compares, judges whether network side has the update file of the html file, in the case where no update file, client The offline render instruction that can be issued according to server is held to read the html file stored before this from local data base, thus right Webpage is rendered.Compared with prior art, HTML text all is obtained from server when the present invention can be avoided rendering webpage every time Part can make client off-line render webpage in the case where html file does not update.Due to being not necessarily to server The data of html file are requested, therefore the speed of webpage rendering is not limited by network bandwidth or server handling ability, it can be with The speed of webpage rendering is greatly improved.
It is reported and is issued in addition, html file is divided into different blocks by the embodiment of the present invention, so that server The more new segment for only issuing html file, can be substantially reduced the data volume that server issues, at the same can by CSS file and/or It is issued together in JS file (file fragment or code snippet) write-in html file, the number that server issues can be substantially reduced, These embodiments can rationally utilize the process resource of server, improve the speed of webpage rendering.
Further, as an implementation of the above method and the application of above-mentioned apparatus, as shown in figure 5, the present invention is implemented Example additionally provides a kind of system of webpage rendering, which includes client 51 and server 52.Wherein, client 51 includes Device shown in Fig. 3 in embodiment, server 52 include device shown in Fig. 4 in embodiment.
The system of webpage provided in an embodiment of the present invention rendering, can by server according to the file identification of html file into The mode that row compares, judges whether network side has the update file of the html file, in the case where no update file, client The offline render instruction that can be issued according to server is held to read the html file stored before this from local data base, thus right Webpage is rendered.Compared with prior art, HTML text all is obtained from server when the present invention can be avoided rendering webpage every time Part can make client off-line render webpage in the case where html file does not update.Due to being not necessarily to server The data of html file are requested, therefore the speed of webpage rendering is not limited by network bandwidth or server handling ability, it can be with The speed of webpage rendering is greatly improved.
It is reported and is issued in addition, html file is divided into different blocks by the embodiment of the present invention, so that server The more new segment for only issuing html file, can be substantially reduced the data volume that server issues, at the same can by CSS file and/or It is issued together in JS file (file fragment or code snippet) write-in html file, the number that server issues can be substantially reduced, These embodiments can rationally utilize the process resource of server, improve the speed of webpage rendering.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, there is no the portion being described in detail in some embodiment Point, reference can be made to the related descriptions of other embodiments.
It is understood that the correlated characteristic in the above method and device can be referred to mutually.In addition, in above-described embodiment " first ", " second " etc. be and not represent the superiority and inferiority of each embodiment for distinguishing each embodiment.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description, The specific work process of device and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
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 described herein include other embodiments In included certain features rather than other feature, but the combination of the feature of different embodiments mean it is of the invention Within the scope of and form different embodiments.For example, in the following claims, embodiment claimed is appointed Meaning one of 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 the denomination of invention according to an embodiment of the present invention (as determined in website The device of Hyperlink rank) in some or all components some or all functions.The present invention is also implemented as being used for Some or all device or device programs of method as described herein are executed (for example, computer program and calculating Machine program product).It is such to realize that program of the invention can store on a computer-readable medium, or can have one Or the form of multiple signals.Such signal can be downloaded from an internet website to obtain, or be provided on the carrier signal, Or it is provided in any other form.
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.The use of word first, second, and third does not indicate any sequence.These words can be explained and be run after fame Claim.

Claims (17)

1. a kind of method of webpage rendering, which is characterized in that the described method includes:
When carrying out webpage rendering, user end to server reports the file identification of hypertext markup language html file, so as to The server judges whether network side has the update file of the html file, the html file according to the file identification For the html file segment of different blocks in the webpage, the file identification of the html file is the html file segment HTML fragment mark;
If the server judges that network side does not have the update file of the html file, the client receives the service The offline render instruction that device issues;
The client reads the html file stored in local data base according to the offline render instruction;
The client renders the webpage according to the html file of reading;
The client reports the code snippet of code snippet in cascading style list CSS and/or scripting language JS to identify, so as to The server judges whether network side has the more new segment of the code snippet according to code snippet mark;
If the server judges that the network side has the more new segment of the code snippet, the client receives the clothes The more new segment that business device issues further comprises:
The client reads more new segment described in the CSS and/or the JS from the update file that server issues.
2. the method according to claim 1, wherein when being rendered for the first time to the webpage, the method Further comprise:
The client receives the html file that the server issues;
The client stores the html file to the local data base.
3. the method according to claim 1, wherein if the server judges that network side has the html file Update file, then the method further includes:
The client receives the update file for the html file that the server issues;
The update file renders the webpage to the client based on the received.
4. according to the method described in claim 3, it is characterized in that, being received described in the server issues in the client After the update file of html file, the method further includes:
The client is replaced the html file in the local data base according to the update file.
5. method according to claim 1 to 4, which is characterized in that the file identification includes:
Timestamp, fileversion number, 5 value MD5 of file key assignments, identity ID and message digest algorithm.
6. a kind of method of webpage rendering, which is characterized in that the described method includes:
When client carries out webpage rendering, server receives the hypertext markup language html file that the client reports File identification, the html file are the html file segment of different blocks in the webpage, the files-designated of the html file Know and is identified for the HTML fragment of the html file segment;
The server judges whether the received file identification is identical as the file identification of the newest html file of network side;
If the received file identification is identical as the file identification of the newest html file of network side, the server is to described Client issues offline render instruction, indicates that the client carries out the webpage according to the html file in local data base Rendering;
The server receives code snippet in the cascading style list CSS and/or scripting language JS that the client reports Code snippet mark;
The server judges whether network side has the more new segment of the code snippet according to code snippet mark;
If the server, which judges the network side, a more new segment of the code snippet, the server is to the client End issues the more new segment, further comprises:
More new segment described in the CSS and/or the JS is written the server updates in file;
The server issues the update file for carrying more new segment described in the CSS and/or the JS to client.
7. according to the method described in claim 6, it is characterized in that, being rendered for the first time in the client to the webpage When, the method further includes:
The server issues the html file to the client, so that the client arrives the html file storage The local data base.
8. according to the method described in claim 6, it is characterized in that, if the server judges that network side has the html file Update file, then the method further includes:
The server issues the update file of the html file to the client, based on the received so as to the client The update file renders the webpage.
9. the method according to any one of claim 6 to 8, which is characterized in that the file identification includes:
Timestamp, fileversion number, 5 value MD5 of file key assignments, identity ID and message digest algorithm.
10. a kind of device of webpage rendering, which is characterized in that described device includes:
Reporting unit, for reporting the files-designated of hypertext markup language html file to server when carrying out webpage rendering Know, it is described so that the server judges whether network side has the update file of the html file according to the file identification Html file is the html file segment of different blocks in the webpage, the text for the html file that the reporting unit reports Part is identified as the HTML fragment mark of the html file segment;
Receiving unit, for judging that network side does not have according to the file identification that the reporting unit reports when the server When the update file of the html file, the offline render instruction that the server issues is received;
Reading unit stores in local data base for being read according to the received offline render instruction of the receiving unit The html file;
Processing unit, the html file for being read according to the reading unit render the webpage;
The reporting unit is also used to report the code snippet of code snippet in cascading style list CSS and/or scripting language JS Mark, so that the server judges whether network side has the more new film of the code snippet according to code snippet mark Section;
The receiving unit is also used to when the server judges that the network side has the more new segment of the code snippet, Receive the more new segment that the server issues;
The reading unit is also used to read described in the CSS and/or the JS more from the update file that server issues New segment.
11. device according to claim 10, which is characterized in that described device further comprises:
Storage unit;
The receiving unit is also used to when being rendered for the first time to the webpage, receive the server issue it is described Html file;
The storage unit, for storing the received html file of the receiving unit to the local data base.
12. device according to claim 10, which is characterized in that the receiving unit, for judging when the server When network side has the update file of the html file, the update file for the html file that the server issues is received;
The processing unit, for being rendered according to the received update file of the receiving unit to the webpage.
13. device according to claim 12, which is characterized in that replacement unit, for receiving institute in the receiving unit After the update file for stating the html file that server issues, according to the update file in the local data base The html file is replaced.
14. a kind of device of webpage rendering, which is characterized in that described device includes:
Receiving unit, for receiving the hypertext markup language that the client reports when client carries out webpage rendering The file identification of html file, the html file are the html file segment of different blocks in the webpage, and the reception is single The file identification of the received html file of member is that the HTML fragment of the html file segment identifies;
Judging unit, for judging the file of the receiving unit received file identification and the newest html file of network side It identifies whether identical;
Issuance unit, for judging the text of the received file identification Yu the newest html file of network side when the judging unit When part mark is identical, offline render instruction is issued to the client, indicates the client according in local data base Html file renders the webpage;
The receiving unit is also used to receive generation in the cascading style list CSS and/or scripting language JS that the client reports The code snippet of chip segment identifies;
The judging unit is also used to judge whether network side has according to the received code snippet mark of the receiving unit The more new segment of the code snippet;
The issuing unit is also used to judge that the network side has the more new segment of the code snippet when the judging unit When, the more new segment is issued to the client;
Writing unit updates in file for more new segment described in the CSS and/or the JS to be written to;
The issuing unit, for issuing the update that the CSS and/or the JS is written in said write unit to client The update file of segment.
15. device according to claim 14, which is characterized in that the issuing unit is used in the client to institute When stating webpage and being rendered for the first time, the html file is issued to the client, so that the client is by the HTML text Part is stored to the local data base.
16. device according to claim 14, which is characterized in that the issuing unit, for sentencing when the judging unit When there is the update file of the html file in circuit network side, the update file of the html file is issued to the client, with Toilet states client, and the update file renders the webpage based on the received.
17. a kind of system of webpage rendering, which is characterized in that the system comprises:
Client and server;
Wherein, the client includes the device as described in any one of claim 10 to claim 13;
The server includes the device as described in any one of claim 14 to claim 16.
CN201410642767.4A 2014-11-11 2014-11-11 The method, apparatus and system of webpage rendering Active CN104462231B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410642767.4A CN104462231B (en) 2014-11-11 2014-11-11 The method, apparatus and system of webpage rendering

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410642767.4A CN104462231B (en) 2014-11-11 2014-11-11 The method, apparatus and system of webpage rendering

Publications (2)

Publication Number Publication Date
CN104462231A CN104462231A (en) 2015-03-25
CN104462231B true CN104462231B (en) 2018-12-04

Family

ID=52908267

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410642767.4A Active CN104462231B (en) 2014-11-11 2014-11-11 The method, apparatus and system of webpage rendering

Country Status (1)

Country Link
CN (1) CN104462231B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2016202907A1 (en) * 2015-07-31 2017-02-16 Wisetech Global Limited Platform-agnostic systems and methods for executable content and executable content flow distribution
CN105302569B (en) * 2015-11-18 2019-05-07 网易(杭州)网络有限公司 A kind of method and apparatus for generating special-shaped window
CN106897336A (en) * 2016-06-28 2017-06-27 阿里巴巴集团控股有限公司 Web page files sending method, webpage rendering intent and device, webpage rendering system
CN106933569B (en) * 2017-02-13 2019-08-09 腾讯科技(深圳)有限公司 A kind of webpage method for refreshing and device
CN107168999A (en) * 2017-03-30 2017-09-15 咪咕数字传媒有限公司 A kind of method for updating pages and device
CN108390915B (en) * 2018-01-24 2021-05-07 平安普惠企业管理有限公司 Interface rendering method and terminal equipment
CN109783752A (en) * 2018-12-14 2019-05-21 深圳壹账通智能科技有限公司 Page loading method and device, electronic equipment and computer readable storage medium
CN109933735B (en) * 2019-03-04 2021-08-20 三星电子(中国)研发中心 Scheduling method, webpage rendering method, webpage display method and equipment thereof
CN110795649A (en) * 2019-09-18 2020-02-14 北京你财富计算机科技有限公司 Target page display method, device and system and electronic equipment
CN115314561A (en) * 2022-08-03 2022-11-08 平安付科技服务有限公司 Page display method and device, storage medium and computer equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101957842A (en) * 2010-09-13 2011-01-26 青岛海信移动通信技术股份有限公司 Webpage cache control method, device and system based on WebKit browser
CN102904947A (en) * 2012-09-29 2013-01-30 北京百度网讯科技有限公司 Application client presentation style updating and/or content expanding method and system
CN103399911A (en) * 2013-07-30 2013-11-20 北京小米科技有限责任公司 Access processing method, device and terminal device on basis of browser client

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140143647A1 (en) * 2012-11-16 2014-05-22 Qualcomm Incorporated Method for improving browser cache by reducing duplicate stored content

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101957842A (en) * 2010-09-13 2011-01-26 青岛海信移动通信技术股份有限公司 Webpage cache control method, device and system based on WebKit browser
CN102904947A (en) * 2012-09-29 2013-01-30 北京百度网讯科技有限公司 Application client presentation style updating and/or content expanding method and system
CN103399911A (en) * 2013-07-30 2013-11-20 北京小米科技有限责任公司 Access processing method, device and terminal device on basis of browser client

Also Published As

Publication number Publication date
CN104462231A (en) 2015-03-25

Similar Documents

Publication Publication Date Title
CN104462231B (en) The method, apparatus and system of webpage rendering
US9727538B2 (en) Editing a fragmented document
US9454281B2 (en) System for providing dynamic linked panels in user interface
US9223773B2 (en) Template system for custom document generation
US9361390B2 (en) Web content management
US10621211B2 (en) Language tag management on international data storage
GB2518745A (en) Template system for custom document generation
CN109299288A (en) Read method, device, server and the storage medium of dictionary data
CN103593414A (en) Showing method and device of webpages in browser
CN109684584A (en) A kind of intelligent switch method of browser kernel, device, terminal and storage medium
CN105094868A (en) Software upgrading method, server and terminal
US20160188584A1 (en) System for tracking and displaying changes in a set of related electronic documents.
CN105045789A (en) Game server database buffer memory method and system
US20110184975A1 (en) Incorporated web page content
US10223415B2 (en) Generation of mapping definitions for content management system
US11176022B2 (en) Health diagnostics and analytics for object repositories
US11010140B2 (en) Integration of workflow and logical data objects using visual programming
CN115905759A (en) Barrier-free webpage generation method, device, medium and equipment
CN109101429A (en) A kind of method and device of the browser page debugging of set-top box
EP2972666B1 (en) Visualization interface for information object system
US9471569B1 (en) Integrating information sources to create context-specific documents
US20200125476A1 (en) Manipulation of complex variables in orchestration applications
CN112241505A (en) Page updating method, page updating device, medium and electronic equipment
CN103440289B (en) The incompatible label parallel search of webpage method based on MapReduce
CN108959541A (en) A kind of new method for realizing the output of the enhanced scalability page based on Website development

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
C41 Transfer of patent application or patent right or utility model
TA01 Transfer of patent application right

Effective date of registration: 20161116

Address after: 100088 Jiuxianqiao Chaoyang District Beijing Road No. 10, building 15, floor 17, layer 1701-26, 3

Applicant after: BEIJING QIANXIN TECHNOLOGY Co.,Ltd.

Address before: 100088 Beijing city Xicheng District xinjiekouwai Street 28, block D room 112 (Desheng Park)

Applicant before: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Applicant before: Qizhi software (Beijing) Co.,Ltd.

GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 100088 Building 3 332, 102, 28 Xinjiekouwai Street, Xicheng District, Beijing

Patentee after: QAX Technology Group Inc.

Address before: 100015 15, 17 floor 1701-26, 3 building, 10 Jiuxianqiao Road, Chaoyang District, Beijing.

Patentee before: BEIJING QIANXIN TECHNOLOGY Co.,Ltd.