Table data processing method and device

By monitoring the table scroll bar movements and calculating the accumulated height, the table data loading strategy is dynamically adjusted, which solves the problems of scrolling lag and loading delay in table data processing, and achieves a smooth user experience and efficient data loading.

CN118567540BActive Publication Date: 2024-10-18ONE NETWORK INTEROPERABILITY (BEIJING) TECH CO LTD

Patent Information

Application Number
CN202411046896.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-01
Publication Date
2024-10-18
Estimated Expiration
2044-08-01

AI Technical Summary

Technical Problem

When processing large amounts of tabular data, common problems include scrolling freezes, filtering and sorting delays, slow editing, long loading times, and high memory usage. Existing technologies such as paging processing and virtual scrolling solutions have poor user experience and are not lightweight enough. .

Method used

By monitoring the scroll bar action of the table list, obtain the scroll distance and visual window height in real time, calculate the cumulative height and index, determine the loading strategy based on the evaluation function, dynamically adjust the loading and rendering of table data, and use paddingTop and paddingBottom to optimize data display to ensure Smooth user experience.

Benefits of technology

While keeping the total height of the table unchanged, the data loading performance is optimized, operation lags are reduced, and user experience and system performance are improved, especially when processing large data sets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118567540B_ABST
    Figure CN118567540B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a table data processing method, device and electronic device, which belongs to the field of data processing technology. The method comprises: monitoring the scrolling action of the scroll bar of the current page of the table list and recording the real-time scrolling distance value LR of the scroll bar, obtaining a first control vector K1 in real time; setting a second control vector K2 corresponding to the table data; traversing all elements contained in the table data, and for each element EMi, updating the accumulated height AH i =AH i‑1 +H i ; Form a loading ternary number SJ={TJ, VG, KP}, and determine the loading strategy of CLA data, PT value and PB value based on the ternary number SJ. This solution sets matching smooth display data according to different operation modes of current data, so as to avoid operation jams.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to a table data processing method, device and electronic equipment. Background Art

[0002] When working with large amounts of data in a spreadsheet, operation lag is a common problem, especially when the spreadsheet contains thousands of rows of data and complex formulas, conditional formats, charts, or graphs. The lag phenomenon is mainly manifested in the following aspects:

[0003] 1. Scrolling lag: When users try to scroll to view the contents of a table, if the table has a large amount of data, the scrolling operation may become slow or even stagnant. This is because the browser or application needs to calculate and render each row of data in the visible area, especially rows with complex formats and formulas.

[0004] 2. Filtering and sorting delays: When applying filtering conditions or performing sorting operations, if the entire dataset needs to be recalculated in the background, it may cause noticeable delays, especially if complex calculation logic or large datasets are involved.

[0005] 3. Slow editing and calculation: When entering data or modifying formulas in a cell, if there are a large number of formulas in the table that rely on the cell, each change may trigger recalculation of the entire table, which will greatly slow down the editing speed.

[0006] 4. Loading time is too long: When opening a spreadsheet file containing a large amount of data, the loading time of the entire file may increase significantly, affecting work efficiency.

[0007] 5. High memory usage: Tables with large amounts of data will take up more computer memory resources. If the computer itself has less memory, it may cause the entire system to run slowly or even crash.

[0008] 6. Sluggish graphics and interactions: Embedding charts or other graphical elements in a table, especially dynamically updated charts, can further exacerbate performance issues because they also require computing and rendering resources.

[0009] In view of the above problem, the existing technology often solves this problem by paging, that is, only a fixed amount of data is displayed at the same time. This method is relatively simple, but requires users to switch pages frequently, and users can only see a small amount of data at the same time, which has a poor user experience.

[0010] In addition, under the premise of maintaining a large amount of data, the existing solutions to this kind of lag are often general virtual scrolling solutions or integrated component libraries, which are not lightweight enough to use.

[0011] The above problems become technical problems that need to be solved. Summary of the invention

[0012] In view of this, an embodiment of the present invention provides a table data processing method, device and electronic device, which at least partially solve the problems existing in the prior art.

[0013] In a first aspect, an embodiment of the present invention provides a table data processing method, comprising:

[0014] Monitor the scrolling action of the scroll bar of the current page of the table list and record the real-time scrolling distance value LR of the scroll bar, and obtain the first control vector K1=[ST, CH, ES] in real time, where ST represents the distance from the current scroll bar to the top, CH represents the height of the current visible window, and ES is the preset height of the element in the table data;

[0015] Set a second control vector K2=[AH, SI, EI, PT, PB] corresponding to the table data, where AH represents the accumulated height of the table data, SI represents the starting index of the table data, EI represents the ending index of the table data, PT represents the top margin adjustment value of the table, and PB represents the bottom margin adjustment value of the table;

[0016] For a table data EM={EM1,EM2,…EMn} containing n table elements, traverse all elements contained in the table data, and for each element EMi, update the cumulative height AH i =AH i-1 + H i ;

[0017] If AH i-1 < ST and AH i >= ST, then set SI equal to i, then PT = ST-AH i-1 , A.H. i and AH i-1 Respectively represent the cumulative heights of the i-th and i-1-th elements;

[0018] If EI is not set, AH i >= ST + CH, then set EI equal to i, and set PB = AH i -(ST + CH);

[0019] The data between SI and EI in the table list is intercepted to form the data CLA to be currently displayed. Based on the preset evaluation function G, the loading time of the data CLA to be currently displayed is calculated to obtain the loading time TJ. Based on the real-time scrolling distance value LR of the scroll bar, the scrolling speed VG of the current scroll bar is determined. The data loading performance of the running device where the table data is located is evaluated to obtain the performance evaluation parameter KP, forming the loading ternary SJ={TJ,VG,KP}. Based on the ternary SJ, the loading strategy of CLA data, PT value and PB value is determined.

[0020] According to a specific implementation of the embodiment of the present disclosure, the monitoring of the scrolling action of the scroll bar of the current page of the table list and recording the real-time scrolling distance value LR of the scroll bar, and obtaining the first control vector K1=[ST, CH, ES] in real time include:

[0021] Select a scrollable The label is used as the target element for listening to scroll events;

[0022] Use the addEventListener method to add a scroll event listener to the target element. The scroll event listener triggers the scroll event processing function when the user scrolls.

[0023] In the triggered scroll event processing function, use event.target.scrollTop to get the distance between the current scroll bar and the top;

[0024] Use the event.target.clientHeight method to get the height of the visible window, and get the preset height of the elements in the table data according to the preset table setting rules.

[0025] According to a specific implementation of the embodiment of the present disclosure, the monitoring of the scrolling action of the scroll bar of the current page of the table list and recording the real-time scrolling distance value LR of the scroll bar, and obtaining the first control vector K1=[ST, CH, ES] in real time also includes:

[0026] Define a scroll event processing function, which is executed each time a scroll event is triggered. Inside the scroll event processing function, an event object is accessed, and the event object is a specific instance of the scroll event;

[0027] Inside the event handler, use the event.target.scrollTop property to get the distance of the current scroll position relative to the top of the element. The scrollTop property returns the pixel value of the current position of the vertical scroll bar, that is, the distance from the top of the element to the top of the view.

[0028] When you no longer need to listen to scroll events, remove the previously added listener by calling the removeEventListener method on the target element.

[0029] According to a specific implementation of the embodiment of the present disclosure, the step of calculating the loading time of the data CLA to be displayed to obtain the loading time TJ includes:

[0030] The data CLA to be displayed is intercepted by DataArray.slice(SI, EI + 1);

[0031] The loading time TJ is calculated by evaluating the function G:

[0032] TJ = G(DCT, AIS, NF, SRE, CTP)

[0033] Among them, DCT represents the number of loaded data items, DCT = EI-SI+1, AIS represents the average size of each data item of the data to be displayed, NF represents the quantitative indicator of the network transmission rate, SRE represents the time required for the server to process the request, and CTP represents the time required for the client to render and process AIS data.

[0034] According to a specific implementation of the embodiment of the present disclosure, the determining of the current scrolling speed VG of the scroll bar based on the real-time scrolling distance value LR of the scroll bar includes:

[0035] Continuously sample multiple scroll positions and corresponding time points to form a scroll distance sequence and time difference series ;

[0036] Based on the scroll distance sequence and time difference series , determine the scroll speed VG of the current scroll bar

[0037] .

[0038] According to a specific implementation of the embodiment of the present disclosure, the data loading performance of the running device where the table data is located is evaluated to obtain the performance evaluation parameter KP, including:

[0039] Construct performance evaluation parameter KP calculation formula:

[0040]

[0041] DTJ indicates the time from when the data request is sent to when it is fully presented on the user interface. AVS indicates the amount of data successfully loaded per unit time. ME indicates the ratio of memory occupied by the application during data loading and processing. CPUU indicates the CPU utilization during data loading and rendering. UIR indicates the delay time from user operation to interface response. NCA indicates the data success rate in the network environment. is the indicator weight, satisfying ;

[0042] , is the minimum loading time, is the first correction parameter;

[0043] , is the normalization function, and max is the maximum value calculation function;

[0044] , is the second correction parameter;

[0045] ;

[0046] , is the third correction parameter;

[0047] , min is the minimum value calculation function.

[0048] According to a specific implementation of an embodiment of the present disclosure, the method of determining a loading strategy of CLA data, PT value and PB value based on the ternary number SJ includes:

[0049] Compare the ternary number SJ with the preset values ​​TJ0, VG0 and KP respectively;

[0050] If TJ is less than TJ0, VG is greater than VG0, and KP is less than KP0, CLA data is not loaded in the current page, and PT value and PB value are not applied in the table of the current page;

[0051] If TJ is less than TJ0, VG is greater than VG0, and KP is greater than KP0, only part of the CLA data in the middle of the current view is loaded in the current page, and the PT value and PB value are not applied in the table of the current page.

[0052] According to a specific implementation of the embodiment of the present disclosure, the loading strategy of determining CLA data, PT value and PB value based on the ternary number SJ further includes:

[0053] If TJ is greater than TJ0, VG is less than VG0, and KP is greater than KP0, then CLA data is loaded in the current page, and PT and PB values ​​are applied to the table of the current page;

[0054] If TJ is greater than TJ0, VG is less than VG0, and KP is less than KP0, then further calculate the intermediate value When ρ is greater than the preset value ρ0, CLA data is loaded in the current page, and the PT value and PB value are not applied in the table of the current page. When ρ is less than the preset value ρ0, only the lower half of the CLA data in the current view is loaded in the current page, and only the PB value is applied in the table of the current page.

[0055] In a second aspect, an embodiment of the present invention provides a table data processing device, comprising:

[0056] The acquisition module monitors the scrolling action of the scroll bar of the current page of the table list and records the real-time scrolling distance value LR of the scroll bar, and obtains the first control vector K1=[ST, CH, ES] in real time, where ST represents the distance from the current scroll bar to the top, CH represents the height of the current visible window, and ES is the preset height of the element in the table data;

[0057] A setting module is used to set a second control vector K2=[AH, SI, EI, PT, PB] corresponding to the table data, where AH represents the accumulated height of the table data, SI represents the starting index of the table data, EI represents the ending index of the table data, PT represents the upper margin adjustment value of the table, and PB represents the lower margin adjustment value of the table;

[0058] The traversal module traverses all elements contained in the table data EM={EM1,EM2,…EMn} containing n table elements, and updates the accumulated height AH for each element EMi i =AH i-1 + H i ;

[0059] First setting module, if AH i-1 < ST and AH i >= ST, then set SI equal to i, then PT = ST-AH i-1 , A.H. i and AH i-1 Respectively represent the cumulative heights of the i-th and i-1-th elements;

[0060] The second setting module, if EI is not set, AH i >= ST + CH, then set EI equal to i, and set PB = AH i -(ST + CH);

[0061] A module is formed, which intercepts the data between SI and EI in the table list to form the data CLA to be currently displayed. Based on the preset evaluation function G, the loading time of the data CLA to be currently displayed is calculated to obtain the loading time TJ. Based on the real-time scrolling distance value LR of the scroll bar, the scrolling speed VG of the current scroll bar is determined. The data loading performance of the running device where the table data is located is evaluated to obtain the performance evaluation parameter KP, and a loading ternary number SJ={TJ,VG,KP} is formed. Based on the ternary number SJ, the loading strategy of CLA data, PT value and PB value is determined.

[0062] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:

[0063] at least one processor; and,

[0064] a memory communicatively connected to the at least one processor; wherein,

[0065] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the table data processing method in any of the aforementioned first aspects or any of the implementations of the first aspect.

[0066] In a fourth aspect, an embodiment of the present invention further provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable the computer to execute the table data processing method in the aforementioned first aspect or any implementation of the first aspect.

[0067] In the fifth aspect, an embodiment of the present invention further provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the table data processing method in the aforementioned first aspect or any implementation of the first aspect.

[0068] The table data processing scheme in the embodiment of the present invention includes: monitoring the scrolling action of the scroll bar of the current page of the table list and recording the real-time scrolling distance value LR of the scroll bar, obtaining a first control vector K1=[ST, CH, ES] in real time, where ST represents the distance between the current scroll bar and the top, CH represents the height of the current visible window, and ES represents the preset height of the element in the table data; setting a second control vector K2=[AH, SI, EI, PT, PB] corresponding to the table data, where AH represents the accumulated height of the table data, SI represents the starting index of the table data, EI represents the ending index of the table data, PT represents the upper margin adjustment value of the table, and PB represents the lower margin adjustment value of the table; for table data EM={EM1, EM2, ... EMn} containing n table elements, traversing all elements contained in the table data, and for each element EMi, updating the accumulated height AH i =AH i-1 +H i ; If AH i-1 < ST and AH i >= ST, then set SI equal to i, then PT = ST-AH i-1 , A.H. i and AH i-1 Respectively represent the cumulative height of the i-th and i-1-th elements; if EI is not set, AH i >= ST + CH, then set EI equal to i, and set PB = AH i -(ST + CH); intercept the data between SI and EI in the table list to form the current data CLA to be displayed, calculate the loading time of the current data CLA to be displayed based on the preset evaluation function G, and obtain the loading time TJ, determine the scrolling speed VG of the current scroll bar based on the real-time scrolling distance value LR of the scroll bar, evaluate the data loading performance of the running device where the table data is located, obtain the performance evaluation parameter KP, form the loading ternary SJ={TJ,VG,KP}, and determine the loading strategy of CLA data, PT value and PB value based on the ternary SJ. This solution stores the height occupied by each piece of data in the table while keeping the total height of the table supported by the content unchanged, calculates the data that should be displayed in the visible area of ​​the current table by monitoring the current position of the page scroll bar, and selectively fills the areas above and below the visible area with paddingTop and paddingBottom, so as to achieve the display of only smooth data that matches the current operation and device at the same time, thereby avoiding operation jams. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0070] Figure 1 A schematic diagram of a table data processing method provided by an embodiment of the present invention;

[0071] Figure 2 A schematic flow chart of another table data processing method provided by an embodiment of the present invention;

[0072] Figure 3 A schematic diagram of the structure of a table data processing device provided by an embodiment of the present invention;

[0073] Figure 4 A schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0074] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0075] The following describes the embodiments of the present disclosure through specific examples, and those skilled in the art can easily understand other advantages and effects of the present disclosure from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all of the embodiments. The present disclosure can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present disclosure. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present disclosure.

[0076] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein may be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present disclosure, it should be understood by those skilled in the art that an aspect described herein may be implemented independently of any other aspect, and two or more of these aspects may be combined in various ways. For example, any number of aspects described herein may be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein may be used to implement this device and / or practice this method.

[0077] It should also be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present disclosure. The drawings only show components related to the present disclosure rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.

[0078] Additionally, in the following description, specific details are provided to facilitate a thorough understanding of the examples. However, it will be understood by those skilled in the art that the aspects described may be practiced without these specific details.

[0079] The present disclosure provides a table data processing method. The table data processing method provided in this embodiment can be executed by a computing device, which can be implemented as software or a combination of software and hardware, and can be integrated in a server, terminal device, etc.

[0080] See also Figure 1 and Figure 2 , the present disclosure provides a table data processing method, including:

[0081] S101, monitor the scrolling action of the scroll bar of the current page of the table list and record the real-time scrolling distance value LR of the scroll bar, and obtain the first control vector K1=[ST, CH, ES] in real time, where ST represents the distance of the current scroll bar from the top, CH represents the height of the current visible window, and ES is the preset height of the element in the table data.

[0082] In order to monitor the scroll bar scrolling action of the table list or its wrapped container, record the scroll distance (LR) and obtain the control vector K1, the element to monitor the scroll event can be determined, usually a scrollable element. Or directly the browser's viewport. If it is a wrapper table , make sure it has overflow: auto; or overflow: scroll; set to make the content scrollable.

[0083] You can use JavaScript's addEventListener method to add a scroll event listener to the target element. In the triggered scroll event handler, use event.target.scrollTop (directly listen to the scroll element) or window.pageYOffset (listen to the entire page scroll) to get the distance between the current scroll bar and the top.

[0084] To get the height of the visible window, you can use event.target.clientHeight or document.documentElement.clientHeight to calculate and obtain. ES is the preset height of a single element (such as a row) in a table. This value is usually fixed and needs to be set in advance according to the table design. You can directly use this preset value in the code.

[0085] Through the above steps, the movement of the scroll bar can be monitored in real time, ST, CH and the preset ES value can be obtained, so as to construct the control vector K1.

[0086] S102, set the second control vector K2=[AH, SI, EI, PT, PB] corresponding to the table data, AH represents the accumulated height of the table data, SI represents the starting index of the table data, EI represents the ending index of the table data, PT represents the top margin adjustment value of the table, and PB represents the bottom margin adjustment value of the table.

[0087] Setting the second control vector K2 = [AH, SI, EI, PT, PB] can better manage and control the display and loading of table data, optimize user experience and improve performance. The meaning of each element is as follows:

[0088] AH - table data accumulation height:

[0089] This value represents the total height of the data from the first row to the last row of the table. In a virtual scrolling scenario, it helps to quickly locate the position of a specific data row in the total height, which is critical for scroll bar position mapping and preloading judgment.

[0090] SI - starting index of table data:

[0091] Refers to the starting row index of the data in the current view. In paging or virtual scrolling, by adjusting SI, you can control which part of the data is rendered and displayed on the screen.

[0092] EI - End index of table data:

[0093] Indicates the end row index of the data in the current view (excluding this row). Together with SI, it defines the data range in the current visible range.

[0094] PT - table top margin adjustment value:

[0095] Used to control the spacing between the table content and the top of the container. When implementing preloading, PT can help load data that is about to enter the visible area in advance to reduce the loading delay perceived by users.

[0096] 5. PB - Table bottom margin adjustment value:

[0097] Controls the distance between the table content and the bottom of the container. Similar to PT, PB can be used to load more data in advance to ensure that the next page of data is seamlessly connected when the user scrolls to the bottom, improving the scrolling experience.

[0098] Through the second control vector, a framework is provided for dynamically managing the display range and loading strategy of table data, which can effectively improve performance and user experience, especially when processing large data sets. By updating these parameters in real time, data can be loaded on demand, scrolled smoothly, and managed efficiently.

[0099] S103, for table data EM={EM1, EM2, ... EMn} containing n table elements, traverse all elements contained in the table data, and for each element EMi, update the accumulated height AH i =AH i-1 + H i .

[0100] Traversing all elements in the table data EM={EM1,EM2,…,EMn} and calculating the cumulative height AHi of each element may include the following steps:

[0101] Define the variable cumulative height AH = 0 as the initial value of the cumulative height, which is used to store the accumulated height from the first row to the current row.

[0102] Traverse each element in the table data set EM, that is, from EM1 to EMn. For each element EMi (where i ranges from 1 to n): For each element EMi, get the height of the element, recorded as Hi.

[0103] Based on the cumulative height AH of the previous row i-1 , calculate the cumulative height AH of the current row i =AH i-1 + H i , at the first iteration (i.e. i=1), since there is no previous row, the accumulated height is directly equal to H i .

[0104] During the traversal process, the accumulated height AH i It can be used for a variety of purposes, such as determining which data rows should be rendered, or helping calculate the position and scale of scroll bars.

[0105] After the traversal is completed, AH will store the total height of the entire table data. This total height can be used to optimize scrolling performance, preload data, or perform other scrolling-related calculations.

[0106] Through the above method, the height of each table element can be gradually accumulated to obtain the accumulated height information of the entire table, which is used to manage and optimize the display of table data.

[0107] S104, if AH i-1 < ST and AH i >= ST, then set SI equal to i, then PT = ST-AH i-1 , A.H. i and AH i-1 Represent the cumulative heights of the i-th and i-1-th elements respectively.

[0108] When traversing the accumulated height of table elements, encountering a point that meets certain conditions can be used to determine the key parameters in the rolling loading strategy. The specific steps are as follows:

[0109] When the accumulation reaches the i-th element, if the accumulation height of the previous element is AH i-1 Less than the viewport top distance ST (that is, the distance from the scroll bar to the top), and added to the height AH of the current element i If it is greater than or equal to ST, the starting index SI is set to i, which means that the data starting from element EMi should be loaded and displayed in the visible area.

[0110] When the above conditions are met, the top margin adjustment value PT is set to ST - AH i-1 This value represents the theoretical value of the scroll bar from AH to ST. i-1 In practical applications, this value can be used to determine the starting point of preloading data to ensure that the data is ready when the user scrolls to the top of the visible area.

[0111] Such a mechanism can effectively help realize dynamic data loading during scrolling, ensure a smooth user experience, and optimize resource utilization.

[0112] S105, if EI is not set, AH i >= ST + CH, then set EI equal to i, and set PB = AH i -(ST + CH);

[0113] When the accumulated height reaches or exceeds a certain threshold, which is the current window height CH plus the starting offset ST, the following operations are performed:

[0114] Set end index: If the accumulated height AHi exceeds ST + CH without setting EI (i.e. the end index of the table data) in advance, set EI equal to the current index i. This means that EMi is the last element that makes the accumulated height within the current window display range.

[0115] Set the bottom margin adjustment value: At the same time, set PB (the bottom margin adjustment value of the table) to AH i -(ST + CH). This calculation reflects the cumulative height AH from the bottom of the current viewport. i The extra space ensures that when the user scrolls close to the end of the current data, the system can load more data in advance to reduce blank space or delay when scrolling to the bottom.

[0116] This approach can dynamically adjust the data loading range to ensure a smooth user experience, especially when dealing with scrolling tables with large amounts of data.

[0117] S106, intercept the data between SI and EI in the table list to form the data CLA to be currently displayed, calculate the loading time of the data CLA to be currently displayed based on the preset evaluation function G, and obtain the loading time TJ, determine the scrolling speed VG of the current scroll bar based on the real-time scrolling distance value LR of the scroll bar, evaluate the data loading performance of the running device where the table data is located, and obtain the performance evaluation parameter KP, form the loading ternary SJ={TJ,VG,KP}, and determine the loading strategy of CLA data, PT value and PB value based on the ternary SJ.

[0118] According to the starting index SI and the ending index EI, the data fragments to be displayed are intercepted from the table list to form the current data to be displayed CLA. Apply the preset evaluation function G, based on the characteristics of CLA (such as data volume, data type, etc.) and device performance, calculate the estimated time TJ required to load CLA. By analyzing the real-time scrolling distance value LR of the scroll bar and its changes over time, calculate the scrolling speed VG of the scroll bar, so as to predict the user's scrolling behavior and optimize the data preloading time. It is also possible to further examine the comprehensive performance of the running device when processing the current data loading task, including but not limited to CPU usage, memory usage, network status, etc., and combine these factors to obtain the performance evaluation parameter KP. The above-obtained TJ (loading time), VG (scrolling speed) and KP (performance evaluation parameter) are integrated into the loading ternary SJ = {TJ, VG, KP}.

[0119] Based on SJ, dynamically adjust the key parameters of the data loading strategy, including:

[0120] PT value: The top margin adjustment value. Based on VG and TJ, it determines how much data should be preloaded before the user scrolls to reduce waiting time.

[0121] PB value: bottom margin adjustment value, combined with VG and KP, determines when to start loading subsequent data, ensuring data continuity during scrolling to avoid blank spaces or delays.

[0122] CLA data processing: Optimize the rendering order and method of CLA data according to TJ and device performance KP.

[0123] Specifically, the loading strategy of determining the CLA data, the PT value and the PB value based on the ternary number SJ may include:

[0124] Compare the ternary number SJ with the preset values ​​TJ0, VG0 and KP respectively;

[0125] If TJ is less than TJ0, VG is greater than VG0, and KP is less than KP0, CLA data is not loaded in the current page, and PT value and PB value are not applied in the table of the current page;

[0126] If TJ is less than TJ0, VG is greater than VG0, and KP is greater than KP0, only part of the CLA data in the middle of the current view is loaded in the current page, and the PT value and PB value are not applied in the table of the current page.

[0127] If TJ is greater than TJ0, VG is less than VG0, and KP is greater than KP0, then CLA data is loaded in the current page, and PT and PB values ​​are applied to the table of the current page;

[0128] If TJ is greater than TJ0, VG is less than VG0, and KP is less than KP0, then further calculate the intermediate value When ρ is greater than the preset value ρ0, CLA data is loaded in the current page, and the PT value and PB value are not applied in the table of the current page. When ρ is less than the preset value ρ0, only the lower half of the CLA data in the current view is loaded in the current page, and only the PB value is applied in the table of the current page.

[0129] Through the above steps, you can achieve refined management of table data loading and ensure a smooth browsing experience under different device performance and user scrolling behaviors.

[0130] According to a specific implementation of the embodiment of the present disclosure, the monitoring of the scrolling action of the scroll bar of the current page of the table list and recording the real-time scrolling distance value LR of the scroll bar, and obtaining the first control vector K1=[ST, CH, ES] in real time include:

[0131] Select a scrollable The label is used as the target element for listening to scroll events;

[0132] Use the addEventListener method to add a scroll event listener to the target element. The scroll event listener triggers the scroll event processing function when the user scrolls.

[0133] In the triggered scroll event processing function, use event.target.scrollTop to get the distance between the current scroll bar and the top;

[0134] Use the event.target.clientHeight method to get the height of the visible window, and get the preset height of the elements in the table data according to the preset table setting rules.

[0135] According to a specific implementation of the embodiment of the present disclosure, the monitoring of the scrolling action of the scroll bar of the current page of the table list and recording the real-time scrolling distance value LR of the scroll bar, and obtaining the first control vector K1=[ST, CH, ES] in real time also includes:

[0136] Define a scroll event processing function, which is executed each time a scroll event is triggered. Inside the scroll event processing function, an event object is accessed, and the event object is a specific instance of the scroll event;

[0137] Inside the event handler, use the event.target.scrollTop property to get the distance of the current scroll position relative to the top of the element. The scrollTop property returns the pixel value of the current position of the vertical scroll bar, that is, the distance from the top of the element to the top of the view.

[0138] When you no longer need to listen to scroll events, remove the previously added listener by calling the removeEventListener method on the target element.

[0139] According to a specific implementation of the embodiment of the present disclosure, the step of calculating the loading time of the data CLA to be displayed to obtain the loading time TJ includes:

[0140] The data CLA to be displayed is intercepted by DataArray.slice(SI, EI + 1);

[0141] The loading time TJ is calculated by evaluating the function G:

[0142] TJ = G(DCT, AIS, NF, SRE, CTP)

[0143] Among them, DCT represents the number of loaded data items, DCT = EI-SI+1, AIS represents the average size of each data item of the data to be displayed, NF represents the quantitative indicator of the network transmission rate, SRE represents the time required for the server to process the request, and CTP represents the time required for the client to render and process AIS data.

[0144] According to a specific implementation of the embodiment of the present disclosure, the determining of the current scrolling speed VG of the scroll bar based on the real-time scrolling distance value LR of the scroll bar includes:

[0145] Continuously sample multiple scroll positions and corresponding time points to form a scroll distance sequence and time difference series ;

[0146] Based on the scroll distance sequence and time difference series , determine the scroll speed VG of the current scroll bar

[0147] .

[0148] According to a specific implementation of the embodiment of the present disclosure, the data loading performance of the running device where the table data is located is evaluated to obtain the performance evaluation parameter KP, including:

[0149] Construct performance evaluation parameter KP calculation formula:

[0150]

[0151] DTJ indicates the time from when the data request is sent to when it is fully presented on the user interface. AVS indicates the amount of data successfully loaded per unit time. ME indicates the ratio of memory occupied by the application during data loading and processing. CPUU indicates the CPU utilization during data loading and rendering. UIR indicates the delay time from user operation to interface response. NCA indicates the data success rate in the network environment. is the indicator weight, satisfying ;

[0152] , is the minimum loading time, is the first correction parameter;

[0153] , is the normalization function, and max is the maximum value calculation function;

[0154] , is the second correction parameter;

[0155] ;

[0156] , is the third correction parameter;

[0157] , min is the minimum value calculation function.

[0158] According to a specific implementation of an embodiment of the present disclosure, the method of determining a loading strategy of CLA data, PT value and PB value based on the ternary number SJ includes:

[0159] Compare the ternary number SJ with the preset values ​​TJ0, VG0 and KP respectively;

[0160] If TJ is less than TJ0, VG is greater than VG0, and KP is less than KP0, CLA data is not loaded in the current page, and PT value and PB value are not applied in the table of the current page;

[0161] If TJ is less than TJ0, VG is greater than VG0, and KP is greater than KP0, only part of the CLA data in the middle of the current view is loaded in the current page, and the PT value and PB value are not applied in the table of the current page.

[0162] According to a specific implementation of the embodiment of the present disclosure, the loading strategy of determining CLA data, PT value and PB value based on the ternary number SJ further includes:

[0163] If TJ is greater than TJ0, VG is less than VG0, and KP is greater than KP0, then CLA data is loaded in the current page, and PT and PB values ​​are applied to the table of the current page;

[0164] If TJ is greater than TJ0, VG is less than VG0, and KP is less than KP0, then further calculate the intermediate value When ρ is greater than the preset value ρ0, CLA data is loaded in the current page, and the PT value and PB value are not applied in the table of the current page. When ρ is less than the preset value ρ0, only the lower half of the CLA data in the current view is loaded in the current page, and only the PB value is applied in the table of the current page.

[0165] Corresponding to the above method embodiment, see Figure 3 The embodiment of the present invention further discloses a table data processing device 30, comprising:

[0166] The acquisition module 301 monitors the scrolling action of the scroll bar of the current page of the table list and records the real-time scrolling distance value LR of the scroll bar, and acquires the first control vector K1=[ST, CH, ES] in real time, where ST represents the distance from the current scroll bar to the top, CH represents the height of the current visible window, and ES is the preset height of the element in the table data;

[0167] A setting module 302 sets a second control vector K2=[AH, SI, EI, PT, PB] corresponding to the table data, where AH represents the accumulated height of the table data, SI represents the starting index of the table data, EI represents the ending index of the table data, PT represents the upper margin adjustment value of the table, and PB represents the lower margin adjustment value of the table;

[0168] The traversal module 303 traverses all elements contained in the table data EM={EM1, EM2, ... EMn} containing n table elements, and updates the accumulated height AH for each element EMi. i =AH i-1 + H i ;

[0169] The first setting module 304, if AH i-1 < ST and AH i >= ST, then set SI equal to i, then PT =ST-AH i-1 , A.H. i and AH i-1 Respectively represent the cumulative heights of the i-th and i-1-th elements;

