CN107748689B - Webpage display method and device - Google Patents

Webpage display method and device Download PDF

Info

Publication number
CN107748689B
CN107748689B CN201710976978.5A CN201710976978A CN107748689B CN 107748689 B CN107748689 B CN 107748689B CN 201710976978 A CN201710976978 A CN 201710976978A CN 107748689 B CN107748689 B CN 107748689B
Authority
CN
China
Prior art keywords
resource
page
address
version
page static
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710976978.5A
Other languages
Chinese (zh)
Other versions
CN107748689A (en
Inventor
王甜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Advanced New Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Advanced New Technologies Co Ltd filed Critical Advanced New Technologies Co Ltd
Priority to CN201710976978.5A priority Critical patent/CN107748689B/en
Publication of CN107748689A publication Critical patent/CN107748689A/en
Application granted granted Critical
Publication of CN107748689B publication Critical patent/CN107748689B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The embodiment of the specification provides a webpage display method and a webpage display device, wherein the method comprises the following steps: when the page to be displayed is rendered, according to the second resource address, requesting the resource server to acquire the page static resource of the second version; when the resource server returns that the resource acquisition fails, acquiring a first resource address corresponding to the page static resource of a first version, wherein the first resource address is an address for determining to provide the page static resource; requesting a resource server to acquire the page static resource according to the first resource address; and receiving and loading the page static resource fed back by the resource server so as to render and display the page.

Description

Webpage display method and device
Technical Field
The present disclosure relates to the field of network technologies, and in particular, to a method and an apparatus for displaying a webpage.
Background
The mobile Web page is a Web page running in the mobile terminal APP. And at the mobile terminal, the mobile Web page can be loaded and displayed through WebView, and the WebView can be regarded as a browser for loading and displaying the webpage. The displayed mobile web page may include dynamically updated page data, and also include some static resources that do not change frequently, such as various js files, CSS files, pictures, and so on.
The static resource can play a role in setting page style and interaction characteristics in the mobile Web page, for example, a js file can enable a page to have some dynamic interaction attributes, and a user can click a button to trigger a corresponding page display operation, or enable a page element to have a certain color through a CSS file. Therefore, in the process of loading the mobile Web page, WebView needs to acquire, load and analyze static resources contained in the page, so that the page can be normally displayed, and the normal operation of a service function corresponding to the page is ensured.
Disclosure of Invention
In view of this, the present disclosure provides a method and an apparatus for displaying a webpage, so as to ensure that the function of the webpage is normal.
Specifically, one or more embodiments of the present disclosure are implemented by the following technical solutions:
in a second aspect, a method for displaying a webpage is provided, the method comprising:
when a page to be displayed is rendered, according to a second resource address, requesting a resource server to acquire a second version of page static resources contained in the page;
when the resource server returns that the resource acquisition fails, acquiring a first resource address corresponding to the page static resource of a first version, wherein the first resource address determines that the page static resource of the first version can be provided;
requesting the resource server to acquire the page static resource of the first version according to the first resource address;
and receiving and loading the first version of the page static resource fed back by the resource server so as to render and display the page.
In a first aspect, an apparatus for displaying a web page is provided, the apparatus comprising:
the resource request module is used for requesting the resource server to acquire the page static resource of the second version contained in the page according to the second resource address when the page to be displayed is rendered;
an address obtaining module, configured to obtain a first resource address corresponding to a first version of the page static resource when the resource server returns a resource obtaining failure, where the first resource address determines that the page static resource of the first version can be provided;
the re-request module is used for requesting the resource server to acquire the page static resource of the first version according to the first resource address;
and the resource receiving module is used for receiving and loading the page static resource of the first version fed back by the resource server so as to render and display the page.
In a second aspect, there is provided a web page presentation apparatus, the apparatus comprising a memory, a processor, and computer instructions stored on the memory and executable on the processor, the processor implementing the following steps when executing the instructions:
when a page to be displayed is rendered, according to a second resource address, requesting a resource server to acquire a second version of page static resources contained in the page;
when the resource server returns that the resource acquisition fails, acquiring a first resource address corresponding to the page static resource of a first version, wherein the first resource address determines that the page static resource of the first version can be provided;
requesting the resource server to acquire the page static resource of the first version according to the first resource address;
and receiving and loading the first version of the page static resource fed back by the resource server so as to render and display the page.
According to the webpage display method and device in one or more embodiments of the specification, when the server returns that the resource acquisition fails, the server is requested for another version of the resource through the first resource address, so that the static resource of the page can be acquired, and the service function of the page can be normally operated.
Drawings
In order to more clearly illustrate one or more embodiments or technical solutions in the prior art in the present specification, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in one or more embodiments of the present specification, and other drawings can be obtained by those skilled in the art without inventive exercise.
FIG. 1 is a diagram illustrating an update structure of a static resource of a page according to one or more embodiments of the present disclosure;
FIG. 2 is a flowchart of a method for displaying a web page according to one or more embodiments of the present disclosure;
FIG. 3 is a flow diagram of a normal invocation of a resource according to one or more embodiments of the present specification;
FIG. 4 is a flow diagram illustrating a resource invocation error according to one or more embodiments of the present disclosure;
FIG. 5 is a schematic structural diagram of a web page display apparatus according to one or more embodiments of the present disclosure;
fig. 6 is a schematic structural diagram of a web page display device according to one or more embodiments of the present disclosure.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in one or more embodiments of the present disclosure, the technical solutions in one or more embodiments of the present disclosure will be clearly and completely described below with reference to the drawings in one or more embodiments of the present disclosure, and it is obvious that the described embodiments are only a part of the embodiments, and not all embodiments. All other embodiments that can be derived by one of ordinary skill in the art from one or more embodiments of the disclosure without making any creative effort shall fall within the scope of protection of the disclosure.
Web pages are built in many APPs, for example, client APPs of many e-commerce platforms use the Web pages to display commodities. The Web page running in the APP can be called a mobile Web page, and the mobile Web page can be loaded and displayed through a WebView component of a mobile terminal. One type of resource that may be included in a mobile Web page is a page static resource, such as a CSS file for setting page styles, a js file for generating page interaction properties, and so on.
In a mobile Web page, the resource file of the static resource of the page may include a plurality of files, which may have different file names, for example, common. The number and the name of the resource files of the static resources included in the page can be determined according to actual business requirements, and the resource file of each page static resource can have a corresponding function in page display.
The resource file of the page static resource may also be updated, for example, sometimes the style and layout of the mobile Web page needs to be updated, or some fine adjustment is made to the interaction characteristic of the page, so that the resource file corresponding to the changed page characteristic needs to be modified at this time. For example, suppose a certain mobile Web page in a mobile terminal APP upgrades the style in the page, and correspondingly, the content in the CSS file used by the page is updated, and some codes of new styles are added.
Referring to fig. 1, fig. 1 illustrates an update structure of a static resource of a page. The resource file of the static resource may be stored in the static resource server 11. A mobile Web page 13 is loaded and displayed on the mobile terminal 12, and the resource file of one of the static resources that needs to be loaded is displayed on the mobile Web page 13 and is a.css, which is used for limiting the page style.
Assuming that the version of the mobile Web page where the current mobile Web page 13 is located is version 1.0, when the page of version 1.0 is loaded and displayed, the mobile terminal may call the resource file a.css stored in the resource address 1 of the static resource server 11, and the resource address 1 at this time may be https:// a.b.c.com/manager/1.0/a/a.css, where 1.0 in the resource address 1 is a version number.
It is further assumed that the page of the new style released by the mobile Web page corresponds to version 2.0, the page style of the page of version 2.0 is style-improved relative to version 1.0, and the file content in the corresponding a.css file is also modified, which may be a code added with some new styles. The a.cs file of version 2.0 may be stored in the resource address 2 of the static resource server 11, and the mobile terminal acquires the latest a.cs file according to the resource address 2 when calling the resource file. However, the a.css file of version 2.0 and the a.css file of version 1.0 are named the same. Resource address 2 may be https:// a.b.c.com/manager/2.0/a/a.css, where 2.0 in resource address 2 is the version number.
As can be seen from the above, the static resource in the mobile Web page may have a plurality of different resource addresses, which are listed as the resource address changes due to the file version change, but in actual implementation, the resource address may also be changed due to other situations. However, for the mobile terminal, under the above version management mechanism, although the resource address changes, the called resources are all different versions of the same resource file, for example, all are a.css, only the address of the file changes, and the file content of the file is updated, one is an a.css file of version 1.0, and one is an a.css file of version 2.0; in other examples, it may be that the resource address has changed but the contents of the resource file have not been updated.
In the process of loading and displaying a mobile Web page, sometimes a static resource server cannot normally provide a static resource requested to be called, so that the normal use of a service function is influenced. For example, if a mobile Web page calls the a.css of the resource address 2 in the loading process, however, for some unknown reasons, the static resource server cannot normally return to the a.css, so that the Web page cannot be normally displayed, and the service function of the page is also affected and cannot normally operate. Generally, when a static resource on a calling server cannot return normally, a user may see a page without a style and being inoperable on the page, and when a developer tool is used to check the resource status of the page, a prompt of 404 is seen, that is, 404 represents that the server cannot provide information normally when a client browses a web page or acquires a resource, or the server cannot respond and does not know the reason. Invoking 404 the page static resource may affect the normal use of the page function.
In order to solve the above problem 404 and ensure that the business function of the page normally operates, fig. 2 illustrates a method for displaying a web page, which may include:
in step 200, when the page to be displayed is rendered, according to the second resource address, a request is made to the resource server to obtain the second version of the page static resource included in the page.
For example, assume that a Web page is loaded in the current mobile terminal APP, and the Web page contains some static resource files for defining page styles and interactions. In this step, the static resource server may be requested to call to obtain the static resource of the page according to the resource address included in the page.
For example, taking a.css in fig. 1 as an example, assuming that the current Web page corresponds to a page of version 2.0, a.css is requested from the server according to resource address 2. The resource address 2 may be referred to as a second resource address, that is, an address corresponding to a static resource currently being requested, and the a.css of version 2.0 may be referred to as a second version of the page static resource.
In step 202, when the resource server returns that the resource acquisition fails, a first resource address corresponding to the first version of the page static resource is acquired, where the first resource address is an address that is determined to be capable of providing the first version of the page static resource.
For example, the static resource server returns 404 that the a.css of resource address 2 cannot be retrieved for some unknown reason. Then, in this step, a first resource address corresponding to the a.cs of the first version may be obtained, where the first resource address is a determined address capable of stably providing a page static resource a.cs, that is, the a.cs may be obtained by the first resource address, but the obtained a.cs may be another version. For example, the first resource address may be resource address 1 in fig. 1, or another resource address not shown in fig. 1. It should be noted that, the reference to "second" or "first" in this example is only for distinguishing different resource addresses or different versions of the static resource in the same page, and has no other limiting effect.
In step 204, a request is made to the resource server to obtain a first version of the page static resource according to the first resource address.
In this step, the mobile terminal may request the resource server to obtain the page static resource according to the first resource address. For example, when a.css cannot be obtained by resource address 1 in fig. 1, a.css may be obtained again according to resource address 1.
In step 206, the first version of the page static resource fed back by the resource server is received and loaded to render and display the page.
Since the first resource address is an address that is determined to be able to provide the static resource of the page, the mobile terminal may receive the static resource, such as the above a.css, returned by the static resource server at this time, and load and display the static resource, so as to normally display the Web page.
According to the webpage display method, when the server returns that the resource acquisition fails, the resource is requested to the server through the first resource address, so that the static resource of the page can be acquired, and the service function of the page can run normally. Although it is possible that the returned resource file is not the file to be obtained when the resource file is initially requested according to the first resource address, for example, the files of the two addresses have some differences in page style, the method of this example can maximally ensure the normal operation of the service function, and sometimes the normal operation of the page function is more important than the update of the page style.
The above-described procedure for preventing 404 the condition by the first resource address is described in detail as an example. The mobile Web page can be loaded and displayed through a WebView component, and the WebView can be regarded as a browser for loading and displaying a webpage. The WebView can comprise web page engines Webcore and WebViewClient, wherein the WebCore can be a module which is positioned at a bottom layer (C/C + + layer) and is responsible for analyzing a web page, the WebViewClient can be a module which is positioned at an upper layer (Java layer) and is responsible for executing some calling requests, and when the Webcore needs to call some resources in the process of analyzing the web page, the WebViewClient can be informed to acquire the resources. The interaction of WebCore, WebViewClient and static resource server can be described below to illustrate how to load and display a mobile Web page to overcome the service function failure caused by 404. The method includes a normal call flow when the resource is normally acquired and a protection flow when the resource is acquired at 404.
FIG. 3 illustrates an example normal call flow during normal resource acquisition, which may include:
in step 300, the WebCore notifies the WebViewClient of the request for static resources, carrying the resource identifier of the requested page static resources.
In this step, when the WebCore parses the Web page and needs to request to acquire the static resource in the page, the webview client may be notified to acquire the resource, and the resource address is notified to the webview client.
In one example, WebCore may add a resource identification, which may be referred to as a resource, of the static resource of the request to the resource address. For example, assuming the resource address is https:// a.b.c.com/manager/1.0/a/a.cs, after increasing resource, the address could be https:// a.b.c.com/manager/1.0/a/a.cs? resource-key-a. In this example, a in the file name a.css of the resource file may be used as the resource, because different resource files generally have different file names, and using the file name as the resource may implement differentiation of different files, and implement unique identification of each resource file requested. Of course, the resource identifier may be set in other manners.
In step 302, the WebViewClient requests the resource server to obtain the page static resource according to the resource address.
For example, WebViewClient can be based on the above-mentioned address https:// a.b.c.com/manager/1.0/a/a.css? And (b) requesting the resource file a.css of the static resource by the static resource server.
In step 304, the resource server returns the static resource to WebViewClient normally.
In this example, the resource server may successfully return the page static resource, and based on this, the WebViewClient may also determine that the resource address on which the resource is requested in step 302 is an address determined to be capable of stably providing the page static resource.
In step 306, WebViewClient returns static resources to Webcore.
Webcore may receive a resource file of static resources and load the file to display pages normally.
In step 308, WebViewClient obtains the resource identification of the static resource.
In step 304, the WebViewClient has determined that the resource address on which the resource is requested is the address that can stably provide the static resource of the page, and in this step, the WebViewClient can obtain the resource identifier of the static resource. For example, the resource identification may be obtained from the resource address https:// a.b.c.com/manager/1.0/a/a.css? resource identification resource can be obtained from resource a.
In step 310, WebViewClient stores the corresponding relationship between the resource identifier and the resource address to a local cache.
For example, the correspondence stored by WebViewClient may be:
a——https://a.b.c.com/manager/1.0/a/a.css?resourcekey=a
the above correspondence shows that, for a page static resource whose resource key is a, one of the resource addresses capable of stably providing the resource is https:// a.b.c.com/manager/1.0/a/a.css? resource-key-a.
In the process shown in fig. 3, when the server returns the resource normally, the corresponding relationship between the resource and the stable resource address thereof may be stored in the local cache for use in the subsequent process shown in fig. 4. When the mobile terminal parses the page for multiple times, for example, when the user opens the APP for multiple times, to show the page, the page static resource of the page may be requested for multiple times, but the local cache may store a corresponding relationship.
Fig. 4 illustrates an example protection flow when an error code occurs to request the static resource to return 404, and the flow of fig. 4 may use the correspondence stored in fig. 3, where, in the example shown in fig. 3, the resource address https:// a.b.c.com/manager/1.0/a/a.css? resource is called as a first resource address, and the normally returned resource can be called as a first version of page static resource. As shown in fig. 4, the method of the present example may include:
in step 400, the WebCore notifies the WebViewClient of the request for static resources, carrying the resource identifier of the requested page static resources.
In this step, when the WebCore parses the Web page and needs to request to acquire the static resource in the page, the webview client may be notified to acquire the resource, and the resource address is notified to the webview client. The resource address in this step may be referred to as a second resource address, which may be https:// a.b.c.com/manager/2.0/a/a.cs? resource key a, that is, the second resource address is the address corresponding to the Web page of version 2.0, and the previous first resource address is version 1.0.
In step 402, the WebViewClient requests the resource server to obtain the second version of the page static resource according to the second resource address.
For example, WebViewClient can be based on the above-mentioned address https:// a.b.c.com/manager/2.0/a/a.css? And (b) requesting the resource file a.css of the static resource by the static resource server. Except that this a.css is a second version of a.css, which may not be the same version as the a.css obtained in the example of fig. 3, e.g., some changes are made to the specific style.
In step 404, the resource server returns 404 to WebViewClient.
In this example, the resource server may not find the page static resource.
In step 406, WebViewClient obtains the resource identifier from the second resource address.
For example, can be represented by https:// a.b.c.com/manager/2.0/a/a.css? And acquiring a resource identifier, namely resource.
In step 408, the WebViewClient obtains the corresponding first resource address from the local cache according to the resource identifier.
In this step, since the page static resource of the second version and the page static resource of the first version correspond to the same resource identifier, for example, the resource is a, the WebViewClient may request the local cache to obtain the first resource address corresponding to the resource.
In step 410, WebViewClient receives the first resource address returned by the local cache.
For example, the first resource address may be a ground in the correspondence stored in the flow of FIG. 3, https:// a.b.c.com/manager/1.0/a/a.cs? resource-key-a. I.e. an address that may be version 1.0.
In step 412, the WebViewClient requests the resource server to obtain the page static resource according to the first resource address.
In step 414, WebViewClient receives the resource file returned by the server.
Since the first resource address is an address determined to be capable of stably providing the resource, the WebViewClient can acquire the resource file when requesting the resource according to the first resource address. For example, when the resource file is not obtained at resource address 2 (second resource address) in fig. 1, the resource file may be obtained at resource address 1 (first resource address) because the address is an address to which a resource has been normally returned before.
In step 416, WebViewClient returns the resource file to Webcore.
In the step, the WebViewClient returns the resource file to the Webcore, so that the Webcore can load static resources and the page function can normally run.
In addition, the WebViewclient can also call a log reporting interface to report alarm information so as to inform a developer of the problem that the second resource address cannot acquire the resource file.
According to the webpage display method, when the server returns that the resource acquisition fails, the resource is requested to the server through the first resource address, so that the static resource of the page can be acquired, and the service function of the page can run normally.
In order to implement the method, one or more embodiments of the present specification further provide a web page display apparatus, as shown in fig. 5, the apparatus may include: a resource request module 51, an address acquisition module 52, a re-request module 53 and a resource receiving module 54.
The resource request module 51 is configured to, when a page to be displayed is rendered, request a resource server to acquire a second version of a page static resource included in the page according to a second resource address;
an address obtaining module 52, configured to obtain a first resource address corresponding to the first version of the page static resource when the resource server returns that resource obtaining fails, where the first resource address determines that the page static resource of the first version can be provided;
a re-request module 53, configured to request the resource server to obtain the page static resource of the first version according to the first resource address;
and the resource receiving module 54 is configured to receive and load the first version of the page static resource fed back by the resource server, so as to render and display the page.
In one example, as shown in FIG. 6, the apparatus further includes an address storage module 55.
The resource request module 51 is further configured to, before requesting the resource server to acquire the page static resource of the second version according to the second resource address, request the resource server to acquire the page static resource of the first version according to the first resource address;
an address storage module 55, configured to determine that the first resource address is an address for determining to provide the first version of the page static resource when the resource server successfully returns the page static resource, and store a corresponding relationship between a resource identifier of the page static resource and the first resource address.
In an example, the resource requesting module 51 is further configured to allocate a corresponding resource identifier for the page static resource, and set the resource identifier in the first resource address;
the address storage module 55 is specifically configured to obtain the resource identifier from the first resource address, and store a corresponding relationship between the resource identifier and the first resource address.
In an example, the address storage module 55 is specifically configured to store, in a local cache, a corresponding relationship between a resource identifier of the page static resource and a first resource address.
In an example, the address obtaining module 52 is configured to obtain the resource identifier from the second resource address, where the second resource address carries the resource identifier of the page static resource; acquiring the first resource address corresponding to the resource identifier according to the resource identifier; and the page static resource of the second version and the page static resource of the first version correspond to the same resource identifier.
For convenience of description, the above devices are described as being divided into various modules by functions, and are described separately. Of course, the functionality of the modules may be implemented in the same one or more software and/or hardware implementations in implementing one or more embodiments of the present description.
The execution sequence of each step in the flow shown in the above method embodiment is not limited to the sequence in the flow chart. Furthermore, the description of each step may be implemented in software, hardware or a combination thereof, for example, a person skilled in the art may implement it in the form of software code, and may be a computer executable instruction capable of implementing the corresponding logical function of the step. When implemented in software, the executable instructions may be stored in a memory and executed by a processor in the device.
For example, corresponding to the above-mentioned web page display method, one or more embodiments of the present specification also provide a web page display apparatus, which may include a processor, a memory, and computer instructions stored in the memory and executable on the processor, where the processor is configured to execute the instructions to implement the following steps: when the page to be displayed is rendered, according to the second resource address, requesting the resource server to acquire the page static resource of the second version; when the resource server returns that the resource acquisition fails, acquiring a first resource address corresponding to the page static resource of a first version, wherein the first resource address is an address for determining to provide the page static resource of the first version; requesting a resource server to acquire the page static resource of the first version according to the first resource address; and receiving and loading the first version of the page static resource fed back by the resource server so as to render and display the page.
The apparatuses or modules illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
One skilled in the art will recognize that one or more embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, one or more embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, one or more embodiments of the present description 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.
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.
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.
One or more embodiments of the present description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. One or more embodiments of the specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. Especially, for the server device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for relevant points, refer to part of the description of the method embodiment.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The above description is only exemplary of the preferred embodiment of one or more embodiments of the present disclosure, and is not intended to limit the present disclosure, so that any modification, equivalent replacement, or improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (10)

1. A method of web page presentation, the method comprising:
when a page to be displayed is rendered, according to a second resource address, requesting a resource server to acquire a second version of page static resources contained in the page;
when the resource server returns that the resource acquisition fails, acquiring a first resource address corresponding to the page static resource of a first version, wherein the first resource address determines that the page static resource of the first version can be provided; the first version and the second version correspond to different versions of the same page static resource;
requesting the resource server to acquire the page static resource of the first version according to the first resource address;
receiving and loading the first version of the page static resource fed back by the resource server to render and display the page;
before requesting, from the resource server, to acquire the second version of the page static resource included in the page according to the second resource address, the method further includes:
requesting the resource server to acquire the page static resource of the first version according to the first resource address;
and if the resource server successfully returns the page static resource of the first version, determining that the first resource address is the address for providing the page static resource of the first version, and storing the corresponding relation between the resource identifier of the page static resource and the first resource address.
2. The method of claim 1, wherein the first and second light sources are selected from the group consisting of,
the requesting, according to the first resource address, a resource server to obtain the page static resource of the first version further includes: allocating corresponding resource identifiers for the page static resources, wherein the page static resources of the second version and the page static resources of the first version correspond to the same resource identifiers, and setting the resource identifiers in the first resource addresses;
the storing the corresponding relationship between the resource identifier of the page static resource and the first resource address includes: and acquiring the resource identifier from the first resource address, and storing the corresponding relation between the resource identifier and the first resource address.
3. The method of claim 1, wherein storing the correspondence between the resource identifier of the static resource of the page and the first resource address comprises: and storing the corresponding relation between the resource identifier of the page static resource and the first resource address in a local cache.
4. The method of claim 1, wherein the second resource address carries a resource identifier of the page static resource; the page static resource of the second version and the page static resource of the first version correspond to the same resource identifier;
the acquiring a first resource address corresponding to the page static resource includes:
acquiring the resource identifier from the second resource address;
and acquiring the first resource address corresponding to the resource identifier according to the resource identifier.
5. A method of web page presentation, the method comprising:
according to the first resource address, requesting a resource server to acquire a page static resource of a first version of a page to be displayed;
receiving the page static resource of the first version successfully returned by the resource server;
storing the corresponding relation between the resource identifier of the page static resource and the first resource address;
according to the second resource address, requesting the resource server to acquire the page static resource of the second version of the page to be displayed; the first version and the second version correspond to different versions of the same page static resource;
when the resource server returns that the resource acquisition fails, acquiring the first resource address corresponding to the resource identifier from the stored corresponding relation according to the resource identifier of the page static resource;
acquiring the page static resource of the first version according to the first resource address;
and receiving and loading the first version of the page static resource fed back by the resource server so as to render and display the page.
6. A web page presentation apparatus, the apparatus comprising:
the resource request module is used for requesting the resource server to acquire the page static resource of the second version contained in the page according to the second resource address when the page to be displayed is rendered;
an address obtaining module, configured to obtain a first resource address corresponding to a first version of the page static resource when the resource server returns a resource obtaining failure, where the first resource address determines that the page static resource of the first version can be provided; the first version and the second version correspond to different versions of the same page static resource;
the re-request module is used for requesting the resource server to acquire the page static resource of the first version according to the first resource address;
the resource receiving module is used for receiving and loading the page static resource of the first version fed back by the resource server so as to render and display the page;
the resource request module is further configured to request the resource server to acquire the page static resource of the first version according to the first resource address before requesting the resource server to acquire the page static resource of the second version according to the second resource address;
the device further comprises: and the address storage module is used for determining that the first resource address is the address for determining the page static resource providing the first version when the resource server successfully returns the page static resource, and storing the corresponding relation between the resource identifier of the page static resource and the first resource address.
7. The apparatus of claim 6, wherein the first and second electrodes are disposed on opposite sides of the substrate,
the resource request module is further configured to allocate a corresponding resource identifier for the page static resource, and set the resource identifier in the first resource address;
the address storage module is specifically configured to obtain the resource identifier from the first resource address, and store a corresponding relationship between the resource identifier and the first resource address.
8. The apparatus of claim 6, wherein the first and second electrodes are disposed on opposite sides of the substrate,
the address storage module is specifically configured to store the corresponding relationship between the resource identifier of the page static resource and the first resource address in a local cache.
9. The apparatus of claim 6, wherein the first and second electrodes are disposed on opposite sides of the substrate,
the address obtaining module is configured to obtain a resource identifier of the page static resource from the second resource address, where the second resource address carries the resource identifier of the page static resource; acquiring the first resource address corresponding to the resource identifier according to the resource identifier; and the page static resource of the second version and the page static resource of the first version correspond to the same resource identifier.
10. A web page presentation apparatus, the apparatus comprising a memory, a processor, and computer instructions stored on the memory and executable on the processor, the processor when executing the instructions performing the steps of:
when a page to be displayed is rendered, according to a second resource address, requesting a resource server to acquire a second version of page static resources contained in the page;
when the resource server returns that the resource acquisition fails, acquiring a first resource address corresponding to the page static resource of a first version, wherein the first resource address determines that the page static resource of the first version can be provided; the first version and the second version correspond to different versions of the same page static resource;
requesting the resource server to acquire the page static resource of the first version according to the first resource address;
receiving and loading the first version of the page static resource fed back by the resource server to render and display the page;
before requesting to obtain the page static resource of the second version contained in the page from the resource server according to the second resource address, the processor further implements the following steps when executing the instruction:
requesting the resource server to acquire the page static resource of the first version according to the first resource address;
and if the resource server successfully returns the page static resource of the first version, determining that the first resource address is the address for providing the page static resource of the first version, and storing the corresponding relation between the resource identifier of the page static resource and the first resource address.
CN201710976978.5A 2017-10-19 2017-10-19 Webpage display method and device Active CN107748689B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710976978.5A CN107748689B (en) 2017-10-19 2017-10-19 Webpage display method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710976978.5A CN107748689B (en) 2017-10-19 2017-10-19 Webpage display method and device

Publications (2)

Publication Number Publication Date
CN107748689A CN107748689A (en) 2018-03-02
CN107748689B true CN107748689B (en) 2020-11-10

Family

ID=61252988

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710976978.5A Active CN107748689B (en) 2017-10-19 2017-10-19 Webpage display method and device

Country Status (1)

Country Link
CN (1) CN107748689B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110244975A (en) * 2018-03-08 2019-09-17 北京京东尚科信息技术有限公司 A kind of generation method and device of static resource version number
CN111931111A (en) * 2020-08-14 2020-11-13 工银科技有限公司 Webpage development method, webpage display method, device and equipment
CN112016014B (en) * 2020-08-18 2023-12-26 北京达佳互联信息技术有限公司 Webpage display method, webpage resource generation device, electronic equipment and medium
CN113778707A (en) * 2021-08-24 2021-12-10 北京达佳互联信息技术有限公司 Front-end frame loading method and device, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105516261A (en) * 2015-11-26 2016-04-20 深圳市深信服电子科技有限公司 Web page loading control method and load balancer
CN106209925A (en) * 2015-04-29 2016-12-07 阿里巴巴集团控股有限公司 Page loading method, client and system

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103942225B (en) * 2013-01-23 2018-06-08 阿里巴巴集团控股有限公司 A kind of resource transfer method, client and the system of mixed type applications client
CN104965717A (en) * 2014-06-05 2015-10-07 腾讯科技(深圳)有限公司 Method and apparatus for loading page
CN105760405A (en) * 2014-12-19 2016-07-13 阿里巴巴集团控股有限公司 Methods and devices for obtaining network resource for loading web page and method and device for caching network resource
CN106293675B (en) * 2015-06-08 2020-12-25 腾讯科技(深圳)有限公司 System static resource loading method and device
CN105630981A (en) * 2015-12-25 2016-06-01 小米科技有限责任公司 Network resource loading and configuration method and device
CN106095999A (en) * 2016-06-22 2016-11-09 腾讯科技(深圳)有限公司 Obtain the method and device of content of pages

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106209925A (en) * 2015-04-29 2016-12-07 阿里巴巴集团控股有限公司 Page loading method, client and system
CN105516261A (en) * 2015-11-26 2016-04-20 深圳市深信服电子科技有限公司 Web page loading control method and load balancer

Also Published As

Publication number Publication date
CN107748689A (en) 2018-03-02

Similar Documents

Publication Publication Date Title
CN107748689B (en) Webpage display method and device
US11842222B2 (en) Using scripts to bootstrap applications with metadata from a template
US7266370B2 (en) System and method for developing and deploying device independent applications
US20160335079A1 (en) Zero down-time deployment of new application versions
JP7106001B2 (en) SUB-APPLICATION DEVELOPMENT METHOD, APPARATUS, COMPUTER DEVICE, AND COMPUTER PROGRAM
CN109408136A (en) Information processing method, device, storage medium and electronic equipment
US20120130702A1 (en) Verification of a computer program in respect to an unexpected response to an access request
CN111767090A (en) Method and device for starting small program, electronic equipment and storage medium
CN108776587B (en) Data acquisition method and device, computer equipment and storage medium
JP2021509498A (en) Computing device
CN110704031B (en) Software application project creating method and device and electronic equipment
CN107479868B (en) Interface loading method, device and equipment
CN109032693B (en) Method and device for loading display information, electronic equipment and readable storage medium
US8365194B2 (en) Creating and processing dynamic proxy actions for actions that are not yet registered with a client side broker
US10997269B1 (en) Using web application components with different web application frameworks in a web application
US20180067754A1 (en) Service-driven dynamic user interface technology
US10073689B2 (en) Managing application lifecycles within a federation of distributed software applications
US20200241846A1 (en) Namespace and Class Utilities for Managed Packages
CN114860203A (en) Project creation method, project creation device, server and storage medium
CN106775608B (en) Method and device for realizing independent system process
CN110599112A (en) Method and device for developing and maintaining network page
CN110502251B (en) Application installation method and device
CN111459933B (en) GDB data dynamic expansion method, device and storage medium
CN114185845A (en) File management method and device, computer equipment and storage medium
US10642629B2 (en) Web-application-launch application programming interfaces

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
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 1249236

Country of ref document: HK

TA01 Transfer of patent application right

Effective date of registration: 20200924

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20200924

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Applicant before: Alibaba Group Holding Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant