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

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

Info

Publication number
CN113836458A
CN113836458A CN202010582661.5A CN202010582661A CN113836458A CN 113836458 A CN113836458 A CN 113836458A CN 202010582661 A CN202010582661 A CN 202010582661A CN 113836458 A CN113836458 A CN 113836458A
Authority
CN
China
Prior art keywords
page
offline
data packet
resource file
static resource
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
CN202010582661.5A
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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN202010582661.5A priority Critical patent/CN113836458A/en
Publication of CN113836458A publication Critical patent/CN113836458A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/986Document structures and storage, e.g. HTML extensions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a page loading method, a page loading device, a server, electronic equipment and a computer storage medium. The method comprises the following steps: acquiring a main document and a corresponding static resource file for constructing an offline page; generating the off-line page according to the contents of the main document and the static resource file; and generating an offline data packet according to the offline page, and sending the offline data packet to the client. According to the embodiment of the invention, the network consumption generated by loading static resources in the process of rendering the page can be saved, and the page loading speed is increased.

Description

Page loading method, device and equipment and computer storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a page loading method, a page loading apparatus, a server, an electronic device, and a computer storage medium.
Background
As the number of users increases, the requirements of the service provider regarding the user experience also increase. The rendering time of the first screen of the page becomes an index for improving the user experience, the waiting time of the user is reduced, and the retention rate of the user is improved to a certain extent.
In the prior art, in order to increase the loading speed of the first screen of a page, when an offline data packet is constructed by a server, a main document of the page to be accelerated offline and corresponding static resources, such as Cascading Style Sets (CSS) resources and js (javascript) resources, are packaged together and sent to a local directory of an Application program (APP) corresponding to a client. When the client renders the page, the APP directly loads the main document of the offline data packet in the local directory so as to reduce network requests in the loading process, and therefore the loading speed is increased.
However, when the client loads the main document in the offline data packet, external links, such as the CSS resource and the JS resource, existing in the main document still send a request to the server to acquire content corresponding to the CSS resource and content corresponding to the JS resource when the client loads the CSS resource and the JS resource, so as to complete loading of the page, but this process may block a rendering flow of the page. Accordingly, the inventors have determined that there is a need for improvement in at least one of the problems of the prior art described above.
Disclosure of Invention
An object of the embodiments of the present invention is to provide a new technical solution for page loading.
According to a first aspect of the embodiments of the present invention, there is provided a page loading method applied to a server, the method including:
acquiring a main document and a corresponding static resource file for constructing an offline page;
generating the off-line page according to the contents of the main document and the static resource file;
and generating an offline data packet according to the offline page, and sending the offline data packet to the client.
Optionally, the constructing the offline page according to the content of the main document and the static resource file includes:
acquiring the content of the static resource file according to the link in the static resource file;
and embedding the content of the static resource file into the main document to generate the offline page.
Optionally, the static resource file at least comprises Cascading Style Sheet (CSS) resources and JS resources;
the main document is an off-line hypertext markup language HTML main document.
According to a second aspect of the embodiments of the present invention, there is also provided a page loading method applied to a client, where the method includes:
acquiring a page access request, wherein the page access request at least comprises a Uniform Resource Locator (URL) of a page to be accessed;
loading a corresponding offline data packet from a local storage directory according to the URL;
and rendering a page to be displayed according to a main document in the offline data packet, wherein the main document is embedded with the content of a static resource file.
Optionally, before the obtaining the page access request, the method further includes:
and receiving the offline data packet from the server and storing the offline data packet into the local storage directory.
According to a third aspect of the embodiments of the present invention, there is also provided a page loading apparatus, applied to a server, the apparatus including:
the acquisition module is used for acquiring a main document and a corresponding static resource file for constructing an offline page;
the generating module is used for generating the offline page according to the main document and the content of the static resource file;
and the sending module is used for generating an offline data packet according to the offline page and sending the offline data packet to the client.
According to a fourth aspect of the embodiments of the present invention, there is also provided a page loading apparatus, applied to a client, the apparatus including:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a page access request which at least comprises a Uniform Resource Locator (URL) of a page to be accessed;
the loading module is used for loading the corresponding offline data packet from the local storage directory according to the URL;
and the rendering module is used for rendering a page to be displayed according to a main document in the offline data packet, wherein the main document is embedded with the content of the static resource file.
According to a fifth aspect of the present invention, there is also provided a server comprising: a memory for storing instructions and a processor; the instructions are configured to control the processor to operate so as to perform the page loading method according to any one of the first aspect of the embodiments of the present invention.
According to a sixth aspect of the present invention, there is also provided an electronic apparatus comprising: a memory for storing instructions and a processor; the instructions are used for controlling the processor to operate so as to execute the page loading method according to any one of the second aspect of the embodiment of the invention.
According to a seventh aspect of the present invention, there is also provided a computer storage medium having stored thereon a computer program which, when executed by a processor, implements the page loading method according to any one of the first aspect of the embodiments of the present invention; alternatively, the computer program, when executed by a processor, implements the page loading method as described in any one of the second aspect of the embodiments of the present invention.
The page loading method provided by the embodiment of the invention comprises the steps of obtaining a main document for constructing an offline page and a corresponding static resource file; generating the off-line page according to the contents of the main document and the static resource file; and generating an offline data packet according to the offline page, and sending the offline data packet to the client. Because the content of the static resource file is embedded into the main document in advance, the client does not need to send an HTTP request to the server aiming at the static resource file when rendering the front screen page, so that the network consumption generated by loading the static resource in the process of rendering the page is saved, and the page loading speed is improved.
Other features of the present invention and advantages thereof will become apparent from the following detailed description of exemplary embodiments thereof, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description, serve to explain the principles of the invention.
Fig. 1 is a hardware configuration block diagram of a page loading system for implementing the present embodiment;
FIG. 2 is a schematic flow chart of a page loading method applied to a server provided by the invention;
FIG. 3 is a schematic block diagram of a page loading apparatus according to an embodiment of the server of the present invention;
FIG. 4 shows a schematic block diagram of a server according to an embodiment of the invention;
FIG. 5 shows a schematic flow chart diagram of a page loading method applied to a client according to an embodiment of the present invention;
FIG. 6 is a schematic block diagram of a page loading apparatus according to an embodiment of a client;
fig. 7 shows a schematic structural diagram of an electronic device provided by an embodiment of the present invention.
Detailed Description
Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless specifically stated otherwise.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
In all examples shown and discussed herein, any particular value should be construed as merely illustrative, and not limiting. Thus, other examples of the exemplary embodiments may have different values.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
Various embodiments and examples according to embodiments of the present invention are described below with reference to the accompanying drawings.
< hardware configuration >
Generally, when constructing an offline data packet, a server packages a main document of an offline acceleration page and corresponding static resources, such as CSS resources and JS resources, and sends the main document and the corresponding static resources to a local directory of an APP corresponding to a client. When the client side renders the page, the main document of the offline data packet in the local directory is directly loaded, so that network requests in the loading process are reduced, and the page loading speed can be increased.
However, external links, such as static resource files, often exist in the main document of the offline data package in the local directory of the APP, and when the client loads the main document of the offline data package in the local directory, a corresponding HTTP request is still generated to obtain content corresponding to the external links from the server, so as to complete loading of the page, which may cause a block in the rendering process.
Therefore, the embodiment of the present invention provides a new page loading method, where when an offline data packet is constructed, a server obtains content of a static resource file in advance according to a link in the static resource file, embeds the content of the static resource file into a main document, and constructs the main document and the content of a corresponding static resource file into an offline page to generate an offline data packet and send the offline data packet to a client. When the client side renders the page, the main document of the content embedded with the static resource file in the offline data packet in the local directory can be directly loaded, and the page loading is completed. Compared with the prior art, because the content of the static resource file is embedded into the main document in advance, the client does not need to send an HTTP request to the server aiming at the link in the main document when rendering the page, thereby saving the network consumption generated by loading the static resource in the process of rendering the page and improving the page loading speed.
Fig. 1 is a hardware configuration block diagram of a page loading system for implementing the present embodiment.
As shown in fig. 1, the page loading system includes: electronic device 1000, server 2000, and network 3000.
In this embodiment, the electronic device 1000 is an electronic device having a communication function and web browsing. The electronic device 1000 may be a mobile terminal such as a mobile phone, a laptop, a tablet, a palmtop, etc.
As shown in fig. 1, the electronic apparatus 1000 may include a processor 1100, a memory 1200, an interface device 1300, a communication device 1400, a display device 1500, an input device 1600, an output device 1700, a camera device 1800, and the like.
The processor 1100 may be a central processing unit CPU, a microprocessor MCU, or the like. The memory 1200 includes, for example, a ROM (read only memory), a RAM (random access memory), a nonvolatile memory such as a hard disk, and the like. The interface device 1300 includes, for example, a USB interface, a headphone interface, and the like. Communication device 1400 is capable of wired or wireless communication, for example. The display device 1500 is, for example, a liquid crystal display panel, a touch panel, or the like. The input device 1600 may include, for example, a touch screen, a keyboard, or a microphone, among others. The output device 1700 is used for outputting information and may be a speaker, for example. The image capturing apparatus 1800 is used for capturing acquisition information, and is, for example, a camera or the like.
Although a number of devices are shown in fig. 1 for electronic device 1000, the present invention may relate to only some of the devices, for example, electronic device 1000 may relate to only memory 1200 and processor 1100.
In this embodiment, the server 2000 may be, for example, a blade server or the like.
In one example, server 2000 may be a computer.
In another example, the server 2000 may be as shown in fig. 1, including a processor 2100, a memory 2200, an interface device 2300, a communication device 2400, a display device 2500, an input device 2600. Although the server may also include speakers, microphones, etc., these components are not relevant to the present invention and are omitted here.
The processor 2100 may be, for example, a central processing unit CPU, a microprocessor MCU, or the like. The memory 2200 includes, for example, a ROM (read only memory), a RAM (random access memory), a nonvolatile memory such as a hard disk, and the like. The interface device 2300 includes, for example, a USB interface, a serial interface, and the like. Communication device 2400 is capable of wired or wireless communication, for example. The display device 2500 is, for example, a liquid crystal display. The input device 2600 may include, for example, a touch screen, a keyboard, and the like.
The servers shown in fig. 1 are merely illustrative and are in no way meant to limit the invention, its application, or uses. In an embodiment of the present invention, the memory 2200 of the server 2000 is configured to store instructions for controlling the processor 2100 to operate to execute any one of the page loading methods provided by the embodiment of the present invention.
It will be appreciated by those skilled in the art that although a plurality of devices are shown for server 2000 in fig. 1, the present invention may relate to only some of the devices, for example, server 2000 relates to only processor 2100 and storage device 2200.
The network 3000 may be a wireless communication network or a wired communication network, and may be a local area network or a wide area network. In the system configuration shown in fig. 1, an electronic device 1000 and a server 2000 communicate with each other via a network 3000. Further, the networks 3000 on which these communications are based may be the same or different.
The page loading system shown in FIG. 1 is illustrative only and is not intended to limit the present disclosure, its application, or uses in any way.
In the above description, the skilled person can design the instructions according to the solutions provided in the present disclosure. How the instructions control the operation of the processor is well known in the art and will not be described in detail herein.
< Server embodiment >
< method >
As shown in fig. 2, the page loading method provided in the embodiment of the present invention uses the server 2000 as an execution main body, and includes the following steps 2100 to 2300:
in step 2100, a master document and corresponding static resource files for constructing an offline page are obtained.
Wherein the static resource file at least comprises a Cascading Style Sheet (CSS) resource and a JavaScript (JS) resource; the main document is an offline HyperText Markup Language (HTML) main document.
Specifically, before this step, the server 2000 may first construct an address of the service input page offline, and after constructing the service analysis page, obtain a main document and a corresponding static resource file for constructing the offline page, where the static resource file may be obtained by merging the CSS resource file and the JS resource file.
Step 2200, generating the offline page according to the content of the main document and the static resource file.
The main document may include a link, for example, a picture link, and the corresponding picture resource may be acquired according to the link. In order to avoid that the client requests the server for the content of the static resource file corresponding to the link in the main document when rendering the page. In this step, when the server 2000 generates an offline page, it will first obtain the content of the static resource file according to the link in the main document; and the content of the static resource file is embedded into the main document to generate the offline page.
Therefore, the content of the static resource file required to be used in the main document is directly embedded into the main document to generate the offline page, so that when the browser of the client renders the offline page, the phenomenon that a browser kernel blocks a rendering main flow due to the fact that the static resource file needs to be loaded, such as CSS resources and JS resources, can be avoided, meanwhile, network consumption caused by loading of the CSS resources and the JS resources in the rendering process can be saved, and therefore page loading speed is improved.
2300, generating an offline data packet according to the offline page, and sending the offline data packet to the client.
Specifically, the server 2000 may compress the offline page to generate the offline data packet, and issue the offline data packet to the client through the offline packet issuing system.
In the page loading method of the embodiment, a server acquires a main document and a corresponding static resource file for constructing an offline page; generating the off-line page according to the contents of the main document and the static resource file; and generating an offline data packet according to the offline page, and sending the offline data packet to the client. Because the content of the static resource file is embedded into the main document in advance, the client does not need to send an HTTP request to the server aiming at the static resource file when rendering the front screen page, so that the network consumption generated by loading the static resource in the process of rendering the page is saved, and the page loading speed is improved.
< apparatus >
As shown in fig. 3, the page loading apparatus 3000 according to an embodiment of the present invention may include an obtaining module 3100, a generating module 3200, and a sending module 3300.
The obtaining module 3100 is configured to obtain a master document and a corresponding static resource file for constructing an offline page.
The generating module 3200 is configured to generate the offline page according to the content of the main document and the static resource file.
The sending module 3300 is configured to generate an offline data packet according to the offline page, and send the offline data packet to the client.
In a possible implementation manner, the generating module 3200 may specifically be configured to obtain the content of the static resource file according to a link in the static resource file; and embedding the content of the static resource file into the main document to generate the offline page.
Optionally, the static resource file at least includes a CSS resource and a JS resource; the main document is an off-line HTML main document.
The page loading apparatus of this embodiment may be configured to execute the technical solutions of the foregoing method embodiments, and the implementation principles and technical effects thereof are similar, and are not described herein again.
< Server >
As shown in fig. 4, in the present embodiment, there is also provided a server 4000, where the server 4000 includes a memory 4100 and a processor 4200, and the memory 4100 is used for storing instructions; the instructions are used to control the processor 4200 to perform operations to execute the page loading method according to this embodiment.
< computer storage Medium >
In this embodiment, a computer storage medium is further provided, where the computer storage medium stores computer instructions, and when the computer instructions in the storage medium are executed by a processor, the page loading method provided by the embodiment shown in fig. … … is implemented.
< client embodiment >
< method >
In the page loading method provided in the embodiment of the present invention, the page loading method of the embodiment may be executed by a client, and the client may be disposed in the electronic device 1000 shown in fig. 1, for example.
As shown in fig. 5, the method of the present embodiment may include steps 5100 to 5300 of:
in step 5100, a page access request is obtained, where the page access request at least includes a Uniform Resource Locator (URL) of a page to be accessed.
Specifically, the page access request is initiated by a user, for example, the electronic device 1000 obtains the access request for the page by obtaining a click operation of the user for a certain page link in a currently displayed browser.
Step 5200, loading the corresponding offline data packet from the local storage directory according to the URL.
In practical applications, before the electronic device 1000 obtains the page access request, i.e. before the step 5100, the electronic device 1000 receives the offline data packet from the server and stores the offline data packet in the local storage directory.
The offline data packet may be, for example, an offline data packet for loading a certain page. The offline data package includes offline pages, which are generated from the content of the main document and the static resource file. The content of the static resource file is obtained in advance according to the static resource file in the main document when the server generates an offline page. The content of the static resource file may be, for example, content corresponding to a CSS resource and/or content corresponding to a JS resource.
After acquiring the page access request, the browser in the electronic device 1000 may load the offline data packet corresponding to the URL from the local storage directory. Specifically, the electronic device 1000 can create a webview control and instantiate the webview to load the URL of the page to be accessed. Because the local storage directory has the offline data packet, the offline module of the browser intercepts the page access request of the URL and loads the offline data packet corresponding to the URL from the local storage directory.
Step 5300, rendering a page to be displayed according to a main document in the offline data package, wherein the main document is embedded with contents of static resource files.
Because the content of the static resource file is embedded in the master document, the browser of the electronic device 1000 may directly render the page to be displayed without requesting and loading the content of the static resource file, such as the content corresponding to the CSS resource and the content corresponding to the JS resource, from the server. Therefore, the phenomenon that the browser kernel blocks a rendering main flow due to the fact that static resource files need to be loaded, such as CSS resources and JS resources, can be avoided, and meanwhile, network consumption caused by the fact that the static resource files are loaded in the rendering process, such as CSS resources and JS resources, can be saved.
According to the page loading method, the client receives the offline data packet from the server in advance and stores the offline data packet into the local storage directory, when a user initiates a page access request, the corresponding offline data packet is loaded from the local storage directory according to the URL, and the page to be displayed is rendered according to the main document in the offline data packet, so that when the browser of the client renders the offline page, the phenomenon that the browser kernel blocks a rendering main flow due to the fact that CSS resources and JS resources need to be loaded can be avoided, meanwhile, network consumption caused by the fact that CSS resources and JS resources are loaded in the rendering process can be saved, and therefore page loading speed is improved.
< apparatus >
As shown in fig. 6, the page loading apparatus 6000 according to the embodiment of the present invention may include an obtaining module 6100, a loading module 6200, and a rendering module 6300.
The obtaining module 6100 is configured to obtain a page access request, where the page access request at least includes a URL of a page to be accessed.
The loading module 6200 is configured to load the corresponding offline data packet from the local storage directory according to the URL.
The rendering module 6300 is configured to render a page to be displayed according to a main document in the offline data package, where the main document is embedded with contents of a static resource file.
Further, the page loading apparatus 6000 may further include a receiving module, configured to receive the offline data packet from the server and store the offline data packet in the local storage directory.
The page loading apparatus of this embodiment may be configured to execute the technical solutions of the foregoing method embodiments, and the implementation principles and technical effects thereof are similar, and are not described herein again.
< electronic apparatus >
As shown in fig. 7, in the present embodiment, there is also provided an electronic device 7000, which electronic device 7000 may comprise a memory 7100 and a processor 7200, said memory 7100 being for storing instructions; the instruction is used for controlling the processor 7200 to operate so as to execute the page loading method of the embodiment.
< computer storage Medium >
In this embodiment, a computer storage medium is further provided, where the computer storage medium stores computer instructions, and when the computer instructions in the storage medium are executed by a processor, the page loading method provided in the foregoing embodiment is implemented.
The present invention may be an apparatus, method and/or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied therewith for causing a processor to implement various aspects of the present invention.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: 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), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations of the present invention may be assembler instructions, Instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, aspects of the present invention are implemented by personalizing an electronic circuit, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA), with state information of computer-readable program instructions, which can execute the computer-readable program instructions.
Aspects of the present invention are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
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 instructions, which comprises one or more executable instructions for implementing the specified logical function(s). 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 and/or flowchart illustration, and combinations of blocks in the block diagrams and/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. It is well known to those skilled in the art that implementation by hardware, by software, and by a combination of software and hardware are equivalent.
Having described embodiments of the present invention, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen in order to best explain the principles of the embodiments, the practical application, or improvements made to the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the invention is defined by the appended claims.

Claims (10)

1. A page loading method is applied to a server, and the method comprises the following steps:
acquiring a main document and a corresponding static resource file for constructing an offline page;
generating the off-line page according to the contents of the main document and the static resource file;
and generating an offline data packet according to the offline page, and sending the offline data packet to the client.
2. The method of claim 1, wherein constructing the offline page from the content of the master document and the static resource file comprises:
acquiring the content of the static resource file according to the link in the static resource file;
and embedding the content of the static resource file into the main document to generate the offline page.
3. The method of claim 2, wherein the static resource file includes at least Cascading Style Sheet (CSS) resources and JS resources;
the main document is an off-line hypertext markup language HTML main document.
4. A page loading method is applied to a client side, and comprises the following steps:
acquiring a page access request, wherein the page access request at least comprises a Uniform Resource Locator (URL) of a page to be accessed;
loading a corresponding offline data packet from a local storage directory according to the URL;
and rendering a page to be displayed according to a main document in the offline data packet, wherein the main document is embedded with the content of a static resource file.
5. The method of claim 4, wherein prior to obtaining the page access request, the method further comprises:
and receiving the offline data packet from the server and storing the offline data packet into the local storage directory.
6. A page loading apparatus, applied to a server, the apparatus comprising:
the acquisition module is used for acquiring a main document and a corresponding static resource file for constructing an offline page;
the generating module is used for generating the offline page according to the main document and the content of the static resource file;
and the sending module is used for generating an offline data packet according to the offline page and sending the offline data packet to the client.
7. A page loading apparatus, applied to a client, the apparatus comprising:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a page access request which at least comprises a Uniform Resource Locator (URL) of a page to be accessed;
the loading module is used for loading the corresponding offline data packet from the local storage directory according to the URL;
and the rendering module is used for rendering a page to be displayed according to a main document in the offline data packet, wherein the main document is embedded with the content of the static resource file.
8. A server, comprising: a memory for storing instructions and a processor; the instructions are for controlling the processor to operate so as to carry out the page loading method of any one of claims 1 to 3.
9. An electronic device, comprising: a memory for storing instructions and a processor; the instructions are for controlling the processor to operate so as to carry out the page loading method of claim 4 or 5.
10. A computer storage medium, on which a computer program is stored, which, when executed by a processor, implements the page loading method of any one of claims 1-3; alternatively, the computer program realizes the page loading method of claim 4 or 5 when executed by a processor.
CN202010582661.5A 2020-06-23 2020-06-23 Page loading method, device and equipment and computer storage medium Pending CN113836458A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010582661.5A CN113836458A (en) 2020-06-23 2020-06-23 Page loading method, device and equipment and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010582661.5A CN113836458A (en) 2020-06-23 2020-06-23 Page loading method, device and equipment and computer storage medium

Publications (1)

Publication Number Publication Date
CN113836458A true CN113836458A (en) 2021-12-24

Family

ID=78964257

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010582661.5A Pending CN113836458A (en) 2020-06-23 2020-06-23 Page loading method, device and equipment and computer storage medium

Country Status (1)

Country Link
CN (1) CN113836458A (en)

Similar Documents

Publication Publication Date Title
US11144711B2 (en) Webpage rendering method, device, electronic apparatus and storage medium
US8527862B2 (en) Methods for making ajax web applications bookmarkable and crawlable and devices thereof
US10880227B2 (en) Apparatus, hybrid apparatus, and method for network resource access
CN106874519B (en) Page display method and device
CN111143725A (en) Page generation method and device and electronic equipment
US9563449B2 (en) Mobilizing a web application to take advantage of a native device capability
CN111338623B (en) Method, device, medium and electronic equipment for developing user interface
CN111459364B (en) Icon updating method and device and electronic equipment
CN107479868B (en) Interface loading method, device and equipment
CN110825990A (en) Page access method, client, server and system
CN109725970B (en) Method and device for displaying application client window and electronic equipment
US20140229533A1 (en) Client-side network page generation
CN113382083A (en) Webpage screenshot method and device
CN113157153A (en) Content sharing method and device, electronic equipment and computer readable storage medium
CN111581555A (en) Document loading method, device, equipment and storage medium
CN113505302A (en) Method, device and system for supporting dynamic acquisition of buried point data and electronic equipment
CN115470432A (en) Page rendering method and device, electronic equipment and computer readable medium
CN113076294A (en) Information sharing method and device
CN110647327B (en) Method and device for dynamic control of user interface based on card
CN112256370A (en) Information display method and device and electronic equipment
CN113452733A (en) File downloading method and device
CN111177634A (en) Multi-language supporting file content loading method, device, equipment and medium
CN107918552B (en) Light application calling method and device, client device and electronic equipment
CN113779122B (en) Method and device for exporting data
CN113836458A (en) Page loading method, device and equipment and computer storage medium

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