[go: up one dir, main page]

CN110020304A - A method and device for loading a page - Google Patents

A method and device for loading a page Download PDF

Info

Publication number
CN110020304A
CN110020304A CN201711224439.2A CN201711224439A CN110020304A CN 110020304 A CN110020304 A CN 110020304A CN 201711224439 A CN201711224439 A CN 201711224439A CN 110020304 A CN110020304 A CN 110020304A
Authority
CN
China
Prior art keywords
page
page file
fold
screen
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
CN201711224439.2A
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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information 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 Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201711224439.2A priority Critical patent/CN110020304A/en
Publication of CN110020304A publication Critical patent/CN110020304A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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)

Abstract

本发明公开了一种加载页面的方法和装置,涉及计算机技术领域。该方法的一具体实施方式包括:向服务器端发送页面文件请求;接收服务器端返回的包含首屏数据的页面文件;其中,所述首屏数据包括需要在首屏展示的媒体文件的链接;根据所述首屏数据生成首屏内容;根据所述页面文件生成包含所述首屏内容的页面。该实施方式能够明显减少加载页面首屏内容的时间,提升用户体验。

The invention discloses a method and device for loading pages, and relates to the technical field of computers. A specific implementation of the method includes: sending a page file request to the server; receiving a page file returned by the server including the first screen data; wherein, the first screen data includes links to media files that need to be displayed on the first screen; The above-the-fold data generates above-the-fold content; and a page including the above-the-fold content is generated according to the page file. This embodiment can significantly reduce the time for loading the content on the first screen of the page and improve user experience.

Description

Page loading method and device
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for loading a page.
Background
With the coming of the internet era, the demand of people for webpage browsing is more and more rich, and the content of a front-end page is more and more complex. The existing front-end page mainly comprises tools such as HyperText markup language (HTML) files for displaying, JavaScript codes for controlling page logic, and Cascading Style Sheets (CSSs) codes for page styles. In order to ensure the dynamic property of the page, the basic data of the page is provided with an interface by a server, and a front-end browser calls the interface. The more complex the page, the more interfaces that need to be called, which in turn increases the time consumption of page loading.
In the existing page loading method, when parsing a page file, a logical processing tool (such as the aforementioned JavaScript code and cascading style sheet code) of a page is first requested, and then page data is requested according to content included in the logical processing tool.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art: since the interface data is requested after the logical processing tool is parsed, and then the page data is further acquired according to the interface data, a plurality of request processes are performed. Resulting in too long time spent in loading complex pages and long waiting time for the user.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for loading a page, which can reduce the time for loading the page and improve user experience.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a method for loading a page, including:
sending a page file request to a server;
receiving a page file containing first screen data returned by a server; the first screen data comprises links of media files needing to be displayed on the first screen;
generating first screen content according to the first screen data;
and generating a page containing the first screen content according to the page file.
Optionally, after the step of sending the page file request to the server, the method includes:
after receiving the page file request, the server side acquires a page file containing pre-added first screen data according to the page file request and returns the page file containing the first screen data; or,
after receiving the page file request, the server side acquires a page file according to the page file request, analyzes a first screen logic processing tool in the page file, acquires first screen data according to an analysis result, adds the first screen data into the page file, and returns the page file containing the first screen data.
Optionally, after the step of generating a page including the first screen content according to the page file, the method includes:
acquiring a non-first-screen logic processing tool and non-first-screen data;
generating non-first screen content according to the non-first screen logic processing tool and the non-first screen data;
adding the non-first screen content to the page.
Optionally, the step of acquiring the non-first-screen logical processing tool and the non-first-screen data includes:
analyzing the non-first-screen logic processing tool;
determining non-first-screen data to be acquired according to the analysis result;
judging whether the non-first-screen data needing to be acquired exists in a cache;
if not, sending a request for the non-first-screen data to be acquired to a server;
and if so, acquiring the non-first-screen data to be acquired from the cache.
To achieve the above object, according to another aspect of the embodiments of the present invention, there is provided an apparatus for loading a page, including:
the page file request module is used for sending a page file request to the server side;
the page file receiving module is used for receiving a page file containing first screen data returned by the server side; the first screen data comprises links of media files needing to be displayed on the first screen;
the first screen content generation module is used for generating first screen content according to the first screen data;
and the first screen page generation module is used for generating a page containing the first screen content according to the page file.
Optionally, after receiving the page file request, the server side obtains a page file containing the pre-added first screen content according to the page file request, and returns the page file containing the first screen content; or,
after receiving the page file request, the server side acquires a page file according to the page file request, analyzes a first screen logic processing tool in the page file, acquires first screen data according to an analysis result, adds the first screen content into the page file after generating first screen content according to the first screen logic processing tool and the first screen data, and returns the page file containing the first screen content.
Optionally, the apparatus further comprises:
the non-first screen content generation module is used for acquiring a non-first screen logic processing tool and non-first screen data; generating non-first screen content according to the non-first screen logic processing tool and the non-first screen data;
and the page updating module is used for adding the non-first screen content to the page.
Optionally, the non-first-screen content generating module is further configured to:
analyzing the non-first-screen logic processing tool; determining non-first-screen data to be acquired according to the analysis result; judging whether the non-first-screen data needing to be acquired exists in a cache; if not, sending a request for the non-first-screen data to be acquired to a server; and if so, acquiring the non-first-screen data to be acquired from the cache.
To achieve the above object, according to another aspect of the embodiments of the present invention, there is provided an electronic device for loading a page, including:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to perform at least the following:
sending a page file request to a server;
receiving a page file containing first screen data returned by a server; the first screen data comprises links of media files needing to be displayed on the first screen;
generating first screen content according to the first screen data;
and generating a page containing the first screen content according to the page file.
To achieve the above object, according to another aspect of the embodiments of the present invention, there is provided a computer readable medium having stored thereon a computer program that, when executed by a processor, at least realizes:
sending a page file request to a server;
receiving a page file containing first screen data returned by a server; the first screen data comprises links of media files needing to be displayed on the first screen;
generating first screen content according to the first screen data;
and generating a page containing the first screen content according to the page file.
One embodiment of the above invention has the following advantages or benefits: the technical means of returning the page file containing the first screen data when the browser sends the page file request is adopted, so that the browser can directly display the first screen content corresponding to the first screen data without carrying out tool requests or data requests, the time consumed for loading the first screen content of the page is reduced, the technical problem that the page loading time is long due to multiple requests of the existing complex page is solved, and the technical effects of improving the page loading speed and improving the user experience are achieved.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of the main steps of a method of loading a page according to an embodiment of the invention;
FIG. 2 is a timing diagram of the main steps of an alternative implementation of the method of loading pages of the present invention;
FIG. 3 is a schematic diagram of the main modules of an apparatus for loading pages according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of the main modules of an apparatus for loading pages according to another embodiment of the present invention;
FIG. 5 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 6 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
FIG. 1 is a diagram illustrating the main steps of a method for loading a page according to an embodiment of the present invention.
As shown in fig. 1, a method for loading a page according to an embodiment of the present invention includes:
and S10, the client sends a page file request to the server. The page file requested by the page file request refers to a file for describing content, style, display effect and the like of a page, and the page file can be analyzed by a browser of a client to organize and form the page, for example, the page file can be an HTML file.
S11, the server side generates a page file containing the first screen data; the first screen data comprises links of the media files needing to be displayed on the first screen. The first screen data corresponds to content which can be directly acquired by the browser and then displayed in the page; in the step, the server end replaces a browser end to finish analysis and rendering of the part related to the first screen data in the page file, namely, the server end acquires and analyzes the first screen logic processing tool according to the page file, acquires the first screen data, and then adds the first screen data and/or the related logic processing tool to the page file. The logical processing tool refers to a tool for describing logical rules of a page, and its functions include determining the position, size, color, hierarchical relationship, rendering effect, etc. of each element, for example, the logical processing tool may include JavaScript code or CSS code. Alternatively, the related codes of the first screen data, such as links of media files such as pictures or videos, and/or corresponding logic processing tools, etc., may be added to the page file manually in advance. Optionally, in this step, the dynamic server is used to complete generation and addition of the first screen content.
And S12, the server side sends the page file to the client side.
And S13, the client receives the page file containing the first screen data returned by the server. The "first screen data" generally refers to data corresponding to more important content in a page, and a browser may directly acquire the corresponding content according to the data and need an additional parsing process, for example, content that is more likely to attract attention of a user from a visual perspective, including text content such as a title and an important text, or links of media content such as a picture and a video.
As can be seen, the first screen content in this embodiment is not all content in the page, and other non-first screen content except the first screen content may not be returned together with the page file, but is requested, parsed, and rendered by the browser end according to the page file by a conventional method. Due to the fact that the first screen content is displayed quickly, the main content of the page can be seen directly from the perspective of a user, and the browser can further finish loading of the non-first screen content in the process that the user browses the main content of the page, so that user experience is improved.
And S14, the client generates the first screen content according to the first screen data. According to the foregoing description, the corresponding first screen content can be directly acquired according to the first screen data, and then the first screen content is displayed according to the setting of the page file; if the page file further comprises a logic processing tool required for processing the first screen data, the first screen data can be directly processed according to the logic processing tool to obtain the first screen content, and then the page containing the first screen content is displayed.
And S15, the client generates a page containing the first screen content according to the page file. Since the first screen content is directly displayable, the browser can directly display the first screen content in the page file without additional request after generating the first screen content in the page file. Therefore, in the embodiment, the processing work of the first screen content is distributed to the server side to be performed or is performed in advance, so that the request times when the first screen content is generated are reduced, and a large amount of time is saved.
As can be seen from the above, the method for loading a page provided in this embodiment adopts a technical means of returning the page file including the first screen data when the browser sends the page file request, so that the browser can directly display the first screen content corresponding to the first screen data without performing a tool request or a data request, and time consumed for loading the first screen content of the page is reduced, thereby overcoming a technical problem of long page loading time caused by multiple requests of the existing complex page, and further achieving technical effects of increasing page loading speed and improving user experience.
In some optional embodiments, after the step of the client generating the page including the first screen content according to the page file at S14:
generating non-first screen content;
adding the non-first screen content to the page.
The step of generating the non-first-screen data comprises the following steps:
acquiring a non-first-screen logic processing tool;
analyzing the non-first-screen logic processing tool;
acquiring non-first-screen data according to the analysis result;
and generating non-first-screen content according to the non-first-screen logic processing tool and the non-first-screen data.
After generating the page containing the first screen content, the browser further generates other content in the page, namely non-first screen content, according to the page file. The browser acquires and analyzes the non-first-screen logical processing tool according to the page file, further requests non-first-screen data (mainly including interface data, such as domain name links of media files of pictures, sounds, videos and the like) appointed by the analyzed non-first-screen logical processing tool, and finally renders the non-first-screen data according to the non-first-screen logical processing tool, so that non-first-screen content is generated.
In some optional embodiments, the non-first-screen logical processing tool And the non-first-screen data are acquired by using an Asynchronous request And a receiving manner, for example, the non-first-screen logical processing tool And the non-first-screen data are implemented by using technologies such as Asynchronous JavaScript And XML (Asynchronous JavaScript And XML, AJAX).
According to some optional implementation manners of this embodiment, the step of obtaining the non-top-screen data according to the parsing result includes:
determining non-first-screen data to be acquired according to the analysis result;
judging whether the non-first-screen data exists in a cache or not;
if not, sending a request for the non-first-screen data to a server side;
and if so, acquiring the non-first-screen data from the cache.
According to the embodiment, if the relevant non-first-screen data is requested in the previous page loading process, the cached non-first-screen data can not be requested again when the non-first-screen data is acquired this time. When the steps of the embodiment are executed, a storage rule of the cache can be preset, and a long storage life is set for some frequently-used non-first-screen data in the cache for repeated use; in addition, after it is detected that the non-first-screen data in the cache needs to be updated, the non-first-screen data needing to be updated can be requested again and the existing non-first-screen data in the cache can be replaced.
In some optional embodiments, after the step of the client generating the page including the first screen content according to the page file at S14:
and carrying out domain name pre-resolution on the non-first-screen data link contained in the page file.
Domain name resolution is a process of pointing a domain name to a website space IP Address (Internet Protocol Address). The pre-analysis in this embodiment refers to pre-obtaining an IP address of a domain name link corresponding to non-first-screen data before obtaining the non-first-screen data from the server according to the page file, so that the time for domain name resolution can be saved in subsequent data obtaining, and the request and obtaining speed can be improved. The related commands of domain name pre-resolution can be added into the page file from the server side.
In some optional embodiments, after the step of the client generating the page including the first screen content according to the page file at S14:
and preloading the first screen content of the next-level page according to the link of the next-level page in the page.
During the user's browsing of the current page, the browser is in an idle state most of the time. In the embodiment, in the idle time of the browser, the first screen data or the logic processing tool in the next-level page is preloaded according to the link of the next-level page included in the current page, so that after the user clicks the link of the next-level page, the time consumed for requesting the first screen data or the logic processing tool in the next-level page can be saved, and the loading speed of the next-level page is increased.
The method for loading pages provided by the present invention is further explained by a specific example.
FIG. 2 is a timing diagram of the main steps of an alternative implementation of the method of loading pages of the present invention.
As shown in fig. 2, the present embodiment provides a method for loading a front-end page based on HTML, which is applicable to an electronic device provided with a browser supporting an HTML page, and includes the following main steps:
s200, the browser requests the HTML frame from the dynamic server. The HTML frame in this step is an HTML file containing HTML source code and first screen content. The meaning of the first screen content has been explained in the foregoing embodiment, and in this embodiment, the first screen content mainly includes a first screen picture subjected to rendering and the like.
S201, the dynamic server generates an HTML frame. Compared with an ordinary HTML page, the HTML frame in this embodiment further includes the first screen data in addition to the HTML source code, and when the first screen data is added to the HTML frame, the first screen data needs to be dynamically rendered, so that the first screen data cannot be provided by a static server (for example, a server in a content distribution network), and the dynamic server needs to be used to complete the rendering operation in advance.
S202, the dynamic server returns an HTML frame to the browser.
S203, the browser analyzes the HTML frame. After the browser analyzes the HTML frame, the browser can acquire the page source code and the first screen data. Because the first screen content can be directly requested according to the first screen data and can be directly used for displaying, after the execution of the step S203 is finished, the browser displays the first screen content in the page, so that the user can browse important information in the page. Other non-first screen content or functional components in the page other than the first screen content are further requested and loaded in subsequent steps.
S204, the browser requests the CSS and the JS to the content distribution network. CSS refers to cascading style sheet code and JS refers to JavaScript code. A Content Delivery Network (CDN) is a one-layer intelligent virtual Network based on the existing internet, which is formed by placing node servers at various places in the Network, so that the CDN system can redirect a user's request to a service node closest to the user in real time according to Network traffic, connection of each node, load conditions, and comprehensive information such as a distance to the user and response time. The method aims to enable the user to obtain the required content nearby, solve the problem of congestion of the Internet network and improve the response speed of the user for accessing the website. The content distribution network in the present embodiment may also refer to a node server in the content distribution network. In addition to using a node server in the content distribution network, the present embodiment may also provide data storage service support using a general server.
Before step S204 is executed, the browser may search the JS and CSS codes to be requested in the local cache, and if the JS and CSS codes can be found, the data does not need to be requested from the server, which reduces time consumption for requesting data and improves loading speed of the page.
When step S204 is executed, the requested quality of the non-first-screen picture and whether the non-first-screen pictures corresponding to different domain names need to be requested respectively are determined according to the number of the non-first-screen pictures that need to be requested and the current network state, so as to optimize the bandwidth utilization rate or break through the limitation of the single domain name download number of the browser.
S205, the content distribution network reads the CSS and the JS.
S206, the content distribution network returns CSS and JS to the browser.
S207, the browser analyzes and executes the JS. In the prior art, after the JS is analyzed, a first screen picture needs to be further requested to a data interface appointed by the JS, and a certain time needs to be additionally consumed; and because subsequent parsing and loading work cannot be performed before the interface data is returned, the loading speed of the page is further slowed down. This embodiment has then added the first screen content in advance in the html frame, and the interlinkage of first screen picture promptly can directly according to JS after the analysis JS with the interlinkage carries out the page and renders up to processing speed has been improved.
Before step S207, the browser may perform pre-resolution on the domain name in the non-first-screen data through a command such as DNS-pre-resolution (DNS pre-resolution), so as to improve the speed of subsequent data acquisition.
S208, the browser requests the non-first-screen interface data from each interface data server. In order to ensure the loading speed of the first screen page, the non-first screen interface data is not contained in the first screen content, and a further request is made in the step. The non-first screen interface data may include, for example, a link to a non-first screen picture, etc.
S209, the interface data server generates non-first screen interface data.
S210, the interface data server returns non-first-screen interface data to the browser.
S211, the browser requests the non-first-screen picture from the content distribution network.
And S212, reading the non-first-screen picture by the content distribution network.
S213, the content delivery network returns the non-first screen picture to the browser.
When steps S208 to S213 are executed, the non-first screen content may be requested in the AJAX manner, and the page may be partially refreshed.
In step S213, the current page is completely loaded. After step S213, the content of the next-level page (mainly referring to the CSS file of the next-level page) may also be preloaded according to the link in the current page, so as to increase the speed of loading the next-level page.
As can be seen from the above, in the method provided in this embodiment, by adopting a technical means of returning the page file including the first screen data when the browser sends the page file request, the browser can directly display the first screen content corresponding to the first screen data without performing a tool request or a data request, and the time consumed for loading the first screen content of the page is reduced, so that the technical problem of long page loading time caused by multiple requests of the existing complex page is solved, and the technical effects of increasing the page loading speed and improving the user experience are achieved.
FIG. 3 is a schematic diagram of the main modules of an apparatus for loading pages according to an embodiment of the present invention.
As shown in fig. 3, an apparatus 300 for loading a page according to an embodiment of the present invention is mainly applied to a client, and includes:
a page file request module 301, configured to send a page file request to a server;
the page file receiving module 302 is configured to receive a page file containing first screen data returned by a server; the first screen data comprises links of media files needing to be displayed on the first screen;
a first screen content generating module 303, configured to generate a first screen content according to the first screen data;
a home screen page generating module 304, configured to generate a page including the home screen content according to the page file.
In some optional embodiments, the apparatus 300 further comprises:
a non-first screen content generation module 305, configured to generate non-first screen content;
a page update module 306, configured to add the non-top screen content to the page.
In some optional embodiments, the non-top screen content generation module 304 is further configured to: the method comprises the steps of acquiring a non-first-screen logic processing tool and non-first-screen data; and generating non-first-screen content according to the non-first-screen logic processing tool and the non-first-screen data.
In some optional embodiments, the non-top screen content generation module 304 is further configured to: determining non-first-screen data to be acquired according to the analysis result; judging whether the non-first-screen data exists in a cache or not; if not, sending a request for the non-first-screen data to a server side; and if so, acquiring the non-first-screen data from the cache.
In some optional embodiments, the apparatus 300 further comprises:
and the pre-resolution module 307 is configured to perform domain name pre-resolution on the non-first-screen data link included in the page file.
In some optional embodiments, the apparatus 300 further comprises:
and the preloading module 308 is configured to preload the first screen content of the next-level page according to the link of the next-level page in the pages.
As can be seen from the above, the device for loading a page provided in the embodiment of the present invention adopts the technical means of returning the page file including the first screen data when the browser sends the page file request, so that the browser can directly display the first screen content corresponding to the first screen data without performing a tool request or a data request, and the time consumed for loading the first screen content of the page is reduced, thereby overcoming the technical problem of long page loading time caused by multiple requests of the existing complex page, and further achieving the technical effects of increasing the page loading speed and improving the user experience.
FIG. 4 is a schematic diagram of the main modules of an apparatus for loading pages according to another embodiment of the present invention.
As shown in fig. 4, the apparatus 400 for loading a page according to an embodiment of the present invention is mainly applied to a server, and includes:
a page file request receiving module 401, configured to receive a page file request sent by a client;
a first screen data processing module 402, configured to generate first screen data according to the page file, and then add the first screen data to the page file;
a page file sending module 403, configured to send the page file to the client.
In some optional embodiments, the first-screen data processing module 402 is further configured to: analyzing a first screen logic processing tool in the page file; and acquiring the first screen data according to the analysis result.
In some optional embodiments, after receiving the page file request, the apparatus 400 obtains, according to the page file request, a page file containing pre-added first screen data, and returns the page file containing the first screen data; or, after receiving the page file request, the apparatus 400 obtains a page file according to the page file request, parses a first screen logic processing tool in the page file, obtains first screen data according to a parsing result, adds the first screen data to the page file, and returns the page file including the first screen data.
As can be seen from the above, the device for loading a page provided in the embodiment of the present invention adopts the technical means of returning the page file including the first screen data when the browser sends the page file request, so that the browser can directly display the first screen content corresponding to the first screen data without performing a tool request or a data request, and the time consumed for loading the first screen content of the page is reduced, thereby overcoming the technical problem of long page loading time caused by multiple requests of the existing complex page, and further achieving the technical effects of increasing the page loading speed and improving the user experience.
Fig. 5 illustrates an exemplary system architecture 500 to which the method of loading pages or the apparatus for loading pages of the present invention may be applied.
As shown in fig. 5, the system architecture 500 may include terminal devices 501, 502, 503, a network 504, and a server 505. The network 504 is used to provide a medium for communication links between the terminal devices 501, 502, 503 and the server 405. Network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 501, 502, 503 to interact with a server 505 over a network 504 to receive or send messages or the like. The terminal devices 501, 502, 503 may have various communication client applications installed thereon, such as a shopping application, a web browser application, a search application, an instant messaging tool, a mailbox client, social platform software, and the like.
The terminal devices 501, 502, 503 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 505 may be a server providing various services, such as a DNS server, a CDN server, a static or dynamic data server, etc. providing support for pages browsed by users using the terminal devices 501, 502, 503.
It should be understood that the number of terminal devices, networks, and servers in fig. 5 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
The invention also provides an electronic device and a readable storage medium according to the embodiment of the invention.
Fig. 6 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
Referring now to FIG. 6, a block diagram of a computer system 600 suitable for use with a terminal device implementing an embodiment of the invention is shown. The terminal device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU)601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, the processes described above in the schematic representation of the main steps may be implemented as computer software programs according to embodiments of the present invention. For example, an embodiment of the invention comprises a computer program product comprising a computer program carried on a computer readable medium, the computer program comprising program code for performing the method illustrated in the schematic diagram of the main steps. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 601.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a pagefile requesting module 301, a pagefile receiving module 302, and a home screen page generating module 303. The names of these modules do not form a limitation on the modules themselves in some cases, for example, the top screen page generation module 303 may also be described as a "module for generating a page containing the top screen content from the page file".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to at least perform:
sending a page file request to a server;
receiving a page file containing first screen content returned by a server;
and generating a page containing the first screen content according to the page file.
In another alternative embodiment, the one or more programs, when executed by an apparatus, cause the apparatus to perform at least the following:
receiving a page file request sent by a client;
generating first screen content according to the page file, and then adding the first screen content to the page file;
and sending the page file to a client.
According to the technical scheme of the embodiment of the invention, as the technical means of returning the page file containing the first screen content when the browser sends the page file request is adopted, the browser can directly display the first screen content without carrying out tool request or data request, and the loading time consumption of the first screen content of the page is reduced, the technical problem of long page loading time caused by multiple requests of the existing complex page is solved, and the technical effects of improving the page loading speed and improving the user experience are further achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1.一种加载页面的方法,其特征在于,包括:1. a method for loading a page, is characterized in that, comprises: 向服务器端发送页面文件请求;Send a page file request to the server; 接收服务器端返回的包含首屏数据的页面文件;其中,所述首屏数据包括需要在首屏展示的媒体文件的链接;Receive a page file that includes the first screen data returned by the server; wherein, the first screen data includes links to media files that need to be displayed on the first screen; 根据所述首屏数据生成首屏内容;generating above-the-fold content according to the above-the-fold data; 根据所述页面文件生成包含所述首屏内容的页面。A page including the above-the-fold content is generated according to the page file. 2.根据权利要求1所述的方法,其特征在于,所述向服务器端发送页面文件请求的步骤后,包括:2. The method according to claim 1, characterized in that, after the step of sending a page file request to the server side, comprising: 服务器端在接收到所述页面文件请求后,根据所述页面文件请求获取包含有预先添加的首屏数据的页面文件,以及返回包含所述首屏数据的页面文件;或者,After receiving the page file request, the server side obtains the page file containing the pre-added first screen data according to the page file request, and returns the page file containing the first screen data; or, 服务器端在接收到所述页面文件请求后,根据所述页面文件请求获取页面文件,解析所述页面文件中的首屏逻辑处理工具,根据解析结果获取首屏数据,将所述首屏数据加入所述页面文件,以及返回包含所述首屏数据的页面文件。After receiving the page file request, the server side obtains the page file according to the page file request, parses the first screen logic processing tool in the page file, obtains the first screen data according to the analysis result, and adds the first screen data the page file, and the page file containing the above-the-fold data is returned. 3.根据权利要求1所述的方法,其特征在于,根据所述页面文件生成包含所述首屏内容的页面的步骤后,包括:3. The method according to claim 1, wherein after the step of generating a page containing the above-the-fold content according to the page file, comprising: 获取非首屏逻辑处理工具和非首屏数据;Get below-the-fold logic processing tools and below-the-fold data; 根据所述非首屏逻辑处理工具和非首屏数据生成非首屏内容;Generate below-the-fold content according to the below-fold logic processing tool and below-fold data; 将所述非首屏内容添加至所述页面。Add the below-the-fold content to the page. 4.根据权利要求3所述的方法,其特征在于,获取非首屏逻辑处理工具和非首屏数据的步骤包括:4. The method according to claim 3, wherein the step of acquiring a logic processing tool below the fold and data below the fold comprises: 解析所述非首屏逻辑处理工具;Parse the below-the-fold logic processing tool; 根据解析结果确定需获取的非首屏数据;Determine the off-the-fold data to be obtained according to the analysis result; 判断缓存中是否存在所述需获取的非首屏数据;Determine whether there is the below-the-fold data to be acquired in the cache; 若不存在,则向服务器端发送对所述需获取的非首屏数据的请求;If it does not exist, send a request for the non-folding data to be obtained to the server; 若存在,则从所述缓存获取所述需获取的非首屏数据。If it exists, obtain the below-the-fold data to be obtained from the cache. 5.一种加载页面的装置,其特征在于,包括:5. A device for loading pages, comprising: 页面文件请求模块,用于向服务器端发送页面文件请求;The page file request module is used to send a page file request to the server; 页面文件接收模块,用于接收服务器端返回的包含首屏数据的页面文件;其中,所述首屏数据包括需要在首屏展示的媒体文件的链接;a page file receiving module, configured to receive a page file including the first screen data returned by the server; wherein the first screen data includes links to media files that need to be displayed on the first screen; 首屏生成获取模块,用于根据所述首屏数据生成首屏内容;The first screen generation and acquisition module is used to generate the first screen content according to the first screen data; 首屏页面生成模块,用于根据所述页面文件生成包含所述首屏内容的页面。The above-the-fold page generation module is configured to generate a page including the above-the-fold content according to the page file. 6.根据权利要求5所述的装置,其特征在于,6. The device of claim 5, wherein: 服务器端在接收到所述页面文件请求后,根据所述页面文件请求获取包含有预先添加的首屏数据的页面文件,以及返回包含所述首屏数据的页面文件;或者,After receiving the page file request, the server side obtains the page file containing the pre-added first screen data according to the page file request, and returns the page file containing the first screen data; or, 服务器端在接收到所述页面文件请求后,根据所述页面文件请求获取页面文件,解析所述页面文件中的首屏逻辑处理工具,根据解析结果获取首屏数据,将所述首屏数据加入所述页面文件,以及返回包含所述首屏数据的页面文件。After receiving the page file request, the server side obtains the page file according to the page file request, parses the first screen logic processing tool in the page file, obtains the first screen data according to the analysis result, and adds the first screen data the page file, and the page file containing the above-the-fold data is returned. 7.根据权利要求5所述的装置,其特征在于,所述装置还包括:7. The apparatus of claim 5, wherein the apparatus further comprises: 非首屏内容生成模块,用于获取非首屏逻辑处理工具和非首屏数据;根据所述非首屏逻辑处理工具和非首屏数据生成非首屏内容;A below-the-fold content generation module, used to obtain below-fold logic processing tools and below-fold data; and generate below-fold content according to the below-fold logic processing tools and below-fold data; 页面更新模块,用于将所述非首屏内容添加至所述页面。A page update module, configured to add the below-the-fold content to the page. 8.根据权利要求7所述的装置,其特征在于,所述非首屏内容生成模块还用于:8. The apparatus according to claim 7, wherein the below-the-fold content generation module is further configured to: 解析所述非首屏逻辑处理工具;根据解析结果确定需获取的非首屏数据;判断缓存中是否存在所述需获取的非首屏数据;若不存在,则向服务器端发送对所述需获取的非首屏数据的请求;若存在,则从所述缓存获取所述需获取的非首屏数据。Parse the below-the-fold logic processing tool; determine the below-the-fold data to be acquired according to the parsing result; determine whether the below-the-fold data to be acquired exists in the cache; if not, send a request to the server The request for the obtained below-the-fold data; if there is, the below-fold data to be obtained is obtained from the cache. 9.一种加载页面的电子设备,其特征在于,包括:9. An electronic device for loading a page, comprising: 一个或多个处理器;one or more processors; 存储装置,用于存储一个或多个程序,storage means for storing one or more programs, 当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1-4中任一所述的方法。The one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-4. 10.一种计算机可读介质,其上存储有计算机程序,其特征在于,所述程序被处理器执行时实现如权利要求1-4中任一所述的方法。10. A computer-readable medium on which a computer program is stored, characterized in that, when the program is executed by a processor, the method according to any one of claims 1-4 is implemented.
CN201711224439.2A 2017-11-29 2017-11-29 A method and device for loading a page Pending CN110020304A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711224439.2A CN110020304A (en) 2017-11-29 2017-11-29 A method and device for loading a page

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711224439.2A CN110020304A (en) 2017-11-29 2017-11-29 A method and device for loading a page

Publications (1)

Publication Number Publication Date
CN110020304A true CN110020304A (en) 2019-07-16

Family

ID=67185947

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711224439.2A Pending CN110020304A (en) 2017-11-29 2017-11-29 A method and device for loading a page

Country Status (1)

Country Link
CN (1) CN110020304A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110753098A (en) * 2019-10-12 2020-02-04 北京达佳互联信息技术有限公司 Download request execution method and device, server and storage medium
CN111274512A (en) * 2020-01-16 2020-06-12 深圳市元征科技股份有限公司 Page loading method, device and medium
CN111563225A (en) * 2020-07-13 2020-08-21 随身云(南京)信息技术有限公司 Source code filling method and platform for overcoming first screen blank
CN111639289A (en) * 2020-05-13 2020-09-08 北京三快在线科技有限公司 Webpage loading method and device
CN112256363A (en) * 2020-09-21 2021-01-22 北京三快在线科技有限公司 Application page rendering method and device and electronic equipment
CN112379950A (en) * 2020-11-17 2021-02-19 北京金山云网络技术有限公司 Page calling method and device and server
CN112434233A (en) * 2020-02-20 2021-03-02 上海哔哩哔哩科技有限公司 Method and equipment for accelerating first screen rendering of secondary page
CN114518912A (en) * 2022-02-21 2022-05-20 度小满科技(北京)有限公司 Page loading method, device and equipment and readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102760133A (en) * 2011-04-28 2012-10-31 腾讯科技(深圳)有限公司 Webpage loading method, webpage loading system, browser, terminal and server
CN105205157A (en) * 2015-09-28 2015-12-30 北京奇艺世纪科技有限公司 Page loading method, device and system
CN106339414A (en) * 2016-08-12 2017-01-18 合网络技术(北京)有限公司 Webpage rendering method and device
CN107391664A (en) * 2017-07-19 2017-11-24 广州华多网络科技有限公司 Page data processing method and system based on WEB
CN107402938A (en) * 2016-05-22 2017-11-28 广州市动景计算机科技有限公司 page display method, device and client device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102760133A (en) * 2011-04-28 2012-10-31 腾讯科技(深圳)有限公司 Webpage loading method, webpage loading system, browser, terminal and server
CN105205157A (en) * 2015-09-28 2015-12-30 北京奇艺世纪科技有限公司 Page loading method, device and system
CN107402938A (en) * 2016-05-22 2017-11-28 广州市动景计算机科技有限公司 page display method, device and client device
CN106339414A (en) * 2016-08-12 2017-01-18 合网络技术(北京)有限公司 Webpage rendering method and device
CN107391664A (en) * 2017-07-19 2017-11-24 广州华多网络科技有限公司 Page data processing method and system based on WEB

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110753098A (en) * 2019-10-12 2020-02-04 北京达佳互联信息技术有限公司 Download request execution method and device, server and storage medium
CN111274512A (en) * 2020-01-16 2020-06-12 深圳市元征科技股份有限公司 Page loading method, device and medium
CN112434233A (en) * 2020-02-20 2021-03-02 上海哔哩哔哩科技有限公司 Method and equipment for accelerating first screen rendering of secondary page
CN112434233B (en) * 2020-02-20 2023-03-07 上海哔哩哔哩科技有限公司 Method and device for accelerating first screen rendering of secondary page
CN111639289A (en) * 2020-05-13 2020-09-08 北京三快在线科技有限公司 Webpage loading method and device
CN111639289B (en) * 2020-05-13 2024-02-23 北京三快在线科技有限公司 Webpage loading method and device
CN111563225A (en) * 2020-07-13 2020-08-21 随身云(南京)信息技术有限公司 Source code filling method and platform for overcoming first screen blank
CN112256363A (en) * 2020-09-21 2021-01-22 北京三快在线科技有限公司 Application page rendering method and device and electronic equipment
CN112379950A (en) * 2020-11-17 2021-02-19 北京金山云网络技术有限公司 Page calling method and device and server
CN112379950B (en) * 2020-11-17 2024-08-27 北京金山云网络技术有限公司 Page calling method, device and server
CN114518912A (en) * 2022-02-21 2022-05-20 度小满科技(北京)有限公司 Page loading method, device and equipment and readable storage medium
CN114518912B (en) * 2022-02-21 2023-04-25 度小满科技(北京)有限公司 Page loading method, device, equipment and readable storage medium

Similar Documents

Publication Publication Date Title
US11647096B2 (en) Method and apparatus for automatically optimizing the loading of images in a cloud-based proxy service
CN110020304A (en) A method and device for loading a page
CN108984714B (en) Page rendering method and device, electronic equipment and computer readable medium
KR101824222B1 (en) Fast rendering of websites containing dynamic content and stale content
CN109683998B (en) Internationalization realization method, device and system
US11017152B2 (en) Optimizing loading of web page based on aggregated user preferences for web page elements of web page
US8732571B2 (en) Methods and systems for generating and displaying a preview image of a content area
US8527862B2 (en) Methods for making ajax web applications bookmarkable and crawlable and devices thereof
US8935798B1 (en) Automatically enabling private browsing of a web page, and applications thereof
CN111143725A (en) Page generating method, device and electronic device
CN113626113B (en) Page rendering method and device
US8689099B1 (en) Cross-domain communication
US8516041B1 (en) Pre-fetching asynchronously requested content
CN110471656B (en) Method and device for adjusting component level
CN104462571A (en) Webpage loading method and device and browser client-side
CN111339461A (en) Page access method of application program and related product
CN113452733A (en) File downloading method and device
CN115495417A (en) Content loading method, device, equipment, medium and program product
CN110020320A (en) The method and apparatus for caching page pictures
CN106354792B (en) Webpage display method and device
CN112948728B (en) Method and device for browsing pictures
US10990750B2 (en) Dynamically bundling web page resources
CN113836458A (en) Page loading method, apparatus, device and computer storage medium
CN113760149B (en) Page split screen system, method and device
CN113760268A (en) Method and apparatus for generating pages

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