CN116578800A - Page rendering method and device, electronic equipment and computer readable storage medium - Google Patents

Page rendering method and device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN116578800A
CN116578800A CN202310560888.3A CN202310560888A CN116578800A CN 116578800 A CN116578800 A CN 116578800A CN 202310560888 A CN202310560888 A CN 202310560888A CN 116578800 A CN116578800 A CN 116578800A
Authority
CN
China
Prior art keywords
page
resource data
component
rendered
historical
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310560888.3A
Other languages
Chinese (zh)
Inventor
张文静
韩露
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dushang Software Technology Co ltd
Original Assignee
Beijing Dushang Software Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dushang Software Technology Co ltd filed Critical Beijing Dushang Software Technology Co ltd
Priority to CN202310560888.3A priority Critical patent/CN116578800A/en
Publication of CN116578800A publication Critical patent/CN116578800A/en
Pending legal-status Critical Current

Links

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/972Access to data in other repository systems, e.g. legacy data or dynamic Web page generation

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 Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The disclosure provides a page rendering method, a page rendering device, electronic equipment and a computer readable storage medium, and relates to the technical field of computers, in particular to the technical field of application program pages or the technical field of front-end development. The specific implementation scheme is as follows: responding to the fact that the current page starts rendering, inquiring historical page resource data corresponding to a page component to be rendered in the current page from a cache to obtain a first inquiring result, wherein the historical page resource data in the cache is stored based on the component identification of the page component, and the historical page resource data corresponding to the page component to be rendered is data required in the historical rendering operation of the page component to be rendered; rendering the page component to be rendered based on the first query result. According to the scheme, the historical page resource data is cached based on the component identification of the page component, so that the cache can be effectively utilized, and the page rendering speed can be improved.

Description

Page rendering method and device, electronic equipment and computer readable storage medium
Technical Field
The disclosure relates to the field of computer technology, in particular to the field of application program page technology or front-end development technology, and specifically relates to a page rendering method, a device, electronic equipment and a computer readable storage medium.
Background
With the development of mobile interconnection technology, people increasingly browse media information by accessing front-end pages through terminal equipment.
The terminal device needs to load page resource data from the server, and then render pages based on the page resource data.
In the related art, page resource data loaded in the history access is cached. How to increase the page rendering speed based on cached page resource data becomes an important technical problem.
Disclosure of Invention
In order to solve at least one of the defects, the disclosure provides a page rendering method, a page rendering device, electronic equipment and a computer readable storage medium.
According to a first aspect of the present disclosure, there is provided a page rendering method, the method comprising:
responding to the fact that the current page starts rendering, inquiring historical page resource data corresponding to a page component to be rendered in the current page from a cache to obtain a first inquiring result, wherein the historical page resource data in the cache is stored based on the component identification of the page component, and the historical page resource data corresponding to the page component to be rendered is data required in the historical rendering operation of the page component to be rendered;
Rendering the page component to be rendered based on the first query result.
According to a second aspect of the present disclosure, there is provided a page rendering apparatus, the apparatus comprising:
the historical page resource data query module is used for responding to the fact that the current page is detected to start rendering, querying historical page resource data corresponding to a page component to be rendered in the current page from the cache to obtain a first query result, wherein the historical page resource data in the cache is stored based on the component identification of the page component, and the historical page resource data corresponding to the page component to be rendered is data required in the historical rendering operation of the page component to be rendered;
and the page rendering module is used for rendering the page component to be rendered based on the first query result.
According to a third aspect of the present disclosure, there is provided an electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the page rendering method.
According to a fourth aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the above-described page rendering method.
According to a fifth aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the above-described page rendering method.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
fig. 1 is a schematic flow chart of a page rendering method according to an embodiment of the disclosure;
FIG. 2 is a flow diagram of accessing historical page resource data in an embodiment of the present disclosure;
FIG. 3 is a flow diagram of caching historical page resource data in an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a page rendering device according to an embodiment of the present disclosure;
fig. 5 is a block diagram of an electronic device used to implement a page rendering method of an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In the related art, page resource data loaded in the history access is cached. How to increase the page rendering speed based on cached page resource data becomes an important technical problem.
In the related art, page resource data is generally loaded through an interface with a server, and the loaded page resource data is cached based on an interface identifier, that is, a unique identifier of the interface is used as a key to cache the page resource data. When the page content is frequently changed, the situation that page resource data in the cache is repeatedly covered in the cache mode can occur, so that the cache utilization rate is low. For example, when multiple login accounts are frequently switched in the same browser, page contents under each login account are different, so that page resource data of a previous page in the cache cannot be utilized by a next page, and page resource data of the next page also covers page resource data of the previous page in the cache, which results in that page resource data in the cache cannot be effectively utilized.
The embodiment of the disclosure provides a page rendering method, a page rendering device, an electronic device and a computer readable storage medium, which aim to solve at least one of the above technical problems in the prior art.
Fig. 1 shows a flow chart of a page rendering method provided by an embodiment of the disclosure, and as shown in fig. 1, the method may mainly include:
step S110: responding to the fact that the current page starts rendering, inquiring historical page resource data corresponding to a page component to be rendered in the current page from a cache to obtain a first inquiring result, wherein the historical page resource data in the cache is stored based on the component identification of the page component, and the historical page resource data corresponding to the page component to be rendered is data required in the historical rendering operation of the page component to be rendered;
step S120: rendering the page component to be rendered based on the first query result.
The historical page resource data are page resource data loaded in the historical access of the current page, and the historical page resource data can be stored in the cache, so that the historical page resource data are acquired from the cache to render the current page when the current page is accessed later, the number of the page resource data requested at the rear end is reduced, the network load is reduced, and the response speed of the page is improved.
In the embodiment of the disclosure, the historical page resource data in the cache is stored based on the component identification of the page component, specifically, the unique identification of the page component is used as a key to cache the historical page resource data.
By caching the historical page resource data from the dimension of the page component, when the page component changes in the page, the page component can be cached based on different component identifications and cannot be covered, and the historical page resource data caused by caching the page resource data based on the unique identification of the interface in the related technology can be effectively avoided from being covered.
In the embodiment of the disclosure, when the current page is detected to start rendering, for example, when a rendering instruction of the current page is detected, whether historical page resource data of the page component to be rendered exists in a cache or not may be queried based on the component identification of the page component to be rendered, so as to obtain a first query result, and render the page component to be rendered based on the first query result.
According to the method provided by the embodiment of the disclosure, the current page is detected to start rendering, and the historical page resource data corresponding to the page component to be rendered in the current page is queried from the cache to obtain a first query result, wherein the historical page resource data in the cache is stored based on the component identification of the page component, and the historical page resource data corresponding to the page component to be rendered is data required in the historical rendering operation of the page component to be rendered; rendering the page component to be rendered based on the first query result. According to the scheme, the historical page resource data is cached based on the component identification of the page component, so that the cache can be effectively utilized, and the page rendering speed can be improved.
In the embodiment of the disclosure, the cached historical page resource data based on the component identification of the page component is not covered, so that the utilization rate of the cache is greatly improved.
In an optional manner of the disclosure, historical page resource data in a cache is also stored based on a user identifier, a component to be rendered is used for displaying information of a data object corresponding to a current login user, and the historical page resource data corresponding to the page component to be rendered in the current page is queried from the cache to obtain a query result, which includes:
inquiring historical page resource data corresponding to the current login user from the cache to obtain a second inquiry result;
and inquiring historical page resource data corresponding to the page component to be rendered in the current page based on the second inquiry result to obtain a first inquiry result.
In the embodiment of the disclosure, the historical page resource data in the cache may also be stored based on the user identification, specifically, the unique identification of the user is used as a key to cache the historical page resource data. This leaves the cached historical page resource data for different users uncovered.
In embodiments of the present disclosure, the user identification may be a higher level of storage dimension than the page component identification. When the historical page resource data is queried from the cache, the second query result can be queried based on the user identification of the current login user, and then the first query result is queried based on the second query result, so that the query efficiency can be improved.
The component to be rendered is used for displaying information of the data object corresponding to the current login user. As an example, the current page is used to show the store managed by the current page to the user, where the store is the data object in this example, and the component to be rendered is used to show the information of the store. Stores managed by different users are different, and the historical page resource data of the page components corresponding to the stores are stored based on the component identifiers, so that the historical page resource data of the page components corresponding to the stores are prevented from being covered.
As an example, fig. 2 is a flow diagram of accessing historical page resource data in an embodiment of the present disclosure.
As shown in fig. 2, historical page resource data may be stored based on store dimensions as well as user dimensions, with different users, user 1, user 2, etc., each being able to access the data upon hitting the cache logic. The cache in this example may use a Local Storage (Local Storage), where historical page resource data of multiple users can be stored in a user dimension.
By caching the historical page resource data based on store dimensions and user dimensions, effective management of the cached data is achieved, the problem that the cache is covered is avoided, and the utilization rate of the cache is improved.
In an optional manner of the disclosure, based on a second query result, querying historical page resource data corresponding to a to-be-rendered page component in a current page to obtain a first query result, including:
responding to the second query result to query the historical page resource data corresponding to the current login user, and querying the historical page resource data corresponding to the page component to be rendered in the current page from the historical page resource data corresponding to the current login user to obtain a first query result;
and responding to the second query result that the historical page resource data corresponding to the current login user is not queried, and determining the first query result as the historical page resource data corresponding to the page component to be rendered is not queried.
In the embodiment of the disclosure, the second query result may include historical page resource data corresponding to the queried current login user and historical page resource data corresponding to the queried current login user.
When the historical page resource data corresponding to the current login user is queried, the first query result can be queried from the historical page resource data corresponding to the current login user based on the component identification of the page component to be rendered.
The first query result may be historical page resource data corresponding to the queried page component to be rendered and historical page resource data corresponding to the queried page component not to be rendered.
By querying based on the user identification of the current login user and then querying based on the component identification of the page component to be rendered, query efficiency can be improved compared with directly querying in a cache based on the component identification of the page component to be rendered.
In the embodiment of the disclosure, when the second query result is that the historical page resource data corresponding to the current login user is not queried, the cache is indicated to not contain the page data corresponding to the current login user, and at this time, it may be determined that the first query result is determined that the historical page resource data corresponding to the page component to be rendered is not queried.
In an optional manner of the disclosure, rendering the page component to be rendered based on the first query result includes:
responding to the first query result to query the historical page resource data corresponding to the page component to be rendered, and rendering the page component to be rendered based on the historical page resource data corresponding to the page component to be rendered.
In the embodiment of the disclosure, the first query result is that the historical page resource data corresponding to the page component to be rendered is queried, that is, the historical page resource data corresponding to the page component to be rendered is queried from the cache, and at this time, the rendering of the page component to be rendered can be performed based on the historical page resource data corresponding to the page component to be rendered, so that the quick page rendering by using the cache is realized, and the response speed of the page is improved.
In an optional manner of the disclosure, after rendering the to-be-rendered page component based on the historical page resource data corresponding to the to-be-rendered page component, the method further includes:
acquiring current page resource data corresponding to a page component to be rendered;
and updating the page component to be rendered after rendering based on the current page resource data.
In the embodiment of the disclosure, after rendering the page component to be rendered based on the historical page resource data, current page resource data corresponding to the page component to be rendered in current practice can be obtained, so that the page component to be rendered after rendering is updated based on the current page resource data, and the accuracy of the displayed page content is ensured.
As an example, a preset duration, for example, 1s, after rendering the page component to be rendered based on the historical page resource data may be used to request the current page resource data from the background server based on the resource address of the current page resource data corresponding to the page component to be rendered.
After the current page resource data is acquired, the page component to be rendered after rendering can be updated based on the current page resource data. As one example, after the current page resource data is obtained, re-rendering may be performed directly based on the current page sub-metadata, with the re-rendered page components replacing the page components rendered based on the historical page resource data.
As another example, re-rendering the page component may cause jitter to the page, giving the user a bad use experience. Since the update of the current page resource data of the page component is generally aimed at specific content in the page component, the content in the rendered page component can be directly updated. If the component incoming value of the page component is updated, the updated component incoming value can be directly used for replacing the original component incoming value. By updating only the component content of the page component, page jitter caused by re-rendering the page component can be avoided.
In the embodiment of the disclosure, because the historical page resource data in the cache is stored based on the component identifier of the page component, that is, the historical page resource data is cached in a fine granularity by the dimension of the page component, when the page component to be rendered after rendering is updated based on the current page resource data, the page component dimension is updated, so that fine granularity update of the content in the page can be realized, and fine control over the update of the content in the page is realized.
In an optional manner of the disclosure, the method further includes:
and updating the historical page resource data corresponding to the page component to be rendered in the cache based on the current page resource data.
In this embodiment, after the current page resource data is obtained, the corresponding historical page resource data in the cache may be updated by the current page resource data, so as to ensure timely update of the cache.
In an optional manner of the disclosure, rendering the page component to be rendered based on the first query result includes:
responding to the first query result that the historical page resource data corresponding to the page component to be rendered is not queried, and acquiring the current page resource data corresponding to the page component to be rendered;
rendering the page component to be rendered based on the current page resource data.
In the embodiment of the disclosure, the first query result is that the historical page resource data corresponding to the page component to be rendered is not queried, that is, the historical page resource data corresponding to the page component to be rendered does not exist in the cache, at this time, the current page resource data corresponding to the page component to be rendered currently and actually can be directly obtained, and the page component to be rendered is rendered based on the current page resource data.
As one example, current page resource data may be requested from a background server based on a resource address of the current page resource data corresponding to the page component to be rendered.
In an optional manner of the disclosure, the method further includes:
determining the cached time length of page resource data corresponding to each page component in the cache;
and deleting the historical page resource data corresponding to the target page component from the cache in response to the cached time length of the historical page resource data corresponding to the target page component being not less than the expiration time length corresponding to the target page component.
In the embodiment of the disclosure, the expiration time of the historical page resource data corresponding to each page component can be preconfigured, when the cached time of the historical page resource data is not less than the corresponding expiration time, the historical page resource data is indicated to be expired, and the expired historical page resource data can be deleted from the cache.
In one alternative of the present disclosure, the expiration time period corresponding to the target page component is determined based on how frequently component content contained in the target page component changes during the historical access.
In the embodiment of the disclosure, the expiration time period may be determined based on the frequency of the component content included in the target page component in the history access, for example, when the frequency of the component content is high, the component content is indicated to be changed frequently, and then the shorter expiration time period may be configured so as to delete the history page resource data that may be invalid in time. When the frequency of the component content changes is low, the content of the identification component does not change frequently, and a longer expiration time can be configured to improve the utilization rate of the cache.
In an alternative of the present disclosure, the cache is a Local Storage (Local Storage).
The front end commonly used caches small amounts of information (cookies), session storage (SessionStorage) and localStorage.
A Cookie is a simple text file stored in the client, typically 4k in size, beyond which limit the data cannot be stored in the Cookie. cookies can be disabled, and when a user is very concerned with personal privacy protection, the cookie function of the browser can be disabled. cookies may be deleted because each cookie is a file on the hard drive and thus likely to be deleted by the user. It follows that cookie stored files are small and can be masked, and are not suitable for use as cache history page resource data in this case.
SessionStorage is to save data in a session object whose lifecycle is valid only under the current session. SessionStorage introduces a concept of "browser window", which is data that always exists in a homologous browser window. When the browser window is not closed, data still exists even if the page is refreshed or another page is brought in. The SessionStorage is destroyed after the browser window is closed. Simultaneously, the same browser window is independently opened, and the SessionStorages are different. Therefore, the effective range and time of the SessionStorage storage file are limited, and the SessionStorage storage file is not suitable for being used as the cache history page resource data in the scheme.
The LocalStorage size is typically 5MB, beyond which limit the LocalStorage cannot store the data. The lifecycle of LocalStorage is permanent and the data in LocalStorage does not disappear after closing the page or browser. LocalStorage data never disappears unless it is actively deleted. Therefore, the LocalStorage storage time is not limited, the storable file is larger and cannot be shielded by a user, and the LocalStorage storage time is more suitable for being used as the cache history page resource data in the scheme.
In the embodiment of the disclosure, the content stored in the LocalStorage may be managed by using a least recently used content (Least Recently Used, LRU) algorithm to improve the cache utilization. The LocalStorage may have an overrun storage condition, and after overrun, the LocalStorage overflows to report errors, so that the errors can be captured, and the stored data is maintained according to a first-in first-out rule.
As an example, a schematic flow diagram of buffering historical page resource data in an embodiment of the present disclosure is shown in fig. 3.
As shown in fig. 3, a new cache data is created, i.e. a user identification or page component identification is used as a key (key), historical page resource data is used as a value (value), and an expiration time (ExpireTime) of the cache data can be determined. And reading the current cache time for subsequent judgment of expiration. And calculating the size of the existing data of the LocalStorage and the size of the data to be written, and then calculating whether the LocalStorage is overrun after the new cache data is stored. If the LocalStorage is out of limit, the LRU algorithm is used for clearing part of stored data in the LocalStorage, and then new data is written in the LocalStorage. If the LocalStorage is not overrun, new data can be directly written into the LocalStorage.
Based on the same principle as the method shown in fig. 1, fig. 4 shows a schematic structural diagram of a page rendering device provided by an embodiment of the present disclosure, and as shown in fig. 4, the page rendering device 40 may include:
the historical page resource data query module 410 is configured to query, in response to detecting that the current page starts rendering, historical page resource data corresponding to a page component to be rendered in the current page from a cache, to obtain a first query result, where the historical page resource data in the cache is stored based on a component identifier of the page component, and the historical page resource data corresponding to the page component to be rendered is data required in a historical rendering operation of the page component to be rendered;
the page rendering module 420 is configured to render the page component to be rendered based on the first query result.
According to the device provided by the embodiment of the disclosure, the rendering is started by responding to the detected current page, the historical page resource data corresponding to the page component to be rendered in the current page is queried from the cache to obtain the first query result, the historical page resource data in the cache is stored based on the component identification of the page component, and the historical page resource data corresponding to the page component to be rendered is data required in the historical rendering operation of the page component to be rendered; rendering the page component to be rendered based on the first query result. According to the scheme, the historical page resource data is cached based on the component identification of the page component, so that the cache can be effectively utilized, and the page rendering speed can be improved.
Optionally, the historical page resource data in the cache is further stored based on a user identifier, the to-be-rendered component is used for displaying information of a data object corresponding to the current login user, and the historical page resource data query module is specifically used for, when querying, from the cache, the historical page resource data corresponding to the to-be-rendered page component in the current page to obtain a first query result:
inquiring historical page resource data corresponding to the current login user from the cache to obtain a second inquiry result;
and inquiring historical page resource data corresponding to the page component to be rendered in the current page based on the second inquiry result to obtain a first inquiry result.
Optionally, the historical page resource data query module is specifically configured to, when querying, based on the second query result, historical page resource data corresponding to the to-be-rendered page component in the current page to obtain the first query result:
responding to the second query result to query the historical page resource data corresponding to the current login user, and querying the historical page resource data corresponding to the page component to be rendered in the current page from the historical page resource data corresponding to the current login user to obtain a first query result;
And responding to the second query result that the historical page resource data corresponding to the current login user is not queried, and determining the first query result as the historical page resource data corresponding to the page component to be rendered is not queried.
Optionally, the page rendering module is specifically configured to:
responding to the first query result to query the historical page resource data corresponding to the page component to be rendered, and rendering the page component to be rendered based on the historical page resource data corresponding to the page component to be rendered.
Optionally, the above device further includes a component update module, where the component update module is configured to:
after rendering the page component to be rendered based on the historical page resource data corresponding to the page component to be rendered, acquiring current page resource data corresponding to the page component to be rendered;
and updating the page component to be rendered after rendering based on the current page resource data.
Optionally, the apparatus further includes a cache update module, where the cache update module is configured to:
and updating the historical page resource data corresponding to the page component to be rendered in the cache based on the current page resource data.
Optionally, the page rendering module is specifically configured to:
responding to the first query result that the historical page resource data corresponding to the page component to be rendered is not queried, and acquiring the current page resource data corresponding to the page component to be rendered;
Rendering the page component to be rendered based on the current page resource data.
Optionally, the apparatus further includes an expiration cache deletion module, where the expiration cache deletion module is configured to:
determining the cached time length of page resource data corresponding to each page component in the cache;
and deleting the historical page resource data corresponding to the target page component from the cache in response to the cached time length of the historical page resource data corresponding to the target page component being not less than the expiration time length corresponding to the target page component.
Optionally, the expiration time corresponding to the target page component is determined based on how frequently component content contained in the target page component changes during the historical access.
Optionally, the cache is a Local Storage.
It will be appreciated that the above-described modules of the page rendering apparatus in the embodiments of the present disclosure have functions of implementing the respective steps of the page rendering method in the embodiment shown in fig. 1. The functions can be realized by hardware, and can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the functions described above. The modules may be software and/or hardware, and each module may be implemented separately or may be implemented by integrating multiple modules. For the functional description of each module of the above page rendering device, reference may be specifically made to the corresponding description of the page rendering method in the embodiment shown in fig. 1, which is not repeated herein.
In the technical scheme of the disclosure, the related processes of collecting, storing, using, processing, transmitting, providing, disclosing and the like of the personal information of the user accord with the regulations of related laws and regulations, and the public order colloquial is not violated.
According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
The electronic device includes: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a page rendering method as provided by embodiments of the present disclosure.
Compared with the prior art, the electronic device starts rendering by responding to the detected current page, queries historical page resource data corresponding to a page component to be rendered in the current page from a cache to obtain a first query result, and stores the historical page resource data in the cache based on the component identification of the page component, wherein the historical page resource data corresponding to the page component to be rendered is data required in the historical rendering operation of the page component to be rendered; rendering the page component to be rendered based on the first query result. According to the scheme, the historical page resource data is cached based on the component identification of the page component, so that the cache can be effectively utilized, and the page rendering speed can be improved.
The readable storage medium is a non-transitory computer readable storage medium storing computer instructions for causing a computer to perform a page rendering method as provided by embodiments of the present disclosure.
Compared with the prior art, the readable storage medium starts rendering by responding to the detection of the current page, queries historical page resource data corresponding to a page component to be rendered in the current page from a cache to obtain a first query result, and the historical page resource data in the cache is stored based on the component identification of the page component, wherein the historical page resource data corresponding to the page component to be rendered is data required in the historical rendering operation of the page component to be rendered; rendering the page component to be rendered based on the first query result. According to the scheme, the historical page resource data is cached based on the component identification of the page component, so that the cache can be effectively utilized, and the page rendering speed can be improved.
The computer program product comprises a computer program which, when executed by a processor, implements a page rendering method as provided by embodiments of the present disclosure.
Compared with the prior art, the computer program product starts rendering by responding to the detected current page, queries historical page resource data corresponding to a page component to be rendered in the current page from a cache to obtain a first query result, and stores the historical page resource data in the cache based on the component identification of the page component, wherein the historical page resource data corresponding to the page component to be rendered is data required in the historical rendering operation of the page component to be rendered; rendering the page component to be rendered based on the first query result. According to the scheme, the historical page resource data is cached based on the component identification of the page component, so that the cache can be effectively utilized, and the page rendering speed can be improved.
Fig. 5 shows a schematic block diagram of an example electronic device 50 that may be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 5, the electronic device 50 includes a computing unit 510 that can perform various suitable actions and processes according to a computer program stored in a Read Only Memory (ROM) 520 or a computer program loaded from a storage unit 580 into a Random Access Memory (RAM) 530. In RAM 530, various programs and data required for the operation of device 50 may also be stored. The computing unit 510, ROM 520, and RAM 530 are connected to each other by a bus 540. An input/output (I/O) interface 550 is also connected to bus 540.
Various components in the device 50 are connected to the I/O interface 550, including: an input unit 560 such as a keyboard, a mouse, etc.; an output unit 570 such as various types of displays, speakers, and the like; a storage unit 580 such as a magnetic disk, an optical disk, or the like; and a communication unit 590 such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 590 allows the device 50 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunication networks.
The computing unit 510 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 510 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 510 performs the page rendering method provided in the embodiments of the present disclosure. For example, in some embodiments, performing the page rendering methods provided in embodiments of the present disclosure may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as the storage unit 580. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 50 via the ROM 520 and/or the communication unit 590. One or more steps of the page rendering method provided in the embodiments of the present disclosure may be performed when the computer program is loaded into RAM 530 and executed by computing unit 510. Alternatively, in other embodiments, the computing unit 510 may be configured to perform the page rendering methods provided in embodiments of the present disclosure in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server incorporating a blockchain.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel, sequentially, or in a different order, provided that the desired results of the disclosed aspects are achieved, and are not limited herein.
The above detailed description should not be taken as limiting the scope of the present disclosure. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present disclosure are intended to be included within the scope of the present disclosure.

Claims (20)

1. A method of page rendering, comprising:
responding to the fact that the current page starts rendering, inquiring historical page resource data corresponding to a page component to be rendered in the current page from a cache to obtain a first inquiring result, wherein the historical page resource data in the cache is stored based on the component identification of the page component, and the historical page resource data corresponding to the page component to be rendered is data required in the historical rendering operation of the page component to be rendered;
And rendering the page component to be rendered based on the first query result.
2. The method of claim 1, wherein the historical page resource data in the cache is further stored based on a user identifier, the component to be rendered is configured to display information of a data object corresponding to a current login user, the query is performed on the historical page resource data corresponding to the page component to be rendered in the current page from the cache, and a first query result is obtained, and the method includes:
inquiring historical page resource data corresponding to the current login user from a cache to obtain a second inquiry result;
and inquiring historical page resource data corresponding to the page component to be rendered in the current page based on the second inquiry result to obtain a first inquiry result.
3. The method of claim 2, wherein the querying, based on the second query result, the historical page resource data corresponding to the page component to be rendered in the current page, to obtain a first query result, includes:
responding to the second query result to query the historical page resource data corresponding to the current login user, and querying the historical page resource data corresponding to the page component to be rendered in the current page from the historical page resource data corresponding to the current login user to obtain a first query result;
And responding to the second query result that the historical page resource data corresponding to the current login user is not queried, and determining the first query result as the historical page resource data corresponding to the page component to be rendered is not queried.
4. The method of any of claims 1-3, wherein the rendering of the page component to be rendered based on the first query result comprises:
and responding to the first query result to query the historical page resource data corresponding to the page component to be rendered, and rendering the page component to be rendered based on the historical page resource data corresponding to the page component to be rendered.
5. The method of claim 4, after the rendering of the page component to be rendered based on the historical page resource data corresponding to the page component to be rendered, the method further comprising:
acquiring current page resource data corresponding to the page component to be rendered;
and updating the page component to be rendered after rendering based on the current page resource data.
6. The method of claim 5, further comprising:
and updating the historical page resource data corresponding to the page component to be rendered in the cache based on the current page resource data.
7. The method of any of claims 1-6, wherein the rendering of the page component to be rendered based on the first query result comprises:
responding to the first query result that the historical page resource data corresponding to the page component to be rendered is not queried, and acquiring the current page resource data corresponding to the page component to be rendered;
rendering the page component to be rendered is performed based on the current page resource data.
8. The method of any of claims 1-7, further comprising:
determining the cached time length of page resource data corresponding to each page component in the cache;
and deleting the historical page resource data corresponding to the target page component from the cache in response to the cached time length of the historical page resource data corresponding to the target page component being not less than the expiration time length corresponding to the target page component.
9. The method of claim 8, wherein the expiration time period corresponding to the target page component is determined based on how frequently component content contained in the target page component changes during historical accesses.
10. The method of any of claims 1-9, wherein the cache is a local memory LocalStorage.
11. A page rendering apparatus comprising:
the system comprises a historical page resource data query module, a first query module and a second query module, wherein the historical page resource data query module is used for responding to the fact that the current page starts rendering, querying historical page resource data corresponding to a page component to be rendered in the current page from a cache to obtain a first query result, the historical page resource data in the cache is stored based on the component identification of the page component, and the historical page resource data corresponding to the page component to be rendered is data required in the historical rendering operation of the page component to be rendered;
and the page rendering module is used for rendering the page component to be rendered based on the first query result.
12. The apparatus of claim 11, wherein the historical page resource data in the cache is further stored based on a user identifier, the component to be rendered is configured to display information of a data object corresponding to a current login user, and the historical page resource data query module is specifically configured to, when querying, from the cache, the historical page resource data corresponding to the page component to be rendered in the current page to obtain a first query result:
inquiring historical page resource data corresponding to the current login user from a cache to obtain a second inquiry result;
And inquiring historical page resource data corresponding to the page component to be rendered in the current page based on the second inquiry result to obtain a first inquiry result.
13. The apparatus of claim 12, wherein the historical page resource data query module is configured to, when querying the historical page resource data corresponding to the page component to be rendered in the current page based on the second query result, obtain a first query result, specifically configured to:
responding to the second query result to query the historical page resource data corresponding to the current login user, and querying the historical page resource data corresponding to the page component to be rendered in the current page from the historical page resource data corresponding to the current login user to obtain a first query result;
and responding to the second query result that the historical page resource data corresponding to the current login user is not queried, and determining the first query result as the historical page resource data corresponding to the page component to be rendered is not queried.
14. The apparatus of any of claims 11-13, wherein the page rendering module is specifically configured to:
And responding to the first query result to query the historical page resource data corresponding to the page component to be rendered, and rendering the page component to be rendered based on the historical page resource data corresponding to the page component to be rendered.
15. The apparatus of claim 14, further comprising a component update module to:
after the rendering of the page component to be rendered is performed based on the historical page resource data corresponding to the page component to be rendered, current page resource data corresponding to the page component to be rendered is obtained;
and updating the page component to be rendered after rendering based on the current page resource data.
16. The apparatus of claim 15, further comprising a cache update module to:
and updating the historical page resource data corresponding to the page component to be rendered in the cache based on the current page resource data.
17. The apparatus of any of claims 11-16, wherein the page rendering module is specifically configured to:
responding to the first query result that the historical page resource data corresponding to the page component to be rendered is not queried, and acquiring the current page resource data corresponding to the page component to be rendered;
Rendering the page component to be rendered is performed based on the current page resource data.
18. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-10.
19. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-10.
20. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any of claims 1-10.
CN202310560888.3A 2023-05-17 2023-05-17 Page rendering method and device, electronic equipment and computer readable storage medium Pending CN116578800A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310560888.3A CN116578800A (en) 2023-05-17 2023-05-17 Page rendering method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310560888.3A CN116578800A (en) 2023-05-17 2023-05-17 Page rendering method and device, electronic equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN116578800A true CN116578800A (en) 2023-08-11

Family

ID=87540894

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310560888.3A Pending CN116578800A (en) 2023-05-17 2023-05-17 Page rendering method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN116578800A (en)

Similar Documents

Publication Publication Date Title
CN110737399B (en) Method, apparatus and computer program product for managing a storage system
CN110598138A (en) Cache-based processing method and device
CN113961510B (en) File processing method, device, equipment and storage medium
CN115599821A (en) Cache control method, device, equipment and medium
CN113127382A (en) Data reading method, device, equipment and medium for additional writing
CN113010535B (en) Cache data updating method, device, equipment and storage medium
CN112883041B (en) Data updating method and device, electronic equipment and storage medium
CN113742131B (en) Method, electronic device and computer program product for storage management
CN117009693A (en) http request front-end caching method and device, electronic equipment and readable medium
CN117040799A (en) Page interception rule generation and page access control method and device and electronic equipment
CN116578800A (en) Page rendering method and device, electronic equipment and computer readable storage medium
CN113676531B (en) E-commerce flow peak clipping method and device, electronic equipment and readable storage medium
CN112631517B (en) Data storage method and device, electronic equipment and storage medium
CN112887426B (en) Information stream pushing method and device, electronic equipment and storage medium
CN114861097A (en) Browser caching method and device, electronic equipment and storage medium
CN107423375B (en) Application program searching method and device
CN114461146B (en) Cloud storage data processing method, device, system, equipment, medium and product
CN114461950A (en) Global caching method and device, electronic equipment and storage medium
CN115840604B (en) Data processing method, device, electronic equipment and computer readable storage medium
CN114416414B (en) Fault information positioning method, device, equipment and storage medium
CN115964391A (en) Cache management method, device, equipment and storage medium
CN114338543B (en) Network access speed limiting method, device, equipment and storage medium
CN116257670A (en) Metadata processing method and device, electronic equipment and storage medium
CN116303298A (en) Method, device, equipment and storage medium for managing cache data
CN117632795A (en) Statistical method, system, device, equipment and medium for cache data access frequency

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication