CN111695058A - Webpage loading method and device - Google Patents

Webpage loading method and device Download PDF

Info

Publication number
CN111695058A
CN111695058A CN201910189329.XA CN201910189329A CN111695058A CN 111695058 A CN111695058 A CN 111695058A CN 201910189329 A CN201910189329 A CN 201910189329A CN 111695058 A CN111695058 A CN 111695058A
Authority
CN
China
Prior art keywords
webpage
component
network state
web page
determining
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
CN201910189329.XA
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 CN201910189329.XA priority Critical patent/CN111695058A/en
Publication of CN111695058A publication Critical patent/CN111695058A/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/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 relates to a webpage loading method and a webpage loading device, which comprise the following steps: receiving a webpage loading request sent by terminal equipment; responding to the webpage loading request, and determining the network state of the terminal equipment; matching components corresponding to the web pages according to the network states; and after the webpage is constructed according to the components corresponding to the webpage, the webpage is sent to the terminal equipment. According to the webpage loading method and device provided by the embodiment of the invention, the webpage loading speed can be increased, and further the user experience can be improved.

Description

Webpage loading method and device
Technical Field
The invention relates to the technical field of computers, in particular to a webpage loading method and device.
Background
With the popularization of terminal devices and the rapid development of science and technology, people acquire various information by browsing webpages on the terminal devices.
However, the speed of web page loading is affected by the network. When the same terminal device accesses different networks (2G, 3G, 4G, WIFI, etc.) and accesses the same website, the web page loading speed is different, that is, the web page loading speed is normal under the condition of good network state, but the web page loading speed is slow under the condition of poor network state, which results in poor user experience.
Disclosure of Invention
In view of this, the present invention provides a method for loading a web page, which is applied to a server, and the method includes:
receiving a webpage loading request sent by terminal equipment;
responding to the webpage loading request, and determining the network state of the terminal equipment;
matching components corresponding to the web pages according to the network states;
and after the webpage is constructed according to the components corresponding to the webpage, the webpage is sent to the terminal equipment.
In a possible implementation manner, the determining the network status of the terminal device includes:
acquiring the initiation time and the receiving time of a webpage loading request;
determining time delay information of the webpage loading request according to the initiating time and the receiving time;
and determining the network state of the terminal equipment according to the time delay information of the webpage loading request.
In a possible implementation manner, the determining the network state of the terminal device according to the delay information of the web page loading request includes:
determining the position information of the terminal equipment;
determining at least one piece of reference time delay information according to the position information of the terminal equipment;
determining the network state of the terminal equipment according to the time delay information and the reference time delay information;
and the reference time delay information is the time delay information when the terminal equipment positioned at the position information sends a webpage loading request to the server under different network states.
In a possible implementation manner, the matching a component corresponding to a web page according to the network state includes:
when the network state is a first network state, matching a first component corresponding to a webpage according to the first network state; or,
when the network state is a second network state, matching a second component corresponding to the webpage according to the second network state;
wherein the network state characterized by the first network state is better than the network state characterized by the second network state;
the first component and the second component are the same functional component, and the bandwidth occupied by the first component is larger than the bandwidth occupied by the second component.
In a possible implementation manner, the web page loading request includes web page path information, and the matching of the components corresponding to the web page according to the network state includes:
determining a component library corresponding to the webpage according to the webpage path information;
searching a corresponding component list in the component library according to the network state;
determining the components recorded in the component list as components corresponding to the webpage;
the component library is used for storing a component list corresponding to the webpage in each network state.
In a possible implementation manner, the sending the web page to the terminal device after the web page is constructed according to the component corresponding to the web page includes:
acquiring a universal component corresponding to a webpage, wherein the universal component is the same component in components corresponding to the webpage in different network states;
constructing the webpage according to the universal component and the component corresponding to the webpage;
and sending the webpage to the terminal equipment.
According to an aspect of the present invention, there is provided a web page loading apparatus applied to a server, the apparatus including:
the receiving module is used for receiving a webpage loading request sent by the terminal equipment;
the determining module is used for responding to the webpage loading request and determining the network state of the terminal equipment;
the matching module is used for matching components corresponding to the webpage according to the network state;
and the sending module is used for sending the webpage to the terminal equipment after the webpage is constructed according to the components corresponding to the webpage.
In a possible implementation manner, the determining module is further configured to:
acquiring the initiation time and the receiving time of a webpage loading request;
determining time delay information of the webpage loading request according to the initiating time and the receiving time;
and determining the network state of the terminal equipment according to the time delay information of the webpage loading request.
In a possible implementation manner, the determining module is further configured to:
determining the position information of the terminal equipment;
determining at least one piece of reference time delay information according to the position information of the terminal equipment;
determining the network state of the terminal equipment according to the time delay information and the reference time delay information;
and the reference time delay information is the time delay information when the terminal equipment positioned at the position information sends a webpage loading request to the server under different network states.
In a possible implementation manner, the matching module is further configured to:
when the network state is a first network state, matching a first component corresponding to a webpage according to the first network state; or,
when the network state is a second network state, matching a second component corresponding to the webpage according to the second network state;
wherein the network state characterized by the first network state is better than the network state characterized by the second network state;
the first component and the second component are the same functional component, and the bandwidth occupied by the first component is larger than the bandwidth occupied by the second component.
In a possible implementation manner, the web page loading request includes web page path information, and the matching module is further configured to:
determining a component library corresponding to the webpage according to the webpage path information;
searching a corresponding component list in the component library according to the network state;
determining the components recorded in the component list as components corresponding to the webpage;
the component library is used for storing a component list corresponding to the webpage in each network state.
In a possible implementation manner, the sending module is further configured to:
acquiring a universal component corresponding to a webpage, wherein the universal component is the same component in components corresponding to the webpage in different network states;
constructing the webpage according to the universal component and the component corresponding to the webpage;
and sending the webpage to the terminal equipment.
According to another aspect of the present invention, there is provided a web page loading apparatus, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to perform the above method.
According to another aspect of the present invention, there is provided a non-transitory computer readable storage medium having computer program instructions stored thereon, wherein the computer program instructions, when executed by a processor, implement the above-described method.
In this way, the server can respond to the webpage loading request sent by the terminal device, match the components corresponding to the webpage according to the network state of the terminal device after determining the network state of the terminal device, construct the webpage according to the matched components, and send the webpage to the terminal device after constructing the webpage. Therefore, according to the webpage loading method and device disclosed by the embodiment of the invention, the server can dynamically match the components corresponding to the webpage according to the network state of the terminal equipment, so that the terminal equipment can quickly load the webpage under each network state, the webpage loading speed can be increased, and the user experience can be improved.
Other features and aspects of the present invention will become apparent from the following detailed description of exemplary embodiments, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate exemplary embodiments, features, and aspects of the invention and, together with the description, serve to explain the principles of the invention.
FIG. 1 illustrates a flow diagram of a method for loading a web page in accordance with an embodiment of the present invention;
FIG. 2 illustrates an exemplary component diagram according to the present invention;
FIG. 3 illustrates an exemplary component diagram according to the present invention;
FIG. 4 illustrates a flow diagram of a method for loading a web page in accordance with an embodiment of the present invention;
FIG. 5 illustrates a flow diagram of a method for loading a web page in accordance with an embodiment of the present invention;
FIG. 6 illustrates a flow diagram of a method for loading a web page in accordance with an embodiment of the present invention;
FIG. 7 illustrates a flow diagram of a method for loading a web page in accordance with an embodiment of the present invention;
FIG. 8 illustrates a schematic diagram of an exemplary web page interface in accordance with the present invention;
FIG. 9 illustrates a schematic diagram of an exemplary web page interface in accordance with the present invention;
fig. 10 is a block diagram illustrating a structure of a web page loading apparatus according to an embodiment of the present invention;
FIG. 11 is a block diagram illustrating an apparatus 1900 for web page loading according to an example embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
Example 1
Fig. 1 shows a flowchart of a web page loading method according to an embodiment of the present invention. The method may be applied to a server, and as shown in fig. 1, the method may include:
step 101, receiving a webpage loading request sent by a terminal device.
For example, the terminal device may send a web page loading request for a web page to the server in response to a loading operation (an operation for triggering the terminal device to load the web page) for the web page by the user.
And step 102, responding to the webpage loading request, and determining the network state of the terminal equipment.
The server can respond to the webpage loading request sent by the terminal equipment and determine the network state of the terminal equipment. For example, the network status of the terminal device may include: better, normal, worse; alternatively, the network status of the terminal device may include: normal and normal; still alternatively, the network status of the terminal device may include: excellent, good, medium and poor. The present invention is not limited to the division of the network state of the terminal device.
And 103, matching components corresponding to the webpage according to the network state.
Different components may be associated with the same web page for different network states. For example, the component corresponding to the web page in the poor network state occupies a smaller bandwidth (the component adopts a default style, or resources such as css, js, pictures, html and the like used by the component occupy a smaller bandwidth) than the component corresponding to the web page in the good network state. For example: for a webpage A, the webpage A comprises a form component for displaying various items of balance data and a button control for triggering terminal equipment to export the form component, wherein when the network state is good, the components corresponding to the webpage A are both modified (pattern modification is carried out by adopting resources such as css, js, pictures and the like) form components (the form components with colors, pictures and the like can better modify a page and better display content) and modified button controls; when the network state is poor, the components corresponding to the webpage A are unmodified simple form components and button controls (default component styles, and less bandwidth is occupied).
In a possible implementation manner, the matching of the components corresponding to the web pages according to the network state may include:
when the network state is a first network state, matching a first component corresponding to a webpage according to the first network state; or,
when the network state is a second network state, matching a second component corresponding to the webpage according to the second network state;
wherein the network state characterized by the first network state is better than the network state characterized by the second network state; the first component and the second component are the same functional component, and the bandwidth occupied by the first component is larger than the bandwidth occupied by the second component.
For example, the network state may include a first network state and a second network state. When the terminal device is in the first network state, the network state of the terminal device can be represented to be better, and when the terminal device is in the second network state, the network state of the terminal device can be represented to be poorer. If the server determines that the network state of the terminal device is the first network state, the component corresponding to the webpage can be determined as the first component; assuming that the server determines that the network state of the terminal device is a second network state, it may determine that the component corresponding to the web page is a second component, where the first component and the second component are the same functional component, but a bandwidth occupied by the first component may be greater than a bandwidth occupied by the second component.
FIG. 2 illustrates an exemplary component diagram according to the present invention; fig. 3 shows a schematic diagram of an exemplary assembly according to the present invention.
Illustratively, the first component and the second component are table components for displaying data, wherein the first component is a table component which beautifies the background color of a header by using a css style, distinguishes odd and even rows, and supports the sorting of columns by using icons and js scripts, and refer to fig. 2; the second component is a table component with only data but no additional modifications of cs, js, pictures, etc., see FIG. 3.
When the network state of the terminal device is the first network state, the server can determine that the component corresponding to the webpage is the first component, and the first component is a table component modified by resources such as css, js and pictures, so that the list content can be displayed better and the page can be beautified without affecting the webpage loading speed of the terminal device. When the network state of the terminal device is the second network state, the server can determine that the component corresponding to the webpage is the second component, and the second component does not have modified resources such as css, js and pictures, and only simply displays the content of the list, so that the occupied bandwidth resource is less, and the webpage loading speed of the terminal device can be improved.
And 104, after the webpage is constructed according to the components corresponding to the webpage, sending the webpage to the terminal equipment.
After determining the component corresponding to the webpage according to the network state of the terminal device, the server can construct the webpage according to the component corresponding to the webpage and can send the constructed webpage to the terminal device, so that the terminal device can load the webpage constructed by the server.
In this way, the server can respond to the webpage loading request sent by the terminal device, match the components corresponding to the webpage according to the network state of the terminal device after determining the network state of the terminal device, construct the webpage according to the matched components, and send the webpage to the terminal device after constructing the webpage. Therefore, according to the webpage loading method disclosed by the embodiment of the invention, the server can dynamically match the components corresponding to the webpage according to the network state of the terminal equipment, so that the terminal equipment can quickly load the webpage in each network state, the webpage loading speed can be increased, and the user experience can be further improved.
FIG. 4 is a flowchart illustrating a method for loading a web page according to an embodiment of the invention.
In a possible implementation manner, referring to fig. 4, the determining the network status of the terminal device may include:
step 1021, acquiring the initiation time and the receiving time of the webpage loading request.
And step 1022, determining the time delay information of the webpage loading request according to the initiating time and the receiving time.
For example, the server may determine a receiving time of receiving the web page loading request, obtain an initiating time of the web page loading request from the web page loading request, and determine that a time difference between the initiating time and the receiving time is a time delay of the web page loading request. For example: if the terminal device initiates a webpage loading request at 20 o 'clock and 30 min 00 s and the server receives the webpage loading request at 20 o' clock and 30 min 02 s, the server can determine that the time delay of the webpage loading request is 2 s.
And 1023, determining the network state of the terminal equipment according to the time delay information of the webpage loading request.
The server can determine the network state of the terminal device according to the time delay information. For example, the server may determine that the terminal device is in the first network state when the delay information is smaller than a delay threshold, or determine that the terminal device is in the second network state when the delay information is greater than the delay threshold, where the delay threshold may be a preset time value.
FIG. 5 is a flowchart illustrating a method for loading a web page according to an embodiment of the invention.
In a possible implementation manner, referring to fig. 5, the step 1022 of determining the network state of the terminal device according to the delay information of the web page loading request may include:
step 10221, determining the position information of the terminal equipment;
step 10222, determining at least one reference time delay information according to the position information of the terminal device;
step 10223, determining the network state of the terminal device according to the delay information and the reference delay information;
and the reference time delay information is the time delay information when the terminal equipment positioned at the position information sends a webpage loading request to the server under different network states.
For example, the server may determine the location information of the terminal device according to the header information of the web page loading request. For example: the location information of the terminal device may be determined from the IP information carried in the header information.
For example, the server may store the reference delay information in a delay information storage area, where the delay information storage area is used to store a mapping relationship between any one of the location information and at least one of the reference delay information. The reference delay information corresponding to the terminal device at any position may be determined according to the delays corresponding to the multiple historical web page loading requests sent by the terminal device at the position, for example: and determining the average value of the time delays corresponding to the multiple historical webpage loading requests as reference time delay information.
For example, an average value of time delays corresponding to a plurality of historical webpage loading requests sent by the terminal device located at the position a when the network state is good may be determined as reference time delay information corresponding to the position a. After determining that the position information of the terminal device is the position A, the server may match reference delay information corresponding to the position A in the delay information storage area, and further may determine the network state of the terminal device according to the web page loading request and the reference delay information.
For example: the server may determine that the terminal device is in the first network state when the delay information is smaller than the reference delay information, or determine that the terminal device is in the second network state when the delay information is larger than the reference delay information. Alternatively, the server may determine that the terminal device is in the first network state when the difference between the delay information and the reference delay information is smaller than a first difference threshold, or determine that the terminal device is in the second network state when the difference between the delay information and the reference delay information is greater than the first difference threshold and smaller than a second difference threshold, or determine that the terminal device is in the third network state when the delay information is greater than the second difference threshold. The network state represented by the first network state is superior to the network state represented by the second network state, and the network state represented by the second network state is superior to the network state represented by the third network state.
For another example, a delay range (a range formed by a minimum delay and a maximum delay) formed by delays corresponding to a plurality of historical web page loading requests sent by the terminal device at the location a in a good network state may be determined as first reference delay information, a delay range formed by delays corresponding to a plurality of historical web page loading requests sent by the terminal device at the location a in a poor network state may be determined as second reference delay information, and a corresponding relationship between the location a and the first reference delay information and the second reference delay information may be stored in the delay information storage area. After determining that the position information of the terminal device is the position a, the server may match first reference delay information and second reference delay information corresponding to the position a in the delay information storage area, and may determine that the network state of the terminal device is the first network state when the delay of the web page loading request is within a delay range corresponding to the first reference delay information, determine that the network state of the terminal device is the third network state when the delay of the web page loading request is within a delay range corresponding to the second reference delay information, and determine that the network state of the terminal device is the second network state when the delay corresponding to the web page loading request is within a range between the first reference delay information and the second reference delay information.
FIG. 6 is a flowchart illustrating a method for loading a web page according to an embodiment of the invention.
In a possible implementation manner, the web page loading request may include web page path information, and referring to fig. 6, the step 103 of matching a component corresponding to the web page according to the network state may include:
and step 1031, determining a component library corresponding to the webpage according to the webpage path information.
The web page path information may be information for identifying a web page to be loaded, for example: URL (Uniform resource Locator).
For example, the server may store, in the component storage area, a component library corresponding to each web page and a correspondence between web page path information corresponding to each web page and the corresponding component library. The component library may be configured to record a component list corresponding to the web page in each network state, where the component list may be configured to record at least one component included in the web page in the corresponding network state. For example: the component library 1 corresponding to the web page a may record a component list 1 corresponding to the web page a in the first network state and a component list 2 corresponding to the second network state, where the component list 1 includes components corresponding to the web page a in the first network state: component a1, component b1, and component c1, wherein component list 2 contains the corresponding components of web page a in the second network state: module a2, module b2, and module c 2; the component library 2 corresponding to the web page B may record a component list 3 corresponding to the web page B in the first network state and a component list 4 corresponding to the web page B in the second network state.
Step 1032, searching a corresponding component list in the component library according to the network state.
For example, the server may determine, according to the web page path information of the web page a, that the component library corresponding to the web page a is: the component library 1 can search a component list corresponding to the network state in the component library 1 according to the network state. For example: when the network state of the terminal device is the first network state, the server may determine that the component list corresponding to the web page a is the component list 1, and when the network state of the terminal device is the second network state, the server may determine that the component list corresponding to the web page a is the component list 2.
Step 1033, determining the components recorded in the component list as the components corresponding to the web page;
the component library is used for storing a component list corresponding to the webpage in each network state.
After determining the component list corresponding to the web page a, the server may determine that the components recorded in the component list are the components corresponding to the web page, and may further acquire the components recorded in the component list, so as to construct the web page according to the acquired components.
It should be noted that, in the foregoing embodiment of the present invention, the server determines the network state of the terminal device according to the web page loading request sent by the terminal device, and further matches the corresponding component according to the network state of the terminal device, which is only an example of the embodiment of the present invention, and actually, the embodiment of the present invention may also be implemented in the following manner:
the terminal device sends a first webpage loading request to the server, and the server may determine the network state of the terminal device in response to the first webpage loading request and send a webpage loading request response to the terminal device, where the webpage loading request response may include the network state of the terminal device. After receiving the response of the web page loading request, the terminal device may send a second web page loading request to the server according to the network state of the terminal device, where the web page loading request may include web page path information and the network state of the terminal device. The server can determine a component library corresponding to the webpage according to the webpage path information, and acquire a corresponding component list from the component library according to the network state of the terminal device. The server may construct a web page according to the components recorded in the component list, and send the constructed web page to the terminal device.
FIG. 7 is a flowchart illustrating a method for loading a web page according to an embodiment of the invention.
In a possible implementation manner, referring to fig. 7, the step 104 of sending the web page to the terminal device after constructing the web page according to the component corresponding to the web page may include:
step 1041, acquiring a general component corresponding to the web page, where the general component is the same component in components corresponding to the web page in different network states.
For example, the same component may exist in corresponding components of the web page in different network states, and the same component is a general component. For example: the corresponding components of the webpage A in the first network state comprise: component a1 and component b, the corresponding components in the second network state comprising: the component a2 and the component b, the component a1 may be a form component modified by resources such as css, js, pictures and the like, the component a2 is a simple form component without any modification, and the component b is an unmodified text box component, wherein the component b is a general component corresponding to the web page a.
For example, the server may store general components corresponding to each web page in the general component storage area, and may store a component library corresponding to the web page in the component storage area, where the component library may include a first component list corresponding to a first network state and a second component list corresponding to a second network state. For example: the server can obtain the corresponding general components from the general component storage area according to the webpage path information in the webpage loading request: and the component b acquires a component library corresponding to the web page from the component storage area according to the web page path information, matches a corresponding first component list (wherein the first component list records a component a1, and the second component list records a component a2) from the component library according to the first network state of the terminal device, and acquires a component a1 corresponding to the web page from the first component list.
And 1042, constructing the webpage according to the general components and the components corresponding to the webpage.
After the server acquires the corresponding components of the webpage according to the network state, the webpage can be constructed according to the general components and the components corresponding to the webpage. For example: the server acquires a component corresponding to the webpage: component a1, general component: component b, and thus the server, can build a web page from component a1 and component b.
And 1043, sending the webpage to the terminal device.
The server can send the constructed webpage to the terminal device, so that the terminal device can load the webpage.
Therefore, the general components in the components corresponding to the web pages in different network states do not need to be recorded repeatedly, the resource occupation can be reduced, and the resource utilization rate can be improved.
FIG. 8 illustrates a schematic diagram of an exemplary web page interface in accordance with the present invention; FIG. 9 illustrates a schematic diagram of an exemplary web page interface in accordance with the present invention.
In order to make the embodiment of the present invention better understood by those skilled in the art, the embodiment of the present invention is described below by way of an example, which is only an example of the present invention and is not to be construed as a limitation of the present invention.
For example, when the terminal device loads a web page, a web page loading request may be sent to the server, where the web page loading request includes the URL of the requested web page: URL1, and request initiation time. After receiving the web page loading request, the server may determine the location information of the terminal device according to the header information of the web page loading request: position a. The server acquires corresponding reference time delay information from a time delay storage area (refer to the following table 1) according to the position information of the terminal equipment: 3s in the sequence.
TABLE 1
Location information Reference delay information
Position A 3s
Position B 4s
Position C 2s
The server may obtain the component library corresponding to the web page from the component storage area (refer to table 2 below) according to the URL 1: the component library 1 includes a component list 1 corresponding to a good network status and a component list 2 corresponding to a bad network status in the component library 1. The component list 1 includes a component a1, a component b1, a component c1, and the component list 2 includes a component a2, a component b2, and a component c2, where the component a1, the component b1, and the component c1 are all components modified by resources such as css, js, and pictures, the component a2, the component b2, and the component c2 have no additional css style compared with the component a1, the component b1, and the component c1, default styles (such as fonts, background colors, hover animations, background pictures, and the like) are used more, menu items icon, logo, and the like are removed, shortcut functions such as header search, header sorting, and editing are removed for the js function code, html tags are reduced, page layouts, icon loading tags are reduced, pages are smaller, table presentation columns are reduced, data requests are smaller, page loading data is smaller, and pages are smaller, and therefore, bandwidth is occupied.
TABLE 2
URL information Component library
URL1 Component library 1
URL2 Component library 2
URL3 Component library 3
Assuming that the server determines that the delay information of the web page loading request is 2s according to the initiation time and the reception time of the web page loading request, because the delay information is less than the reference delay information, the server may determine that the terminal device is in a good network state, and further may determine that the component a1, the component b1, and the component c1 recorded in the component list 1 of the web page are components corresponding to the web page, construct the web page according to the component a1, the component b1, and the component c1, and send the constructed web page to the terminal device, so that the terminal device may load the web page, and the loaded web page may refer to fig. 8.
Assuming that the server can determine that the delay information of the web page loading request is 3.2s according to the initiation time and the reception time of the web page loading request, because the delay information is greater than the reference delay information, the server can determine that the terminal device is in a poor network state, and further, the server can determine that the component a2, the component b2 and the component c2 recorded in the component list 2 of the web page are corresponding to the web page, construct the web page according to the component a2, the component b2 and the component c2, and send the constructed web page to the terminal device, so that the terminal device can load the web page, and the loaded web page can refer to fig. 9.
Fig. 10 is a block diagram illustrating a structure of a web page loading apparatus according to an embodiment of the present invention. The apparatus may be applied to a server, and referring to fig. 10, the apparatus may include:
a receiving module 1001, configured to receive a web page loading request sent by a terminal device;
a determining module 1002, configured to determine a network status of the terminal device in response to the web page loading request;
a matching module 1003, configured to match a component corresponding to the web page according to the network status;
the sending module 1004 may be configured to send the webpage to the terminal device after the webpage is constructed according to the component corresponding to the webpage.
In this way, the server can respond to the webpage loading request sent by the terminal device, match the components corresponding to the webpage according to the network state of the terminal device after determining the network state of the terminal device, construct the webpage according to the matched components, and send the webpage to the terminal device after constructing the webpage. Therefore, according to the webpage loading device disclosed by the embodiment of the invention, the server can dynamically match the components corresponding to the webpage according to the network state of the terminal equipment, so that the terminal equipment can quickly load the webpage in each network state, the webpage loading speed can be increased, and the user experience can be improved.
In a possible implementation manner, the determining module may be further configured to:
acquiring the initiation time and the receiving time of a webpage loading request;
determining time delay information of the webpage loading request according to the initiating time and the receiving time;
and determining the network state of the terminal equipment according to the time delay information of the webpage loading request.
In a possible implementation manner, the determining module may be further configured to:
determining the position information of the terminal equipment;
determining at least one piece of reference time delay information according to the position information of the terminal equipment;
determining the network state of the terminal equipment according to the time delay information and the reference time delay information;
and the reference time delay information is the time delay information when the terminal equipment positioned at the position information sends a webpage loading request to the server under different network states.
In a possible implementation manner, the matching module may be further configured to:
when the network state is a first network state, matching a first component corresponding to a webpage according to the first network state; or,
when the network state is a second network state, matching a second component corresponding to the webpage according to the second network state;
wherein the network state characterized by the first network state is better than the network state characterized by the second network state;
the first component and the second component are the same functional component, and the bandwidth occupied by the first component is larger than the bandwidth occupied by the second component.
In a possible implementation manner, the web page loading request includes web page path information, and the matching module is further configured to:
determining a component library corresponding to the webpage according to the webpage path information;
searching a corresponding component list in the component library according to the network state;
determining the components recorded in the component list as components corresponding to the webpage;
the component library is used for storing a component list corresponding to the webpage in each network state.
In a possible implementation manner, the sending module may be further configured to:
acquiring a universal component corresponding to a webpage, wherein the universal component is the same component in components corresponding to the webpage in different network states;
constructing the webpage according to the universal component and the component corresponding to the webpage;
and sending the webpage to the terminal equipment.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described 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 flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, 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 specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
FIG. 11 is a block diagram illustrating an apparatus 1900 for web page loading according to an example embodiment. For example, the apparatus 1900 may be provided as a server. Referring to FIG. 11, the device 1900 includes a processing component 1922 further including one or more processors and memory resources, represented by memory 1932, for storing instructions, e.g., applications, executable by the processing component 1922. The application programs stored in memory 1932 may include one or more modules that each correspond to a set of instructions. Further, the processing component 1922 is configured to execute instructions to perform the above-described method.
The device 1900 may also include a power component 1926 configured to perform power management of the device 1900, a wired or wireless network interface 1950 configured to connect the device 1900 to a network, and an input/output (I/O) interface 1958. The device 1900 may operate based on an operating system stored in memory 1932, such as Windows Server, MacOS XTM, UnixTM, LinuxTM, FreeBSDTM, or the like.
In an exemplary embodiment, a non-transitory computer readable storage medium, such as the memory 1932, is also provided that includes computer program instructions executable by the processing component 1922 of the apparatus 1900 to perform the above-described methods.
The present invention may be a system, 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.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (14)

1. A webpage loading method is applied to a server, and the method comprises the following steps:
receiving a webpage loading request sent by terminal equipment;
responding to the webpage loading request, and determining the network state of the terminal equipment;
matching components corresponding to the web pages according to the network states;
and after the webpage is constructed according to the components corresponding to the webpage, the webpage is sent to the terminal equipment.
2. The method of claim 1, wherein the determining the network status of the terminal device comprises:
acquiring the initiation time and the receiving time of a webpage loading request;
determining time delay information of the webpage loading request according to the initiating time and the receiving time;
and determining the network state of the terminal equipment according to the time delay information of the webpage loading request.
3. The method according to claim 2, wherein the determining the network status of the terminal device according to the delay information of the web page loading request comprises:
determining the position information of the terminal equipment;
determining at least one piece of reference time delay information according to the position information of the terminal equipment;
determining the network state of the terminal equipment according to the time delay information and the reference time delay information;
and the reference time delay information is the time delay information when the terminal equipment positioned at the position information sends a webpage loading request to the server under different network states.
4. The method according to any one of claims 1 to 3, wherein the matching components corresponding to the web page according to the network state comprises:
when the network state is a first network state, matching a first component corresponding to a webpage according to the first network state; or,
when the network state is a second network state, matching a second component corresponding to the webpage according to the second network state;
wherein the network state characterized by the first network state is better than the network state characterized by the second network state;
the first component and the second component are the same functional component, and the bandwidth occupied by the first component is larger than the bandwidth occupied by the second component.
5. The method according to any one of claims 1 to 4, wherein the web page loading request includes web page path information, and the matching of the components corresponding to the web page according to the network status includes:
determining a component library corresponding to the webpage according to the webpage path information;
searching a corresponding component list in the component library according to the network state;
determining the components recorded in the component list as components corresponding to the webpage;
the component library is used for storing a component list corresponding to the webpage in each network state.
6. The method of claim 1, wherein the sending the web page to the terminal device after the web page is constructed according to the component corresponding to the web page comprises:
acquiring a universal component corresponding to a webpage, wherein the universal component is the same component in components corresponding to the webpage in different network states;
constructing the webpage according to the universal component and the component corresponding to the webpage;
and sending the webpage to the terminal equipment.
7. A web page loading apparatus, applied to a server, the apparatus comprising:
the receiving module is used for receiving a webpage loading request sent by the terminal equipment;
the determining module is used for responding to the webpage loading request and determining the network state of the terminal equipment;
the matching module is used for matching components corresponding to the webpage according to the network state;
and the sending module is used for sending the webpage to the terminal equipment after the webpage is constructed according to the components corresponding to the webpage.
8. The apparatus of claim 7, wherein the determining module is further configured to:
acquiring the initiation time and the receiving time of a webpage loading request;
determining time delay information of the webpage loading request according to the initiating time and the receiving time;
and determining the network state of the terminal equipment according to the time delay information of the webpage loading request.
9. The apparatus of claim 8, wherein the determining module is further configured to:
determining the position information of the terminal equipment;
determining at least one piece of reference time delay information according to the position information of the terminal equipment;
determining the network state of the terminal equipment according to the time delay information and the reference time delay information;
and the reference time delay information is the time delay information when the terminal equipment positioned at the position information sends a webpage loading request to the server under different network states.
10. The apparatus of any of claims 7 to 9, wherein the matching module is further configured to:
when the network state is a first network state, matching a first component corresponding to a webpage according to the first network state; or,
when the network state is a second network state, matching a second component corresponding to the webpage according to the second network state;
wherein the network state characterized by the first network state is better than the network state characterized by the second network state;
the first component and the second component are the same functional component, and the bandwidth occupied by the first component is larger than the bandwidth occupied by the second component.
11. The apparatus of any one of claims 7 to 10, wherein the web page loading request includes web page path information, and the matching module is further configured to:
determining a component library corresponding to the webpage according to the webpage path information;
searching a corresponding component list in the component library according to the network state;
determining the components recorded in the component list as components corresponding to the webpage;
the component library is used for storing a component list corresponding to the webpage in each network state.
12. The apparatus of claim 7, wherein the sending module is further configured to:
acquiring a universal component corresponding to a webpage, wherein the universal component is the same component in components corresponding to the webpage in different network states;
constructing the webpage according to the universal component and the component corresponding to the webpage;
and sending the webpage to the terminal equipment.
13. A web page loading apparatus, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to perform the method of any of claims 1 to 6.
14. A non-transitory computer readable storage medium having computer program instructions stored thereon, wherein the computer program instructions, when executed by a processor, implement the method of any of claims 1 to 6.
CN201910189329.XA 2019-03-13 2019-03-13 Webpage loading method and device Pending CN111695058A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910189329.XA CN111695058A (en) 2019-03-13 2019-03-13 Webpage loading method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910189329.XA CN111695058A (en) 2019-03-13 2019-03-13 Webpage loading method and device

Publications (1)

Publication Number Publication Date
CN111695058A true CN111695058A (en) 2020-09-22

Family

ID=72475164

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910189329.XA Pending CN111695058A (en) 2019-03-13 2019-03-13 Webpage loading method and device

Country Status (1)

Country Link
CN (1) CN111695058A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160259800A1 (en) * 2013-11-26 2016-09-08 Uc Mobile Co., Ltd. Webpage loading method, client and server
CN106874520A (en) * 2017-03-20 2017-06-20 北京猎豹移动科技有限公司 Webpage loading method, device and electronic equipment
CN106874434A (en) * 2017-01-24 2017-06-20 青岛海信电器股份有限公司 A kind of web data treatment, webpage loading method and relevant apparatus
CN108024136A (en) * 2017-12-14 2018-05-11 深圳Tcl新技术有限公司 Load method, smart television and the computer-readable recording medium of user interface

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160259800A1 (en) * 2013-11-26 2016-09-08 Uc Mobile Co., Ltd. Webpage loading method, client and server
CN106874434A (en) * 2017-01-24 2017-06-20 青岛海信电器股份有限公司 A kind of web data treatment, webpage loading method and relevant apparatus
CN106874520A (en) * 2017-03-20 2017-06-20 北京猎豹移动科技有限公司 Webpage loading method, device and electronic equipment
CN108024136A (en) * 2017-12-14 2018-05-11 深圳Tcl新技术有限公司 Load method, smart television and the computer-readable recording medium of user interface

Similar Documents

Publication Publication Date Title
US10880227B2 (en) Apparatus, hybrid apparatus, and method for network resource access
CN109446459B (en) Page switching method and device, electronic equipment and storage medium
JP2019520624A (en) Page component dynamic layout
CN107479868B (en) Interface loading method, device and equipment
CN105824830B (en) Method, client and equipment for displaying page
US11262883B2 (en) Associating browser with application
CN110968314B (en) Page generation method and device
CN112612982A (en) Webpage preloading method and device and computer equipment
CN113254136A (en) Information recommendation popup window display method, device, equipment and computer readable medium
CN110866208B (en) Page response type layout method, device and equipment
CN104899203B (en) Webpage generation method and device and terminal equipment
CN108664191B (en) System access method and device
CN110618811B (en) Information presentation method and device
CN110708270B (en) Abnormal link detection method and device
CN111783010A (en) Webpage blank page monitoring method, device, terminal and storage medium
CN108337294B (en) Application program downloading method and device
CN111078654A (en) Method and equipment for sharing information
CN111695058A (en) Webpage loading method and device
CN114461960B (en) Page generation method, page display method and page display device
US20150378688A1 (en) Developing rich internet application
CN115225950A (en) Video playing control method and device
CN112256991B (en) Method and equipment for native rendering of information flow fusing multiple link addresses
US10990750B2 (en) Dynamically bundling web page resources
CN111124399B (en) Processing method and device of popup assembly, storage medium and processor
CN112256992A (en) Native rendering method and device for information stream fusing multi-link addresses

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200922