[0170] The second setting module 305, if EI is not set, AH i >= ST + CH, then set EI equal to i, and set PB = AH i (ST + CH);

[0171] Forming module 306, intercepting the data between SI and EI in the table list, forming the data CLA to be currently displayed, calculating the loading time of the data CLA to be currently displayed based on the preset evaluation function G, obtaining the loading time TJ, determining the scrolling speed VG of the current scroll bar based on the real-time scrolling distance value LR of the scroll bar, evaluating the data loading performance of the running device where the table data is located, obtaining the performance evaluation parameter KP, forming the loading ternary SJ={TJ,VG,KP}, and determining the loading strategy of CLA data, PT value and PB value based on the ternary SJ.

[0172] See also Figure 4 The embodiment of the present invention further provides an electronic device 60, the electronic device comprising:

[0173] at least one processor; and,

[0174] a memory communicatively connected to the at least one processor; wherein,

[0175] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the table data processing method in the aforementioned method embodiment.

[0176] An embodiment of the present invention further provides a non-transitory computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable the computer to execute the aforementioned method embodiment.

[0177] An embodiment of the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions, which, when executed by a computer, enable the computer to execute the table data processing method in the aforementioned method embodiment.

[0178] Reference below Figure 4 , which shows a schematic diagram of the structure of an electronic device 60 suitable for implementing the embodiment of the present disclosure. The electronic device in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 4 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0179] like Figure 4 As shown, the electronic device 60 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 60 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0180] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, a gage, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 60 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 4 The electronic device 60 is shown with various devices, but it should be understood that it is not required to implement or have all the devices shown. More or fewer devices may be implemented or have instead.

[0181] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0182] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A table data processing method, characterized in that: include: Monitor the scrolling action of the scroll bar of the current page of the table list and record the real-time scrolling distance value LR of the scroll bar, and obtain the first control vector K1=[ST, CH, ES] in real time, where ST represents the distance from the current scroll bar to the top, CH represents the height of the current visible window, and ES is the preset height of the element in the table data; Set a second control vector K2=[AH, SI, EI, PT, PB] corresponding to the table data, where AH represents the accumulated height of the table data, SI represents the starting index of the table data, EI represents the ending index of the table data, PT represents the top margin adjustment value of the table, and PB represents the bottom margin adjustment value of the table; For a table data EM={EM1,EM2,…EMn} containing n table elements, traverse all elements contained in the table data, and for each element EMi, update the cumulative height AH i =AH i-1 + H i ; If AH i-1 < ST and AH i >= ST, then set SI equal to i, then PT = ST-AH i-1 , A.H. i and AH i-1 Respectively represent the cumulative heights of the i-th and i-1-th elements; If EI is not set, AH i >= ST + CH, then set EI equal to i, and set PB = AH i -(ST + CH); Intercept the data between SI and EI in the table list to form the data CLA to be displayed currently, calculate the loading time of the data CLA to be displayed currently based on the preset evaluation function G, obtain the loading time TJ, determine the scrolling speed VG of the current scroll bar based on the real-time scrolling distance value LR of the scroll bar, evaluate the data loading performance of the running device where the table data is located, obtain the performance evaluation parameter KP, form the loading ternary number SJ={TJ,VG,KP}, and determine the loading strategy of CLA data, PT value and PB value based on the ternary number SJ; The method of determining the loading strategy of CLA data, PT value and PB value based on the ternary number SJ includes: Compare the ternary number SJ with the preset values ​​TJ0, VG0 and KP respectively; If TJ is less than TJ0, VG is greater than VG0, and KP is less than KP0, CLA data is not loaded in the current page, and PT value and PB value are not applied in the table of the current page; If TJ is less than TJ0, VG is greater than VG0, and KP is greater than KP0, only the CLA data in the middle of the current view is loaded in the current page, and the PT value and PB value are not applied in the table of the current page; If TJ is greater than TJ0, VG is less than VG0, and KP is greater than KP0, then CLA data is loaded in the current page, and PT and PB values ​​are applied to the table of the current page; If TJ is greater than TJ0, VG is less than VG0, and KP is less than KP0, then further calculate the intermediate value When ρ is greater than the preset value ρ0, CLA data is loaded in the current page, and the PT value and PB value are not applied in the table of the current page. When ρ is less than the preset value ρ0, only the lower half of the CLA data in the current view is loaded in the current page, and only the PB value is applied in the table of the current page.

2. The method according to claim 1, characterized in that The monitoring of the scrolling action of the scroll bar of the current page of the table list and recording the real-time scrolling distance value LR of the scroll bar, and obtaining the first control vector K1=[ST, CH, ES] in real time, includes: Select a scrollable The label is used as the target element for listening to scroll events; Use the addEventListener method to add a scroll event listener to the target element. The scroll event listener triggers the scroll event processing function when the user scrolls. In the triggered scroll event processing function, use event.target.scrollTop to get the distance between the current scroll bar and the top; Use the event.target.clientHeight method to get the height of the visible window, and according to the preset rules, get the preset height of the elements in the table data.

