CN109582899A - Page loading method, device, computer equipment and storage medium - Google Patents

Page loading method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN109582899A
CN109582899A CN201811255726.4A CN201811255726A CN109582899A CN 109582899 A CN109582899 A CN 109582899A CN 201811255726 A CN201811255726 A CN 201811255726A CN 109582899 A CN109582899 A CN 109582899A
Authority
CN
China
Prior art keywords
page
data
target pages
priority
pages data
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.)
Pending
Application number
CN201811255726.4A
Other languages
Chinese (zh)
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201811255726.4A priority Critical patent/CN109582899A/en
Publication of CN109582899A publication Critical patent/CN109582899A/en
Pending legal-status Critical Current

Links

Abstract

The invention discloses a kind of page loading method, device, computer equipment and storage mediums, which comprises sends page request instruction to server-side;Receive the response message that server-side returns;Page data is obtained from response message;It is matched using preset filter label with the hypertext markup language label in each page data;The corresponding page data of hypertext markup language label of successful match is filtered;Remaining page data is stored as target pages data to preset spatial cache after filtering;According to the priority sequence from high to low of target pages data, the display page is loaded by each target pages data in spatial cache are asynchronous.The present invention avoids causing to show the case where page can not be shown because partial page data load exception, so that the resource of page load is reduced, improves page loading efficiency by being filtered processing, and the loading page by the way of asynchronous load to page data.

Description

