CN108875036B - Page data caching method and device and electronic equipment - Google Patents

Page data caching method and device and electronic equipment Download PDF

Info

Publication number
CN108875036B
CN108875036B CN201810667915.6A CN201810667915A CN108875036B CN 108875036 B CN108875036 B CN 108875036B CN 201810667915 A CN201810667915 A CN 201810667915A CN 108875036 B CN108875036 B CN 108875036B
Authority
CN
China
Prior art keywords
page data
data
page
caching
website
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
CN201810667915.6A
Other languages
Chinese (zh)
Other versions
CN108875036A (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.)
Beijing Yong'an Communication Technology Co ltd
Original Assignee
Beijing Yong'an Communication 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 Yong'an Communication Technology Co ltd filed Critical Beijing Yong'an Communication Technology Co ltd
Priority to CN201810667915.6A priority Critical patent/CN108875036B/en
Publication of CN108875036A publication Critical patent/CN108875036A/en
Application granted granted Critical
Publication of CN108875036B publication Critical patent/CN108875036B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application relates to a page data caching method, a page data caching device and electronic equipment, wherein the page data caching method comprises the following steps: under the condition of accessing a website, retrieving a fixed area according to identification information of the website and retrieving a high-priority area and a low-priority area according to a first directional address and a second directional address of first page data cached in the fixed area; caching page data of the website in response to the fixed area not having the cache data; responding to the cached page data in the high-priority area and the low-priority area, and judging whether the page data is the latest data according to the update time field of the current page of the website; the page data of the website is cached in response to the page data not being the most recent data. Therefore, the page data can be cached in different cache regions by dividing the cache regions and using an optimized strategy, so that high-efficiency cache reading and writing are realized, and the storage space is saved.

Description

Page data caching method and device and electronic equipment
Technical Field
The present application relates generally to the field of data storage, and more particularly, to a page data caching method, a page data caching apparatus, and an electronic device.
Background
When a user accesses a website through a browser, a browser caching technology is generally adopted.
The browser caching technology means that the browser stores data of a website recently visited by a user in a local disk, so that the user can access the website next time, the local cache is read preferentially, user experience is improved, bandwidth occupation is reduced, and server pressure is relieved. In addition, the browser caching technology can shorten the idle waiting time of the CPU, improve the utilization rate of the CPU and enhance the overall performance of the computer.
However, the current browser caching technology has some defects when caching page data, and therefore an improved page data caching scheme is needed.
Disclosure of Invention
The present application is proposed to solve the above-mentioned technical problems. Embodiments of the present application provide a page data caching method, a page data caching apparatus, a page caching data structure, and an electronic device, which can implement efficient caching, reading, and writing and save storage space by dividing cache regions and caching page data in different cache regions with an optimized policy based on storage conditions in each cache region and a condition of the page data to be cached.
According to an aspect of the present application, there is provided a page data caching method, including: under the condition of accessing a website, retrieving a fixed area according to the identification information of the website; responding to the absence of cache data in the fixed area, and caching page data of the website; in response to the first page data cached in the fixed area, retrieving a high priority area according to a first pointing address of the first page data; responding to second page data cached in the high-priority area, and judging whether the second page data is the latest data or not according to an update time field of the current page of the website; caching the page data of the website in response to the second page data not being the latest data; in response to the fixed region having cached first page data and the high priority region not having cached data, retrieving a low priority region according to a second directional address of the first page data; responding to the third page data cached in the low-priority area, and judging whether the third page data is the latest data or not according to the update time field of the current page of the website; and caching the page data of the website in response to the third page data not being the latest data.
In the above page data caching method, caching the page data of the website in response to the absence of the cache data in the fixed area includes: marking whether the page data to be cached of the website is frequently changed; caching the page data which is not frequently changed into the fixed area; and caching frequently changing page data into at least one of the high priority region and the low priority region.
In the above page data caching method, the method further includes: in response to the second page data being the most recent data, rendering pages of the website directly with the second page data.
In the above page data caching method, caching the page data of the website in response to the second page data not being the latest data includes: determining whether a time interval between a current access time and a last access time of the page is greater than a predetermined time threshold; caching the page data into the tail part of the high priority area in response to the time interval being smaller than the preset time threshold; and in response to the time interval being greater than the predetermined time threshold, caching the page data into a header of the low priority region.
In the above page data caching method, the method further includes: in response to the third page data being the most recent data, rendering pages of the website directly with the third page data.
In the above page data caching method, the method further includes: and storing the third page data into the tail part of the high priority area.
In the above page data caching method, the method further includes: judging whether second page data cached in the high-priority area meets a preset standard or not during page data analysis; in response to the second page data satisfying a predetermined criterion, maintaining caching of the second page data in the high priority region; and in response to the second page data not meeting a predetermined criterion, caching the second page data in the low priority region.
In the above page data caching method, the method further includes: judging whether third page data cached in the low-priority area meets a preset standard or not during page data analysis; caching the third page data into the high priority region in response to the third page data satisfying a predetermined criterion; and, in response to the third page data not meeting a predetermined criterion, maintaining caching of the third page data in the low priority region.
In the above page data caching method, the predetermined criterion is based on at least one of: the analysis time interval of the page data, the user access dwell time corresponding to the page data and the user access click times corresponding to the page data.
According to another aspect of the present application, there is provided a page data caching apparatus, including: the first data cache unit is used for retrieving a fixed area according to the identification information of the website under the condition of accessing the website; responding to the absence of cache data in the fixed area, and caching page data of the website; a second data cache unit, configured to, in response to the first page data cached in the fixed area being present, retrieve a high priority area according to a first pointing address of the first page data; responding to second page data cached in the high-priority area, and judging whether the second page data is the latest data or not according to an update time field of the current page of the website; caching the page data of the website in response to the second page data not being the latest data; a third data cache unit configured to retrieve a low priority region according to a second directional address of the first page data in response to the first page data cached in the fixed region being present and the high priority region not having the cached data; responding to the third page data cached in the low-priority area, and judging whether the third page data is the latest data or not according to the update time field of the current page of the website; and caching the page data of the website in response to the third page data not being the latest data.
In the above page data caching apparatus, the first data caching unit is configured to: marking whether the page data to be cached of the website is frequently changed; caching the page data which is not frequently changed into the fixed area; and the high-priority cache unit and the low-priority cache unit are used for caching frequently-changed page data into at least one of the high-priority area and the low-priority area.
In the above page data caching apparatus, the method further includes: and the page rendering unit is used for directly rendering the page of the website by the second page data in response to the second page data being the latest data.
In the above page data caching apparatus, the second data caching unit is configured to: determining whether a time interval between a current access time and a last access time of the page is greater than a predetermined time threshold; caching the page data into the tail part of the high priority area in response to the time interval being smaller than the preset time threshold; and in response to the time interval being greater than the predetermined time threshold, caching the page data into a header of the low priority region.
In the above page data caching apparatus, the method further includes: and the page rendering unit is used for directly rendering the page of the website by the third page data in response to the third page data being the latest data.
In the above page data caching apparatus, the third data caching unit is further configured to store the third page data in the tail of the high priority region.
In the above page data caching apparatus, the second data caching unit is configured to: judging whether second page data cached in the high-priority area meets a preset standard or not during page data analysis; in response to the second page data satisfying a predetermined criterion, maintaining caching of the second page data in the high priority region; and in response to the second page data not meeting a predetermined criterion, caching the second page data in the low priority region.
In the above page data caching apparatus, the third page caching unit is configured to: judging whether third page data cached in the low-priority area meets a preset standard or not during page data analysis; caching the third page data into the high priority region in response to the third page data satisfying a predetermined criterion; and, in response to the third page data not meeting a predetermined criterion, maintaining caching of the third page data in the low priority region.
In the above page data caching apparatus, the predetermined criterion is based on at least one of: the analysis time interval of the page data, the user access dwell time corresponding to the page data and the user access click times corresponding to the page data.
According to another aspect of the present application, there is provided a page cache data structure, including: the fixed area is used for caching the fixed page data which is not frequently changed in the page data to be cached of the website; the high-priority area is used for caching high-priority page data in frequently-changed page data in the page data to be cached; the low-priority area is used for caching low-priority page data in frequently-changed page data in the page data to be cached; wherein the high priority page data, when parsed, determines whether a predetermined criterion is met and in response to meeting the predetermined criterion remains in the high priority zone and in response to not meeting the predetermined criterion is cached in the low priority zone; and determining whether predetermined criteria are met when the low priority page data is parsed and caching in the high priority zone in response to meeting the predetermined criteria and retaining in the low priority zone in response to not meeting the predetermined criteria.
In the above page cache data structure, the fixed page data is used to: retrieving a fixed area according to identification information of a website under the condition of accessing the website; and caching in response to the fixed region not having cached data; the high priority page data is for: in response to the fixed area having cached fixed page data, retrieving a high priority region according to a first pointing address of the fixed page data; responding to the high-priority page data cached in the high-priority area, and judging whether the high-priority page data is the latest data or not according to the update time field of the current page of the website; and, in response to the high priority page data not being the most recent data, updating the high priority page data and/or the low priority page data with page data of the website; the low priority page data is for: in response to the fixed area having cached first page data and the high-priority area not having the high-priority page data, retrieving a low-priority area according to a second directional address of the fixed page data; responding to the low-priority page data cached in the low-priority area, and judging whether the low-priority page data is the latest data or not according to the update time field of the current page of the website; and in response to the low-priority page data not being the most recent data, updating the low-priority page data and/or the high-priority page data with page data of the website.
In the above-described page cache data structure, the high-priority page data is used to directly render a page of the website therewith in response to being the latest data.
In the above page cache data structure, in response to the high-priority page data not being the latest data, updating the high-priority page data and/or the low-priority page data with the page data of the website includes: determining whether a time interval between a current access time and a last access time of the page is greater than a predetermined time threshold; in response to the time interval being less than the predetermined time threshold, caching the page data into the tail of the high priority region to update the high priority page data; and in response to the time interval being greater than the predetermined time threshold, caching the page data into a header of the low priority region to update the low priority page data.
In the above page cache data structure, the low priority page data is used to directly render a page of the website therewith in response to being the latest data.
In the above page cache data structure, further comprising: and storing the low-priority page data into the tail part of the high-priority area so as to update the low-priority page data and the high-priority page data.
In the above page cache data structure, the predetermined criterion is based on at least one of: the analysis time interval of the page data, the user access dwell time corresponding to the page data and the user access click times corresponding to the page data.
According to yet another aspect of the present application, there is provided an electronic device including: a processor; and a memory in which are stored computer program instructions which, when executed by the processor, cause the processor to perform the page data caching method as described above.
According to the page data caching method, the page data caching device, the page caching data structure and the electronic equipment, page data can be cached in different caching areas through dividing the caching areas and according to the storage condition in each caching area and the condition of the page data to be cached, the page data can be cached in different caching areas through an optimized strategy, and therefore high-efficiency caching reading and writing can be achieved, and storage space can be saved.
Drawings
Various other advantages and benefits of the present application will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the application. It is obvious that the drawings described below are only some embodiments of the application, and that for a person skilled in the art, other drawings can be derived from them without inventive effort. Also, like parts are designated by like reference numerals throughout the drawings.
FIG. 1 illustrates a flow diagram of a page data caching method according to an embodiment of the present application;
FIG. 2 illustrates a flow diagram of one example of a page data caching method according to an embodiment of the present application;
fig. 3 illustrates a flowchart of an example of processing cache data according to priority in a page data caching method according to an embodiment of the present application;
FIG. 4 illustrates a block diagram of a page data caching apparatus according to an embodiment of the present application;
FIG. 5 illustrates a schematic diagram of a page cache data structure according to an embodiment of the present application;
FIG. 6 illustrates a block diagram of an electronic device in accordance with an embodiment of the present application.
Detailed Description
Hereinafter, example embodiments according to the present application will be described in detail with reference to the accompanying drawings. It should be understood that the described embodiments are only some embodiments of the present application and not all embodiments of the present application, and that the present application is not limited by the example embodiments described herein.
Summary of the application
As described above, when caching page data, the current browser caching technology needs to replace the cached page data due to the limitation of the cache size, and an LRU (Least Recently Used) algorithm and an LFU (Least Frequently Used) algorithm are popular.
LRU is the most common basic cache replacement algorithm used, and its idea is to replace the least recently used data block in the cache out of the cache when performing data replacement. However, this algorithm underperforms this data access scheme for sequential access scanning, and LRUs do not serve any caching function when the size of the scanned data exceeds the cache size.
And when the LFU carries out data block replacement, selecting the data block which is accessed least in the cache data for replacement. However, this algorithm performs poorly in active set time varying access patterns, with no expiration time limit.
In view of the technical problem, the present application provides a page data caching method, a page data caching apparatus, a page caching data structure, and an electronic device, which divide a caching area into a fixed area, a high priority area, and a low priority area, and store page data of a website in the area with an improved caching policy based on the property of the page data to be cached when the website is accessed. Therefore, the problem that the existing browser cache replacement algorithm is not flexible enough in the actual application process can be solved, the cache reading and writing speed is improved, and the memory is saved.
Having described the general principles of the present application, various non-limiting embodiments of the present application will now be described with reference to the accompanying drawings.
Exemplary method
Fig. 1 illustrates a flowchart of a page data caching method according to an embodiment of the present application. As shown in fig. 1, a page data caching method according to an embodiment of the present application includes: s110, under the condition of visiting a website, searching a fixed area according to the identification information of the website; s120, responding to the situation that cache data do not exist in the fixed area, and caching page data of the website; s130, responding to the first page data cached in the fixed area, and retrieving a high-priority area according to a first pointing address of the first page data; s140, responding to the second page data cached in the high-priority area, and judging whether the second page data is the latest data or not according to the update time field of the current page of the website; s150, responding to the fact that the second page data are not the latest data, and caching the page data of the website; s160, in response to the first page data cached in the fixed area and the cache data not existing in the high-priority area, retrieving the low-priority area according to the second directional address of the first page data; s170, responding to the third page data cached in the low-priority area, and judging whether the third page data is the latest data or not according to the update time field of the current page of the website; and S180, responding to the third page data not being the latest data, and caching the page data of the website.
In step S110, in the case of accessing a website, a fixed area is retrieved based on identification information of the website. Whether the user has visited the website before can be determined by the identification information of the website, for example, the identification field, URL, etc. of the website.
In step S120, in response to that no cache data exists in the fixed area, caching page data of the website. That is, in a case where a user accesses a website for the first time through a browser and the browser parses page data of a page of the website being opened, if cache data with respect to the website, that is, page data of the page being opened, does not exist in the fixed area, the page data of the website needs to be cached.
In the page data caching method according to the embodiment of the application, a caching area for caching page data is divided into a fixed area, a high priority area and a low priority area, and page data with different properties are stored in the areas. In the fixed area, page data that does not change frequently, such as page template data or the like, is stored. And in the high-priority area and the low-priority area, page data that changes frequently, such as specific content data on the page, is stored. Specifically, the change rate of page data is determined, and a storage space and a field are allocated for the page data, on the premise of caching a website, the cache content of the website is marked, and the marking is based on whether the data changes frequently, the data which does not change frequently is stored in a fixed area, the data which changes frequently is stored in a variable area, and the variable area can be subdivided into two areas, namely a high priority area and a low priority area. The storage of page data in the high priority region and the low priority region will be further explained below.
Therefore, in the page data caching method according to the embodiment of the application, caching the page data of the website in response to the absence of the cache data in the fixed area includes: marking whether the page data to be cached of the website is frequently changed; caching the page data which is not frequently changed into the fixed area; and caching frequently changing page data into at least one of the high priority region and the low priority region.
In step S130, in response to the first page data cached in the fixed area, the high priority area is retrieved according to the first pointing address of the first page data. Here, in the page data caching method according to the embodiment of the present application, when caching page data of a website, the page data is actually divided into two parts, namely, a frequently-changed part and an infrequently-changed part. Therefore, when storing the infrequently-changed parts in the fixed area, in order to facilitate the resolution of the page data, an index to the frequently-changed parts, such as a pointing address, is stored at the same time, so that the browser can conveniently retrieve all the cached page data when resolving the data.
In step S140, in response to the second page data cached in the high-priority area, it is determined whether the second page data is the latest data according to the update time field of the current page of the website. That is, if the corresponding frequently-changed part, i.e., the second page data, is retrieved in the high-priority region according to the pointing address corresponding to the infrequently-changed part, it is determined whether the second page data is the latest data according to the update time field of the current page of the website. Specifically, if the update time of the current page is later than the caching time of the second page data, it indicates that the page has been updated after the second page data is cached, so that the second page data conflicts with or is inconsistent with the page data of the current page.
In step S150, in response to the second page data not being the latest data, caching the page data of the website. That is, if the second page data is not the latest data, indicating that the web page data of the accessed website has changed with respect to the cached page data, the cached page data needs to be replaced with the updated page data. Here, as can be understood by those skilled in the art, when storing the web page data in the cache area, if the stored page data conflicts with the page data of the current page, the stored page data is replaced with the page data of the current page, i.e., the stored page data is deleted and the page data of the current page is stored.
Further, if the second page data is the latest data, the second page data may be directly retrieved from the high priority region and a page may be rendered based on the second page data.
That is to say, in the page data caching method according to the embodiment of the present application, the method further includes: in response to the second page data being the most recent data, rendering pages of the website directly with the second page data.
In step S160, in response to the first page data cached in the fixed area and the absence of the cached data in the high priority area, the low priority area is retrieved according to the second directional address of the first page data. That is, if the cached first page data exists within the fixed region, indicating that the current page was previously accessed, and if page data does not exist in the high priority region relative to the page of the website that is being opened, then the low priority region is further retrieved. Similarly to the previous step S130, the low priority area is retrieved based on the index, e.g. the second directional address, of the first page data with respect to the low priority area.
In step S170, in response to the cached third page data existing in the low-priority area, it is determined whether the third page data is the latest data according to the update time field of the current page of the website.
And in step S180, in response to the third page data not being the latest data, caching the page data of the website.
The steps S170 and S180 are similar to the steps S140 and S150 described above, and are not described again to avoid redundancy.
In the page data caching method according to the embodiment of the application, in steps S150 and S180, the latest page data may be directly cached in the corresponding cache region, for example, in the high priority region in step S150, and in the low priority region in step S180. However, in order to enable the caching policy to flexibly cope with the data situation, the page data may be selectively cached in the high priority region and the low priority region further based on the access frequency of the page.
In particular, if a page is accessed more frequently, the page data may be cached in the high priority region for quick retrieval upon subsequent accesses, and, relatively, if a page is accessed less frequently, the page data may be cached in the low priority region.
In one example, in a page data caching method according to an embodiment of the present application, caching page data of the website in response to the second page data not being the latest data includes: determining whether a time interval between a current access time and a last access time of the page is greater than a predetermined time threshold; caching the page data into the tail part of the high priority area in response to the time interval being smaller than the preset time threshold; and in response to the time interval being greater than the predetermined time threshold, caching the page data into a header of the low priority region.
Similarly, in the page data caching method according to the embodiment of the present application, caching the page data of the website in response to the third page data not being the latest data includes: determining whether a time interval between a current access time and a last access time of the page is greater than a predetermined time threshold; caching the page data into the tail part of the high priority area in response to the time interval being smaller than the preset time threshold; and in response to the time interval being greater than the predetermined time threshold, caching the page data into a header of the low priority region.
In addition, if the page data cached in the low priority region is already the latest page data, a page may be directly rendered with the page data similarly to the page data cached in the high priority region.
That is to say, in the page data caching method according to the embodiment of the present application, the method further includes: in response to the third page data being the most recent data, rendering pages of the website directly with the third page data.
In this case, the priority of the third page data may be further increased in order to increase the retrieval speed at the time of subsequent access.
That is to say, in the page data caching method according to the embodiment of the present application, the method further includes: storing the third page data in a tail of the high priority region in response to the third page data being the most recent data.
Fig. 2 is a flowchart illustrating an example of a page data caching method according to an embodiment of the present application. As shown in fig. 2, the example of the page data caching method according to the embodiment of the present application includes: s201, accessing a page of a website; s202, judging whether the fixed area has cache data or not according to the identification field; s203, in response to the judgment of No in the step S202, namely that no cache data exists in the fixed area, caching page data of the page of the website which is being visited; s204, in response to the judgment of the step S202, judging whether the cache data exists in the high-priority area; s205, in response to the determination of the step S204 being "yes", that is, the cached data exists in the high-priority area, determining whether the cached page data in the high-priority area is the latest page data according to the update time field of the current page; s206, in response to the determination of step S205 being "yes", that is, the cached page data in the high priority region is the latest page data, rendering the page with the page data; s207, in response to the determination of "no" in step S205, that is, the cached page data in the high priority region is not the latest page data, replacing the cached page data with the page data of the current page being opened; s208, in response to the determination of the step S204 being "No", that is, no cache data exists in the high priority area, determining whether cache data exists in the low priority area; s209, in response to the determination of the step S208 being "yes", that is, the cached data exists in the low-priority area, determining whether the cached page data in the low-priority area is the latest page data according to the update time field of the current page; s210, in response to the determination of the step S209 being "yes", that is, the cached page data in the low-priority area is the latest page data, rendering a page with the page data, and caching the page data in the high-priority area; s211, in response to the determination of step S209 being no, i.e., the cached page data in the low priority area is not the latest page data, replacing the cached page data with the page data of the current page being opened.
In addition, in the page data caching method according to the embodiment of the application, the page data may be determined to be stored in the high priority region or the low priority region based on other parameters than the page access interval time. In the embodiment of the present application, access to the page data in the cache area when the browser opens the page of the website is defined as resolution of the page data, which corresponds to both the case of rendering the page with the page data when the page data is the latest data and the case of replacing the cached page data with the latest data when the page data is not the latest data in the above-described case.
That is, in both cases described above, it is possible to re-determine that page data is stored in the high priority region or the low priority region based on a predetermined policy, so that it is possible to flexibly cope with an actual situation.
Therefore, in the page data caching method according to the embodiment of the application, the method further includes: judging whether second page data cached in the high-priority area meets a preset standard or not during page data analysis; in response to the second page data satisfying a predetermined criterion, maintaining caching of the second page data in the high priority region; and in response to the second page data not meeting a predetermined criterion, caching the second page data in the low priority region.
Moreover, in the page data caching method according to the embodiment of the present application, the method further includes: judging whether third page data cached in the low-priority area meets a preset standard or not during page data analysis; caching the third page data into the high priority region in response to the third page data satisfying a predetermined criterion; and, in response to the third page data not meeting a predetermined criterion, maintaining caching of the third page data in the low priority region.
In another example, instead of setting the priority of the page data cached in the cache region, the priority of the page may be determined according to a predetermined criterion when the page is opened, so that the page data of the page determined as the high priority is cached in the high priority region, and the page data of the page determined as the low priority is cached in the low priority region.
In the above criteria, the access frequency of the page may be considered, such as the time interval of the last two accesses of the page, or the dwell time of the user on the page, or the number of times the user clicked on the page, or a combination thereof. For example, when the user access is judged, the dwell time of the user for accessing the page and the number of times of clicking the page are monitored, if the number of clicks is higher than the dwell time of accessing the page, the priority of the page is increased, and the priority of the page with longer dwell time and less clicks is reduced.
That is, in the page data caching method according to the embodiment of the present application, the predetermined criterion is based on at least one of: the analysis time interval of the page data, the user access dwell time corresponding to the page data and the user access click times corresponding to the page data.
In addition, in the page data caching method according to the embodiment of the application, a cache data deletion mechanism may be further configured. Specifically, it may be determined whether the cache reaches the critical range, and in the case that the cache reaches the critical range, the cache data at the tail of the low-priority area is deleted. Alternatively, the page data of the page with the longest retention time but the smallest number of clicks may be deleted according to a criterion similar to the above when the cache reaches the critical range.
Fig. 3 is a flowchart illustrating an example of processing cache data according to priority in a page data caching method according to an embodiment of the present application. As shown in fig. 3, a process of processing cache data according to priority in the page data caching method according to the embodiment of the present application includes: s301, judging whether the priority of the cache data in the low-priority area is improved; s302, in response to the judgment result of the step S301 being "YES", that is, the priority of the cache data in the low priority area is increased, caching the cache data into the high priority area; s303, in response to the judgment result of the step S301 being NO, namely the priority of the cache data in the low-priority area is reduced, deleting the cache data; s304, judging whether the priority of the cache data in the high-priority area is improved; s305, in response to the determination result of step S304 being yes, that is, the priority of the cache data in the high priority area is increased, keeping the cache data stored in the high priority area; and S306, in response to the judgment result of the step S304 being NO, namely the priority of the cache data in the high priority area is reduced, caching the cache data in the low priority area.
Exemplary devices
Fig. 4 illustrates a block diagram of a page data caching apparatus according to an embodiment of the present application.
As shown in fig. 4, the page data caching apparatus 400 according to the embodiment of the present application includes: a first data cache unit 410, configured to retrieve a fixed area according to identification information of a website when the website is accessed; responding to the absence of cache data in the fixed area, and caching page data of the website; a second data cache unit 420, configured to, in response to the first page data cached in the fixed area, retrieve a high priority area according to a first pointing address of the first page data; responding to second page data cached in the high-priority area, and judging whether the second page data is the latest data or not according to an update time field of the current page of the website; caching the page data of the website in response to the second page data not being the latest data; and a third data cache unit 430, configured to, in response to that there is cached first page data in the fixed area and there is no cached data in the high priority area, retrieve a low priority area according to a second directional address of the first page data; responding to the third page data cached in the low-priority area, and judging whether the third page data is the latest data or not according to the update time field of the current page of the website; and caching the page data of the website in response to the third page data not being the latest data.
In an example, in the above-mentioned page data caching apparatus 400, the first data caching unit 410 is configured to: marking whether the page data to be cached of the website is frequently changed; caching the page data which is not frequently changed into the fixed area; and the high-priority cache unit and the low-priority cache unit are used for caching frequently-changed page data into at least one of the high-priority area and the low-priority area.
In an example, in the above page data caching apparatus 400, further comprising: and the page rendering unit is used for directly rendering the page of the website by the second page data in response to the second page data being the latest data.
In an example, in the above page data caching apparatus 400, the second data caching unit 420 is configured to: determining whether a time interval between a current access time and a last access time of the page is greater than a predetermined time threshold; caching the page data into the tail part of the high priority area in response to the time interval being smaller than the preset time threshold; and in response to the time interval being greater than the predetermined time threshold, caching the page data into a header of the low priority region.
In an example, in the above page data caching apparatus 400, further comprising: and the page rendering unit is used for directly rendering the page of the website by the third page data in response to the third page data being the latest data.
In one example, in the above-mentioned page data buffering apparatus 400, the third data buffering unit 430 is further configured to store the third page data in the tail of the high priority area.
In an example, in the above page data caching apparatus 400, the second data caching unit 420 is configured to: judging whether second page data cached in the high-priority area meets a preset standard or not during page data analysis; in response to the second page data satisfying a predetermined criterion, maintaining caching of the second page data in the high priority region; and in response to the second page data not meeting a predetermined criterion, caching the second page data in the low priority region.
In an example, in the above-mentioned page data caching apparatus 400, the third page caching unit 430 is configured to: judging whether third page data cached in the low-priority area meets a preset standard or not during page data analysis; caching the third page data into the high priority region in response to the third page data satisfying a predetermined criterion; and, in response to the third page data not meeting a predetermined criterion, maintaining caching of the third page data in the low priority region.
In one example, in the above page data caching apparatus 400, the predetermined criterion is based on at least one of: the analysis time interval of the page data, the user access dwell time corresponding to the page data and the user access click times corresponding to the page data.
Here, it will be understood by those skilled in the art that the specific functions and operations of the respective units and modules in the above-described page data caching apparatus 400 have been described in detail in the page data caching method described above with reference to fig. 1 to 3, and thus, a repetitive description thereof will be omitted.
As described above, the page data caching apparatus 400 according to the embodiment of the present application can be implemented in various terminal devices installed with a browser, such as a smart phone, a tablet, a desktop computer, or a notebook computer. In one example, the page data caching apparatus 400 according to the embodiment of the present application may be integrated into the terminal device as a software module and/or a hardware module. For example, the page data caching apparatus 400 may be a software module in an operating system of the terminal device, or may be an application developed for the terminal device; of course, the page data caching apparatus 400 may also be one of many hardware modules of the terminal device.
Alternatively, in another example, the page data buffering apparatus 400 and the terminal device may also be separate devices, and the page data buffering apparatus 400 may be connected to the terminal device through a wired and/or wireless network and transmit the interaction information according to an agreed data format.
Exemplary data Structure
Fig. 5 illustrates a schematic diagram of a page cache data structure according to an embodiment of the present application.
As shown in fig. 5, a page cache data structure 500 according to an embodiment of the present application includes: a fixed area 510, configured to cache infrequently changed fixed page data in page data to be cached in the website; a high priority region 520, configured to cache high priority page data in frequently changed page data of the page data to be cached; and a low priority area 530 for caching low priority page data among frequently changed page data among the page data to be cached; wherein the high priority page data, when parsed, determines whether a predetermined criterion is met and in response to meeting the predetermined criterion remains in the high priority zone and in response to not meeting the predetermined criterion is cached in the low priority zone; and determining whether predetermined criteria are met when the low priority page data is parsed and caching in the high priority zone in response to meeting the predetermined criteria and retaining in the low priority zone in response to not meeting the predetermined criteria.
Wherein the above-mentioned fixed area 510 points to the frequently changed portions of the corresponding page data stored in the high priority area 520 and the low priority area 530 through the first pointing address and the second pointing address of the infrequently changed portions of the page data stored therein.
In one example, in the above-described page cache data structure 500, the FixedPage data is used to: retrieving a fixed area according to identification information of a website under the condition of accessing the website; and caching in response to the fixed region not having cached data; the high priority page data is for: in response to the fixed area having cached fixed page data, retrieving a high priority region according to a first pointing address of the fixed page data; responding to the high-priority page data cached in the high-priority area, and judging whether the high-priority page data is the latest data or not according to the update time field of the current page of the website; and, in response to the high priority page data not being the most recent data, updating the high priority page data and/or the low priority page data with page data of the website; the low priority page data is for: in response to the fixed area having cached first page data and the high-priority area not having the high-priority page data, retrieving a low-priority area according to a second directional address of the fixed page data; responding to the low-priority page data cached in the low-priority area, and judging whether the low-priority page data is the latest data or not according to the update time field of the current page of the website; and in response to the low-priority page data not being the most recent data, updating the low-priority page data and/or the high-priority page data with page data of the website.
In one example, in the above-described page cache data structure 500, the high priority page data is used to render pages of the website directly therewith in response to being the most recent data.
In one example, in the above-described page cache data structure 500, in response to the high-priority page data not being the most recent data, updating the high-priority page data and/or the low-priority page data with the page data of the website includes: determining whether a time interval between a current access time and a last access time of the page is greater than a predetermined time threshold; in response to the time interval being less than the predetermined time threshold, caching the page data into the tail of the high priority region to update the high priority page data; and in response to the time interval being greater than the predetermined time threshold, caching the page data into a header of the low priority region to update the low priority page data.
In one example, in the above-described page cache data structure 500, the low priority page data is used to render pages of the website directly therewith in response to being the most recent data.
In one example, in the above page cache data structure 500, further includes: and storing the low-priority page data into the tail part of the high-priority area so as to update the low-priority page data and the high-priority page data.
In one example, in the above-described page cache data structure 500, the predetermined criterion is based on at least one of: the analysis time interval of the page data, the user access dwell time corresponding to the page data and the user access click times corresponding to the page data.
Here, those skilled in the art can understand that other details of the page cache data structure according to the embodiment of the present application are completely the same as the corresponding details described in the page data caching method according to the embodiment of the present application, and are not described again to avoid redundancy.
Exemplary electronic device
Next, an electronic apparatus according to an embodiment of the present application is described with reference to fig. 6.
FIG. 6 illustrates a block diagram of an electronic device in accordance with an embodiment of the present application.
As shown in fig. 6, the electronic device 10 includes one or more processors 11 and memory 12.
The processor 11 may be a Central Processing Unit (CPU) or other form of processing unit having data processing capabilities and/or instruction execution capabilities, and may control other components in the electronic device 10 to perform desired functions.
Memory 12 may include one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. The volatile memory may include, for example, Random Access Memory (RAM), cache memory (cache), and/or the like. The non-volatile memory may include, for example, Read Only Memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium and executed by the processor 11 to implement the page data caching methods of the various embodiments of the present application described above and/or other desired functions. Various contents such as template data, a pointing address, contents data, etc. may also be stored in the computer-readable storage medium.
In one example, the electronic device 10 may further include: an input device 13 and an output device 14, which are interconnected by a bus system and/or other form of connection mechanism (not shown).
The input device 13 may be, for example, a keyboard, a mouse, or the like.
The output device 14 may output various information, such as a web page rendered based on the page data, to the outside. The output devices 14 may include, for example, a display, speakers, a printer, and a communication network and its connected remote output devices, among others.
Of course, for simplicity, only some of the components of the electronic device 10 relevant to the present application are shown in fig. 6, and components such as buses, input/output interfaces, and the like are omitted. In addition, the electronic device 10 may include any other suitable components depending on the particular application.
Exemplary computer program product and computer-readable storage Medium
In addition to the above-described methods and apparatus, embodiments of the present application may also be a computer program product comprising computer program instructions that, when executed by a processor, cause the processor to perform the steps in the page data caching method according to various embodiments of the present application described in the "exemplary methods" section of this specification, above.
The computer program product may be written with program code for performing the operations of embodiments of the present application in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server.
Furthermore, embodiments of the present application may also be a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, cause the processor to perform the steps in the page data caching method according to various embodiments of the present application described in the "exemplary methods" section above in this specification.
The computer-readable storage medium may take any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may include, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, 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.
The foregoing describes the general principles of the present application in conjunction with specific embodiments, however, it is noted that the advantages, effects, etc. mentioned in the present application are merely examples and are not limiting, and they should not be considered essential to the various embodiments of the present application. Furthermore, the foregoing disclosure of specific details is for the purpose of illustration and description and is not intended to be limiting, since the foregoing disclosure is not intended to be exhaustive or to limit the disclosure to the precise details disclosed.
The block diagrams of devices, apparatuses, systems referred to in this application are only given as illustrative examples and are not intended to require or imply that the connections, arrangements, configurations, etc. must be made in the manner shown in the block diagrams. These devices, apparatuses, devices, systems may be connected, arranged, configured in any manner, as will be appreciated by those skilled in the art. Words such as "including," "comprising," "having," and the like are open-ended words that mean "including, but not limited to," and are used interchangeably therewith. The words "or" and "as used herein mean, and are used interchangeably with, the word" and/or, "unless the context clearly dictates otherwise. The word "such as" is used herein to mean, and is used interchangeably with, the phrase "such as but not limited to".
It should also be noted that in the devices, apparatuses, and methods of the present application, the components or steps may be decomposed and/or recombined. These decompositions and/or recombinations are to be considered as equivalents of the present application.
The previous description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present application. Various modifications to these aspects will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other aspects without departing from the scope of the application. Thus, the present application is not intended to be limited to the aspects shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing description has been presented for purposes of illustration and description. Furthermore, the description is not intended to limit embodiments of the application to the form disclosed herein. While a number of example aspects and embodiments have been discussed above, those of skill in the art will recognize certain variations, modifications, alterations, additions and sub-combinations thereof.

Claims (11)

1. A page data caching method comprises the following steps:
under the condition of accessing a website, retrieving a fixed area according to the identification information of the website;
responding to the absence of cache data in the fixed area, and caching page data of the website;
in response to the first page data cached in the fixed area, retrieving a high priority area according to a first pointing address of the first page data;
responding to second page data cached in the high-priority area, and judging whether the second page data is the latest data or not according to an update time field of the current page of the website;
caching the page data of the website in response to the second page data not being the latest data;
in response to the fixed region having cached first page data and the high priority region not having cached data, retrieving a low priority region according to a second directional address of the first page data;
responding to the third page data cached in the low-priority area, and judging whether the third page data is the latest data or not according to the update time field of the current page of the website; and
and in response to the third page data not being the latest data, caching the page data of the website.
2. The page data caching method of claim 1, wherein caching the page data of the website in response to the fixed region not having cached data comprises:
marking whether the page data to be cached of the website is frequently changed;
caching the page data which is not frequently changed into the fixed area; and
caching frequently changing page data into at least one of the high priority region and the low priority region.
3. The page data caching method of claim 1, further comprising:
in response to the second page data being the most recent data, rendering pages of the website directly with the second page data.
4. The page data caching method of claim 1, wherein caching page data of the website in response to the second page data not being the most recent data comprises:
determining whether a time interval between a current access time and a last access time of the page is greater than a predetermined time threshold;
caching the page data into the tail part of the high priority area in response to the time interval being smaller than the preset time threshold; and
in response to the time interval being greater than the predetermined time threshold, caching the page data into a header of the low priority region.
5. The page data caching method of claim 1, further comprising:
in response to the third page data being the most recent data, rendering pages of the website directly with the third page data.
6. The page data caching method of claim 5, further comprising:
and storing the third page data into the tail part of the high priority area.
7. The page data caching method of claim 1, further comprising:
judging whether second page data cached in the high-priority area meets a preset standard or not during page data analysis;
in response to the second page data satisfying a predetermined criterion, maintaining caching of the second page data in the high priority region; and
buffering the second page data in the low priority region in response to the second page data not meeting a predetermined criterion.
8. The page data caching method of claim 1, further comprising:
judging whether third page data cached in the low-priority area meets a preset standard or not during page data analysis;
caching the third page data into the high priority region in response to the third page data satisfying a predetermined criterion; and
in response to the third page data not meeting a predetermined criterion, maintaining caching of the third page data in the low priority zone.
9. A page data caching method according to claim 7 or 8, wherein said predetermined criterion is based on at least one of: the analysis time interval of the page data, the user access dwell time corresponding to the page data and the user access click times corresponding to the page data.
10. A page data caching apparatus, comprising:
a first data buffer unit for
Under the condition of accessing a website, retrieving a fixed area according to the identification information of the website;
responding to the absence of cache data in the fixed area, and caching page data of the website;
a second data buffer unit for
In response to the first page data cached in the fixed area, retrieving a high priority area according to a first pointing address of the first page data;
responding to second page data cached in the high-priority area, and judging whether the second page data is the latest data or not according to an update time field of the current page of the website;
caching the page data of the website in response to the second page data not being the latest data; a third data buffer unit for
In response to the fixed region having cached first page data and the high priority region not having cached data, retrieving a low priority region according to a second directional address of the first page data;
responding to the third page data cached in the low-priority area, and judging whether the third page data is the latest data or not according to the update time field of the current page of the website; and
caching the page data of the website in response to the third page data not being the latest data;
the fixed area is used for caching infrequently changed fixed page data in the page data to be cached of the website;
the high-priority area is used for caching high-priority page data in frequently-changed page data in the page data to be cached; and
the low-priority area is used for caching low-priority page data in frequently-changed page data in the page data to be cached;
wherein the high priority page data, when parsed, determines whether a predetermined criterion is met and in response to meeting the predetermined criterion remains in the high priority zone and in response to not meeting the predetermined criterion is cached in the low priority zone; and
the low priority page data is parsed by determining whether predetermined criteria are met, and cached in the high priority zone in response to meeting predetermined criteria and retained in the low priority zone in response to not meeting predetermined criteria.
11. An electronic device, comprising:
a processor; and
memory having stored therein computer program instructions which, when executed by the processor, cause the processor to perform the page data caching method of any one of claims 1 to 9.
CN201810667915.6A 2018-06-26 2018-06-26 Page data caching method and device and electronic equipment Active CN108875036B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810667915.6A CN108875036B (en) 2018-06-26 2018-06-26 Page data caching method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810667915.6A CN108875036B (en) 2018-06-26 2018-06-26 Page data caching method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN108875036A CN108875036A (en) 2018-11-23
CN108875036B true CN108875036B (en) 2021-03-16

Family

ID=64295788

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810667915.6A Active CN108875036B (en) 2018-06-26 2018-06-26 Page data caching method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN108875036B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109492020A (en) * 2018-11-26 2019-03-19 北京知道创宇信息技术有限公司 A kind of data cache method, device, electronic equipment and storage medium
CN114556335A (en) * 2019-10-21 2022-05-27 华为技术有限公司 On-chip cache and integrated chip

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6427189B1 (en) * 2000-02-21 2002-07-30 Hewlett-Packard Company Multiple issue algorithm with over subscription avoidance feature to get high bandwidth through cache pipeline
CN102955786A (en) * 2011-08-22 2013-03-06 北大方正集团有限公司 Method and system for caching and distributing dynamic webpage data
CN105589919A (en) * 2015-09-18 2016-05-18 广州市动景计算机科技有限公司 Method and device for processing webpage resource
CN105930530A (en) * 2016-06-13 2016-09-07 乐视控股(北京)有限公司 Mobile terminal page caching method and system
CN106936727A (en) * 2015-12-30 2017-07-07 中国移动通信集团云南有限公司 A kind of Webpage display process and device
CN107451146A (en) * 2016-05-31 2017-12-08 北京京东尚科信息技术有限公司 The method of data and data cached multi-level buffer device are read using multi-level buffer

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140143271A1 (en) * 2012-11-21 2014-05-22 General Electric Company Multi-level medical image viewer memory management

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6427189B1 (en) * 2000-02-21 2002-07-30 Hewlett-Packard Company Multiple issue algorithm with over subscription avoidance feature to get high bandwidth through cache pipeline
CN102955786A (en) * 2011-08-22 2013-03-06 北大方正集团有限公司 Method and system for caching and distributing dynamic webpage data
CN105589919A (en) * 2015-09-18 2016-05-18 广州市动景计算机科技有限公司 Method and device for processing webpage resource
CN106936727A (en) * 2015-12-30 2017-07-07 中国移动通信集团云南有限公司 A kind of Webpage display process and device
CN107451146A (en) * 2016-05-31 2017-12-08 北京京东尚科信息技术有限公司 The method of data and data cached multi-level buffer device are read using multi-level buffer
CN105930530A (en) * 2016-06-13 2016-09-07 乐视控股(北京)有限公司 Mobile terminal page caching method and system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
An efficient technique for video content managing in Peer - to- Peer computing using multilevel cache and bandwidth based cluster;M.Narayanan;《IEEE》;20141231;第317-322页 *
Web系统高性能本地数据缓存实现机制;谢杰涛等;《计算机应用研究》;20140731;第31卷(第7期);第2074-2077页 *

Also Published As

Publication number Publication date
CN108875036A (en) 2018-11-23

Similar Documents

Publication Publication Date Title
KR100908746B1 (en) Systems and computer-readable media for managing objects stored in the cache
US6807607B1 (en) Cache memory management system and method
CN107870728B (en) Method and apparatus for moving data
US8972690B2 (en) Methods and apparatuses for usage based allocation block size tuning
US8504792B2 (en) Methods and apparatuses to allocate file storage via tree representations of a bitmap
US20100318745A1 (en) Dynamic Content Caching and Retrieval
US10649905B2 (en) Method and apparatus for storing data
CN108090078B (en) Document online preview method and device, storage medium and electronic equipment
US11314689B2 (en) Method, apparatus, and computer program product for indexing a file
CN110737399A (en) Method, apparatus and computer program product for managing a storage system
CN111352861A (en) Memory compression method and device and electronic equipment
CN107544926B (en) Processing system and memory access method thereof
US11113195B2 (en) Method, device and computer program product for cache-based index mapping and data access
CN112905111A (en) Data caching method and data caching device
CN112214420A (en) Data caching method, storage control device and storage equipment
CN108875036B (en) Page data caching method and device and electronic equipment
US7496722B2 (en) Memory mapped page priorities
CN110765036B (en) Method and device for managing metadata at a control device
US20210286730A1 (en) Method, electronic device and computer program product for managing cache
CN111708720A (en) Data caching method, device, equipment and medium
US11093389B2 (en) Method, apparatus, and computer program product for managing storage system
CN112148736A (en) Method, device and storage medium for caching data
CN113094392A (en) Data caching method and device
CN110941595B (en) File system access method and device
US9858204B2 (en) Cache device, cache system, and cache method

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 100102 Beijing Chaoyang District Wangjing Lizi Zhongyuan two district 203, level 1102.

Applicant after: BEIJING YONG'AN COMMUNICATION TECHNOLOGY Co.,Ltd.

Address before: 100081 room 901, Fuhai international port 17, Da Liu Shu Lu, Haidian District, Beijing.

Applicant before: BEIJING YONG'AN COMMUNICATION TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant