Method and apparatus for rendering large page table

By recording row and column change information using hash tables and segmented tables, the consistency of cell identifiers is ensured, which solves the problem of low rendering efficiency when row and column changes occur in large-scale tables and achieves efficient rendering.

CN117172224BActive Publication Date: 2026-11-27HANGZHOU WEIMING XINKE TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310906517.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-21
Publication Date
2026-11-27
Estimated Expiration
2043-07-21

AI Technical Summary

Technical Problem

Existing table rendering methods result in a large number of cell components being re-rendered when rows and columns change, leading to low rendering efficiency, especially noticeable in large-scale tables.

Method used

By recording row and column changes using hash tables and segmented tables, the identifier of each cell is determined to be consistent with the identifier before the change, reducing the need for re-rendering.

Benefits of technology

It improves the rendering efficiency of large-scale page tables when rows and columns change, and reduces unnecessary re-rendering operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117172224B_ABST
    Figure CN117172224B_ABST
Patent Text Reader

Abstract

The present application relates to a kind of rendering method and device of large-scale page table, method includes: in determining the display state of each first cell in the visible area table is different, and determine that the metadata of target table does not include header, based on the actual row number and actual column number of each first cell in the visible area table in target table, determine the identifier of each first cell in the visible area table;And in the case of row and column change, based on hash table and segmented table, maintain the identifier of the first cell that does not occur row and column change unchanged, and based on the actual row number and actual column number of row and column deletion and the offset corresponding to the row and column after it, determine the identifier of the cell involved after row and column deletion, based on the new virtual row number and / or new virtual column number, determine the identifier of the cell involved after row and column increase, based on the identifier of cell, the rendering of renderer content is rendered.Based on this, improve the rendering efficiency when row and column change.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a method and apparatus for rendering large-scale page tables. Background Technology

[0002] Front-end big data table rendering is a key function widely used in modern web applications. With the continuous growth of data volume, traditional rendering methods face some challenges and limitations. Current solutions for large-scale tables appearing on front-end pages mainly involve calculating based on the current viewport, dividing the visible area, and only requesting and rendering the data for the visualized portion, thereby reducing rendering time and memory usage.

[0003] However, existing table rendering methods, whether using the virtual document object model (DOM) of third-party frameworks such as React and Vue, or directly manipulating the DOM, will cause a large number of cell components to change their unique identifiers after the rows and columns of the table change. This will result in a large number of cells needing to be re-rendered, leading to low rendering efficiency when rows and columns change. Summary of the Invention

[0004] This invention provides a method and apparatus for rendering large-scale page tables, which reduces the large-scale re-rendering of cells and improves rendering efficiency when rows and columns change.

[0005] A method for rendering a large-scale page table, the method comprising: obtaining metadata corresponding to a target table and content corresponding to a rendering area table; the rendering area table being contained within the target table; the rendering area table containing a viewport table; and, given that the display states of each first cell in the viewport table are different, and based on the metadata corresponding to the target table, it is determined that the metadata corresponding to the target table does not contain a table header, determining a first identifier for each first cell in the viewport table based on the actual row number and actual column number of each first cell in the viewport table in the target table; In response to user commands to modify rows and columns in the visible table, the hash table and segment table are updated. The hash table records the correspondence between the actual row number and the newly added virtual row number, as well as the correspondence between the actual column number and the newly added virtual column number, during row and column changes. The segment table records the actual row number or the actual column number of the initial row or column that was modified during the row and column change, and the offset of the modified row or column from its state before the change. The newly added virtual row number is a row number added when rows and columns are added, and it differs from the actual row number of each first cell before the row and column change. The newly added virtual column number is... The newly added column number when rows and columns are added is different from the actual column number of each first cell before the row and column change; based on the hash table and segment table, the second identifier of each second cell and each third cell in the viewport table is determined, and the third identifier of each fourth cell corresponding to the newly added row and column in the viewport table is determined; wherein, the second cell is the first cell whose row and column and the rows and columns before the cell have not changed; the third cell is the first cell whose row and column before the cell have been deleted; the second identifier is related to the actual row number of the initial row or the actual column number of the initial column in the segment table, and the offset of the changed row or column from before the row and column change; the third identifier of each fourth cell is related to the newly added virtual row number and / or newly added virtual column number of each fourth cell in the hash table; based on the identifier of each cell in the viewport table after the row and column change, the identifier corresponding to each cell in the viewport table after the row and column change in the file object model is determined; and based on the identifier corresponding to each cell in the viewport table after the row and column change in the file object model, and the content corresponding to the rendering area table, the content corresponding to each cell in the viewport table is rendered.

[0006] In one embodiment, updating the hash table and segment table in response to a user's command to change the rows and columns of the viewport table includes: in response to a user's command to add a row to the viewport table, assigning a new virtual row number to the cell of the added row, and saving the correspondence between the new virtual row number and the actual row number at the added position to the hash table; or, in response to a user's command to add a column to the viewport table, assigning a new virtual column number to the cell of the added column, and saving the correspondence between the new virtual column number and the actual column number at the added position to the hash table; in response to a user's command to change the rows and columns of the viewport table, adding an element corresponding to the row and column change to the segment table array, and updating the actual row number or actual column number of the row or column where the row and column change occurred in the hash table; wherein the element corresponding to the row and column change includes the initial row or initial column corresponding to the row and column change, and the offset of the row or column corresponding to the row and column change.

[0007] In one embodiment, determining the second identifier of each second cell and each third cell in the viewport table based on the hash table and the segmentation table, and determining the third identifier of each fourth cell corresponding to the newly added row and column in the viewport table, includes: searching the hash table for the actual row number or actual column number of each cell in the viewport table; if the hash table contains at least one of the target actual row number and the target actual column number of the target fourth cell, determining at least one of the target newly added virtual row number and the target new virtual column number of the target fourth cell from the hash table; and if the hash table lacks either the target actual row number or the target actual column number of the target fourth cell, determining the target actual row number or the target new virtual column number of the target fourth cell from the segmentation table. Mark the actual column number; based on the newly added virtual column number and the newly added virtual row number of the target fourth cell, determine the second identifier of the target fourth cell; or, if it is determined that the hash table does not contain at least one of the target actual row number and the target actual column number of the target second cell, determine the element corresponding to the row and column change of the target second cell from the segmented table; based on the element corresponding to the row and column change of the target second cell, determine the second identifier of the target second cell; if it is determined that the hash table does not contain at least one of the target actual row number and the target actual column number of the target third cell, determine the element corresponding to the row and column change of the target third cell from the segmented table; based on the element corresponding to the row and column change of the target third cell, determine the second identifier of the target third cell.

[0008] In one embodiment, when it is determined that the hash table contains at least one of the target actual row number and the target actual column number of the target fourth cell, at least one of the target newly added virtual row number and the target cell newly added virtual column number is determined from the hash table; and when it is determined that the hash table lacks either the target actual row number or the target actual column number of the target fourth cell, the target actual row number or the target actual column number of the target fourth cell is determined from the segmented table; determining the second identifier of the target fourth cell based on the newly added virtual column number and the newly added virtual row number of the target fourth cell includes: when it is determined that the hash table contains the target actual row number of the target fourth cell, and the hash table does not contain the target actual column number of the target fourth cell, determining the target newly added virtual row number corresponding to the target actual row number of the target fourth cell based on the hash table, and obtaining the target actual column number of the target fourth cell from the segmented table. The column number is used to determine the third identifier of the target fourth cell based on the target newly added virtual row number and the target actual column number; or, if the hash table contains the target actual column number of the target fourth cell but does not contain the target actual row number of the target fourth cell, the target newly added virtual column number corresponding to the target actual column number of the target fourth cell is obtained from the hash table, and the target actual row number of the target fourth cell is determined based on the segmented table, and the third identifier of the target fourth cell is determined based on the target newly added virtual column number and the target actual row number; or, if the hash table contains the target actual column number of the target fourth cell and contains the target actual row number of the target fourth cell, the target newly added virtual column number corresponding to the target actual column number of the target fourth cell and the target newly added virtual row number corresponding to the target actual row number of the target fourth cell are obtained from the hash table, and the third identifier of the target fourth cell is determined based on the target newly added virtual column number and the target newly added virtual row number.

[0009] In one embodiment, the method further includes: determining a fourth identifier for each first cell in the viewport table, based on the table header and column identifier or row identifier, when it is determined that the display states of each first cell in the viewport table are different and the metadata corresponding to the target table contains a table header.

[0010] In one embodiment, the method further includes: when it is determined that the display states of each first cell in the viewport table are the same, determining a fifth identifier of each first cell in the viewport table based on the position of each first cell in the viewport table in the rendering area table.

[0011] In one embodiment, determining the fifth identifier of each first cell in the viewport table based on the position of each first cell in the rendering area table includes: sequentially numbering the columns of each fifth cell in the rendering area table from left to right; sequentially numbering the rows of each fifth cell in the rendering area table from top to bottom; and determining the fifth identifier of each first cell in the viewport table based on the row number and column number corresponding to each fifth cell in the rendering area table.

[0012] In one embodiment, before obtaining the content corresponding to the rendering area table, the method further includes: dividing the target table into multiple data blocks according to a preset size; obtaining the content corresponding to the rendering area table includes: in response to a user's rendering request for the visible area table, obtaining the range of the visible area table; determining the range of the rendering area table based on the range of the visible area table; and determining the data blocks corresponding to the rendering area table based on the range of the rendering area table.

[0013] A rendering apparatus for a large-scale page table, the apparatus comprising: an acquisition module, configured to acquire metadata corresponding to a target table and content corresponding to a rendering area table; the rendering area table being contained within the target table; the rendering area table containing a viewport table; and a first determination module, configured to, when determining that the display states of each first cell in the viewport table are different, and based on the metadata corresponding to the target table, determine that the metadata corresponding to the target table does not contain a table header, determine each first cell in the viewport table based on the actual row number and actual column number of each first cell in the viewport table in the target table. The first identifier of the cell; and in response to the user's command to change the rows and columns of the visible area table, update the hash table and the segment table; wherein, the hash table is used to record the correspondence between the actual row number and the newly added virtual row number when the row or column is added during the row and column change, and the correspondence between the actual column number or the newly added virtual column number; the segment table is used to record the actual row number or the actual column number of the initial row or column that is changed during the row and column change, and the offset of the changed row or column from before the row and column change; the newly added virtual row number is the row number added when the row and column are added, which is different from the actual row number of each first cell before the row and column change; the newly added virtual column number is The newly added column number when rows and columns are added is different from the actual column number of each first cell before the row and column change; the second determining module is used to determine the second identifier of each second cell and each third cell in the visible area table based on the hash table and the segmentation table, and to determine the third identifier of each fourth cell corresponding to the newly added row and column in the visible area table; wherein, the second cell is the first cell whose row and column and the rows and columns before the cell have not changed; the third cell is the first cell whose rows and columns before the cell have been deleted; the second identifier is the actual row of the initial row in the segmentation table. The actual column number of the initial column or the row or column that has changed is related to the offset of the row or column compared to before the row or column change; the third identifier of each fourth cell is related to the newly added virtual row number and / or newly added virtual column number of each fourth cell in the hash table; the rendering module is used to determine the identifier corresponding to each cell in the viewport table after the row and column change in the file object model based on the identifier of each cell in the viewport table after the row and column change in the file object model, and to render the content corresponding to each cell in the viewport table based on the identifier corresponding to each cell in the viewport table after the row and column change in the file object model, and the content corresponding to the rendering area table.

[0014] A computer device includes a memory and a processor, the memory storing computer-readable instructions that, when executed by the processor, cause the processor to perform the steps of the rendering method for large-scale page tables described above.

[0015] A storage medium storing computer-readable instructions, which, when executed by one or more processors, cause the one or more processors to perform the steps of the rendering method for the large-scale page table described above.

[0016] The aforementioned rendering method and apparatus for large-scale page tables employ different processing methods depending on the different display states of the cells in the table. Specifically, when the display states of cells in the table are inconsistent and the unique identifier of a cell cannot be determined from the table header, information about row and column changes is recorded in a hash table and a segmentation table. This facilitates the subsequent determination of the cell identifier based on the row and column change information in the hash table and segmentation table, ensuring that the identifier of the cell after the row and column change is as consistent as possible with the identifiers of the cells before the row and column change. Specifically, in the case of row and column deletion, the segmentation table can be used to determine that the offset of the rows and columns that have not undergone row and column changes from their original row or column numbers is 0, while the offset of the rows and columns that have undergone row and column changes from their original row or column numbers is known. Therefore, the row or column numbers of the rows and columns that have not undergone row and column changes, as determined by the segmentation table, remain unchanged. Furthermore, the actual row or column numbers of the rows and columns that have undergone row and column changes before the change can be determined based on the segmentation table. This ensures that the identifier of the cell remains unchanged before and after the row and column changes, and that the identifier of the cells that have undergone row and column changes remains the same as before the change. As a result, during subsequent rendering, only the specific content of the corresponding cell elements in the original file object model needs to be modified, without the need to rebuild a new file object model to adapt to the overall change of cell elements in the file object model caused by the change in the position of the original cell elements. Furthermore, when new rows or columns are added, virtual row or column numbers are set that are different from the actual row or column numbers of each cell. The identifier of each cell after the row or column change is determined based on the virtual row or column number. This ensures that the identifier of the newly added row or column is unique during subsequent rendering, thus eliminating the need for large-scale re-rendering and improving the rendering efficiency when large-scale page tables undergo row and column changes. Attached Figure Description

[0017] Figure 1 This is a diagram illustrating the implementation environment of a method for rendering large-scale page tables provided in one embodiment.

[0018] Figure 2 This is one of the flowcharts illustrating a method for rendering a large-scale page table in one embodiment;

[0019] Figure 3 This is a schematic diagram illustrating the layer-by-layer division of a target table as provided in one embodiment;

[0020] Figure 4This is a second flowchart illustrating a method for rendering large-scale page tables provided in one embodiment.

[0021] Figure 5 This is the third flowchart illustrating a method for rendering large-scale page tables in one embodiment;

[0022] Figure 6 This is the fourth flowchart illustrating a method for rendering large-scale page tables in one embodiment.

[0023] Figure 7 A structural block diagram of a rendering apparatus for a large-scale page table provided in one embodiment;

[0024] Figure 8 This is a schematic diagram of an electronic device provided in one embodiment. Detailed Implementation

[0025] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0026] It should be noted that, unless otherwise defined, the technical or scientific terms used in this invention should have the ordinary meaning understood by one of ordinary skill in the art to which this invention pertains. The terms "first," "second," and similar terms used in this invention do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed following the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are used only to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0027] To facilitate understanding, the inventive concept of this invention will be introduced first.

[0028] Front-end big data table rendering is a crucial function widely used in modern web applications. Current solutions for large-scale tables on front-end pages primarily involve calculating based on the current viewport, dividing the visible area, and only requesting and rendering the data for the visualized portion to reduce rendering time and memory usage. However, in existing rendering methods, changes to the table content within the visible area typically cause changes to the labels of all cells corresponding to the row and column changes, leading to large-scale re-rendering and consequently low rendering efficiency during row and column changes.

[0029] Furthermore, the complexity of the rendering process varies depending on the different display states of the cells in the table. When the display states of the cells are relatively consistent, the cells in a row or column will display in the same way. During rendering, only the content of each cell needs to be considered, without needing to consider the differences in the display formats between rows or columns. However, when the display states of the cells are relatively consistent, but the display formats between rows or columns differ, changes in row or column orientation will significantly alter the display formats of the corresponding cells. Therefore, if the row or column identifier changes, the identifier of the corresponding cell's DOM element will change, requiring a large number of cells to be re-rendered. Thus, in this case of row or column changes, minimizing the change in cell identifiers during row or column changes helps improve rendering efficiency.

[0030] In view of this, the present invention proposes a rendering method for large-scale page tables. This method employs different processing methods depending on the different display states of the cells in the table. Specifically, when the display states of cells in the table are inconsistent and the unique identifier of a cell cannot be determined from the table header, the method records the row and column change information in a hash table and a segmentation table. This facilitates the subsequent determination of the cell identifier based on the row and column change information in the hash table and segmentation table, ensuring that the identifier of the cell after the row and column change is as consistent as possible with the identifiers of the cells before the row and column change. Specifically, in the case of row and column deletion, the hash table and segmentation table used for recording can be used to determine the rows and columns that have not changed. This ensures that the row or column numbers of these unchanged rows and columns remain unchanged, and that the identifiers of the cells are determined based on the row and column numbers before and after the row and column changes. Furthermore, the identifiers of cells that have undergone row and column changes remain the same as before the change. This allows subsequent rendering to simply modify the corresponding content within the cell elements of the original file object model, without needing to create a new file object model to accommodate changes in the overall cell elements due to changes in their positions. Conversely, in the case of adding rows and columns, virtual row or column numbers, different from the actual row or column numbers of each cell, are set. The identifiers of each cell after the row and column changes are determined based on these virtual row or column numbers. This ensures that the identifiers of newly added rows and columns are unique during subsequent rendering, eliminating the need for large-scale re-rendering and improving rendering efficiency when large-scale page tables undergo row and column changes.

[0031] The rendering method and apparatus for large-scale page tables of the present invention are described below with reference to the accompanying drawings.

[0032] Figure 1 This diagram illustrates the implementation environment of a method for rendering a large-scale page table in one embodiment, including a server 110 and a client 120. The server 110 includes a data module, a data request unit, a data cache, a rendering module, a cell identifier unit, and a DOM cache unit. The client 120 is used to display the rendered table in the viewport.

[0033] The data module provides data query and retrieval functions, including table metadata and data portions. The data request unit initiates data requests to the backend and retrieves table metadata. It then requests specific data from the backend based on a preset data block size, ensuring data integrity and accuracy. The data cache caches already retrieved table data, avoiding duplicate requests. Through an effective data caching mechanism, the system can quickly retrieve and access data when needed, improving data retrieval efficiency. The rendering module renders the table, employing different strategies and technologies depending on the framework used. The cell identifier unit plays a crucial role in rendering, determining the unique identifier for each cell. It maintains cell identifier stability when rows and columns change, ensuring correct data rendering and updates. The DOM cache unit is suitable for direct DOM manipulation. It reuses duplicate cell DOM elements, reducing the actual drawing and creation process. Effective management of the DOM cache unit improves rendering efficiency, reduces unnecessary DOM operations, and speeds up page response.

[0034] Figure 2 This application provides a flowchart illustrating a method for rendering large-scale page tables, which can be executed by a large-scale page table rendering device. Figure 1 The server in the middle. For example... Figure 2 As shown, the method includes:

[0035] Step 210: Obtain the metadata corresponding to the target table and the content corresponding to the table in the rendering area.

[0036] The target table can be understood as the complete table corresponding to the table to be displayed. The metadata of the target table includes information such as the number of rows (table_row), the number of columns (table_col), whether there is a header (head), and an ID column.

[0037] It is understood that in this invention, the target table contains a large amount of content that cannot be fully displayed on a single page. Therefore, a rendering area and a view area are further divided, and the table corresponding to the rendering area can be called the rendering area table, and the table corresponding to the view area can be called the view area table. The rendering area table is contained within the target table, and the rendering area table contains the view area table. Specifically, the content corresponding to the target table, the rendering area, and the view area can be found in [reference needed]. Figure 3 For the sake of brevity, I will not go into details here.

[0038] Step 220: If it is determined that the display states of the first cells in the visible area table are different, and it is determined that the metadata of the target table does not contain a table header, then the first identifier of each first cell in the visible area table is determined based on the actual row number and actual column number of each first cell in the target table; and the hash table and segment table are updated in response to the user's row and column change operation command for the visible area table.

[0039] It is understandable that, in the initial state, the unique identifier of each cell can be determined based on the row number and column number of the cell in the target table. Therefore, specifically, the actual row number and actual column number of each first cell in the viewport table in the target table can be determined as the initial virtual row number and initial virtual column number of each first cell in the viewport table; the combination of the initial virtual row number and initial virtual column number of each first cell is determined as the first identifier of each first cell in the viewport table.

[0040] For example, referring to Table 1 below, if the actual row numbers corresponding to the first cells in the visible area table are 1, 2, 3, 4, 5, 6, and 7 respectively, then their corresponding virtual row numbers can also be marked as 1, 2, 3, 4, 5, 6, and 7. Similarly, if the actual column numbers corresponding to the first cells in the visible area table are 9, 10, and 11 respectively, then their corresponding virtual row numbers can also be marked as 9, 10, and 11, and the identifiers for the cells in the 1st row and 9th column will be 1-9.

[0041] Table 1

[0042] actual line number Virtual line number 1 1 2 2 3 3 4 4 5 5 6 6 7 7

[0043] The viewport table in Table 1 is the initial viewport table, meaning that no row or column changes have occurred. Therefore, its corresponding segmented table and hash table are shown in Table 2 below:

[0044] Table 2

[0045]

[0046] Furthermore, it should be noted that the hash table is used to record the correspondence between the actual row number and the newly added virtual row number during row / column changes, as well as the correspondence between the actual column number and the newly added virtual column number. The segmented table is used to record the actual row number or the actual column number of the initial row or column that was changed during the row / column change, as well as the offset of the changed row or column from its state before the change.

[0047] In this context, the actual row number that changes during row / column alteration refers to the actual row number of the row that underwent the alteration before the alteration. Similarly, the actual column number that changes during row / column alteration refers to the actual column number of the column that underwent the alteration before the alteration. For example, referring to Table 1, deleting the original row 3 results in the actual row number of the row / column alteration being 3. The changes to the actual and virtual row numbers in Table 1 are shown in Table 3. Furthermore, referring to the previous example, the offset of the altered row or column from its original position means that rows 4, 5, 6, and 7 after the altered row 3 are all offset by 1 from their original position. Therefore, the actual row number 3 of the initial row that underwent the alteration and its corresponding offset can be updated in the segmented table. The updated segmented table is shown in Table 4.

[0048] Table 3

[0049] actual line number Virtual line number 1 1 2 2 3 4 4 5 5 6 6 7

[0050] Table 4

[0051]

[0052] It is understandable that by recording the actual row number of the initial row or the actual column number of the initial column where a row or column change occurs in the segmented table, and the offset of the row or column after the changed row or column compared to before the change, it is possible to determine the actual row number of the row and the actual column number of the column before the change. For example, based on the 3 in the segmented table above, it can be determined that the row and column change occurs from row 3. Then, starting from each row after row 3, the actual row number after the change is increased by 1, which gives the actual row number before the change for each row after row 3.

[0053] In addition, the newly added virtual row number in the hash table is the row number added when rows and columns are increased, which is different from the actual row number of each first cell before the row and column change; the newly added virtual column number in the hash table is the column number added when rows and columns are increased, which is different from the actual column number of each first cell before the row and column change.

[0054] To better understand the concepts of adding virtual row numbers and adding virtual column numbers, let's illustrate with an example. Suppose that, based on the correspondence in Table 3, we add a new row of data after row 5. The corresponding correspondence between the actual row numbers and the virtual row numbers can then be shown in Table 5:

[0055] Table 5

[0056] actual line number Virtual line number 1 1 2 2 3 4 4 5 5 6 6 8 7 7

[0057] In other words, a new row of data is added after the 5th row, and the virtual row number corresponding to the new data is set to 8, which is different from the original actual row numbers 1, 2, 3, 4, 5, 6, and 7. Furthermore, a correspondence is added to the hash table between the actual row number 6 where the row and column increase occurred and the new virtual row number 8. For details on the modified hash table and segmented table, please refer to Table 6.

[0058] Table 6

[0059]

[0060] It is understandable that since the data of a new row is added, the corresponding rendering information is also completely new. Therefore, it is only necessary to add a virtual row number that is different from the original row number of each cell to ensure that the identifier of each cell, which is determined by the row number and column number, is different from the original identifier of each cell.

[0061] Step 230: Based on the hash table and segmentation table, determine the second identifier of each second cell and each third cell in the visible area table, and determine the third identifier of each fourth cell corresponding to the newly added row and column in the visible area table.

[0062] The second cell is the first cell whose row and column and the rows and columns preceding it have not changed; the third cell is the first cell whose row and column preceding it have been deleted; the second identifier is related to the actual row number of the initial row or the actual column number of the initial column in the segmented table, and the offset of the changed row or column from the row or column before the change; the third identifier of each fourth cell is related to the newly added virtual row number and / or newly added virtual column number of each fourth cell in the hash table.

[0063] It's understandable that since the row or column corresponding to the second cell and the rows or columns preceding it haven't changed—meaning the row or column corresponding to the second cell hasn't changed since the row / column change—the offset from the row / column change is 0. Therefore, the second identifier corresponding to the second cell can be understood as being determined based on the actual row number of the initial row or the actual column number of the initial column in the segmented table, and is the same as the identifier before the row / column change. Combining the above example, we can assume that before (3, +1) in the segmented table, there is also (1, 0). That is, the initial row corresponding to rows 1 and 2 is 1, with an offset of 0. Therefore, the identifier of the cells corresponding to rows 1 and 2 is the same as the identifier before the row / column change.

[0064] It can also be understood that when adding a new row, the actual column number remains unchanged. Therefore, the identifier of the cell affected by the row and column changes can be determined based on the combination of the newly added virtual row number and its corresponding actual column number, ensuring that different cells have different identifiers. Similarly, when adding a new column, the actual row number remains unchanged. Therefore, the identifier of the cell affected by the row and column changes can be determined based on the combination of the newly added virtual column number and its corresponding actual row number. Likewise, when adding both rows and columns, the identifier of the cell affected by the row and column changes can be determined based on the combination of the newly added virtual column number and the newly added virtual row number.

[0065] In summary, step 230 has three layers of meaning. First, after a row or column change, the row and column number of the second cell in the viewport table that remains unchanged from the previous row or column remains unchanged in the target table. Therefore, the identifier of the second cell remains unchanged. Second, after a row or column change, the row and column number of the first cell in the viewport table that experienced the change also changes. However, since its original rendering information can be reused, its actual row and column numbers before the change can be determined by combining the segmented table mentioned above. Based on these actual row and column numbers, its corresponding identifier can be determined, allowing for the reuse of the cell DOM element corresponding to that identifier in subsequent operations. Third, for cells with newly added rows or columns, the identifier of each cell is determined by adding virtual row or column numbers, striving for uniqueness in cell identifiers. This allows for the reuse of previously existing cell DOM elements corresponding to identifiers during subsequent row or column changes, reducing rendering of existing cells and improving rendering efficiency in the case of row and column changes.

[0066] Step 240: Based on the identifiers of each first cell after the row and column changes, determine the identifiers corresponding to each cell in the viewport table after the row and column changes in the file object model; and based on the identifiers corresponding to each cell in the viewport table after the row and column changes in the file object model, and the content corresponding to the rendering area table, render the content corresponding to each cell in the viewport table.

[0067] Specifically, based on the identifiers corresponding to each cell in the viewport table after the row and column changes in the file object model, the DOM element corresponding to the identifier of each first cell can be obtained from the DOM cache unit, and the content corresponding to each cell in the viewport table can be rendered. If the DOM cache unit does not have the DOM element corresponding to the identifier of the first cell, the DOM element corresponding to the identifier of the first cell is recreated, and the content of the corresponding first cell is rendered.

[0068] The large-scale page table rendering method provided by this invention addresses the situation where the display states of cells in the table are inconsistent and the unique identifier of a cell cannot be determined by the table header. By recording the row and column change information in a hash table and a segment table, it is easier to determine the cell identifier based on the row and column change information in the hash table and the segment table. This ensures that the identifier of the cell after the row and column change is as consistent as possible with the identifier of each cell before the row and column change. Specifically, in the case of row and column deletion, the hash table and segmentation table of the records can be used to determine that the offset of the rows and columns that have not undergone row and column changes from their original row or column numbers is 0, and the offset of the rows and columns that have undergone row and column changes from their original row or column numbers is known. Therefore, the row or column numbers of the rows and columns that have not undergone row and column changes, as determined by the segmentation table, remain unchanged. Furthermore, the actual row or column numbers of the rows and columns that have undergone row and column changes before the change can be determined based on the segmentation table. This ensures that the identifier of the cell remains unchanged before and after the row and column changes, and that the identifier of the cells that have undergone row and column changes remains the same as the identifier before the change. As a result, during subsequent rendering, only the specific content of the cell elements in the original file object model needs to be modified, without the need to rebuild a new file object model to adapt to the overall change of the cell elements in the file object model caused by the change in the position of the original cell elements. Furthermore, when new rows or columns are added, virtual row or column numbers are set that are different from the actual row or column numbers of each cell. The identifier of each cell after the row or column change is determined based on the virtual row or column number. This ensures that the identifier of the newly added row or column is unique during subsequent rendering, thus eliminating the need for large-scale re-rendering and improving the rendering efficiency when large-scale page tables undergo row and column changes.

[0069] Figure 3 This is a diagram illustrating the division of the target table, rendering area, view area, and data blocks. For example... Figure 3 As shown, the rendering area table is contained within the target table, and the rendering area table contains the viewport table. The viewport is the area displayed on the screen. The extent of the rendering area can be determined based on the extent of the viewport. Specifically, the process for determining the extent of the rendering area and the process for determining the data blocks can be found below. Figure 6 The relevant explanations are in the text.

[0070] In one embodiment, such as Figure 4 As shown, the step of updating the hash table and segment table in response to user commands to change the rows and columns of the visible area table includes the following steps:

[0071] Step 410: In response to the user's operation command to add a row to the visible area table, assign a new virtual row number to the cell of the added row, and save the correspondence between the new virtual row number and the actual row number at the added position to a hash table; or, in response to the user's operation command to add a column to the visible area table, assign a new virtual column number to the cell of the added column, and save the correspondence between the new virtual column number and the actual column number at the added position to a hash table.

[0072] Specifically, this process can be referred to in Tables 5 and 6 above, and will not be repeated here for the sake of brevity.

[0073] Step 420: In response to the user's operation command to change the rows and columns of the visible area table, add the element corresponding to the row and column change to the segment table array, and update the actual row number or actual column number of the row and column that has undergone the row and column change in the hash table; wherein, the element corresponding to the row and column change includes the initial row or initial column corresponding to the row and column change, and the offset of the row or column corresponding to the row and column change.

[0074] The initial row or column corresponding to the row and column change can be understood as the row or column corresponding to the location where the row and column change occurs. Specifically, the update process of the segmented table in step 420 can be referred to the relevant descriptions in Tables 3 and 4. For the sake of brevity, it will not be repeated here.

[0075] It is understandable that when a row or column is deleted, the actual row number or column number corresponding to the newly added row or column will change. In order to determine the identifier of each cell based on the actual row number and actual column number in the hash table, the actual row number or actual column number of the row or column that has changed can be updated in the hash table when a row or column is deleted.

[0076] For example, based on Tables 5 and 6 above, if row 4 is deleted, the corresponding correspondence between the actual row number and the virtual row number is shown in Table 7, and the segment table and hash table are shown in Table 8.

[0077] Table 7

[0078] actual line number Virtual line number 1 1 2 2 3 4 4 6 5 8 6 7

[0079] In other words, deleting the data in row 4 changes the original actual row 6 to the current actual row 5, while the newly added virtual row number remains unchanged at 8. Therefore, in addition to updating the corresponding element in the segment table, the actual row number in the hash table also needs to be changed from 6 to 5.

[0080] Table 8

[0081]

[0082] In one embodiment, such as Figure 5 As shown, the step of determining the second identifier of each second cell and each third cell in the viewport table based on the hash table and the segmentation table, and determining the third identifier of each fourth cell corresponding to the newly added row and column in the viewport table, includes:

[0083] Step 510: From the hash table, find the actual row number or actual column number of each cell in the visible area table.

[0084] The visible area table can include cells such as the second, third, and fourth cells. It should be noted that after row and column changes, the exact changes to each cell in the visible area table cannot be determined. Therefore, the situation of the cells corresponding to the newly added rows and columns can be determined first from the hash table, and then the situation of the cells corresponding to the deleted rows and columns can be further determined.

[0085] It is understandable that in actual situations, there may be or may not be an increase in rows and columns. Therefore, the corresponding hash table may or may not contain information related to the increase in rows and columns. Therefore, based on the actual situation, we can first determine the identifiers of the first cells involved in the increase in rows and columns from the hash table, as detailed in step 520; and then determine the identifiers of the first cells involved in the deletion of rows and columns from the segment table, as detailed in step 530.

[0086] Step 520: If it is determined that the hash table contains at least one of the target actual row number and the target actual column number of the target fourth cell, determine at least one of the target newly added virtual row number and the target cell newly added virtual column number from the hash table; if it is determined that the hash table lacks either the target actual row number or the target actual column number of the target fourth cell, determine the target actual row number or the target actual column number of the target fourth cell from the segment table; based on the newly added virtual column number and the newly added virtual row number of the target fourth cell, determine the second identifier of the target fourth cell.

[0087] The target fourth cell is one of the fourth cells corresponding to the newly added row and column.

[0088] Specifically, step 520 may include the following situations:

[0089] In the first case, that is, when it is determined that the hash table contains the target actual row number of the target fourth cell, and the hash table does not contain the target actual column number of the target fourth cell, the target newly added virtual row number corresponding to the target actual row number of the target fourth cell is determined based on the hash table, the target actual column number of the target fourth cell is obtained from the segment table, and the third identifier of the target fourth cell is determined based on the target newly added virtual row number and the target actual column number.

[0090] In the second scenario, where it is determined that the hash table contains the target actual column number of the target fourth cell, but the hash table does not contain the target actual row number of the target fourth cell, the target newly added virtual column number corresponding to the target actual column number of the target fourth cell is obtained from the hash table, and the target actual row number of the target fourth cell is determined based on the segmentation table. Finally, the third identifier of the target fourth cell is determined based on the target newly added virtual column number and the target actual row number; or,

[0091] In the third case, where it is determined that the hash table contains the target actual column number of the target fourth cell and the hash table contains the target actual row number of the target fourth cell, the target newly added virtual column number corresponding to the target actual column number of the target fourth cell and the target newly added virtual row number corresponding to the target actual row number of the target fourth cell are obtained from the hash table, and the third identifier of the target fourth cell is determined based on the target newly added virtual column number and the target newly added virtual row number.

[0092] Step 530: If the hash table does not contain at least one of the actual row number and the actual column number of the target second cell, determine the element corresponding to the row and column change of the target second cell from the segmented table; based on the element corresponding to the row and column change of the target second cell, determine the second identifier of the target second cell; if the hash table does not contain at least one of the actual row number and the actual column number of the target third cell, determine the element corresponding to the row and column change of the target third cell from the segmented table; based on the element corresponding to the row and column change of the target third cell, determine the second identifier of the target third cell.

[0093] Among them, the target second cell is one of the second cells, and the target third cell is one of the third cells.

[0094] Specifically, the element corresponding to the row and column change of the target second cell is the element in the segmented table whose actual row number of the initial row is less than or equal to the actual row number of the target second cell before the row and column change, and whose difference between the actual row number of the target second cell before the row and column change and the actual row number of the initial row is the smallest; or, the element in the segmented table whose actual column number of the initial column is less than or equal to the actual column number of the target second cell, and whose difference between the actual column number of the target second cell before the row and column change and the actual column number of the initial row is the smallest. Similarly, the element corresponding to the row and column change of the target third cell is the element in the segmented table whose actual row number of the initial row is less than or equal to the actual row number of the target third cell before the row and column change, and whose difference between the actual row number of the target third cell before the row and column change and the actual row number of the initial row is the smallest; or, the element in the segmented table whose actual column number of the initial column is less than or equal to the actual column number of the target third cell, and whose difference between the actual column number of the target third cell before the row and column change and the actual column number of the initial row is the smallest.

[0095] To facilitate understanding, Tables 5 and 6 are used to explain the elements corresponding to the row and column changes of the target second cell and the target third cell. It can be understood that in Tables 5 and 6, after deleting the third row, the cells corresponding to the first and second rows before the row and column changes can be considered the second cell. Furthermore, based on the previous description, their actual row number and offset are (1, 0). That is, the cells corresponding to the first and second rows before the row and column changes are all offset 0 rows relative to the first row. The actual row number 1 of the initial row in element (1, 0) is equal to the actual row number 1 of the first row. The actual row number 1 of the initial row in element (1, 0) is less than the actual row number 2 of the second row. Therefore, based on element (1, 0), the actual row numbers of the first and second rows after the row and column changes can be determined, and thus the cells corresponding to the first and second rows after the row and column changes can be determined. Similarly, the cell corresponding to the 4th row before the row and column change can be understood as the 3rd cell. The actual row number 3 of the initial row in element (3, +1) is less than the actual row number 4 of the 4th row before the row and column change. Therefore, the actual row numbers of the 3rd and 4th rows after the row and column change can be determined based on element (3, +1), and thus the cells corresponding to the 3rd and 4th rows after the row and column change can be determined. As for the cell corresponding to the 7th row before the row and column change, the actual row numbers in elements (3, +1) and (6, 0) both satisfy the condition that the actual row number of the initial row is less than or equal to the actual row number of the 2nd cell before the row and column change. However, compared to element (6, 0), the actual row number in element (3, +1) does not satisfy the condition that the difference between the actual row number 7 before the row and column change and the actual row number 3 of the initial row is the smallest. Therefore, for the cell corresponding to the 7th row before the row and column change, the row number after the row and column change can be determined based on element (6, 0).

[0096] Specifically, after determining the element corresponding to the row and column change of the target second cell or the target third cell, the actual row number or column number of the target second or third cell can be increased by an offset to obtain its original row number or column number. Based on this original row number or column number, the identifier of the cell can be determined. The original row number can be recorded as a virtual row number, and the original column number as a virtual column number. In the example above, 3+1 gives the original row number 4 of the third row, which is recorded as virtual row number 4. It should be understood that the above example only illustrates the corresponding content using row changes as an example. The process of column changes and simultaneous changes in row types is similar to the process of row changes, and for the sake of simplicity, it will not be elaborated here.

[0097] Alternatively, it can be understood that, given the different display states of each cell and the fact that the metadata of the target table includes the table header, a unique identifier for each cell is determined based on the table header. This way, as the rows and columns of the viewport change, the existing cell identifiers will not change accordingly. Therefore, the DOM elements corresponding to cells with existing identifiers can be reused, eliminating the need to rebuild existing cell DOM elements when rows and columns change, thus improving rendering efficiency during row and column changes.

[0098] Therefore, corresponding to step 220 above, in one embodiment, the method further includes:

[0099] If it is determined that the display states of each first cell in the visible area table are different, and it is determined that the metadata corresponding to the target table contains the table header, then the fourth identifier of each first cell in the visible area table is determined based on the table header and column identifier or row identifier.

[0100] Specifically, when the header is a single row of data, the unique identifier of each cell is determined by combining the column identifier of each cell; or, when the header is a single column of data, the unique identifier of each cell is determined by combining the row identifier of each cell.

[0101] It is understandable that, except for cases where the pending display states of each cell are inconsistent, since the pending display states of each cell are relatively consistent and there are no significant changes in the pending display states, it is not necessary to recreate cell DOM elements with different identifiers; only the content of the corresponding text element in the cell DOM element needs to be modified. Therefore, in one embodiment, the method further includes: when it is determined that the pending display states of each first cell in the viewport table are the same, determining the fifth identifier of each first cell in the viewport table based on the position of each first cell in the viewport table in the rendering area table.

[0102] It can also be understood that when the display states of each cell are relatively consistent, the display formats of cells in rows or columns are the same. During rendering, it is only necessary to focus on the content of each cell in the table, without needing to focus on the different display formats of cells in rows or columns. Based on the position of each first cell in the viewport table in the rendering area table, the fifth identifier of each first cell in the viewport table is determined to ensure that the identifiers of the corresponding cells in the rendering area table are different before and after the row and column changes, so that cell DOM elements with different identifiers can be created.

[0103] Furthermore, when the number of changed records in the hash table and segmented table exceeds a certain threshold, a global refresh logic can be triggered to set the virtual row and column numbers to match the actual row and column numbers. This avoids performance issues when the number of changed records is too large and ensures the consistency of the entire rendering system. This method can preserve the unique identifier of unmodified cells as much as possible.

[0104] In one embodiment, determining the fifth identifier of each first cell in the viewport table based on the position of each first cell in the rendering area table includes:

[0105] From left to right, number the fifth cells of the rendering area table column by column; and from top to bottom, number the fifth cells of the rendering area table row by row.

[0106] Based on the row and column numbers corresponding to each fifth cell in the rendering area table, determine the fifth identifier of each first cell in the view area table.

[0107] Furthermore, when the window scrolls, new data needs to be re-requested and rendered, which causes some time overhead and stuttering. To reduce stuttering, a common solution is to pre-request and render a portion of the data outside the visible area as a cache, thus achieving a pre-loading effect during small or slow scrolling. However, since the window scrolls continuously, this approach may lead to inconsistent data sizes requested by the backend, and excessively fragmented and numerous requests. Therefore, to address this issue, this application proposes a progressive approach to isolate the table area, data area, rendering area, and visible area. By dividing the target table into data blocks, it ensures that when the window scrolls continuously, data requests are made to multiple data blocks corresponding to the rendering area, rather than requesting each row of data separately for each additional row appearing in the visible area. This data request method is more user-friendly and avoids excessively large or fragmented network requests.

[0108] Therefore, in one embodiment, such as Figure 6 As shown, before obtaining the content corresponding to the table in the rendering area, the method further includes the following steps: Step 610, dividing the target table into multiple data blocks according to a preset size.

[0109] The preset size can be, for example, 100 rows and 30 columns. This means that setting the number of rows and columns for each data block to (data_row, data_col) ensures that the requested data size is appropriate when subsequently requesting table data in the rendering area.

[0110] Based on the preceding text, the metadata corresponding to the target table includes information such as the number of rows (table_row), the number of columns (table_col), whether there is a header (head), and an ID column. Therefore, by dividing the target table into multiple data blocks according to a preset size, the number of vertically divided data blocks is block_height = (table_row-1) / data_row+1, and the number of horizontally divided data blocks is block_width = (table_col-1) / data_col+1.

[0111] It is understood that, based on the data blocks obtained in step 610, the corresponding data blocks for the rendering area table are further determined. Therefore, in one embodiment, such as Figure 6 As shown, obtaining the content corresponding to the table in the rendering area includes the following steps:

[0112] Step 620: In response to the user's rendering request for the viewport table, obtain the range of the viewport table.

[0113] Specifically, the size of the rendering area window can be determined by obtaining the current view area window size (view_height, view_width) from the front-end page.

[0114] Step 630: Determine the range of the rendering area table based on the range of the viewport table.

[0115] Set the height of the rendering area to `render_height = view_height + 2Δw`, and the width to `render_width = view_width + 2Δh`. Here, `Δw` and `Δh` are the horizontal and vertical extensions, respectively, and can be adjusted as needed to ensure the rendering area is wider than the viewport, eliminating the need for re-rendering during small scrolls. Based on the center point of the rendering area (center_x, center_y), calculate the actual bounding box of the rendering area as ((center_x - render_width / 2, center_y - render_height / 2), (center_x + render_width / 2, enter_y + render_height / 2)). Combining the size of each cell, calculate the cell range of the rendering area, represented by row and column numbers ((col_min, row_min), (row_max, col_max)).

[0116] After receiving the range of the rendering area table based on the required range of the viewport table, the system can determine the data blocks that overwrite the rendering area table during the subsequent process of retrieving the corresponding content. It also checks whether the data cache already contains the data blocks from the rendering area table. The data cache is updated in units of data blocks, with its maximum capacity determined by `cache_size`, ensuring that memory does not contain excessive data. When the `cache_size` is exceeded, the least recently used (LRU) mechanism is used to clean up the data blocks.

[0117] Step 640: Based on the range of the rendering area table, determine the data block corresponding to the rendering area table.

[0118] It is understandable that by using the above method to divide the target table into data blocks, the data requests issued when the window is continuously scrolling are requests for multiple data blocks corresponding to the rendering area, instead of requesting the data of each row that appears in the visible area separately. The data request method is more user-friendly and avoids excessively large or fragmented network requests.

[0119] The rendering apparatus for large-scale page tables provided by the present invention will be described below. The rendering apparatus for large-scale page tables described below corresponds to the rendering method for large-scale page tables described above.

[0120] Figure 7 A schematic block diagram of a rendering apparatus for large-scale page tables provided by the present invention. Figure 7 As shown, the rendering apparatus for large-scale page tables provided by the present invention includes:

[0121] The acquisition module 710 is used to acquire the metadata corresponding to the target table and the content corresponding to the rendering area table; the rendering area table is contained in the target table; the rendering area table contains the view area table;

[0122] The first determining module 720 is used to determine the first identifier of each first cell in the viewport table when the to-be-displayed states of each first cell in the viewport table are different, and based on the metadata corresponding to the target table, it is determined that the metadata corresponding to the target table does not contain a table header. Based on the actual row number and actual column number of each first cell in the viewport table in the target table, the module determines the first identifier of each first cell in the viewport table. In response to a user's row and column change operation command for the viewport table, the module updates the hash table and the segment table. The hash table records the correspondence between the actual row number and the newly added virtual row number, as well as the correspondence between the actual column number and the newly added virtual column number, during the row and column change. The segment table records the actual row number of the initial row or the actual column number of the initial column during the row and column change, and the offset of the changed row or column compared to before the row and column change. The newly added virtual row number is a row number added when rows and columns are added, and is different from the actual row number of each first cell before the row and column change. The newly added virtual column number is a column number added when rows and columns are added, and is different from the actual column number of each first cell before the row and column change.

[0123] The second determining module 730 is used to determine the second identifier of each second cell and each third cell in the visible area table based on the hash table and the segmentation table, and to determine the third identifier of each fourth cell corresponding to the newly added row and column in the visible area table; wherein, the second cell is the first cell whose row and column and the rows and columns before the cell have not been changed; the third cell is the first cell whose rows and columns before the cell have been deleted; the second identifier is related to the actual row number of the corresponding initial row or the actual column number of the initial column in the segmentation table, and the offset of the changed row or column from the row or column before the change; the third identifier of each fourth cell is related to the newly added virtual row number and / or newly added virtual column number of each fourth cell in the hash table;

[0124] The rendering module 740 is used to determine the identifier corresponding to each cell in the viewport table after the row and column changes in the file object model based on the identifier of each cell in the viewport table after the row and column changes in the file object model; and to render the content corresponding to each cell in the viewport table based on the identifier corresponding to each cell in the viewport table after the row and column changes in the file object model and the content corresponding to the rendering area table.

[0125] The rendering apparatus for large-scale page tables provided by this invention employs different processing methods depending on whether the cells in the table are in different display states. Specifically, when the display states of cells in the table are inconsistent and the unique identifier of a cell cannot be determined from the table header, information on row and column changes is recorded in a hash table and a segmentation table. This facilitates the subsequent determination of the cell identifier based on the row and column change information in the hash table and segmentation table, ensuring that the identifier of the cell after the row and column change is as consistent as possible with the identifiers of the cells before the row and column change. Specifically, in the case of row and column deletion, the hash table and segmentation table of the records can be used to determine that the offset of the rows and columns that have not undergone row and column changes from their original row or column numbers is 0, and the offset of the rows and columns that have undergone row and column changes from their original row or column numbers is known. Therefore, the row or column numbers of the rows and columns that have not undergone row and column changes, as determined by the segmentation table, remain unchanged. Furthermore, the actual row or column numbers of the rows and columns that have undergone row and column changes before the change can be determined based on the segmentation table. This ensures that the identifier of the cell remains unchanged before and after the row and column changes, and that the identifier of the cells that have undergone row and column changes remains the same as the identifier before the change. As a result, during subsequent rendering, only the specific content of the cell elements in the original file object model needs to be modified, without the need to rebuild a new file object model to adapt to the overall change of the cell elements in the file object model caused by the change in the position of the original cell elements. Furthermore, when new rows or columns are added, virtual row or column numbers are set that are different from the actual row or column numbers of each cell. The identifier of each cell after the row or column change is determined based on the virtual row or column number. This ensures that the identifier of the newly added row or column is unique during subsequent rendering, thus eliminating the need for large-scale re-rendering and improving the rendering efficiency when large-scale page tables undergo row and column changes.

[0126] In one embodiment, a computer device is provided, the computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, performs the following steps: obtaining metadata corresponding to a target table and content corresponding to a rendering area table; the rendering area table is contained in the target table; the rendering area table contains a viewport table; and, when it is determined that the display states of each first cell in the viewport table are different, and based on the metadata corresponding to the target table, it is determined that the metadata corresponding to the target table does not contain a table header, based on the viewport table... The actual row number and actual column number of each first cell in the target table are used to determine the first identifier of each first cell in the visible area table; and in response to the user's row and column change operation command for the visible area table, the hash table and the segment table are updated; wherein, the hash table is used to record the correspondence between the actual row number and the newly added virtual row number when a row or column is added during row and column changes, as well as the correspondence between the actual column number or the newly added virtual column number; the segment table is used to record the actual row number or the actual column number of the initial row or column that is changed during row and column changes, as well as the offset of the changed row or column from before the row or column change; the newly added virtual row number is added when a row or column is added. The row number is different from the actual row number of each first cell before the row and column change; the newly added virtual column number is the column number added when rows and columns are added, and is different from the actual column number of each first cell before the row and column change; based on the hash table and segment table, the second identifier of each second cell and each third cell in the visible area table is determined, and the third identifier of each fourth cell corresponding to the newly added row and column in the visible area table is determined; wherein, the second cell is the first cell whose row and column and the rows and columns before the cell have not changed; the third cell is the first cell whose row and column before the cell have been deleted; the second identifier The actual row number of the initial row or the actual column number of the initial column in the segmented table, and the offset of the changed row or column compared to before the row or column change; the third identifier of each fourth cell is related to the newly added virtual row number and / or newly added virtual column number of each fourth cell in the hash table; based on the identifier of each cell in the viewport table after the row and column change, the identifier corresponding to each cell in the viewport table after the row and column change in the file object model is determined; and based on the identifier corresponding to each cell in the viewport table after the row and column change in the file object model, and the content corresponding to the rendering area table, the content corresponding to each cell in the viewport table is rendered.

[0127] Figure 8 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 8As shown, the electronic device may include: a processor 810, a communications interface 820, a memory 830, and a communication bus 840, wherein the processor 810, the communications interface 820, and the memory 830 communicate with each other through the communication bus 840. The processor 810 can call logical instructions in the memory 830 to execute the large-scale page table rendering method provided by this invention. The large-scale page table rendering method includes: obtaining the metadata corresponding to the target table and the content corresponding to the rendering area table; the rendering area table is contained in the target table; the rendering area table contains a viewport table; when it is determined that the display states of each first cell in the viewport table are different, and based on the metadata corresponding to the target table, it is determined that the metadata corresponding to the target table does not contain a table header, the rendering area table is then rendered based on the actual row number of each first cell in the viewport table in the target table. The system determines the first identifier of each first cell in the visible area table based on the actual column number; and updates the hash table and segment table in response to user commands to change the rows and columns of the visible area table. The hash table records the correspondence between the actual row number and the newly added virtual row number, as well as the correspondence between the actual column number and the newly added virtual column number, during row and column changes. The segment table records the actual row number of the initial row or the actual column number of the initial column that has been changed, and the offset of the changed row or column from its state before the change. The newly added virtual row number is the row number added when rows and columns are added, and corresponds to the first identifier of each first cell in the visible area table before the row and column change. The actual row number of the cell is different; the newly added virtual column number is the column number added when rows and columns are added, which is different from the actual column number of each first cell before the row and column change; based on the hash table and the segment table, the second identifier of each second cell and each third cell in the visible area table is determined, and the third identifier of each fourth cell corresponding to the newly added row and column in the visible area table is determined; wherein, the second cell is the first cell whose row and column and the rows and columns before the cell have not changed; the third cell is the first cell whose row and column before the cell have been deleted; the second identifier and the corresponding... The actual row number of the initial row or the actual column number of the initial column, and the offset of the changed row or column compared to before the row or column change; the third identifier of each fourth cell is related to the newly added virtual row number and / or newly added virtual column number of each fourth cell in the hash table; based on the identifier of each cell in the viewport table after the row and column change, the identifier corresponding to each cell in the viewport table after the row and column change in the file object model is determined; and based on the identifier corresponding to each cell in the viewport table after the row and column change in the file object model, and the content corresponding to the rendering area table, the content corresponding to each cell in the viewport table is rendered.

[0128] Furthermore, the logical instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0129] On the other hand, the present invention also provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, wherein when the program instructions are executed by a computer, the computer is able to execute the large-scale page table rendering method provided by the present invention, wherein the large-scale page table rendering method comprises: obtaining metadata corresponding to a target table and content corresponding to a rendering area table; the rendering area table being contained in the target table; the rendering area table containing a visible area table; determining that the display states of each first cell in the visible area table are different, and based on the metadata corresponding to the target table... If the metadata corresponding to the target table does not contain a table header, the system determines the first identifier of each first cell in the viewport table based on the actual row number and actual column number of each first cell in the target table. In response to user commands to change the rows and columns of the viewport table, the system updates the hash table and the segment table. The hash table records the correspondence between the actual row number and the newly added virtual row number, as well as the correspondence between the actual column number and the newly added virtual column number, during row and column changes. The segment table records the actual row number of the initial row or the actual column number of the initial column that was changed during the row and column change, and the offset of the changed row or column from its state before the change. The newly added virtual row number is a row number added when rows and columns are increased, and it is different from the actual row number of each first cell before the row and column change; the newly added virtual column number is a column number added when rows and columns are increased, and it is different from the actual column number of each first cell before the row and column change; based on the hash table and the segment table, the second identifier of each second cell and each third cell in the visible area table is determined, and the third identifier of each fourth cell corresponding to the newly added rows and columns in the visible area table is determined; wherein, the second cell is the first cell whose row and column and the rows and columns before the cell have not changed; the third cell is the first cell whose row and column before the cell have been deleted. The first cell; the second identifier is related to the actual row number of the initial row or the actual column number of the initial column in the segmented table, and the offset of the changed row or column compared to before the row or column change; the third identifier of each fourth cell is related to the newly added virtual row number and / or newly added virtual column number of each fourth cell in the hash table; based on the identifiers of each cell in the viewport table after the row and column changes, the identifiers corresponding to each cell in the viewport table after the row and column changes in the file object model are determined; and based on the identifiers corresponding to each cell in the viewport table after the row and column changes in the file object model, and the content corresponding to the rendering area table, the content corresponding to each cell in the viewport table is rendered.

[0130] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements a method for rendering large-scale page tables provided by the present invention. The method includes: acquiring metadata corresponding to a target table and content corresponding to a rendering area table; the rendering area table being contained within the target table; the rendering area table containing a viewport table; and, when it is determined that the display states of the first cells in the viewport table are different, and based on the metadata corresponding to the target table, it is determined that the metadata corresponding to the target table does not contain a table header, the method further... Based on the actual row number and actual column number of each first cell in the viewport table within the target table, a first identifier for each first cell in the viewport table is determined. In response to user commands to modify the row and column of the viewport table, a hash table and a segment table are updated. The hash table records the correspondence between the actual row number and the newly added virtual row number, as well as the correspondence between the actual column number and the newly added virtual column number, during row and column modifications. The segment table records the actual row number of the initial row or the actual column number of the initial column that was modified during the row and column modification, and the offset of the modified row or column from its state before the modification. The newly added virtual row number is determined when rows and columns are added. The newly added row numbers are different from the actual row numbers of the first cells before the row and column changes; the newly added virtual column numbers are column numbers added when rows and columns are added, and are different from the actual column numbers of the first cells before the row and column changes; based on the hash table and segment table, the second identifiers of each second cell and each third cell in the visible area table are determined, and the third identifiers of each fourth cell corresponding to the newly added rows and columns in the visible area table are determined; wherein, the second cell is the first cell whose row and column and the rows and columns before it have not changed; the third cell is the first cell whose row and column before it have been deleted; the second identifier The identifier is related to the actual row number of the initial row or the actual column number of the initial column in the segmentation table, as well as the offset of the changed row or column compared to before the row or column change; the third identifier of each fourth cell is related to the newly added virtual row number and / or newly added virtual column number of each fourth cell in the hash table; based on the identifier of each cell in the viewport table after the row and column change, the identifier corresponding to each cell in the viewport table after the row and column change in the file object model is determined; and based on the identifier corresponding to each cell in the viewport table after the row and column change in the file object model, and the content corresponding to the rendering area table, the content corresponding to each cell in the viewport table is rendered.

[0131] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0132] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0133] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for rendering large-scale page tables, characterized in that, The method includes: Obtain the metadata corresponding to the target table and the content corresponding to the rendering area table; the rendering area table is contained within the target table; the rendering area table contains the viewport table; If it is determined that the display states of the first cells in the visible area table are different, and based on the metadata corresponding to the target table, it is determined that the metadata corresponding to the target table does not contain a table header, then based on the actual row number and actual column number of each first cell in the visible area table in the target table, the first identifier of each first cell in the visible area table is determined; and in response to the user's row and column change operation command for the visible area table, the hash table and the segment table are updated; wherein, the hash table is used to record the correspondence between the actual row number and the newly added virtual row number when a row or column is added during the row and column change, as well as the correspondence between the actual column number or the newly added virtual column number; the segment table is used to record the actual row number or the actual column number of the initial row or column that is changed during the row and column change, as well as the offset of the changed row or column from before the row and column change; the newly added virtual row number is the row number added when a row or column is added, which is different from the actual row number of each first cell before the row and column change; the newly added virtual column number is the column number added when a row or column is added, which is different from the actual column number of each first cell before the row and column change; Based on the hash table and segmentation table, the second identifiers of each second cell and each third cell in the viewport table are determined, and the third identifiers of each fourth cell corresponding to the newly added rows and columns in the viewport table are determined; wherein, the second cell is the first cell whose row and column and the rows and columns preceding it have not been changed; the third cell is the first cell whose row and column preceding it have been deleted; the second identifier is related to the actual row number of the corresponding initial row or the actual column number of the initial column in the segmentation table, and the offset of the changed row or column from before the row and column change; the third identifier of each fourth cell is related to the newly added virtual row number and / or newly added virtual column number of each fourth cell in the hash table; Based on the identifiers of each cell in the viewport table after row and column changes, determine the corresponding identifiers of each cell in the viewport table after row and column changes in the file object model; and based on the corresponding identifiers of each cell in the viewport table after row and column changes in the file object model, and the content corresponding to the rendering area table, render the content corresponding to each cell in the viewport table.