Page loading method, device, computer equipment and storage medium
Technical field
The present invention relates to field of computer technology more particularly to a kind of page loading method, device, computer equipment and deposit Storage media.
Background technique
With the rapid development of network, application and distributed system increased popularity in internet, network is people's Life brings many conveniences, however, due in network functional module increase and the case where service logic becomes increasingly complex Under, server-side needs to call the data of associated database also will be correspondingly in the page load request at customer in response end Increase, when the page needs to load more data, due to the time-consuming increasing of interaction of the server-side between each distributed system Add, the loading velocity of the Webpage of client is caused to reduce.
Summary of the invention
Based on this, it is necessary in view of the above technical problems, provide a kind of page loading method, device, computer equipment and Storage medium, the loading efficiency to solve the problems, such as Webpage are low.
A kind of page loading method, comprising:
Page request instruction is sent to server-side;
The response message that the server-side is returned according to page request instruction is received, and is obtained from the response message Take page data, wherein the response message includes at least two page datas;
It is matched using preset filter label with the hypertext markup language label in each page data;
The corresponding page data of the hypertext markup language label of successful match is filtered, and will be remained after filtering The remaining page data is stored as target pages data to preset spatial cache;
The priority for determining each target pages data is defined according to preset priority;
It, will be described in each of described spatial cache according to the priority sequence from high to low of the target pages data Target pages data are asynchronous to be loaded into the display page.
A kind of page loading device, comprising:
Request sending module, for sending page request instruction to server-side;
Message reception module, the response message returned for receiving the server-side according to page request instruction, and Page data is obtained from the response message, wherein the response message includes at least two page datas;
Information matches module, for using the hypertext markup language in preset filter label and each page data Speech label is matched;
Data filtering module, for carrying out the corresponding page data of the hypertext markup language label of successful match Filtering, and the remaining page data after filtering is stored as target pages data to preset spatial cache;
Data separation module determines the preferential of each target pages data for defining according to preset priority Grade;
Page loading module will be described slow for the sequence of the priority according to the target pages data from high to low Deposit that each of space target pages data are asynchronous to be loaded into the display page.
A kind of computer equipment, including memory, processor and storage are in the memory and can be in the processing The computer program run on device, the processor realize the step of the above-mentioned page loading method when executing the computer program Suddenly.
A kind of computer readable storage medium, the computer-readable recording medium storage have computer program, the meter The step of calculation machine program realizes the above-mentioned page loading method when being executed by processor.
Above-mentioned page loading method, device, computer equipment and storage medium based on web page tag, by sending the page Request instruction obtains page data from response message, makes to server-side after the response message for receiving server-side return It is matched with preset filter label with the hypertext markup language label in each page data, and surpassing successful match The corresponding page data of text mark up language label is filtered, meanwhile, using page data remaining after filtering as page object Face data is stored to preset spatial cache, is finally defined according to preset priority and is determined the preferential of each target pages data Grade is loaded into page for the page data in spatial cache is asynchronous according to the priority sequence from high to low of target pages data Face.By being filtered processing, and the sequence of the priority according to page data to being not required to page data to be used, use The page data of return is loaded into the display page by the mode of asynchronous load, so as to be preferably that user shows significance level Higher page data avoids causing to show the case where page can not be shown because partial page data load exception, so that page The resource of face load is reduced, and improves page loading efficiency.
Detailed description of the invention
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below by institute in the description to the embodiment of the present invention Attached drawing to be used is needed to be briefly described, it should be apparent that, the accompanying drawings in the following description is only some implementations of the invention Example, for those of ordinary skill in the art, without any creative labor, can also be according to these attached drawings Obtain other attached drawings.
Fig. 1 is an application environment schematic diagram of page loading method in one embodiment of the invention;
Fig. 2 is a flow chart of page loading method in one embodiment of the invention;
Fig. 3 is a specific flow chart of step S20 in Fig. 2;
Fig. 4 is a specific flow chart of step S50 in Fig. 2;
Fig. 5 is the target pages data preferentially loaded in page loading method within visible area in one embodiment of the invention A specific flow chart;
Fig. 6 is a specific flow chart of step S60 in Fig. 2;
Fig. 7 is a functional block diagram of page loading device in one embodiment of the invention;
Fig. 8 is a schematic diagram of computer equipment in one embodiment of the invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are some of the embodiments of the present invention, instead of all the embodiments.Based on this hair Embodiment in bright, every other implementation obtained by those of ordinary skill in the art without making creative efforts Example, shall fall within the protection scope of the present invention.
Page loading method provided by the present application, can be applicable in the application environment such as Fig. 1, which includes service End and client, wherein be attached between server-side and client by network, user sends page request by client It instructs to server-side, server-side instructs returning response message to client according to page request, and client is in response message Page data is filtered processing, and is loaded into the display page according to the progress of the priority of page data is asynchronous.Client is specific It can be, but not limited to be various personal computers, laptop, smart phone, tablet computer and portable wearable device, Server-side can specifically be realized with the server cluster that independent server or multiple servers form.The embodiment of the present invention mentions It is applied to client for the method for page load.
In one embodiment, Fig. 2 shows a flow chart of page loading method in the present embodiment, this method is applied in Fig. 1 In client, for by filtering after page data it is asynchronous be loaded into display the page in.As shown in Fig. 2, the page loads Method includes step S10 to step S60, and details are as follows:
S10: page request instruction is sent to server-side.
Specifically, page request instruction refers to the request for the accession page that user sends in client to server-side, for example, Client provide an interactive interface, user when client accesses the resource of a certain webpage using browser, client according to The operation for requesting access to webpage that family is carried out in interactive interface generates page request instruction corresponding with the webpage and is sent to service End.
Wherein, page face request instruction includes URL (Uniform Resource Locator, uniform resource locator) Location, the address URL are the positions stored on the internet for unique identification resource corresponding with the webpage of requested access.
Preferably, page request instruction can be asynchronous system transmission, and Ajax (Asynchronous can be used in client JavaScript and XML, asynchronous JavaScript and XML technology) technology execution asynchronous network request, that is, client Page request being sent asynchronously with using JavaScript technology to instruct, page request instruction includes N number of thread, and N is positive integer, For the resource of functional module each in webpage, number of the corresponding thread to the server-side request functional module is created According to if client receives the request data of thread return, using the JavaScript technology innovation page, so that client exists It does not need in the case where reloading full page, data is exchanged with server-side and update section divides web page contents, realize webpage Asynchronous refresh.
Wherein, JavaScript is used to the scripting language of webpage addition dynamic function, XML (Extensible Markup Language, extensible markup language) it is a kind of for marking electronic document to make it have structural label language The data transmitted between network are marked and are defined the type of data, so that client and server-side are identified by speech.
S20: the response message that server-side is returned according to page request instruction is received, and obtains page number from response message According to, wherein response message includes at least two page datas.
Wherein, response message includes responsive state, response head and response text.
Responsive state is the identification information for describing the response results that server-side instructs page request, for example, response State is that " 200 " indicate client request success, and responsive state is that " 404 " indicate that request resource is not present.
Response head include but is not limited to the response time, response source, the type of page data and page data compression side Formula etc., wherein response source refers to the address of the server of response.
Response text includes the page data for constituting webpage, and responding includes at least two page datas in text.
Specifically, client receives the response message that server-side returns, and obtains page from the response text of response message Face data, page data is the corresponding resource of webpage of requested access, for showing the number in the interactive interface of client According to each webpage includes multiple page datas.
In the present embodiment, server-side is with HTML (Hyper Text Markup Language tag, hypertext markup language Speech) form return response text, that is, page data be HTML code, page data includes html tag, the html tag It is the attribute for identified page data, for example, if the html tag of page data is<video>, then it represents that the page data Attribute be video, if the html tag of page data be<dialog>, then it represents that the attribute of page data be dialog box or window Mouthful.
S30: it is matched using preset filter label with the hypertext markup language label in each page data.
In the present embodiment, preset filter label is the html tag for hash to be filtered, wherein Hash refers to that user is not required to resource to be used in webpage, for example, the resources such as advertisement, intelligent recommendation or sharing, when When the data of load are not belonging to the resource that user needs to obtain, as hash.
For example, the advertisement of pop-up class or the html tag of intelligent recommendation are generally<dialog>label, then can incite somebody to action< Dialog > label is set as filter label, alternatively, filter label can also need to be customized according to the browsing of user, herein With no restrictions.
Specifically, client using the hypertext markup language label in preset filter label and each page data into Row matching, if there is label identical with the hypertext markup language label of page data in preset filter label, then it represents that Hypertext markup language tag match success, and determine that the corresponding page data of hypertext markup language label is useless number According to otherwise, if the hypertext markup language label and preset filter label of page data are inconsistent, then it represents that the hypertext It fails to match for markup language tag.
S40: the corresponding page data of hypertext markup language label of successful match is filtered, and will be remained after filtering Remaining page data is stored as target pages data to preset spatial cache.
Specifically, processing is filtered to the corresponding page data of hypertext markup language label of successful match, rejected The hash that server-side response returns, retaining user needs resource to be used, and will remaining page data conduct after filtering For the storage of target pages data to preset spatial cache, which is that client presets the webpage due to storage request The memory space of resource.
Preferably, if client issues page request instruction, client finds buffered be somebody's turn to do in spatial cache The corresponding web page resources in the address URL in page request instruction, then inquire the last modification time of the web page resources to server-side, If the last modification time for the web page resources that server-side returns, the last modification being cached in the web page resources in spatial cache Time consistency, then client from obtained in spatial cache the page request instruction in the corresponding web page resources in the address URL, thus The acquisition time that web page resources can be saved improves the page loading efficiency of webpage.
S50: the priority for determining each target pages data is defined according to preset priority.
Wherein, preset priority definition, for distinguishing the priority of target pages data, target pages data it is preferential Grade is higher, then it represents that the significance level of the target pages data in webpage is higher, and preset priority definition specifically can root It is configured according to the content of target pages data, can also be configured according to the size of target pages data, not limited herein System.
For example, target pages data are that Form Element then belongs to the first priority, target pages data belong to non-table unit It is plain then belong to the second priority, wherein Form Element is including but not limited to text filed, list box and input frame etc., non-list Element includes but is not limited to link label, separates label and table labelling etc., and the first priority is higher than the second priority.
S60: according to the priority sequence from high to low of target pages data, by each target pages in spatial cache Data are asynchronous to be loaded into the display page.
Specifically, according to the priority of the step S50 each target pages data determined, according to the excellent of target pages data The sequence of first grade from high to low obtains target pages data from spatial cache, uses the rendering engine performance objective of client HTML code in page data, and load CSS (CascadingStyle Sheets, cascading style sheets) pattern and be determined The coordinate and size of each element in target pages data, by the corresponding position of target pages data render to webpage, thus Target pages data are asynchronously loaded into the display page, wherein CSS is by describing based on the files pattern such as HTML or XML Calculation machine language can accurately control the typesetting progress Pixel-level of element position in webpage.
It is understood that client by the way of asynchronous load, respectively adds the target pages data of webpage It carries, the target pages high priority data that elder generation gets from server-side is loaded, needs to wait server-side relative to client The corresponding whole resources of webpage are returned, then to the mode that webpage is disposably loaded, improve page loading efficiency.
In the present embodiment, by sending page request instruction to server-side, disappear in the response for receiving server-side return After breath, page data is obtained from response message, uses the hypertext mark in preset filter label and each page data Note linguistic labels are matched, and the corresponding page data of hypertext markup language label of successful match is filtered, together When, it stores page data remaining after filtering as target pages data to preset spatial cache, finally according to preset Priority defines the priority for determining each target pages data, according to priority from high to low suitable of target pages data Sequence is loaded into the page for the page data in spatial cache is asynchronous.By being filtered place to being not required to page data to be used The page data of return is loaded into aobvious by reason, and the sequence of the priority according to page data using the mode of asynchronous load Show in the page, so as to be preferably that user shows the higher page data of significance level, avoids loading because of partial page data It is abnormal and lead to show the case where page can not be shown, so that the resource of page load is reduced, improve page loading efficiency.
In one embodiment, the present embodiment provides referred to the reception server-side mentioned in step S20 according to page request The response message returned is enabled, and the concrete methods of realizing of acquisition page data is described in detail from response message.
Referring to Fig. 3, Fig. 3 shows a specific flow chart of step S20, details are as follows:
S201: the response message that server-side is returned according to page request instruction is received, wherein response message includes responding just Text, the response text are present in response message in the form of compressed file.
In the present embodiment, response message includes responsive state, response head and response text, and responsive state includes response As a result identification information, response head includes but is not limited to response time, response source, the type of page data and page data Compress mode etc., response text include the page data for constituting webpage, and response text includes at least two page datas.
Specifically, server-side parses page request instruction, obtains the address URL corresponding with page request instruction, The resource of corresponding webpage is obtained as page data, according to preset compress mode, using data compression according to the address URL Technology carries out compression processing to page data and obtains response text, and text generates response message according to response, by response message It is transferred to client, client receives the response message that server-side returns by network, wherein preset compress mode refers to clothes The pre-configured data compression technique in business end, for example, RAR compress technique or GZIP compress technique etc..
Preferably, client can add message " Accept-Encoding:gzip " in page request instruction, indicate The data that client is encoded to server-side request GZIP, if server-side is supported to carry out GZIP coding to data, server-side can be with Page data is compressed using preset GZIP compress technique, which is that server-side is pre-configured with Good compress mode, for example, can be in the Apache Server or Nginx server of server-side, pre-configured GZIP Compress technique, for compressing to transmission data, but it is not limited to this, can be specifically configured according to practical application, this Place is with no restrictions, wherein Apache and Nginx is the high performance Web server of server-side.
It should be noted that GZIP is a kind of data compression scheme, using GZIP compress technique to being transmitted between network Data are compressed, and 60% transmission flow, and improve data transfer efficiency can be saved.
S202: according to preset decompression mode, the response text that response message includes is decompressed, page number is obtained According to.
Specifically, client obtains the compress mode of page data from the response head of response message, and in client The response text in response message is decompressed using preset decompression mode, to obtain page data, wherein preset Decompression mode is the pre-configured file decompression technique of client, is carried out for various types of compressed files to client Decompression.
For example, including message " Content-Encoding:gzip " in the response head of response message, then it represents that page number According to content encoding format be GZIP form, client is according to the compress mode of the page data acquired, in preset solution In pressure mode, decompression mode corresponding with GZIP compress technique is called to carry out decompression processing to response text.
In the present embodiment, the response message returned by receiving server-side according to page request instruction, and according to default Decompression mode, the response text that response message includes is decompressed, page data is obtained, enable a client to receive exist Server-side reduces the data volume of network transmission using the data after data compression technique compression, saves network bandwidth, and make It is transmitted with compressed data, can be improved data transmission efficiency, to improve page loading efficiency.
In one embodiment, the present embodiment provides determine to being defined mentioned in step S50 according to preset priority The concrete methods of realizing of the priority of each target pages data is described in detail.
Referring to Fig. 4, Fig. 4 shows a specific flow chart of step S50, details are as follows:
S501: the hypertext markup language label of each target pages data is obtained from spatial cache.
Specifically, page data includes hypertext markup language label, which is for identifying The attribute of page data, target pages data are that the user being filtered to the page data received needs money to be used Source obtains the hypertext markup language label of each target pages data from spatial cache, to determine each target pages The attribute of data.
S502: according to the hypertext markup language label of target pages data, inquiry is every in the definition of preset priority The corresponding priority tag of a hypertext markup language label.
Specifically, it is the definition for presetting the priority for distinguishing target pages data that preset priority, which defines, According to the hypertext markup language label of target pages data, each hypertext markup language is inquired in the definition of preset priority Say the corresponding priority tag of label, the priority of the corresponding priority tag of hypertext markup language label is higher, then it represents that Significance level of the corresponding target pages data of the hypertext markup language label in webpage is higher.
S503: according to the corresponding priority tag of hypertext markup language label inquired, hypertext markup language is determined Say the priority of the corresponding target pages data of label.
Specifically, according to the corresponding priority tag of hypertext markup language label inquired, hypertext can be determined The priority of the corresponding target pages data of markup language tag, each target pages number in the webpage so as to learn request According to significance level.
For example, the hypertext markup language label of target pages data A is<img>, the hypertext mark of target pages data B Remember that linguistic labels are<input>, the hypertext markup language label of target pages data C is<title>, in preset priority In definition, the first priority tag includes<value>,<table>and<input>etc., and the second priority tag includes<title >,<href>with<nav>deng third priority label includes<video>,<img>with<dialog>deng client can basis The hypertext markup language label of target pages data inquires each hypertext markup language mark in the definition of preset priority Corresponding priority tag is signed, so as to inquire to obtain:<img>label is in third priority,<input>label is in the One priority,<title>label are in the second priority, that is, target pages data A is third priority, target pages number According to B be the first priority, target pages data C be the second priority, wherein the first priority be higher than the second priority, second Priority is higher than the second priority.
In the present embodiment, by obtaining the hypertext markup language marks of each target pages data from spatial cache Label inquire each hypertext mark in the definition of preset priority according to the hypertext markup language label of target pages data Remember the corresponding priority tag of linguistic labels, according to the corresponding priority tag of hypertext markup language label inquired, really Determine the priority of the corresponding target pages data of hypertext markup language label, it is every in the webpage requested access to so as to learn The significance level of a target pages data, so that client can be according to the significance level of target pages data, by target pages Data are output to the display page of client.
In one embodiment, as shown in figure 5, after step s 5, i.e., defining determining target according to preset priority After the priority of page data, page loading method further include:
S51: the size of the display size visualization window corresponding with the display page of target pages data is obtained.
Wherein, the display size of target pages data refers to that target pages data are loaded into target pages in the display page The size that data are shown, the display size of target pages data can specifically be obtained from target pages data, for example, page object Face data is <img src="/i/ct_1px.gif " width=" 200px "
Height=" 30px "/>, indicate that the target pages data are the figures that a width is 200px and height is 30px Piece, wherein px is pixel unit, and 200px indicates 200 pixel sizes.
It should be noted that if there is no the display size of specified element in target pages data, then it is default using client Default display size, for example, in the browser of client, the font size of the text default shown in webpage is 16px.
Wherein, the size of the corresponding visualization window of the display page, refers to client for showing the display page of webpage Visible area, JavaScript code specifically can be used in the size of the corresponding visualization window of the display page " document.body.clientWidth " obtains the width of the display page, and uses JavaScript code " document.body.clientHeight " obtains the height of the display page, to obtain the corresponding visualization window of the display page The size of mouth.
S52: according to the size of the display size of target pages data and visualization window, calculation visualization window can be opened up The page data amount shown.
Specifically, page data amount refers to the quantity for being showed in the target pages data of the display page, specifically can basis The display size of target pages data and the size of visualization window, using the size of visualization window divided by target pages data Display size, the page data amount that visualization window can be shown is calculated.
S53: if the page data amount in spatial cache is greater than the page data amount that visualization window can be shown, basis Preset webpage layout mode, determines the target pages data that visualization window can be shown, and by visualization window institute energy The target pages data enough shown are as the first load data.
Specifically, the page data amount in spatial cache is counted, if the page data amount in spatial cache is greater than The page data amount that visualization window can be shown determines that visualization window can then according to preset webpage layout mode The target pages data of displaying, wherein preset webpage layout mode refers to that the resource in webpage is arranged in advance by service provider Version layout, for defining position of each target resource data in webpage, so that webpage achievees the effect that beauty.
The resource preset webpage layout mode corresponding with the webpage that server-side obtains the webpage returns to client, client End can obtain the corresponding webpage layout mode of webpage from response message, determine the page object that visualization window can be shown Face data, and the target pages data that visualization window can be shown are as the first load data.
S54: according to the priority sequence from high to low of target pages data, by the first load data it is asynchronous be loaded into it is aobvious Show the page.
Specifically, according to the priority of the step S50 each target pages data determined, according to the excellent of target pages data The sequence of first grade from high to low, by the first load, data are asynchronous is loaded into the display page, wherein asynchronous load refers to, using Through loading the display page of target pages data, interacted with the target pages data in spatial cache, what is loaded Target pages data are loaded on the basis of the display page, realize that the part to the display page updates.
It is understood that in the client for showing that the size of the visible area of the display page of webpage is limited , for the target pages data that visualization window can be shown as the first load data, the mode using asynchronous load is excellent Load the first load data are first carried out, allow users to preferentially read the resource in visible area, meanwhile, number is loaded first In, the priority of target pages data there is also difference, client can according to the priority of target pages data from height to Low sequence loads target pages data, and it is higher to allow users to quickly obtain significance level in the webpage Resource.
S55: if the first load data are completed to load, according to priority from high to low suitable of target pages data The target pages data that first loads except data asynchronous are loaded into the display page by sequence.
Specifically, if the first load data are completed to load, then it represents that can in the corresponding visualization window of the display page The data of displaying have loaded completion, according to the priority sequence from high to low of target pages data, load data for first Except target pages data it is asynchronous be loaded into the display page, to complete the load of entire Webpage.
It is understood that the first load data are the target pages data that visualization window can be shown, Yong Hu What client was read first is the corresponding resource of the first load data, and the target pages data except the first load data can be done Delay loading processing.
In the present embodiment, pass through the display size visualization window corresponding with the display page of acquisition target pages data Size, the page data amount that calculation visualization window can be shown, to judge to show that the corresponding visualization window of the page is The no whole resources for capableing of complete displayed web page, if the page data amount in spatial cache is greater than what visualization window can be shown Page data amount determines the target pages data that visualization window can be shown then according to preset webpage layout mode, and The target pages data that visualization window can be shown are as the first load data, according to the priority of target pages data Sequence from high to low, by the first load, data are asynchronous is loaded into the display page, allow users to preferentially read visible area Interior resource, will according to the priority sequence from high to low of target pages data if the first load data are completed to load First load data except target pages data it is asynchronous be loaded into the display page, to complete the load of entire Webpage.
In one embodiment, the present embodiment provides to the priority according to target pages data mentioned in step S60 Sequence from high to low, by the asynchronous concrete methods of realizing for being loaded into the display page of each target pages data in spatial cache It is described in detail.
Referring to Fig. 6, Fig. 6 shows a specific flow chart of step S60, details are as follows:
S601: it according to preset webpage layout, determines position of each target pages data in the display page, and uses Preset placeholder occupies the position of each target pages data.
Specifically, preset webpage layout mode refers to that service provider carries out imposition layout to the resource in webpage in advance, uses In defining position of each target resource data in webpage, client can determine each mesh according to preset webpage layout Position of the page data in the display page is marked, and is occupied the position of each target pages data using preset placeholder.
Wherein, preset placeholder, for occupying the position of target pages data in the display page, the preset placeholder Play the role of occupy-place in the display page, but can't be shown in the display page of client, for waiting pending datas Write-in.
S602: according to the priority sequence from high to low of target pages data, target pages are obtained from spatial cache Data, and according to the hypertext markup language label of target pages data, determine the target pages data in the display page Position the target pages data is written in the corresponding preset placeholder in the position, so that target pages data are loaded into Show the page.
Specifically, according to the priority of the step S50 each target pages data determined, according to the excellent of target pages data The sequence of first grade from high to low obtains target pages data from spatial cache, so as to by the higher money of significance level in webpage Source is preferentially showed in the display page.
According to the hypertext markup language label of target pages data, the attribute of the target pages data is determined, default Webpage layout, inquiry obtain the corresponding target pages data of the hypertext markup language label display the page in position, The target pages data are written in the corresponding preset placeholder in the position HTML code in performance objective page data, So that target pages data are loaded into the display page, so that target pages data are asynchronously loaded into the display page.
In the present embodiment, by determining each target pages data in the display page according to preset webpage layout Position, and the positions of each target pages data is occupied using preset placeholder, page load is avoided to occur deforming Abnormal conditions obtain target pages data according to the priority sequence from high to low of target pages data from spatial cache, And according to the hypertext markup language label of target pages data, position of the target pages data in the display page is determined, The target pages data are written in the corresponding preset placeholder in the position, so that target pages data are loaded into display page Face enables a client to preferentially load the higher resource of significance level in webpage, improves page loading efficiency.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present invention constitutes any limit It is fixed.
In one embodiment, a kind of page loading device is provided, which adds with the page in above-described embodiment Support method corresponds.As shown in fig. 7, the page loading device includes: request sending module 71, message reception module 72, letter Cease matching module 73, data filtering module 74, data separation module 75 and page loading module 76.Each functional module is described in detail It is as follows:
Request sending module 71, for sending page request instruction to server-side;
Message reception module 72, the response message returned for receiving server-side according to page request instruction, and from response Page data is obtained in message, wherein response message includes at least two page datas;
Information matches module 73, for using the hypertext markup language in preset filter label and each page data Label is matched;
Data filtering module 74, for carrying out the corresponding page data of hypertext markup language label of successful match Filter, and remaining page data after filtering is stored as target pages data to preset spatial cache;
Data separation module 75, for defining the priority for determining each target pages data according to preset priority;
Page loading module 76, for the sequence of the priority according to target pages data from high to low, by spatial cache In each target pages data asynchronous be loaded into the display page.
Further, message reception module 72 includes:
Message sink submodule, the response message returned for receiving server-side according to page request instruction, wherein response Message includes response text, which is present in response message in the form of compressed file;
Data decompression submodule, for being solved to the response text that response message includes according to preset decompression mode Pressure, obtains page data.
Further, data separation module 75 includes:
Label acquisition submodule, for obtaining the hypertext markup language mark of each target pages data from spatial cache Label;
Tag queries submodule, for the hypertext markup language label according to target pages data, preset preferential The corresponding priority tag of each hypertext markup language label is inquired in grade definition;
Grade determines submodule, for the corresponding priority tag of hypertext markup language label that basis inquires, really Determine the priority of the corresponding target pages data of hypertext markup language label.
Further, the page loading device further include:
Dimension acquisition module, the display size visualization window corresponding with the display page for obtaining target pages data Size;
Capacity calculation module, for according to the display size of target pages data and the size of visualization window, calculating can The page data amount that can be shown depending on changing window;
Data analysis module, if being greater than the page that visualization window can be shown for the page data amount in spatial cache Data volume determines the target pages data that visualization window can be shown then according to preset webpage layout mode, and can Data are loaded as first depending on changing the target pages data that window can be shown;
Preferential loading module loads number for first for the sequence of the priority according to target pages data from high to low The display page is loaded into according to asynchronous;
Delay loading module, if completing to load for the first load data, according to the priority of target pages data The target pages data that first loads except data asynchronous are loaded into the display page by sequence from high to low.
Further, page loading module 76 includes:
Submodule is pre-processed, for determining each target pages data in the display page according to preset webpage layout Position, and the positions of each target pages data is occupied using preset placeholder;
Load submodule is obtained from spatial cache for the sequence of the priority according to target pages data from high to low Target pages data are taken, and according to the hypertext markup language label of target pages data, determines the target pages data aobvious Show the position in the page, which is written in the corresponding preset placeholder in the position, so that target pages number According to being loaded into the display page.
Specific about page loading device limits the restriction that may refer to above for page loading method, herein not It repeats again.Modules in above-mentioned page loading device can be realized fully or partially through software, hardware and combinations thereof.On Stating each module can be embedded in the form of hardware or independently of in the processor in computer equipment, can also store in a software form In memory in computer equipment, the corresponding operation of the above modules is executed in order to which processor calls.
In one embodiment, a kind of computer equipment is provided, which can be terminal, internal structure Figure can be as shown in Figure 8.The computer equipment includes processor, the memory, network interface, display connected by system bus Screen and input unit.Wherein, the processor of the computer equipment is for providing calculating and control ability.The computer equipment is deposited Reservoir includes non-volatile memory medium and built-in storage.The non-volatile memory medium is stored with operating system and computer journey Sequence.The built-in storage provides environment for the operation of operating system and computer program in non-volatile memory medium.The calculating The network interface of machine equipment is used to communicate with external server by network connection.When the computer program is executed by processor with Realize a kind of page loading method.
In one embodiment, a kind of computer equipment is provided, including memory, processor and storage are on a memory And the computer program that can be run on a processor, processor realize above-described embodiment page load side when executing computer program Step in method, such as step S10 shown in Fig. 2 to step S60, alternatively, being realized when processor execution computer program above-mentioned The function of each module of page loading device in embodiment, such as module 71 shown in Fig. 7 is to the function of module 76.To avoid weight Multiple, which is not described herein again.
In one embodiment, a kind of computer readable storage medium is provided, computer program is stored thereon with, is calculated Machine program realizes that the step in above-mentioned implementation page loading method, such as step S10 shown in Fig. 2 extremely walk when being executed by processor Rapid S60, alternatively, processor realizes the function of each module of page loading device in above-described embodiment when executing computer program, Such as module 71 shown in Fig. 7 is to the function of module 76.To avoid repeating, which is not described herein again.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, the computer program can be stored in a non-volatile computer In read/write memory medium, the computer program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, To any reference of memory, storage, database or other media used in each embodiment provided herein, Including non-volatile and/or volatile memory.Nonvolatile memory may include read-only memory (ROM), programming ROM (PROM), electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM) or flash memory.Volatile memory may include Random access memory (RAM) or external cache.By way of illustration and not limitation, RAM is available in many forms, Such as static state RAM (SRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate sdram (DDRSDRAM), enhancing Type SDRAM (ESDRAM), synchronization link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic ram (DRDRAM) and memory bus dynamic ram (RDRAM) etc..
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each function Can unit, module division progress for example, in practical application, can according to need and by above-mentioned function distribution by different Functional unit, module are completed, i.e., the internal structure of described device is divided into different functional unit or module, more than completing The all or part of function of description.
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although referring to aforementioned reality Applying example, invention is explained in detail, those skilled in the art should understand that: it still can be to aforementioned each Technical solution documented by embodiment is modified or equivalent replacement of some of the technical features;And these are modified Or replacement, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution should all It is included within protection scope of the present invention.

Claims (10)

1. a kind of page loading method, which is characterized in that the page loading method includes:
Page request instruction is sent to server-side;
The response message that the server-side is returned according to page request instruction is received, and obtains page from the response message Face data, wherein the response message includes at least two page datas;
It is matched using preset filter label with the hypertext markup language label in each page data;
The corresponding page data of the hypertext markup language label of successful match is filtered, and will be remaining after filtering The page data is stored as target pages data to preset spatial cache;
The priority for determining each target pages data is defined according to preset priority;
According to the priority sequence from high to low of the target pages data, by each of the spatial cache target Page data is asynchronous to be loaded into the display page.
2. page loading method as described in claim 1, which is characterized in that described to receive the server-side according to the page The response message that request instruction returns, and obtain page data from the response message and include:
Receive the response message that the server-side is returned according to page request instruction, wherein the response message includes ringing Text is answered, the response text is present in the response message in the form of compressed file;
According to preset decompression mode, the response text that the response message includes is decompressed, the page is obtained Data.
3. page loading method as described in claim 1, which is characterized in that described to be determined often according to the definition of preset priority The priority of a target pages data includes:
The hypertext markup language label of each target pages data is obtained from the spatial cache;
According to the hypertext markup language label of the target pages data, inquiry is each in the preset priority definition The corresponding priority tag of the hypertext markup language label;
According to the corresponding priority tag of the hypertext markup language label inquired, the hypertext markup language is determined The priority of the corresponding target pages data of label.
4. page loading method as described in claim 1, which is characterized in that determined in described defined according to preset priority After the priority of the target pages data, the page loading method further include:
Obtain the display size of the target pages data and the size of the corresponding visualization window of the display page;
According to the size of the display size of the target pages data and the visualization window, the visualization window energy is calculated The page data amount enough shown;
If the page data amount in the spatial cache is greater than the page data amount that the visualization window can be shown, basis Preset webpage layout mode, determines the target pages data that the visualization window can be shown, and by the visualization The target pages data that window can be shown are as the first load data;
According to the priority sequence from high to low of the target pages data, by first load, data are asynchronous is loaded into institute State the display page;
If the first load data are completed to load, according to priority from high to low suitable of the target pages data Target pages data except the first load data asynchronous are loaded into the display page by sequence.
5. page loading method as claimed in claim 4, which is characterized in that described according to the preferential of the target pages data Asynchronous be loaded into of each of the spatial cache target pages data is shown page packet by the sequence of grade from high to low It includes:
According to the preset webpage layout, position of each target pages data in the display page is determined, and The position of each target pages data is occupied using preset placeholder;
According to the priority sequence from high to low of the target pages data, the page object is obtained from the spatial cache Face data, and according to the hypertext markup language label of the target pages data, determine the target pages data described aobvious Show the position in the page, which is written in the corresponding preset placeholder in the position, so that the mesh Mark page data is loaded into the display page.
6. a kind of page loading device, which is characterized in that the page loading device includes:
Request sending module, for sending page request instruction to server-side;
Message reception module, the response message returned for receiving the server-side according to page request instruction, and from institute It states and obtains page data in response message, wherein the response message includes at least two page datas;
Information matches module, for using the hypertext markup language mark in preset filter label and each page data Label are matched;
Data filtering module, for carrying out the corresponding page data of the hypertext markup language label of successful match Filter, and the remaining page data after filtering is stored as target pages data to preset spatial cache;
Data separation module, for defining the priority for determining each target pages data according to preset priority;
Page loading module, it is for the sequence of the priority according to the target pages data from high to low, the caching is empty Between each of the target pages data are asynchronous is loaded into the display page.
7. page loading device as claimed in claim 6, which is characterized in that the page loading device further include:
Dimension acquisition module, for obtaining display size and the corresponding visualization of the display page of the target pages data The size of window;
Capacity calculation module, for according to the display size of the target pages data and the size of the visualization window, meter Calculate the page data amount that the visualization window can be shown;
Data analysis module, if being greater than what the visualization window can be shown for the page data amount in the spatial cache Page data amount determines the target pages number that the visualization window can be shown then according to preset webpage layout mode According to, and the target pages data that the visualization window can be shown are as the first load data;
Preferential loading module adds for the sequence of the priority according to the target pages data from high to low by described first Carry that data are asynchronous is loaded into the display page;
Delay loading module, if completing to load for the first load data, according to the excellent of the target pages data Target pages data except the first load data asynchronous are loaded into the display page by the sequence of first grade from high to low Face.
8. page loading device as claimed in claim 7, which is characterized in that the page loading module includes:
Submodule is pre-processed, for determining each target pages data described aobvious according to the preset webpage layout Show the position in the page, and is occupied the position of each target pages data using preset placeholder;
Submodule is loaded, for the sequence of the priority according to the target pages data from high to low, from the spatial cache It is middle to obtain the target pages data, and according to the hypertext markup language label of the target pages data, determine the target The corresponding preset occupy-place in the position is written in the target pages data by position of the page data in the display page Fu Zhong, so that the target pages data are loaded into the display page.
9. a kind of computer equipment, including memory, processor and storage are in the memory and can be in the processor The computer program of upper operation, which is characterized in that the processor realized when executing the computer program as claim 1 to The step of any one of 5 page loading method.
10. a kind of computer readable storage medium, the computer-readable recording medium storage has computer program, and feature exists In the step of realization page loading method as described in any one of claim 1 to 5 when the computer program is executed by processor Suddenly.
CN201811255726.4A 2018-10-26 2018-10-26 Page loading method, device, computer equipment and storage medium Pending CN109582899A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811255726.4A CN109582899A (en) 2018-10-26 2018-10-26 Page loading method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811255726.4A CN109582899A (en) 2018-10-26 2018-10-26 Page loading method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN109582899A true CN109582899A (en) 2019-04-05

Family

ID=65920794

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811255726.4A Pending CN109582899A (en) 2018-10-26 2018-10-26 Page loading method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109582899A (en)

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110286814A (en) * 2019-06-04 2019-09-27 深圳前海达闼云端智能科技有限公司 Page content display method, device, storage medium and electronic equipment
CN110347446A (en) * 2019-07-16 2019-10-18 阿里巴巴集团控股有限公司 A kind of page resource loading method and system
CN110634049A (en) * 2019-09-05 2019-12-31 北京无限光场科技有限公司 Page display content processing method and device, electronic equipment and readable medium
CN110798748A (en) * 2019-11-04 2020-02-14 北京达佳互联信息技术有限公司 Audio and video preloading method and device and electronic equipment
CN110889074A (en) * 2019-11-27 2020-03-17 珠海格力电器股份有限公司 Page display method and device, storage medium and electronic equipment
CN111079046A (en) * 2019-11-14 2020-04-28 拉扎斯网络科技(上海)有限公司 Information loading method, system, server, terminal and storage medium
CN111159603A (en) * 2019-12-30 2020-05-15 北大方正集团有限公司 Method and device for loading page styles
CN111241435A (en) * 2019-12-31 2020-06-05 五八有限公司 Method and device for loading picture elements
CN111309421A (en) * 2020-02-11 2020-06-19 腾讯科技(深圳)有限公司 Interface resource loading method and device, terminal and storage medium
CN111796824A (en) * 2020-06-29 2020-10-20 平安普惠企业管理有限公司 Page loading method, device, server and medium
CN112433779A (en) * 2020-11-10 2021-03-02 金蝶云科技有限公司 Application site preloading method, device and storage medium based on ERP system
CN112947942A (en) * 2021-04-01 2021-06-11 厦门亿联网络技术股份有限公司 Data analysis and acquisition method and device, electronic equipment and storage medium
CN113505320A (en) * 2021-07-14 2021-10-15 杭州隆埠科技有限公司 News content display method and device
CN113505271A (en) * 2021-07-14 2021-10-15 杭州隆埠科技有限公司 HTML document analysis method, HTML document transmission method, HTML document analysis device, and HTML document transmission device
CN113535307A (en) * 2021-07-23 2021-10-22 深圳小湃科技有限公司 Interface loading method and device and storage medium
CN114125535A (en) * 2021-11-11 2022-03-01 广州方硅信息技术有限公司 Live broadcast speaking method, system, device, equipment and storage medium
CN114816586A (en) * 2022-06-28 2022-07-29 深圳高灯计算机科技有限公司 Visible data loading method and device, computer equipment and storage medium
CN115037801A (en) * 2022-03-14 2022-09-09 阿里巴巴(中国)有限公司 Priority adjustment method, electronic device, and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104850415A (en) * 2014-02-13 2015-08-19 腾讯科技(深圳)有限公司 Method and apparatus for loading pages
CN106503135A (en) * 2016-10-20 2017-03-15 浪潮通用软件有限公司 A kind of method and apparatus of WEB page loading
WO2017076315A1 (en) * 2015-11-05 2017-05-11 广州市动景计算机科技有限公司 Page display method, device, and system, and page display assist method and device
CN107977371A (en) * 2016-10-21 2018-05-01 阿里巴巴集团控股有限公司 Requesting method, display methods and the client of page elements
CN108460042A (en) * 2017-02-20 2018-08-28 华为技术有限公司 A kind of method that the page is shown, relevant device and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104850415A (en) * 2014-02-13 2015-08-19 腾讯科技(深圳)有限公司 Method and apparatus for loading pages
WO2017076315A1 (en) * 2015-11-05 2017-05-11 广州市动景计算机科技有限公司 Page display method, device, and system, and page display assist method and device
CN106503135A (en) * 2016-10-20 2017-03-15 浪潮通用软件有限公司 A kind of method and apparatus of WEB page loading
CN107977371A (en) * 2016-10-21 2018-05-01 阿里巴巴集团控股有限公司 Requesting method, display methods and the client of page elements
CN108460042A (en) * 2017-02-20 2018-08-28 华为技术有限公司 A kind of method that the page is shown, relevant device and system

Cited By (25)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110286814A (en) * 2019-06-04 2019-09-27 深圳前海达闼云端智能科技有限公司 Page content display method, device, storage medium and electronic equipment
CN110347446A (en) * 2019-07-16 2019-10-18 阿里巴巴集团控股有限公司 A kind of page resource loading method and system
CN110634049A (en) * 2019-09-05 2019-12-31 北京无限光场科技有限公司 Page display content processing method and device, electronic equipment and readable medium
CN110634049B (en) * 2019-09-05 2022-05-10 北京无限光场科技有限公司 Page display content processing method and device, electronic equipment and readable medium
CN110798748A (en) * 2019-11-04 2020-02-14 北京达佳互联信息技术有限公司 Audio and video preloading method and device and electronic equipment
CN111079046A (en) * 2019-11-14 2020-04-28 拉扎斯网络科技(上海)有限公司 Information loading method, system, server, terminal and storage medium
CN110889074B (en) * 2019-11-27 2022-04-08 珠海格力电器股份有限公司 Page display method and device, storage medium and electronic equipment
CN110889074A (en) * 2019-11-27 2020-03-17 珠海格力电器股份有限公司 Page display method and device, storage medium and electronic equipment
CN111159603A (en) * 2019-12-30 2020-05-15 北大方正集团有限公司 Method and device for loading page styles
CN111159603B (en) * 2019-12-30 2023-08-04 新方正控股发展有限责任公司 Page style loading method and page style loading device
CN111241435A (en) * 2019-12-31 2020-06-05 五八有限公司 Method and device for loading picture elements
CN111241435B (en) * 2019-12-31 2024-02-27 五八有限公司 Method and device for loading picture elements
CN111309421B (en) * 2020-02-11 2021-05-14 腾讯科技(深圳)有限公司 Interface resource loading method and device, terminal and storage medium
CN111309421A (en) * 2020-02-11 2020-06-19 腾讯科技(深圳)有限公司 Interface resource loading method and device, terminal and storage medium
CN111796824A (en) * 2020-06-29 2020-10-20 平安普惠企业管理有限公司 Page loading method, device, server and medium
CN112433779A (en) * 2020-11-10 2021-03-02 金蝶云科技有限公司 Application site preloading method, device and storage medium based on ERP system
CN112433779B (en) * 2020-11-10 2022-10-14 金蝶云科技有限公司 Application site preloading method, device and storage medium based on ERP system
CN112947942A (en) * 2021-04-01 2021-06-11 厦门亿联网络技术股份有限公司 Data analysis and acquisition method and device, electronic equipment and storage medium
CN113505320A (en) * 2021-07-14 2021-10-15 杭州隆埠科技有限公司 News content display method and device
CN113505271A (en) * 2021-07-14 2021-10-15 杭州隆埠科技有限公司 HTML document analysis method, HTML document transmission method, HTML document analysis device, and HTML document transmission device
CN113535307A (en) * 2021-07-23 2021-10-22 深圳小湃科技有限公司 Interface loading method and device and storage medium
CN114125535A (en) * 2021-11-11 2022-03-01 广州方硅信息技术有限公司 Live broadcast speaking method, system, device, equipment and storage medium
CN115037801A (en) * 2022-03-14 2022-09-09 阿里巴巴(中国)有限公司 Priority adjustment method, electronic device, and storage medium
CN114816586A (en) * 2022-06-28 2022-07-29 深圳高灯计算机科技有限公司 Visible data loading method and device, computer equipment and storage medium
CN114816586B (en) * 2022-06-28 2022-09-27 深圳高灯计算机科技有限公司 Visible data loading method and device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109582899A (en) Page loading method, device, computer equipment and storage medium
US20190251143A1 (en) Web page rendering method and related device
US9344491B2 (en) Systems, methods, and computer readable media for providing applications style functionality to a user
US7620891B2 (en) Method and system for improving presentation of HTML pages in web devices
US9916285B2 (en) Generating a preview of a web page for a mobile terminal
CN104981800A (en) Delivery and display of page previews during page retrieval events
JP2004527041A (en) System and method for content delivery over a wireless communication medium to a portable computing device
CN110908712A (en) Data processing method and equipment for cross-platform mobile terminal
CN103812888A (en) Information pushing, receiving and transmitting method, server, client and system
CN110083383A (en) Browser style compatibility method, device, computer equipment and storage medium
CN110647699A (en) Web page rendering method and device, computer equipment and storage medium
US10289747B2 (en) Dynamic file concatenation
WO2022048141A1 (en) Image processing method and apparatus, and computer readable storage medium
CN111273904A (en) Page generation method, device, equipment and storage medium based on custom module
CN110888634B (en) Game floor page generation method, game floor page generation device, computer equipment and storage medium
KR101516213B1 (en) Responsive Web Generating Method By Converting Document To Responsive Web
CN112631564A (en) Content management system-based interface generation method, device, equipment and storage medium
CN114637499B (en) Visualization component processing method, device, equipment and medium
Rey et al. Towards a Performance Optimization of Mobile Automated Fingerprint Identification System (MAFIS) for the Philippine National Police
CN114862470A (en) Advertisement resource adaptation method and device, computer equipment and storage medium
CN104219277A (en) Rearranging a server response
JP5245629B2 (en) Relay device, communication relay method, program thereof, and relay system
EP2557505A1 (en) Web display program conversion system, web display program conversion method, and program for web display program conversion
CN110196724A (en) File loading method, terminal, server, computer equipment and storage medium
CN112328930B (en) Webpage rendering method, server, client and system based on cobalt

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