Page cache scheduling method, device, equipment and medium for layout documents

By classifying and hierarchically cached the relevant pages of the layout document and chunking processing during rendering, the problem of slow rendering speed of layout documents in the prior art is solved, efficient page turn, viewing and jump rendering is achieved, and a smooth user experience is provided.

CN119739935APending Publication Date: 2025-04-01TONGFANG KNOWLEDGE DIGITAL PUBLISHING TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411664311.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-20
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

The prior art lacks effective page cache scheduling methods when processing layout documents, resulting in slow rendering speed when turning pages, looking back and jumping, which cannot meet the user's needs for fast response.

Method used

By performing classification and hierarchical cache processing on the relevant pages of the layout document, the current page, adjacent pages and associated pages are cached to the corresponding cache, and blocking is performed during rendering, giving priority to rendering the chunking of the user's visual area.

Benefits of technology

It realizes efficient rendering when turning pages, viewing and jumping, reduces resource usage, improves display efficiency, and provides a smooth reading experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119739935A_ABST
    Figure CN119739935A_ABST
Patent Text Reader

Abstract

The present application provides a page cache scheduling method, device, equipment and medium for layout documents, and relates to the field of document processing technology. The method includes: in response to a user's request to display the current page of the layout document, classifying and caching the relevant pages of the layout document to cache the relevant pages of the layout document into a corresponding buffer; wherein the relevant pages of the layout document include the current page of the layout document and the associated pages; processing the content of the current page in blocks, and obtaining the blocks of the user-visible area of ​​the current page from the buffer corresponding to the current page for rendering. The present application classifies and caches the relevant pages according to the degree of association, ensures the rendering speed of the layout document when turning pages, reviewing and jumping, and realizes a smooth reading user experience. Block rendering is performed during rendering, and the user-visible area in the layout document is displayed first, reducing unnecessary resource occupation and improving display efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of document processing, and in particular to a page cache scheduling method, device, computer equipment and readable storage medium for layout documents. Background Art

[0002] As a reliable way to present information, layout documents ensure the accuracy and consistency of document content through fixed layouts and formats, and are widely used in publishing, academia, law, business and other fields. For layout documents with a large number of images, complex typesetting or long documents, problems such as long buffering time and page freezes often occur when reading and browsing. Most related technologies use a simple caching mechanism, which simply adds the current page and adjacent pages to the queue cache without performing cache prediction, cache classification and dynamic priority adjustment, resulting in a slow speed when displaying related pages, and cannot achieve a fast response to user needs such as fast page turning, replaying or random jumps. Summary of the invention

[0003] In view of this, the present application provides a page cache scheduling method, apparatus, computer device and readable storage medium for layout documents, which ensure the rendering speed of layout documents when turning pages, reviewing and jumping, and achieve a smooth reading user experience.

[0004] In a first aspect, an embodiment of the present application provides a page cache scheduling method for layout documents, comprising:

[0005] In response to a user's request to display a current page of a layout document, classify and grade the relevant pages of the layout document to cache the relevant pages of the layout document into a corresponding buffer; wherein the relevant pages of the layout document include the current page of the layout document and associated pages of the layout document;

[0006] The content of the current page is processed in blocks, and blocks of a user-visible area of ​​the current page are obtained from a buffer corresponding to the current page for rendering.

[0007] In a second aspect, an embodiment of the present application provides a page cache scheduling device for layout documents, including:

[0008] A cache processing module, for responding to a user's request to display the current page of a layout document, to classify and grade the relevant pages of the layout document so as to cache the relevant pages of the layout document into a corresponding cache; wherein the relevant pages of the layout document include the current page of the layout document and the associated pages of the layout document;

[0009] The rendering module is used to process the content of the current page in blocks, and obtain the blocks of the user visible area of ​​the current page from the buffer corresponding to the current page for rendering.

[0010] In a third aspect, an embodiment of the present application provides a computer device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be executed on the processor, and when the programs or instructions are executed by the processor, the steps of the method of the first aspect are implemented.

[0011] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method of the first aspect are implemented.

[0012] In an embodiment of the present application, after receiving a display request from a user for the current page of a layout document, the pages of the layout document, including the current page, the adjacent pages of the current page, and the associated pages, are subjected to classified cache processing, so that the contents of different types of pages such as the current page, the adjacent pages, and the associated pages are cached in a corresponding buffer. Further, the current page cached in the corresponding buffer is rendered and displayed, and when the associated page is rendered and displayed, the content is obtained from the corresponding buffer for rendering and display. When rendering, the page content is processed in blocks and rendered in blocks. That is, rendering is performed only when the user views the block content, so as to realize the display of the user's visible area.

[0013] In the embodiment of the present application, different types of pages of the layout document are classified and pre-cached to ensure the rendering speed of the layout document when turning pages, reviewing and jumping, and to achieve a smooth reading user experience. In addition, block rendering is performed during rendering, and the user-visible area in the layout document is displayed first, reducing unnecessary resource usage and improving display efficiency.

[0014] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0016] Figure 1 One of the flow diagrams of the page cache scheduling method for layout documents according to an embodiment of the present application is shown;

[0017] Figure 2 A second flow chart of a page cache scheduling method for layout documents according to an embodiment of the present application is shown;

[0018] Figure 3 The third flowchart of the page cache scheduling method for layout documents according to the embodiment of the present application is shown;

[0019] Figure 4 A fourth flow chart of a page cache scheduling method for layout documents according to an embodiment of the present application is shown;

[0020] Figure 5 A structural block diagram of a page cache scheduling device for layout documents according to an embodiment of the present application is shown;

[0021] Figure 6 A structural block diagram of a computer device according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0022] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0023] The terms "first", "second", etc. in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0024] In conjunction with the accompanying drawings, the page cache scheduling method, apparatus, computer equipment and readable storage medium for layout documents provided in the embodiments of the present application are described in detail through specific embodiments and their application scenarios.

[0025] The present application embodiment provides a page cache scheduling method for layout documents, such as Figure 1 As shown, the method includes:

[0026] Step 101, in response to a user's request to display a current page of a layout document, classify and grade the relevant pages of the layout document to cache the relevant pages of the layout document into a corresponding buffer; wherein the relevant pages of the layout document include the current page of the layout document, adjacent pages of the current page, and associated pages;

[0027] Step 102, dividing the content of the current page into blocks, and obtaining blocks of the user visible area of ​​the current page from the buffer corresponding to the current page for rendering.

[0028] In this embodiment, after receiving a user's request to display the current page of a layout document, the related pages of the layout document, including the current page, the adjacent pages of the current page, and the associated pages, are classified and cached, so that the contents of different types of pages such as the current page, the adjacent pages, and the associated pages are cached in the corresponding cache. The type of the associated page also indicates the degree of association between the associated page and the current page. The related pages are classified and cached according to the degree of association. The layout documents include PDF, CAJ, and other layout documents. Furthermore, the current page cached in the corresponding cache is rendered and displayed, and when the associated page is rendered and displayed, the content is obtained from the corresponding cache for rendering and display.

[0029] It should be noted that when rendering, the page content is processed in blocks and rendered in blocks. That is, rendering is performed only when the user views the block content to display the user's visible area. For example, for a page containing a large number of images or complex layouts, it is not necessary to load all of the large number of images or complex layouts, but to load the content in the user's visible area first, thereby reducing unnecessary resource usage and improving display efficiency.

[0030] In the embodiment of the present application, different types of pages of the layout document are classified and pre-cached to ensure the rendering speed of the layout document when turning pages, reviewing and jumping, and to achieve a smooth reading user experience. In addition, block rendering is performed during rendering, and the user-visible area in the layout document is displayed first, reducing unnecessary resource usage and improving display efficiency.

[0031] In one embodiment of the present application, the relevant pages of the layout document are classified and cached to cache the relevant pages of the layout document into corresponding caches, including:

[0032] According to the page type of the relevant page of the layout document, the relevant page is cached in a cache corresponding to the page type; wherein the cache priorities of the caches corresponding to different page types are different; and,

[0033] According to the page type and page related information of the relevant page, the cache priority of the relevant page is calculated, and the cache order of the relevant page in the cache is determined based on the cache priority.

[0034] In this embodiment, a classification cache strategy and a hierarchical cache strategy for the content of the relevant pages of the layout document are provided. Specifically, according to the page type of the relevant pages of the layout document, the classification cache of the relevant pages is performed, that is, the content of the relevant pages is cached in the cache corresponding to the page type. After the relevant pages of different types are determined to the corresponding cache, the cache priority of the relevant pages is determined in the same cache according to the hierarchical cache strategy, and the cache priority of the relevant pages can guide the cache order of the page content in its corresponding cache.

[0035] In one embodiment of the present application, according to the page type of the relevant pages of the layout document, the relevant pages are cached in a cache corresponding to the page type, including: if the relevant page is the current page and / or an adjacent page of the current page, the relevant page is cached in a first cache; if the relevant page is an interval page of the current page and / or a jump page of the current page, the relevant page is cached in a second cache; if the relevant page is a frequently visited page, an importance page and / or a predicted page, the relevant page is cached in a third cache.

[0036] Related pages of the layout document include the current page, adjacent pages of the current page, pages separated from the current page, jump pages of the current page, frequently visited pages, importance pages, predicted pages and other page types, among which, separated pages include next adjacent pages, pages separated from the current page by multiple pages, etc. Frequently visited pages may refer to pages visited by users at a frequency greater than a preset frequency within a period of time, important pages include homepages, abstracts, directories, references and other pages, and predicted pages are pages obtained by predicting pages based on relevant information.

[0037] According to the valid page range, the pages are divided into pages according to the boundary values ​​of each category of the layout document (the boundary values ​​are adjustable), and the relevant page content is cached to the corresponding cache based on the type of the relevant page. For example, Figure 2 As shown, the content of the current page and / or the adjacent pages of the current page is cached in the first cache, and the page is marked as LIMI HLC ; Cache the contents of the pages between the current page and / or the jump pages of the current page into the second cache, and mark the page as LIMI ILC ; Cache the contents of frequently visited pages, important pages and / or predicted pages in the third cache, and mark the page as LIMI LLC .

[0038] In one embodiment, different caches have different cache priorities. The cache priority of a cache can be understood as the loading speed and loading order of the cached content in the cache. The higher the cache priority, the faster the loading speed and the higher the loading order. The cache priority of the first cache is greater than the cache priority of the second cache, and the cache priority of the second cache is greater than the cache priority of the third cache. Using the highest priority cache to cache the content of the current page and / or the adjacent pages of the current page can ensure that it can be displayed quickly when the user turns pages normally; using a medium priority cache to cache the content of the interval pages of the current page and / or the jump pages of the current page to ensure the display speed when the user slides the display; using a low priority cache to cache the content of the user's frequently visited pages, important pages and / or predicted pages to ensure that the page can be loaded quickly when the user looks back or jumps.

[0039] In one embodiment, the first buffer may cache page content in a stack manner, and the second buffer and the third buffer may cache page content in a queue manner. Stack caching of the current page and adjacent pages may ensure that users can access them quickly.

[0040] In the embodiment of the present application, different types of page content are cached in caches of different priorities, which can meet the loading needs of different types of page content and achieve flexible caching.

[0041] In one embodiment of the present application, a prediction method for a predicted page is defined, and the prediction method for a predicted page includes: performing page prediction according to a user reading behavior and a document structure of a layout document to obtain a predicted page.

[0042] In this embodiment, page prediction is performed based on the user's reading behavior and the document structure of the layout document to obtain a predicted page. The user's reading behavior includes the user's page turning speed, the user's page jumping habits, etc. In one embodiment, a page prediction model can be used to perform page prediction. The document structure of the layout document, the user's reading behavior, and other data are input into the page prediction model to predict the predicted page.

[0043] In one embodiment, a page prediction model needs to be established in advance, and the specific steps include:

[0044] The first step is to collect and analyze sample data

[0045] Collect sample data such as page turning speed data, jump habit data, and document structure data. Collect user page turning speed data through page turning records when users read e-books or browse web pages, and analyze changes in user page turning speed in different time periods and different content types. Record user jump behaviors in documents, including clicking links, using bookmarks, returning to the previous page, etc., analyze the target page type, jump frequency, and page relationship before and after the jump. Extract structural information such as chapter division and title hierarchy of the document, and analyze the logical relationship, importance, and parts of the document content that users may be interested in.

[0046] The second step is feature extraction

[0047] The user's reading speed, reading rhythm and other features are extracted from the page turning speed data; the user's preferred page type, jump mode and other features are extracted from the jump habit data; the document's chapter importance, content attractiveness and other features are extracted from the document structure data.

[0048] Step 3: Model selection

[0049] Convolutional Neural Network (CNN) is used to predict the attention of different parts of the document (such as abstract, table of contents, keywords, first-level title, references, important chapters, etc.).

[0050] In some embodiments, other machine learning models or deep learning models may also be used, such as decision trees, random forests, recurrent neural networks, etc. Appropriate model structures and parameters may be selected according to the characteristics of the data and the prediction target.

[0051] Step 4: Model training and verification

[0052] The model is trained using sampled data and model parameters are adjusted to optimize prediction performance. The prediction accuracy of the model is evaluated through cross-validation.

[0053] Step 5: Model Optimization

[0054] Continuously collect new data on page turning speed, jump habit data, and document structure data, and update and optimize the page prediction model to improve prediction accuracy.

[0055] The embodiment of the present application predicts the pages that the user may visit based on the document structure of the layout document and the user's reading behavior, and caches the contents of these predicted pages in the corresponding cache in advance, which can quickly respond to user operations such as page turning or jumping, thereby reducing the waiting time for user operations and improving the user's reading experience.

[0056] In one embodiment of the present application, the page-related information includes at least one of the following: page importance, page access frequency, user sliding operation habits, and preset cache probability;

[0057] Calculate the cache priority of the relevant page based on the page type and page related information of the relevant page, including:

[0058] Determine page related information according to the page type of the related page;

[0059] Based on the page related information, calculate the cache priority of the related pages;

[0060] The formula for calculating the cache priority of the relevant pages is:

[0061]

[0062] Among them, P is the cache priority, p i is the value of the relevant information of the i-th page, m i is the weight coefficient of the relevant information of the i-th page, n is the number of relevant information of the page, i=1,2,......,n.

[0063] In this embodiment, the relevant pages are cached in a hierarchical manner according to the page type of the relevant page and the importance, access frequency, user sliding operation habits and preset cache probability of the relevant page. First, according to the page type of the relevant page, the page related information is determined, and the page related information corresponding to different types of relevant pages can be the same or different. Further, the cache priority of the relevant page is calculated according to the determined page related information. For example, for the current page or the adjacent page, the page related information includes the preset cache probability, that is, when the relevant page is the current page or the adjacent page, the cache priority of the page is directly determined according to the preset cache probability; for the interval page or the jump page, the page related information includes the access frequency and the user sliding operation habit, that is, when the relevant page is the interval page or the jump page, the cache priority of the page is determined according to the access frequency and the user sliding operation habit; for the user frequently visited page, the important page or the predicted page, the page related information includes the importance, the access frequency and the user sliding operation habit, that is, when the relevant page is the user frequently visited page, the important page or the predicted page, the cache priority of the page is determined according to the importance, the access frequency and the user sliding operation habit.

[0064] Among them, when the page related information includes page importance, the page importance score of the page is determined according to the page attributes of the relevant page, and the weight coefficient of the page importance score is determined according to whether the relevant page is a first-visit page or a jump page. Page attributes include attributes such as home page, abstract, directory, references, etc., and are graded from high to low according to the home page, abstract, directory, and references of the layout document. The importance score of each level decreases step by step, and the importance score is recorded as p1. The weight coefficient of the overall page importance is recorded as m1, including the first-open weight and the jump weight. Depending on whether the relevant page is a first-open page or a jump page, it has different weight coefficients, for example, the weight coefficients can be 10% and 0% respectively.

[0065] When the page-related information includes page access frequency, determine the page access frequency score of the relevant page, and determine the weight coefficient corresponding to the page access frequency score according to the page access frequency score. Memorize the high-frequency pages according to the user's access frequency to obtain the page access frequency score of the relevant page, and divide the page access frequency score into 10 grades according to size, and the value of each grade is recorded as p2, and the overall weight of the page access frequency is m2.

[0066] When the page-related information includes the user's sliding operation habits, the effective sliding mean of the user determined by the user's sliding operation habits is used to determine the number of related pages above and below the relevant page after the effective sliding mean acts on the relevant page, and the cache probability of the page is determined based on the number of related pages above and below, which is recorded as p3. Based on the effective sliding mean, it can be inferred how much page content the user tends to load or pre-fetch in advance when browsing the page. For example, if the user tends to swipe down quickly to view more content, more pages below may need to be pre-fetched; conversely, if the user often swipes up to review previous content, more pages above may need to be cached.

[0067] When the page related information includes a preset cache probability, the preset cache probability is the cache probability of the current page and / or the adjacent page of the current page, respectively denoted as p now and p minor .

[0068] According to the formula for calculating the cache priority of the relevant pages Calculate the cache priority of the relevant pages, It should be noted that in the above formula, the relevant information not involved in the page is 0.

[0069] Through the above method, based on the calculated cache priority of the page, the cache order of the page in the corresponding cache is determined to ensure that the page with a higher cache priority is cached earlier and is loaded first.

[0070] For example, Figure 3As shown, in one embodiment of the present application, the above method of the embodiment of the present application is applied in a PDF reader, firstly, the user's reading behavior is analyzed, the next page and the next few pages that the user may turn to are predicted, and the predicted pages are cached. The user's page display request is obtained, and it is determined whether the current page has been cached. If it has been cached, the current page is loaded and rendered. If it has not been cached, the data is cached according to the request to implement the three-level cache of the page, and a cache success signal is fed back after the cache is successful to implement page display.

[0071] In the embodiment of the present application, a stack is used to cache the current page that the user is reading, thereby ensuring the priority of the current page. At the same time, a queue is used in the background to preload the next page and associated pages associated with the current page, thereby ensuring that the next page content is cached in the memory when the user quickly turns the page, thereby avoiding loading delays when turning the page.

[0072] In one embodiment of the present application, the method further includes: when the cache capacity of the cache is greater than or equal to a preset threshold, eliminating the cache content of a target page in the cache, where the target page is a page that has not been accessed for more than a preset time.

[0073] In this embodiment, a dynamic scheduling strategy for the cache is provided. When the cache capacity of the cache is greater than or equal to a preset threshold, the contents of pages in the cache that have not been accessed for more than a preset time are deleted. The pages that have not been accessed for a long time are eliminated, including the timeout cache at the top of the highest priority cache stack, and the caches at the head and tail of the middle priority cache and the low priority cache that have exceeded the longest retention time. In one embodiment, for the low priority cache, only the head of the queue can be eliminated due to timeout.

[0074] In one embodiment, the process of eliminating the content of pages that have not been visited for a long time can be as follows: Figure 4 As shown, cache space is freed up by periodically cleaning pages that have not been accessed for a long time.

[0075] In this application, when a new page read request arrives, the cache level of each page is recalculated according to the above method of the embodiment of this application. According to the new cache priority and the current stack or queue of the cache, elimination processing is performed, and the new request is added to each cache stack or queue according to probability.

[0076] Based on the above dynamic scheduling strategy, asynchronous loading and priority scheduling can be achieved. By asynchronously loading the subsequent parts of the document in the background, while ensuring the fast loading of the current page, the subsequent content is gradually filled in to ensure that the pages required by users are always loaded into the cache first.

[0077] As a specific implementation of the above-mentioned page cache scheduling method for layout documents, the embodiment of the present application provides a page cache scheduling device for layout documents. Figure 5 As shown, the page cache scheduling device 500 for layout documents includes: a cache processing module 501 and a rendering module 502.

[0078] The cache processing module is used to respond to the user's request to display the current page of the layout document, and to perform classified and graded cache processing on the relevant pages of the layout document, so as to cache the relevant pages of the layout document into the corresponding cache; wherein the relevant pages of the layout document include the current page of the layout document, the adjacent pages of the current page, and the associated pages;

[0079] The rendering module is used to process the content of the current page in blocks, and obtain the blocks of the user visible area of ​​the current page from the buffer corresponding to the current page for rendering.

[0080] Furthermore, the cache processing module 501 is specifically used to: cache the relevant pages in the layout document into a cache corresponding to the page type according to the page type of the relevant pages; wherein the cache priorities of the caches corresponding to different page types are different; and, calculate the cache priority of the relevant pages according to the page type of the relevant pages and page-related information, and determine the cache order of the relevant pages in the cache based on the cache priority.

[0081] Furthermore, the cache processing module 501 is specifically configured to:

[0082] If the relevant page is the current page and / or an adjacent page of the current page, the relevant page is cached in the first cache;

[0083] If the relevant page is an interval page of the current page and / or a jump page of the current page, the relevant page is cached in the second cache;

[0084] If the relevant page is a user's frequently visited page, an important page and / or a predicted page, the relevant page is cached in the third cache.

[0085] Furthermore, the device also includes: a page prediction module, which is used to: perform page prediction according to the user's reading behavior and the document structure of the layout document to obtain a predicted page.

[0086] Furthermore, the page-related information includes at least one of the following: page importance, page access frequency, user sliding operation habits, and preset cache probability; the cache processing module 501 is specifically used to:

[0087] Determine page related information according to the page type of the related page;

[0088] Based on the page related information, calculate the cache priority of the related pages;

[0089] The formula for calculating the cache priority of the relevant pages is:

[0090]

[0091] Among them, P is the cache priority, p i is the value of the relevant information of the i-th page, m i is the weight coefficient of the relevant information of the i-th page, n is the number of relevant information of the page, i=1,2,......,n.

[0092] Furthermore, the cache processing module 501 is specifically configured to:

[0093] When the page-related information includes page importance, the page importance score of the relevant page is determined according to the page attributes of the relevant page, and the weight coefficient of the page importance score is determined according to whether the relevant page is a first-visit page or a jump page;

[0094] When the page-related information includes page access frequency, determining a page access frequency score of the relevant page, and determining a weight coefficient corresponding to the page access frequency score according to the page access frequency score;

[0095] When the page-related information includes the user's sliding operation habits, according to the user's effective sliding mean determined by the user's sliding operation habits, the amount of upper and lower related pages of the relevant page after the effective sliding mean acts on the relevant page is determined, and the cache probability of the relevant page is determined based on the upper and lower related pages;

[0096] When the page-related information includes a preset cache probability, the preset cache probability is a cache probability of the current page and / or a page adjacent to the current page.

[0097] Furthermore, the device also includes: a dynamic scheduling module, which is used to: when the cache capacity of the cache is greater than or equal to a preset threshold, eliminate the cache content of the target page in the cache, the target page being a page that has not been accessed for more than a preset time.

[0098] The page cache scheduling device 500 for layout documents in the embodiment of the present application can be a computer device, or a component in a computer device, such as an integrated circuit or a chip. The computer device can be a terminal, or other devices other than a terminal. Exemplarily, the computer device can be a mobile phone, a tablet computer, a laptop computer, a palmtop computer, a netbook, or a personal digital assistant (PDA), etc., and can also be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0099] The page cache scheduling device 500 for layout documents provided in the embodiment of the present application can achieve Figures 1 to 4 To avoid repetition, the various processes implemented by the embodiment of the page cache scheduling method for layout documents are not described here.

[0100] The present application also provides a computer device, such as Figure 6 As shown, the computer device 600 includes a processor 601 and a memory 602. The memory 602 stores programs or instructions that can be executed on the processor 601. When the program or instruction is executed by the processor 601, the various steps of the above-mentioned page cache scheduling method embodiment for layout documents are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0101] The memory 602 can be used to store software programs and various data. The memory 602 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 602 may include a volatile memory or a non-volatile memory, or the memory 602 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 602 in the embodiment of the present application includes but is not limited to these and any other memories suitable for page types.

[0102] The processor 601 may include one or more processing units; optionally, the processor 601 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 601.

[0103] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned page cache scheduling method embodiment for layout documents is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0104] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0105] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A page cache scheduling method for layout documents, characterized in that: include: In response to a user's request to display a current page of a layout document, classify and grade the relevant pages of the layout document to cache the relevant pages of the layout document into a corresponding buffer; wherein the relevant pages of the layout document include the current page of the layout document, adjacent pages of the current page, and associated pages; The content of the current page is processed in blocks, and blocks of a user-visible area of ​​the current page are obtained from a buffer corresponding to the current page for rendering.

2. The method according to claim 1, characterized in that The classifying and caching the relevant pages of the layout document to cache the relevant pages of the layout document into a corresponding buffer includes: According to the page type of the relevant page of the layout document, the relevant page is cached in a cache corresponding to the page type; wherein the cache priorities of the caches corresponding to different page types are different; and, The cache priority of the relevant page is calculated according to the page type and page related information of the relevant page, and the cache order of the relevant page in the cache is determined based on the cache priority.

3. The method according to claim 2, characterized in that The step of caching the relevant pages in a buffer corresponding to the page type according to the page type of the relevant pages of the layout document comprises: If the related page is the current page and / or an adjacent page of the current page, cache the related page in a first cache; If the related page is an interval page of the current page and / or a jump page of the current page, cache the related page in a second cache; If the related page is a user's frequently visited page, an important page and / or a predicted page, the related page is cached in a third cache.

4. The method according to claim 3, characterized in that The method further comprises: Page prediction is performed according to the user's reading behavior and the document structure of the layout document to obtain the predicted page.

5. The method according to claim 2, characterized in that: The page-related information includes at least one of the following: page importance, page access frequency, user sliding operation habits, and preset cache probability; The calculating the cache priority of the relevant page according to the page type and page related information of the relevant page includes: Determining the page related information according to the page type of the related page; Based on the page related information, calculating the cache priority of the related page; The formula for calculating the cache priority of the relevant page is: Wherein, P is the cache priority, p i is the value of the relevant information of the i-th page, m i is the weight coefficient of the relevant information of the i-th page, n is the number of relevant information of the page, i=1,2,......,n.

6. The method according to claim 5, characterized in that The method further comprises: When the page-related information includes page importance, determining the page importance score of the relevant page according to the page attribute of the relevant page, and determining the weight coefficient of the page importance score according to whether the relevant page is a first-visit page or a jump page; When the page related information includes page access frequency, determining a page access frequency score of the related page, and determining a weight coefficient corresponding to the page access frequency score according to the page access frequency score; When the page related information includes a user sliding operation habit, according to a user effective sliding mean determined by the user sliding operation habit, determining the amount of upper and lower related pages of the relevant page after the effective sliding mean acts on the relevant page, and determining the cache probability of the relevant page based on the upper and lower related pages; When the page related information includes a preset cache probability, the preset cache probability is a cache probability of the current page and / or a page adjacent to the current page.

7. The method according to claim 1, characterized in that The method further comprises: When the cache capacity of the cache is greater than or equal to a preset threshold, cache content of a target page in the cache is eliminated, and the target page is a page that has not been accessed for more than a preset time.

8. A page cache scheduling device for layout documents, characterized in that: include: A cache processing module, for responding to a user's request to display the current page of the layout document, performing classified and graded cache processing on the relevant pages of the layout document, so as to cache the relevant pages of the layout document into a corresponding cache; wherein the relevant pages of the layout document include the current page of the layout document, adjacent pages of the current page, and associated pages; The rendering module is used to process the content of the current page in blocks, and obtain the blocks of the user visible area of ​​the current page from the buffer corresponding to the current page for rendering.

9. A computer device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction running on the processor, and when the program or instruction is executed by the processor, the steps of the page cache scheduling method for layout documents as described in any one of claims 1 to 7 are implemented.

10. A readable storage medium having a program or instruction stored thereon, characterized in that: When the program or instruction is executed by a processor, the steps of the page cache scheduling method for layout documents as described in any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Page display method and device

    CN121636841A