2. The method for rendering large-scale page tables as described in claim 1, characterized in that, The step of updating the hash table and segment table in response to user commands to change the rows and columns of the visible area table includes: In response to a user's command to add a row to the visible area table, a new virtual row number is assigned to the cell of the added row, and the correspondence between the new virtual row number and the actual row number at the added position is saved in a hash table; or, in response to a user's command to add a column to the visible area table, a new virtual column number is assigned to the cell of the added column, and the correspondence between the new virtual column number and the actual column number at the added position is saved in a hash table; In response to the user's operation command to change the rows and columns of the visible area table, the element corresponding to the row and column change is added to the segmented table array, and the actual row number or actual column number of the row and column that has undergone the row and column change is updated in the hash table; wherein, the element corresponding to the row and column change includes the initial row or initial column corresponding to the row and column change, and the offset of the row or column corresponding to the row and column change.

3. The method for rendering large-scale page tables as described in claim 2, characterized in that, The step of determining the second identifier of each second cell and each third cell in the viewport table based on the hash table and the segmentation table, and determining the third identifier of each fourth cell corresponding to the newly added row and column in the viewport table; includes: From the hash table, find the actual row number or actual column number of each cell in the visible table; If it is determined that the hash table contains at least one of the target actual row number and the target actual column number of the target fourth cell, at least one of the target newly added virtual row number and the target cell newly added virtual column number is determined from the hash table; if it is determined that the hash table lacks either the target actual row number or the target actual column number of the target fourth cell, the target actual row number or the target actual column number of the target fourth cell is determined from the segment table; based on the newly added virtual column number and the newly added virtual row number of the target fourth cell, the second identifier of the target fourth cell is determined. Alternatively, if it is determined that the hash table does not contain at least one of the actual row number and the actual column number of the target second cell, the element corresponding to the row and column change of the target second cell is determined from the segmented table; based on the element corresponding to the row and column change of the target second cell, the second identifier of the target second cell is determined; if it is determined that the hash table does not contain at least one of the actual row number and the actual column number of the target third cell, the element corresponding to the row and column change of the target third cell is determined from the segmented table; based on the element corresponding to the row and column change of the target third cell, the second identifier of the target third cell is determined.

4. The method for rendering large-scale page tables as described in claim 3, characterized in that, In the case that the hash table contains at least one of the target actual row number and the target actual column number of the target fourth cell, at least one of the target newly added virtual row number and the target new virtual column number of the target fourth cell is determined from the hash table. If it is determined that either the actual row number or the actual column number of the target fourth cell is missing from the hash table, the actual row number or the actual column number of the target fourth cell is determined from the segmented table. Based on the newly added virtual column number and the newly added virtual row number of the target fourth cell, determine the second identifier of the target fourth cell, including: If it is determined that the hash table contains the target actual row number of the target fourth cell, but the hash table does not contain the target actual column number of the target fourth cell, then the target newly added virtual row number corresponding to the target actual row number of the target fourth cell is determined based on the hash table, the target actual column number of the target fourth cell is obtained from the segmentation table, and the third identifier of the target fourth cell is determined based on the target newly added virtual row number and the target actual column number; or, If it is determined that the hash table contains the target actual column number of the target fourth cell, and the hash table does not contain the target actual row number of the target fourth cell, then the target newly added virtual column number corresponding to the target actual column number of the target fourth cell is obtained from the hash table, and the target actual row number of the target fourth cell is determined based on the segmentation table. Finally, the third identifier of the target fourth cell is determined based on the target newly added virtual column number and the target actual row number; or, If it is determined that the hash table contains the target actual column number of the target fourth cell and the hash table contains the target actual row number of the target fourth cell, the target newly added virtual column number corresponding to the target actual column number of the target fourth cell and the target newly added virtual row number corresponding to the target actual row number of the target fourth cell are obtained from the hash table, and the third identifier of the target fourth cell is determined based on the target newly added virtual column number and the target newly added virtual row number.

5. The method for rendering large-scale page tables as described in claim 1, characterized in that, The method further includes: If it is determined that the display states of each first cell in the visible area table are different, and it is determined that the metadata corresponding to the target table contains the table header, then the fourth identifier of each first cell in the visible area table is determined based on the table header and column identifier or row identifier.

6. The method for rendering large-scale page tables as described in claim 1, characterized in that, The method further includes: If it is determined that the display states of each first cell in the viewport table are the same, the fifth identifier of each first cell in the viewport table is determined based on the position of each first cell in the rendering area table.

7. The method for rendering large-scale page tables as described in claim 1, characterized in that, Before obtaining the content corresponding to the table in the rendering area, the method further includes: dividing the target table into multiple data blocks according to a preset size; The process of obtaining the content corresponding to the rendering area table includes: In response to the user's request to render the viewport table, obtain the range of the viewport table; The range of the rendering area table is determined based on the range of the visible area table; Based on the range of the rendering area table, the data block corresponding to the rendering area table is determined.

8. A rendering device for large-scale page tables, characterized in that, The device includes: The acquisition module is used to acquire the metadata corresponding to the target table and the content corresponding to the rendering area table; the rendering area table is contained in the target table; the rendering area table contains the viewport table; The first determining module is used to determine the first identifier of each first cell in the viewport table when the to-be-displayed states of each first cell in the viewport table are different, and based on the metadata corresponding to the target table, it is determined that the metadata corresponding to the target table does not contain a table header. Based on the actual row number and actual column number of each first cell in the viewport table in the target table, the module determines the first identifier of each first cell in the viewport table. In response to a user's row and column change operation command for the viewport table, the module updates the hash table and the segment table. The hash table records the correspondence between the actual row number and the newly added virtual row number, as well as the correspondence between the actual column number and the newly added virtual column number, during the row and column change. The segment table records the actual row number of the initial row or the actual column number of the initial column that was changed during the row and column change, and the offset of the changed row or column compared to before the row and column change. The newly added virtual row number is a row number added when rows and columns are added, and is different from the actual row number of each first cell before the row and column change. The newly added virtual column number is a column number added when rows and columns are added, and is different from the actual column number of each first cell before the row and column change. The second determining module is used to determine the second identifier of each second cell and each third cell in the visible area table based on the hash table and the segmentation table, and to determine the third identifier of each fourth cell corresponding to the newly added row and column in the visible area table; wherein, the second cell is the first cell whose row and column and the rows and columns before the cell have not been changed; the third cell is the first cell whose row and column before the cell have been deleted; the second identifier is related to the actual row number of the corresponding initial row or the actual column number of the initial column in the segmentation table, and the offset of the changed row or column from the row or column before the change; the third identifier of each fourth cell is related to the newly added virtual row number and / or newly added virtual column number of each fourth cell in the hash table; The rendering module is used to determine the identifier corresponding to each cell in the viewport table after the row and column changes in the file object model based on the identifier of each cell in the viewport table after the row and column changes in the file object model; and to render the content corresponding to each cell in the viewport table based on the identifier corresponding to each cell in the viewport table after the row and column changes in the file object model and the content corresponding to the rendering area table.

9. A computer device comprising a memory and a processor, wherein the memory stores computer-readable instructions, characterized in that, When the computer-readable instructions are executed by the processor, the processor performs the rendering method for a large-scale page table as described in any one of claims 1 to 7.

10. A storage medium storing computer-readable instructions, characterized in that, When the computer-readable instructions are executed by one or more processors, the one or more processors perform the method for rendering large-scale page tables as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Method for operating table model

    CN102193782A

  • Electronic device, method, and apparatus for manipulating tables using multi-contact gestures

    CN104536690A