3. The method according to claim 2, characterized in that The monitoring of the scrolling action of the scroll bar of the current page of the table list and recording the real-time scrolling distance value LR of the scroll bar, and obtaining the first control vector K1=[ST, CH, ES] in real time, also includes: Define a scroll event processing function, which is executed each time a scroll event is triggered. Inside the scroll event processing function, an event object is accessed, and the event object is a specific instance of the scroll event; Inside the event handler, use the event.target.scrollTop property to get the distance of the current scroll position relative to the top of the element. The scrollTop property returns the pixel value of the current position of the vertical scroll bar, that is, the distance from the top of the element to the top of the view. When you no longer need to listen to scroll events, remove the previously added listener by calling the removeEventListener method on the target element.

4. The method according to claim 3, characterized in that The step of calculating the loading time of the data CLA to be displayed to obtain the loading time TJ includes: The data CLA to be displayed is intercepted by DataArray.slice(SI, EI + 1); The loading time TJ is calculated by evaluating the function G: TJ = G(DCT, AIS, NF, SRE, CTP) Among them, DCT represents the number of loaded data items, DCT = EI-SI+1, AIS represents the average size of each data item of the data to be displayed, NF represents the quantitative indicator of the network transmission rate, SRE represents the time required for the server to process the request, and CTP represents the time required for the client to render and process AIS data.

5. The method according to claim 4, characterized in that The step of determining the current scrolling speed VG of the scroll bar based on the real-time scrolling distance value LR of the scroll bar includes: Continuously sample multiple scroll positions and corresponding time points to form a scroll distance sequence and time difference series ; Based on scroll distance sequence and time difference series , determine the scroll speed VG of the current scroll bar: 。 6. The method according to claim 5, characterized in that The data loading performance of the running device where the table data is located is evaluated to obtain a performance evaluation parameter KP, including: Construct performance evaluation parameter KP calculation formula: , DTJ indicates the time from when the data request is sent to when it is fully presented on the user interface. AVS indicates the amount of data successfully loaded per unit time. ME indicates the ratio of memory occupied by the application during data loading and processing. CPUU indicates the CPU utilization during data loading and rendering. UIR indicates the delay time from user operation to interface response. NCA indicates the data success rate in the network environment. is the indicator weight, satisfying ; , is the minimum loading time, is the first correction parameter; , is the normalization function, and max is the maximum value calculation function; , is the second correction parameter; ; , is the third correction parameter; , min is the minimum value calculation function.

7. A table data processing device, characterized in that: include: The acquisition module monitors the scrolling action of the scroll bar of the current page of the table list and records the real-time scrolling distance value LR of the scroll bar, and obtains the first control vector K1=[ST, CH, ES] in real time, where ST represents the distance from the current scroll bar to the top, CH represents the height of the current visible window, and ES is the preset height of the element in the table data; A setting module is used to set a second control vector K2=[AH, SI, EI, PT, PB] corresponding to the table data, where AH represents the accumulated height of the table data, SI represents the starting index of the table data, EI represents the ending index of the table data, PT represents the upper margin adjustment value of the table, and PB represents the lower margin adjustment value of the table; The traversal module traverses all elements contained in the table data EM={EM1,EM2,…EMn} containing n table elements, and updates the accumulated height AH for each element EMi i =AH i-1 + H i ; First setting module, if AH i-1 < ST and AH i >= ST, then set SI equal to i, then PT = ST-AH i-1 , A.H. i and AH i-1 Respectively represent the cumulative heights of the i-th and i-1-th elements; The second setting module, if EI is not set, AH i >= ST + CH, then set EI equal to i, and set PB = AH i -(ST + CH); A module is formed, which intercepts the data between SI and EI in the table list to form the data CLA to be displayed currently, calculates the loading time of the data CLA to be displayed currently based on the preset evaluation function G, obtains the loading time TJ, determines the scrolling speed VG of the current scroll bar based on the real-time scrolling distance value LR of the scroll bar, evaluates the data loading performance of the running device where the table data is located, obtains the performance evaluation parameter KP, forms a loading ternary number SJ={TJ,VG,KP}, and determines the loading strategy of CLA data, PT value and PB value based on the ternary number SJ; The method of determining the loading strategy of CLA data, PT value and PB value based on the ternary number SJ includes: Compare the ternary number SJ with the preset values ​​TJ0, VG0 and KP respectively; If TJ is less than TJ0, VG is greater than VG0, and KP is less than KP0, CLA data is not loaded in the current page, and PT value and PB value are not applied in the table of the current page; If TJ is less than TJ0, VG is greater than VG0, and KP is greater than KP0, only the CLA data in the middle of the current view is loaded in the current page, and the PT value and PB value are not applied in the table of the current page; If TJ is greater than TJ0, VG is less than VG0, and KP is greater than KP0, then CLA data is loaded in the current page, and PT and PB values ​​are applied to the table of the current page; If TJ is greater than TJ0, VG is less than VG0, and KP is less than KP0, then further calculate the intermediate value When ρ is greater than the preset value ρ0, CLA data is loaded in the current page, and the PT value and PB value are not applied in the table of the current page. When ρ is less than the preset value ρ0, only the lower half of the CLA data in the current view is loaded in the current page, and only the PB value is applied in the table of the current page.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the table data processing method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Page tabular display method

    CN103164401A

  • Method and apparatus of displaying table data in webpage

    CN106557491A

  • Method for displaying tables in page and mobile terminal

    CN111931093A

  • Data rendering method, device and equipment and storage medium

    CN112000906A

  • Method and equipment for loading and displaying big data report

    CN112732397A

Cited By

  • RAG-based table data processing method and system

    CN120354833A

  • Rag-based table data processing method and system

    CN120354833B