CN106886545B - Page display method, page resource caching method and device - Google Patents

Page display method, page resource caching method and device Download PDF

Info

Publication number
CN106886545B
CN106886545B CN201610405986.XA CN201610405986A CN106886545B CN 106886545 B CN106886545 B CN 106886545B CN 201610405986 A CN201610405986 A CN 201610405986A CN 106886545 B CN106886545 B CN 106886545B
Authority
CN
China
Prior art keywords
page
resource
resources
page resource
server
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
CN201610405986.XA
Other languages
Chinese (zh)
Other versions
CN106886545A (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
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 CN201610405986.XA priority Critical patent/CN106886545B/en
Publication of CN106886545A publication Critical patent/CN106886545A/en
Application granted granted Critical
Publication of CN106886545B publication Critical patent/CN106886545B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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 application discloses a page display method, a page resource caching method and a page resource caching device. The page display method comprises the following steps: receiving a page display instruction; screening out second page resources needing to be acquired from the server from the cached first page resources according to the page display instruction; acquiring the second page resource from the server according to the screened result; and displaying the page according to the acquired second page resource. The page resources used for displaying the page are divided into the plurality of first page resources and cached, and after the display instruction of the page resources is received, the second page resources which need to be acquired from the server side are screened out from the first page resources to display the page. Therefore, the problem that in the prior art, the response speed of page display is low due to the fact that the page resources are wholly obtained from the server side through the global object indication is solved.

Description

Page display method, page resource caching method and device
Technical Field
The present application relates to the field of computer web technologies, and in particular, to a method for displaying a web page, and a method and an apparatus for caching web page resources.
Background
With the continuous development of computer technology, a plurality of Web applications (Web APPs) are available, and people can complete various services through the Web applications. These web applications typically require that a page be presented to a user, and the user performs a corresponding service through the presented page.
In the prior art, when a page is displayed to a user, a page resource required for displaying the page is obtained from a cache, the page resource is usually a page resource cached by a global object established based on traditional JavaScript, and when the page resource needs to be updated, the global object indicates to re-obtain a new page resource from a server for page display.
However, in this way of displaying the page, when the global object indicates to acquire the page resource from the server, the page resource is generally acquired as a whole, so that the number of page resources acquired from the server is large, and the response speed of page displaying is slow.
Disclosure of Invention
The embodiment of the application provides a page display method, a page resource caching method and a page resource caching device, which are used for solving the problems in the prior art.
The embodiment of the application provides a page display method, which comprises the following steps:
receiving a page display instruction;
according to the page display instruction, screening out second page resources required to be acquired from a server from all cached first page resources, wherein the first page resources are determined by splitting page resources required by displaying the page;
acquiring the second page resource from the server according to the screened result;
and displaying the page according to the acquired second page resource.
Preferably, the page resource required by the page is displayed, and the first page resource is determined according to the following method;
and splitting the page resources required by displaying the page into a plurality of first page resources according to the data processing rule of the React frame.
Preferably, the first page resource corresponds to a first timestamp, and the first timestamp is the time when the first page resource is cached; then the process of the first step is carried out,
the step of screening out the second page resources required to be acquired from the server from the first page resources specifically includes:
determining the retention time corresponding to each first page resource through a second time stamp and the first time stamp corresponding to each first page resource;
and respectively judging whether the retention time corresponding to each first page resource is greater than a preset time threshold, and determining a second page resource according to the first page resource of which the retention time is greater than the preset time threshold.
Preferably, the first page resource corresponds to the calling times, and the calling times are the calling times of the cached first page resource; then the process of the first step is carried out,
the step of screening out the second page resources required to be acquired from the server from the first page resources specifically includes:
and respectively judging whether the calling times of the first page resources are greater than a preset calling time threshold value, and determining a second page resource according to the first page resources with the calling times greater than the preset calling time threshold value.
Preferably, after the second page resource is acquired from the server according to the screened result, the method further includes:
splitting the second page resource acquired from the server side into a plurality of second page sub-resources according to the data processing rule of the React frame;
and caching each second page sub-resource.
The embodiment of the present application further provides a page display method, including:
receiving a service request for acquiring second page resources, wherein the second page resources are page resources which are screened from various cached first page resources by a client and need to be acquired from a server, and the first page resources are determined by splitting the page resources needed for displaying the page;
and returning the second page resource to the client so that the client can display the page according to the second page resource.
Preferably, the returning the second page resource to the client specifically includes:
splitting the second page resource into a plurality of second page sub-resources according to the data processing rule of the React frame;
and returning each second page sub-resource to the client.
The embodiment of the present application further provides a page resource caching method, including:
receiving page resources for displaying a page;
splitting the page resource into a plurality of sub-page resources according to the data processing rule of the React frame;
and caching each sub-page resource.
An embodiment of the present application further provides a page display device, where the device includes: page show instruction receiving element, screening unit, acquisition unit and show unit, wherein:
the page display instruction receiving unit is used for receiving a page display instruction;
the screening unit is used for screening second page resources needing to be acquired from a server from all cached first page resources according to the page display instruction, and the first page resources are determined by splitting the page resources needed for displaying the pages according to data processing rules;
the obtaining unit is used for obtaining the second page resource from the server according to the screened result;
and the display unit is used for displaying the page according to the acquired second page resource.
Preferably, the device further includes a first caching unit connected to the obtaining unit, and configured to split the second page resource obtained from the server into a plurality of second page sub-resources according to a data processing rule of the read frame, and cache each of the second page sub-resources.
The embodiment of the present application further provides a device for caching page resources, where the device includes: page resource receiving unit, split unit and second buffer unit, wherein:
the page resource receiving unit is used for receiving page resources for displaying pages;
the splitting unit is used for splitting the page resource into a plurality of sub-page resources according to the data processing rule of the React frame;
the second cache unit is configured to cache each sub-page resource.
The embodiment of the application adopts at least one technical scheme which can achieve the following beneficial effects:
the page resources used for displaying the page are divided into the plurality of first page resources and cached, and after the display instruction of the page resources is received, the second page resources required to be obtained from the server side are screened out from the first page resources, and the page is displayed. Therefore, the problem that in the prior art, the page resources are wholly obtained from the server side through the global object indication, so that the page resources obtained from the server side are more, and the response speed of page display is slower is solved. In addition, the page resources used for displaying the page can be split into a plurality of first page resources according to the data processing rule of the React frame, and the first page resources can be managed and called more conveniently through the unidirectional data stream of the React frame.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a schematic flowchart of a page display method provided in embodiment 1 of the present application;
fig. 2 is an interaction diagram of a client and a server in a page display method provided in embodiment 1 of the present application;
fig. 3 is a schematic view illustrating cache control of a client in a page display method according to embodiment 1 of the present application;
fig. 4 is a schematic flowchart of a page display method provided in embodiment 2 of the present application;
fig. 5 is a schematic structural diagram of a page displaying apparatus provided in embodiment 3 of the present application;
fig. 6 is a schematic structural diagram of a page displaying apparatus provided in embodiment 4 of the present application;
fig. 7 is a schematic diagram of a page display system provided in embodiment 4 of the present application;
fig. 8 is a schematic structural diagram of a cache device of a page resource according to embodiment 5 of the present application.
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
The embodiment 1 of the application provides a page display method, which is used in a client and can solve the problems in the prior art. As shown in fig. 1, the method comprises the steps of:
step S11: the client receives a page display instruction.
A page referred to herein may be a page presented to a user in a Web application (Web APP). Generally speaking, the page may include a plurality of types, which are common to be a main page, a sub page that is displayed after triggering a corresponding link in a parent page, and the like. For example, a web application for online shopping, which typically provides a main page to a user, the user may also enter a corresponding sub-page (a "boy" sub-page, a "god" sub-page, etc.) by triggering a corresponding link (e.g., "boy coffee", "god model", etc.) in the main page (here, a parent page).
The page display instruction may be used to instruct the client to display a page, and the page display instruction is generally received by the client of the web application after a user performs some operation on the web application. On one hand, when the page is a home page of the web application, the user usually enters the home page by inputting the website of the web application, that is, the user inputs the website of the web application, so that the client receives a display instruction of the home page; on the other hand, when the page is a sub-page displayed after triggering the corresponding link in the parent-level page, the user enables the client to receive the display instruction of the sub-page by triggering the link in the parent-level page.
In practical application, when the page refers to a sub-page displayed after triggering a corresponding link in a parent page, the sub-page can be divided into a sub-page displayed by triggering a tail end hyperlink and a sub-page displayed by triggering a classification module according to different triggered links; the classification module reflects classification categories of the provided services or products of the webpage application, and the end hyperlink is used for directly correlating the products or services provided by the webpage application; for example, in a web application for online shopping, a link in the main page (here, the parent page) has a terminal hyperlink that directly associates with a certain product (e.g., a certain soymilk maker, etc.), and a classification module (e.g., "men's clothing," "women's clothing," etc.) that reflects the classification category of the product.
It should be noted that, a client of a web application generally needs to run in a browser, where the browser may be a browser of a mobile terminal, and may also be a browser of a Personal Computer (PC) end. In addition, there may be multiple ways in which a user triggers a link in a parent page. For example, the user may trigger the link in the parent page by moving (or clicking) the mouse, may trigger the link in the parent page by touching, may trigger the link in the parent page by voice or vibration, and may trigger the link in the parent page by other means.
Step S12: and the client screens out second page resources required to be acquired from the server from the cached first page resources according to the page display instruction, wherein the first page resources are determined by splitting the page resources required by displaying the page according to a data processing rule.
Cached here means that the first page resource has been cached in the client. In practical application, for web application, when a client displays a certain page, the client may cache page resources for displaying the page, which are acquired from the server, so that when the client displays the page again, the client can display the page according to the cached page resources. According to the method for acquiring the page resource from the cache to display the page, the speed of acquiring the page resource from the cache is higher than that of acquiring the page resource from the server, so that the response speed of page display can be improved.
The first page resource is determined by splitting the page resource required by displaying the page according to the data processing rule. Because different frames of the web application are operated, data processing rules defined by different frames are usually different, and therefore, the ways of splitting the page resources required for displaying the page are usually different.
For example, in practical applications, a client of a web application may generally adopt an act frame, and a data processing rule of the act frame adopts a mode of 'unidirectional data flow', which defines that web resources flow unidirectionally from a server to the client, so that splitting and calling of the web resources are more convenient to manage, the web resources required for displaying the web pages may be split into a plurality of first web resources according to the act frame, and each of the split first web resources may be generally cached at the client.
It should be noted that the fact frame is a front-end technology frame produced by Facebook, and the front-end development is normalized by adopting a data processing rule of 'unidirectional data stream'. The unidirectional data flow refers to that a page can acquire page resources from a server during presentation, and also can acquire page resources from a cache (the page resources are resources which are cached after being acquired from the server), but the page resources cannot flow between different pages (that is, one page cannot acquire page resources from another page during presentation). The page resources are called by the unidirectional data flow mode, so that the calling process of the page resources can be simplified, and the management of the page resources is facilitated. In addition, the fact that the React framework adopts the unidirectional data stream enables each sub-page resource obtained by splitting to be stable in application when the page resources are split.
For example, in practical application, a page to be displayed may be a sub-page displayed after triggering a classification module in a parent-level page, and since the parent-level page may generally include a plurality of classification modules, when triggering each classification module to display a corresponding sub-page, each sub-page is displayed with a corresponding first page resource. Table 1 shows classification modules in a parent page in actual application, sub pages displayed after triggering the classification modules, and first page resources corresponding to the sub pages when displaying.
Table 1: classification module, sub-page and first page resource in practical application
Classification module Sub-page First page resource
Classification Module 1 First of all A、B
Classification Module 2 Second step C、D
Classification Module 3 C3 A、C
In table 1, the sub-page displayed after the classification module 1 is triggered is the sub-page "a", and the first page resources corresponding to the sub-page "a" are a and B (analogy when the classification module 2 and the classification module 3 are triggered).
In table 1, when A, B, C, D are all the first page resources determined after splitting according to the data processing rule of the fact frame, in the process of displaying the subpages "a", "b", and "c", the display of each subpage has a corresponding data tree (a data structure) in the memory, and each data tree acquires the corresponding first page resource from the cache resource, but cannot acquire the first page resource from the data trees corresponding to other subpages. For example, during the display of the sub-page "a", the corresponding data tree obtains the first page resource A, B from the cache resource, but cannot obtain the first page resource a from the data tree corresponding to the sub-page "c". Therefore, the display of each page can only obtain the corresponding page resource from the cache resource (or the database), and the calling process of the resource is convenient to manage.
The first page resource refers to a cached page resource determined after the page resource required for displaying the page is split, for example, in table 1, when a sub-page "a" is displayed, page resources a and B are the first page resource. Because the page resource usually has the characteristics of timeliness (effective in a period of time) and the like, in practical application, whether the first page resource is invalid or not usually needs to be detected, and when the first page resource is detected to be invalid, a new page resource needs to be acquired again from the server to update the invalid first page resource, so that the page display is completed.
Particularly, the second page resources which need to be acquired from the server are screened from the first page resources, that is, the invalid first page resources are screened from the first page resources according to the screening rule, and then the corresponding new page resources are acquired from the server. For example, the first page resource includes page resource X, page resource Y and page resource Z, and when the page resource to be acquired from the server is selected as page resource X and page resource Y, that is, the page resource X and page resource Y are already invalid according to the selection rule, new page resource X 'and page resource Y' are required to be acquired from the server.
In practical application, after the page resources required for displaying the page are split into a plurality of first page resources, the first page resources are generally cached. When the first page resource is cached, the time when the first page resource is cached can be recorded, and the time can be called a first time stamp, and the first time stamp and the first page resource have a corresponding relationship; that is, a first time stamp corresponds to a first page resource, where the first time stamp is a time when the first page resource is cached; correspondingly, in step S12, the method for determining the second page resource that needs to be acquired from the server from the first page resources includes the following steps:
step S121: and determining the retention time corresponding to each first page resource through a second time stamp and the first time stamp corresponding to each first page resource.
The second timestamp may be a specified time (e.g., 9 am each day, or other time), or may be the current time.
The difference between the second timestamp and the first timestamp corresponding to the first page resource may generally be taken as the retention time of the first page resource. For example, when the second timestamp is the current time, the current time is 10: 51, if the first timestamp corresponding to the first page resource is 10:45, the retention time of the first page resource is 6 minutes.
Step S122: and respectively judging whether the retention time corresponding to each first page resource is greater than a preset time threshold value.
The preset time threshold is used for specifying the maximum value of the effective time of the first page resource. For example, if the preset time threshold is 8 minutes, it indicates that the first page resource is valid for 8 minutes.
Step S123: and determining a second page resource required to be acquired from the server according to the first page resource with the retention time larger than the preset time threshold.
And determining a second page resource according to the first page resource with the retention time larger than the preset time threshold, wherein in practical application, the first page resource with the retention time larger than the preset time threshold can be determined as the second page resource which needs to be acquired from the server.
Step S124: and determining the first page resource with the retention time less than or equal to a preset time threshold as the page resource which does not need to be acquired from the server.
After the retention time corresponding to each first page resource is determined, the failed page resources in the first page resources can be screened out through comparison between the retention time corresponding to each first page resource and the size of the preset time threshold, and then new page resources (second page resources) are obtained from the server to update the failed page resources.
In practical applications, on one hand, the same preset time threshold may be set for different first page resources as needed. For example, the preset time thresholds corresponding to the first page resource a and the first page resource B are both 5 minutes. The different first page resources are convenient for actual operation by uniformly setting the same preset time threshold.
On the other hand, different preset time thresholds can be set for different first page resources. For example, the preset time threshold set for the first page resource X is 10 minutes, while the preset time threshold set for the first page resource Y is 5 minutes.
The preset time threshold corresponding to the first page resource may be set according to the type of the first page resource. For example, for a first page resource of a photo class, a preset time threshold may be set to 5 minutes (or other time); for the first page resource of the text class, a preset time threshold may be set to 3 minutes (or other time). Of course, the preset time threshold may be set for different first page resources according to other manners.
Further, the new page resources obtained from the server are usually different from the first page resources that have failed. For example, the first page resource includes page resource 1, page resource 2, and page resource 3, when the page resource 2 is screened out to be invalid, the page resource acquired from the server is page resource 2 ', and the page resource 2 ' may be the same as or different from the page resource 2, and even the page resource acquired from the server may include a new page resource (e.g., page resource 4, etc.) in addition to page resource 2 '.
In addition, in practical applications, it is often the case that a certain page resource is called multiple times. For example, when a plurality of different pages are displayed, the same page resource needs to be called, or the same page resource needs to be called for a plurality of times. However, in some application scenarios, when a page resource is called for multiple times, the calling of the page resource is usually mistaken due to insufficient permissions and the like. For example, a video displayed in a page has only limited usage rights (meaning that the number of times the video is viewed is limited) for the non-member user A. At this time, when the page resource is called from the cache, it is usually necessary to record the number of times the page resource is called. That is, the first page resource corresponds to the calling times, wherein the calling times are the calling times of the cached first page resource; correspondingly, in step S12, the method for determining the page resource required to be acquired from the server from the first page resources includes the following steps:
respectively judging whether the calling times of the first page resources are greater than a preset calling time threshold value;
determining the first page resource with the calling frequency larger than a preset calling frequency threshold value as a second page resource needing to be acquired from a server;
and determining the first page resource with the calling frequency less than or equal to a preset calling frequency threshold as the page resource which does not need to be acquired from the server.
The threshold of the number of calls is a maximum value of the number of times that the first page resource can be called, and different first page resources may generally set the same threshold of the number of times of calls or different thresholds of the number of times of calls.
Step S13: and the client acquires the second page resource from the server according to the screened result.
And after the second page resource needing to be acquired from the server is screened out, acquiring the second page resource from the server. For example, the first page resource includes a page resource M and a page resource N, and when it is determined according to step S12 that the page resource N is a page resource that needs to be acquired from the server, indicating that the page resource N has failed, a new page resource N' is acquired from the server. In practical application, when the server does not update the page resource N, the page resource N' acquired by the client is the same as the page resource N; when the server updates the page resource N, the page resource N' acquired by the client is different from the page resource N.
In practical application, when the client acquires the second page resource from the server according to the screened result, a service request for acquiring the second page resource needs to be sent to the server, so that the server returns the second page resource to the client after receiving the service request.
It should be noted that, after the second page resource is obtained from the server, the second page resource obtained from the server may also be cached, so that the second page resource can be directly called from the cached resource when the second page resource needs to be used next time. When the front-end technology framework of the web application adopts the read framework, caching the second page resource may be performed by splitting the second page resource into a plurality of second page sub-resources according to the data processing rule of the read framework, and caching each second page sub-resource.
Step S14: and displaying the page according to the acquired second page resource.
After the second page resource is obtained from the server, the page can be displayed according to the second page resource obtained from the server.
In practical application, when the page display is performed according to the second page resource acquired from the server, the page display can be performed by combining the second page resource with the page resources other than the page resource required to be acquired from the server in the first page resource. Namely, the page is displayed according to the acquired second page resource and the page resource which is not required to be acquired from the server side in each first page resource.
For example, the first page resource includes page resource a and page resource b, the page resource a does not need to be obtained from the server when the page is displayed, the page resource b needs to be obtained from the server due to failure, and after the second page resource (page resource b ') is obtained from the server, the page is displayed according to the page resource a and the page resource b'; it should be noted that in practical applications, a new page resource c may appear at the server, when the client requests the server to obtain the page resource b ', the server returns the page resource b ' and the page resource c to the client at the same time, and the client may perform page display by combining the page resource a, the page resource b ' and the page resource c.
In addition, when the web application adopts the reach frame, because the reach frame adopts a virtual document Object model DOM (document Object model) mode for displaying, after the second page resource is obtained, when the second page resource and the page resource (referred to as a third page resource herein) which does not need to be updated in the first page resource are displayed, the second page resource and the third page resource are read into the memory as an integral data tree by the display mode of the virtual document Object model DOM, and are compared with the data tree of the first page resource in the memory, and different parts (namely, corresponding parts of the second page resource) in the data tree are displayed. In the mode, the corresponding processing of displaying the third page resource is not required to be repeated, so that the updating of the page resource and the displaying of the virtual Document Object Model (DOM) are synchronous, and the consistency of the page resource and the displaying is ensured. The document object model DOM is a standard programming interface for the W3C organization to process the xml.
By adopting the method provided by embodiment 1, after receiving a page display instruction, a second page resource required to be acquired from a server is determined from each cached first page resource, and the first page resource is determined by splitting the page resource required to display the page, so that the amount of the second page resource required to be acquired from the server is less than or equal to the amount of the first page resource. The prior art and the present application will be compared by way of example.
For example, in the process of displaying a page P in the prior art, when a resource needs to be updated, a page resource required for displaying the page P is acquired from a server as a whole through a global object indication.
In the scheme, the first page resources are page resources cached after the page resources required for displaying the page are split, and the second page resources required to be acquired from the server are screened out from the first page resources, so that the page is displayed. Therefore, the page resources acquired from the server are reduced, the response speed of page display is accelerated, the calculation pressure of the server can be reduced due to the reduction of the page resources acquired from the server, and in addition, the cached page resources are more fully utilized. When the page resources required by the page are displayed and are split into a plurality of first page resources according to the data processing rule of the React frame, the number of the page resources acquired from the server side can be further reduced due to the characteristic of the single-line data stream of the React frame.
The above is a specific description of the page display method provided in the embodiment of the present application, and for convenience of understanding, the following will further describe from the interaction between the client and the server of the web application. The client of the web application is constructed by adopting a fact frame, as shown in fig. 2, the client 21 of the web application performs data interaction with the server 22. The client 21 is configured to be a virtual DOM211, a service module layer 212, a cache control module 213, and a data exchange processing layer 214, where the virtual DOM211 is configured to display a page to a user, data for displaying the page is provided by each service module (including a service module 1, a service module 2, a service module n, and the like) of the service module layer 212, the cache control module 213 can be configured to determine whether the cache data is valid, that is, whether new data needs to be acquired from a server, and the data exchange processing layer 214 is configured to perform data interaction with the server. In practical applications, the data exchange processing layer 214 may generally adopt Ajax technology to perform data interaction with the server, where Ajax (Asynchronous Javascript And XML) refers to a web page development technology for creating interactive web page applications.
When a certain page in the web application is displayed, the cache control module 213 determines invalid data (data with retention time greater than a preset time threshold, etc.) in each data of the page, sends a data exchange request to the server through the data exchange processing layer 214 according to the determined invalid data, after obtaining updated data, the data exchange processing layer 214 returns the updated data to the cache control module 213, the cache control module 213 caches the updated data, and each service module of the service module layer 212 obtains corresponding data from the cached data, and displays the web through the virtual DOM 211.
In addition, as shown in fig. 3, in practical applications, the buffer control module 213 may be further subdivided into a failure control unit 2131, a data buffer unit 2132, a data structure layer 2133, and a data stream splitting unit 2134. The failure control unit 2131 is configured to determine whether the number of data needed by the display page is failed, the data caching unit 2132 is configured to store cached data, the data structure layer 2133 is configured to configure data into a corresponding data structure as needed, and the data stream splitting unit 2134 is configured to split a data stream acquired from the data exchange processing layer 214.
It should be noted that, in practical application, when the client is constructed by using the fact framework, splitting and caching the page resources for displaying the page may be performed as follows:
step S31: the client receives page resources for displaying the page.
The page resource may generally be a page resource obtained from a server.
Step S32: and the client splits the page resource into a plurality of sub-page resources according to the data processing rule of the React frame.
Step S33: and caching each sub-page resource by the client.
The page resources used for displaying the page are divided into a plurality of sub-page resources according to the data processing rule of the React frame, and then the sub-page resources are cached, so that a foundation is laid for solving the problems in the prior art.
Example 2
The embodiment 2 of the application provides a page display method, which is used in a server and can solve the problems in the prior art. As shown in fig. 4, the method includes the steps of:
step S41: receiving a service request for acquiring a second page resource, wherein the second page resource is a page resource which is screened by a client from various cached first page resources and needs to be acquired from a server, and the first page resource is determined by splitting the page resource which is needed for displaying the page.
The first page resource and the second page resource are the same as those in embodiment 1, and are not described herein again.
Step S42: and returning the second page resource to the client so that the client can display the page according to the second page resource and page resources except the second page resource which needs to be acquired from the server in each first page resource.
The server may return the second page resource to the client in multiple ways, for example, the second page resource may be returned to the client as a whole, or the second page resource may be split into multiple second page sub-resources according to a splitting rule agreed with the client, and each second page sub-resource is returned to the client. In practical application, when the client is constructed by adopting the fact frame, the server can split the second page resource into a plurality of second page sub-resources according to the data processing rule of the fact frame, and return the second page sub-resources to the client.
It should be noted that when the client sends a service request to the server, the service request is usually converted into corresponding technical parameters according to a conversion rule, then data is requested from the server through the technical parameters, and after receiving the technical parameters, the server processes the technical parameters and determines the data requested by the user. The process of processing technical parameters and determining data requested by a user may generally include: formatting, storing, reading and modifying the database, and the like.
By adopting the method provided by the embodiment 2, the service request for acquiring the second page resource sent by the client to the server does not include the service request for acquiring the page resource which is cached in the client and does not need to be acquired from the server, so that the page resources acquired from the server are reduced, and the problem in the prior art is solved.
Example 3
Based on the same inventive concept as that in embodiment 1 of the present application, embodiment 3 of the present application provides a page display apparatus, where the apparatus is located at a client. As shown in fig. 5, the apparatus 50 includes: a page display instruction receiving unit 501, a screening unit 502, an obtaining unit 503, and a display unit 504, wherein:
the page display instruction receiving unit 501 is configured to receive a page display instruction;
the screening unit 502 is configured to screen, according to the page display instruction, a second page resource that needs to be acquired from a server from each cached first page resource, where the first page resource is determined by splitting, according to a data processing rule, a page resource that is needed for displaying the page;
the obtaining unit 503 is configured to obtain the second page resource from the server according to the screened result;
the displaying unit 504 is configured to display the page according to the obtained second page resource.
With the apparatus 50 provided in embodiment 3 of the present application, since the apparatus 50 is based on the same inventive concept as embodiment 1, the inventive effect of embodiment 1 can be obtained. In addition, in practical applications, by combining with specific hardware devices, the apparatus 50 can also obtain other effects, for example, because the apparatus 50 in the hardware device can improve the response speed of the page display of the web application, the use experience of the user on the hardware device can be improved, thereby improving the commercial value of the hardware device.
In practical applications, the apparatus 50 may further include a first caching unit 505 connected to the obtaining unit, and configured to split the second page resource obtained from the server into a plurality of second page sub-resources according to the data processing rule of the fact frame, and cache each of the second page sub-resources.
Through the first cache unit 505, the second page resources are split and cached according to the data processing rule of the read frame, and due to the characteristic of unidirectional data flow, each second page sub-resource can be more conveniently managed and called.
In addition, the first page resource corresponds to a first timestamp, and the first timestamp is the time when the first page resource is cached; when the first page resource corresponds to the first timestamp,
the screening unit 502 includes a first screening subunit 5021 and a second screening subunit 5022, wherein:
the first screening subunit 5021 determines the retention time corresponding to each first page resource through a second timestamp and the first timestamps corresponding to each first page resource;
the second screening subunit 5022 respectively determines whether the retention time corresponding to each first page resource is greater than a preset time threshold, and determines a second page resource according to the first page resource whose retention time is greater than the preset time threshold.
In this way, page resources which are invalid due to too long retention time after caching can be screened out. In addition, different preset time thresholds can be set for each different first page resource according to needs, and the validity of the corresponding first page resource is judged through comparison between the preset time thresholds and the retention time.
Example 4
Based on the same inventive concept as embodiment 2, embodiment 4 of the present application provides a page display apparatus, which is located at a server. As shown in fig. 6, the apparatus 60 includes: a service request receiving unit 601 and a returning unit 602, wherein:
the service request receiving unit 601 is configured to receive a service request for acquiring a second page resource, where the second page resource is a page resource that is screened by a client from cached first page resources and needs to be acquired from a server, and the first page resource is determined by splitting a page resource that is needed for displaying the page;
the returning unit 602 is configured to return the second page resource to the client, so that the client displays the page according to the second page resource.
With the apparatus 60 provided in embodiment 4, the technical effect of embodiment 2 can be obtained by adopting the same inventive concept as embodiment 2. In addition, it should be noted that the effect obtained by the apparatus 60 by combining hardware devices is also within the protection scope of the present application.
In addition, the returning unit 602 may include a returning sub-unit 6021 configured to split the second page resource into a plurality of second page sub-resources according to the data processing rule of the fact frame, and return each of the second page sub-resources to the client. And the server divides the second page resources into a plurality of second page sub-resources, and the operation speed of the server is higher than that of the client, so that the division and the return can be carried out more quickly.
It should be particularly noted that, in the present embodiment, a page displaying system may also be provided, as shown in fig. 7, the system 70 is composed of the page displaying apparatus 50 at the client side provided in embodiment 3 and the page displaying apparatus 60 at the server side provided in embodiment 4. Obviously, the system 70 can solve the technical problems in the prior art.
Example 5
The embodiment of the application also provides a cache device of the page resources, and the device is positioned at the client. As shown in fig. 7, the apparatus 80 includes: a page resource receiving unit 801, a splitting unit 802, and a second caching unit 803, wherein:
the page resource receiving unit 801 is configured to receive a page resource for displaying a page;
the splitting unit 802 is configured to split the page resource into a plurality of sub-page resources according to a data processing rule of the fact frame;
the second caching unit 803 is configured to cache each sub-page resource.
By adopting the device 80, the page resources for displaying the page are split according to the data processing rule of the React frame, and the split sub-page resources are cached, so that the basis is laid for solving the technical problems in the prior art.
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.
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 (7)

1. A page display method is characterized by comprising the following steps:
receiving a page display instruction;
according to the page display instruction, screening second page resources needing to be acquired from a server from all cached first page resources, wherein the first page resources are determined by splitting the page resources needed for displaying the page according to the data processing rule of a read frame, the first page resources correspond to a first timestamp, and the first timestamp is the time when the first page resources are cached;
acquiring the second page resource from the server according to the screened result;
displaying the page according to the acquired second page resource;
the step of screening out the second page resources which need to be acquired from the server from the first page resources specifically comprises the following steps:
determining the retention time corresponding to each first page resource through a second time stamp and the first time stamp corresponding to each first page resource;
respectively judging whether the retention time corresponding to each first page resource is greater than a preset time threshold, and determining the first page resource with the retention time greater than the preset time threshold as a second page resource, wherein the preset time threshold is determined according to the type of the first page resource.
2. The method of claim 1, wherein the first page resource corresponds to a number of calls, and the number of calls is a number of calls of the cached first page resource; then the process of the first step is carried out,
the step of screening out the second page resources required to be acquired from the server from the first page resources specifically includes:
and respectively judging whether the calling times of the first page resources are greater than a preset calling time threshold value, and determining the first page resources with the calling times greater than the preset calling time threshold value as second page resources.
3. The method of claim 1, wherein after obtaining the second page resource from the server according to the filtered result, the method further comprises:
splitting the second page resource acquired from the server side into a plurality of second page sub-resources according to the data processing rule of the React frame;
and caching each second page sub-resource.
4. A page display method is characterized by comprising the following steps:
receiving a service request for acquiring a second page resource, wherein the second page resource is a page resource which is screened by a client from various cached first page resources and needs to be acquired from a server, the first page resource is determined by splitting the page resource required by displaying the page according to a data processing rule of a React frame, the first page resource corresponds to a first timestamp, and the first timestamp is the time when the first page resource is cached;
returning the second page resource to the client so that the client can display the page according to the second page resource;
the step of screening out the second page resources which need to be acquired from the server from the first page resources specifically comprises the following steps:
determining the retention time corresponding to each first page resource through a second time stamp and the first time stamp corresponding to each first page resource;
respectively judging whether the retention time corresponding to each first page resource is greater than a preset time threshold, and determining the first page resource with the retention time greater than the preset time threshold as a second page resource, wherein the preset time threshold is determined according to the type of the first page resource.
5. The method of claim 4, wherein the returning the second page resource to the client specifically comprises:
splitting the second page resource into a plurality of second page sub-resources according to the data processing rule of the React frame;
and returning each second page sub-resource to the client.
6. A page display apparatus, the apparatus comprising: page show instruction receiving element, screening unit, acquisition unit and show unit, wherein:
the page display instruction receiving unit is used for receiving a page display instruction;
the screening unit is used for screening second page resources needing to be acquired from a server from various cached first page resources according to the page display instruction, the first page resources are determined by splitting the page resources needed for displaying the pages according to the data processing rule of the React frame, the first page resources correspond to a first timestamp, and the first timestamp is the time when the first page resources are cached;
the obtaining unit is used for obtaining the second page resource from the server according to the screened result;
the display unit is used for displaying the page according to the acquired second page resource;
the step of screening out the second page resources which need to be acquired from the server from the first page resources specifically comprises the following steps:
determining the retention time corresponding to each first page resource through a second time stamp and the first time stamp corresponding to each first page resource;
respectively judging whether the retention time corresponding to each first page resource is greater than a preset time threshold, and determining the first page resource with the retention time greater than the preset time threshold as a second page resource, wherein the preset time threshold is determined according to the type of the first page resource.
7. The apparatus according to claim 6, further comprising a first caching unit connected to the obtaining unit, configured to split the second page resource obtained from the server into a plurality of second page sub-resources according to a data processing rule of a read frame, and cache each of the second page sub-resources.
CN201610405986.XA 2016-06-08 2016-06-08 Page display method, page resource caching method and device Active CN106886545B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610405986.XA CN106886545B (en) 2016-06-08 2016-06-08 Page display method, page resource caching method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610405986.XA CN106886545B (en) 2016-06-08 2016-06-08 Page display method, page resource caching method and device

Publications (2)

Publication Number Publication Date
CN106886545A CN106886545A (en) 2017-06-23
CN106886545B true CN106886545B (en) 2020-10-02

Family

ID=59176833

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610405986.XA Active CN106886545B (en) 2016-06-08 2016-06-08 Page display method, page resource caching method and device

Country Status (1)

Country Link
CN (1) CN106886545B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110020268B (en) * 2017-07-28 2022-04-12 北京国双科技有限公司 Page returning method and device
CN108399222B (en) * 2018-02-11 2020-09-01 北京奇艺世纪科技有限公司 Page refreshing method and device
CN108681469B (en) * 2018-05-03 2021-07-30 武汉斗鱼网络科技有限公司 Page caching method, device, equipment and storage medium based on Android system
CN110347493A (en) * 2019-07-16 2019-10-18 广州虎牙科技有限公司 Processing method, display methods, device, equipment and the storage medium of page data
CN110727422B (en) * 2019-09-30 2023-10-20 杭州涂鸦信息技术有限公司 Multi-language performance improving method and system based on front-end isomorphic framework
CN111681028A (en) * 2020-04-16 2020-09-18 上海淇玥信息技术有限公司 Resource allocation method and device, electronic equipment and computer readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102591963A (en) * 2011-12-30 2012-07-18 奇智软件(北京)有限公司 Method and device for controlling webpage content loading
CN103257973A (en) * 2012-02-20 2013-08-21 腾讯科技(深圳)有限公司 Method and system for updating browser cache
CN105512278A (en) * 2015-12-04 2016-04-20 小米科技有限责任公司 Webpage display method and device
CN106250128A (en) * 2016-07-26 2016-12-21 网易(杭州)网络有限公司 The display processing method of user interface and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103870487B (en) * 2012-12-13 2017-07-25 腾讯科技(深圳)有限公司 Web page files processing method and mobile terminal

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102591963A (en) * 2011-12-30 2012-07-18 奇智软件(北京)有限公司 Method and device for controlling webpage content loading
CN103257973A (en) * 2012-02-20 2013-08-21 腾讯科技(深圳)有限公司 Method and system for updating browser cache
CN105512278A (en) * 2015-12-04 2016-04-20 小米科技有限责任公司 Webpage display method and device
CN106250128A (en) * 2016-07-26 2016-12-21 网易(杭州)网络有限公司 The display processing method of user interface and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
react.js学习记录——实现一个简单的消息中心组件;AmBeta;《http://ambeta.github.io/2016/04/01/reactjs-study-notes-first.html》;20160401;第2-3页 *

Also Published As

Publication number Publication date
CN106886545A (en) 2017-06-23

Similar Documents

Publication Publication Date Title
CN106886545B (en) Page display method, page resource caching method and device
CN110110174B (en) Data visualization page generation, monitoring and display method, browser and server
CN106202235B (en) Data processing method and device
CN107145489B (en) Information statistics method and device for client application based on cloud platform
US20190243518A1 (en) Application interface management method and apparatus
CN106897347B (en) Webpage display method, operation event recording method and device
TWI683251B (en) Interface display method and device
US9064029B2 (en) Dynamically identifying and evaluating component hierarchy for rendering content components on a webpage
CN107450903B (en) Information processing method and device
CN110968824A (en) Page data processing method and device
US11481196B2 (en) User interface for accessing and modifying development area content
CN110968314B (en) Page generation method and device
US20110302285A1 (en) Update server to update rendered content
CN110955846A (en) Propagation path diagram generation method and device
US10277650B1 (en) Parallel execution of request tracking and resource delivery
CN107220260B (en) Page display method and device
CN112579118A (en) Method, device, system, medium and equipment for updating configuration information of microservice
CN114547514A (en) Dynamic rendering method, device, equipment and medium for components
US11675773B2 (en) Content management
CN112036974A (en) Service commodity online method, device, equipment and storage medium
CN110020332B (en) Event generation method and device based on circled elements
US9230022B1 (en) Customizable result sets for application program interfaces
CN110858238A (en) Data processing method and device
CN112346761B (en) Front-end resource online method, device, system and storage medium
CN113127788B (en) Page processing method, object processing method, device and equipment

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
GR01 Patent grant
GR01 Patent grant
TA01 Transfer of patent application right

Effective date of registration: 20200921

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

Applicant after: Innovative advanced technology Co.,Ltd.

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

Applicant before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20200921

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman, British 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