Data processing method and related product
Through the cross-table synchronous scrolling mechanism, responding to the scroll control event of the first table, calculating the scroll ratio and loading the synchronous table content, it solves the problems of cumbersome multi-table operations and low loading efficiency, and realizes efficient and flexible table data processing.
Patent Information
- Application Number
- CN202510464815.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2025-09-23
AI Technical Summary
In multiple table operation scenarios, existing technologies lead to problems such as cumbersome user operations and low table loading efficiency.
Cross-table synchronous scrolling is achieved by responding to a scroll control event of the first table, determining its scroll information, calculating a scroll ratio, and synchronously loading other table contents having a synchronous scrolling relationship therewith based on the ratio.
It reduces the frequency of user operations when viewing multiple tables, improves the loading efficiency and data consistency of table content, and ensures the flexibility and responsiveness of multiple tables when scrolling synchronously.
Smart Images

Figure CN120687689A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a data processing method and related products. Background Art
[0002] With the development of the internet, spreadsheets have become increasingly common, and users' demand for more advanced spreadsheet functionality has been growing. Currently, spreadsheets can be rendered in a browser to display their contents. When a spreadsheet is large or contains a lot of content, users can scroll through the spreadsheet's scroll bars to view the contents. However, when users need to view multiple related spreadsheets, they must switch between them and manipulate the scroll bars of each spreadsheet, which is not only cumbersome but also results in inefficient table loading. Summary of the Invention
[0003] The purpose of the embodiments of the present application is to provide a data processing method and related products to solve the problem that in the scenario of operating multiple tables, the table data processing mechanism is poor, resulting in cumbersome user operations and low table loading efficiency.
[0004] To solve the above technical problems, the embodiments of the present application are implemented as follows:
[0005] In one aspect, an embodiment of the present application provides a data processing method, comprising:
[0006] In response to a scroll event of a first scroll control of a first table, determining first information of the first scroll control; the first information includes a first offset of the first scroll control scrolled based on the scroll event;
[0007] determining a first scroll ratio of the first scroll control according to the first offset and a first scroll distance of the first scroll control; the first scroll distance is determined according to first size information and second size information of the first table;
[0008] According to the first scroll ratio and the third size information of the third table, a first loading area of the third table is determined, and the table content in the first loading area is loaded; the third table includes the first table and a second table with a synchronous scrolling relationship with the first table.
[0009] On the other hand, an embodiment of the present application provides a data processing device, including:
[0010] A first determining module is configured to determine first information of a first scrolling control in response to a scrolling event of a first scrolling control of a first table, wherein the first information includes a first offset of the first scrolling control based on the scrolling event;
[0011] a second determining module, configured to determine a first scrolling ratio of the first scrolling control according to the first offset and a first scrolling distance of the first scrolling control; the first scrolling distance being determined according to the first size information and the second size information of the first table;
[0012] A loading module is used to determine a first loading area of the third table according to the first scrolling ratio and the third size information of the third table, and load the table content in the first loading area; the third table includes the first table and a second table with a synchronous scrolling relationship with the first table.
[0013] On the other hand, an embodiment of the present application provides an electronic device, including a processor and a memory electrically connected to the processor, the memory storing a computer program, and the processor being configured to call and execute the computer program from the memory to implement the above-mentioned data processing method.
[0014] On the other hand, an embodiment of the present application provides a computer-readable storage medium for storing a computer program, where the computer program can be executed by a processor to implement the above-mentioned data processing method.
[0015] On the other hand, an embodiment of the present application provides a computer program product, including a computer program, which is executed by a processor to implement the above-mentioned data processing method.
[0016] Adopting the technical solution of the embodiment of the present application, in response to the scroll event of the first scroll control for the first table, by determining the first information of the first scroll control, the first information includes the first offset of the first scroll control based on the scroll event; according to the first offset and the first scroll distance of the first scroll control, the first scroll ratio of the first scroll control is determined, the first scroll distance is determined according to the first size information and the second size information of the first table; according to the first scroll ratio and the third size information of the third table, the first loading area of the third table is determined, and the table content within the first loading area is loaded. The third table includes the first table and the second table that has a synchronous scrolling relationship with the first table. It can be seen that as long as a scroll event occurs in the first scroll control of the first table, the synchronous scrolling of the first table and the second table can be triggered, thereby realizing a cross-table synchronous scrolling mechanism. This mechanism can greatly reduce the frequency of operations when users view multiple tables and improve the efficiency of loading table content. In addition, in the cross-table synchronous scrolling mechanism, the synchronous scrolling of the second table is triggered based on the scrolling ratio of the first scrolling control, so that multiple tables with synchronous scrolling relationships can scroll according to the same scrolling ratio without considering the size and table structure of each table, thereby ensuring the data consistency of multiple tables during synchronous scrolling and improving the flexibility and response speed of synchronous operations of multiple tables. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate one or more embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments recorded in one or more embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0018] Figure 1 is a schematic flow chart of a data processing method according to an embodiment of the present application;
[0019] Figure 2 is a schematic block diagram of a data processing device according to an embodiment of the present application;
[0020] Figure 3 This is a schematic block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0021] The embodiments of the present application provide a data processing method and related products to solve the problem that in scenarios where operations are performed on multiple tables, the table data processing mechanism is poor, resulting in cumbersome user operations and low table loading efficiency.
[0022] In order to enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.
[0023] The terms "first," "second," and the like in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a particular order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of the present application can be implemented in orders other than those illustrated or described herein.
[0024] Bidirectional virtual scrolling is a technology for efficiently rendering large-scale data tables. Bidirectional virtual scrolling is not limited to vertical scrolling, but also supports horizontal scrolling in the left and right directions. In related art, users often need to view multiple tables simultaneously. In this scenario, users use the bidirectional virtual scrolling function of each table to operate multiple tables so that the multiple tables can render related data. Obviously, this method is not only cumbersome to operate, but also leads to low table loading efficiency. To address this technical problem, the present application provides a data processing method. In response to a scroll event of a first scroll control for a first table, the method determines first information of the first scroll control. The first information includes a first offset of the first scroll control based on the scroll event. The method then determines a first scroll ratio of the first scroll control based on the first offset and a first scroll distance of the first table. The first scroll distance is determined based on the first size information and second size information of the first table. The method then determines a first loading area of a third table based on the first scroll ratio and third size information of a third table, and loads the table content within the first loading area. The third table includes the first table and a second table that has a synchronous scrolling relationship with the first table. It can be seen that as long as a scroll event occurs in the first scroll control of the first table, the first table and the second table can be triggered to scroll synchronously, thereby realizing a cross-table synchronous scrolling mechanism. This mechanism can greatly reduce the frequency of user operations when viewing multiple tables and improve the efficiency of loading table content. In addition, in the cross-table synchronous scrolling mechanism, the synchronous scrolling of the second table is triggered based on the scroll ratio of the first scroll control, so that multiple tables with synchronous scrolling relationships can scroll according to the same scroll ratio without considering the size and table structure of each table, thereby ensuring the data consistency of multiple tables during synchronous scrolling and improving the flexibility and response speed of synchronous operations of multiple tables.
[0025] The data processing method provided in the embodiments of the present application can be executed by an electronic device or by software installed in the electronic device. Specifically, the electronic device can be a terminal device or a server device. The terminal device can include a smartphone, a laptop computer, a smart wearable device, a vehicle-mounted terminal, etc. The server device can include an independent physical server, a server cluster consisting of multiple servers, or a cloud server capable of cloud computing.
[0026] Figure 1 is a schematic flow chart of a data processing method according to an embodiment of the present application, such as Figure 1 As shown, the method includes the following steps S102-S106:
[0027] Step S102: In response to a scroll event of a first scroll control of a first table, determining first information of the first scroll control; the first information includes a first offset of the first scroll control scrolled based on the scroll event.
[0028] Optionally, a scroll event listener can be pre-configured for the first scroll control of the first table. When the user scrolls the first scroll control, the listener will capture the scroll event and record the position information on the scroll track of the first scroll control. The position information can be used to determine the first offset.
[0029] The embodiment of the present application supports a bidirectional scrolling scenario, and therefore, the scrolling event may be a vertical scrolling event in the up-down direction or a horizontal scrolling event in the left-right direction.
[0030] Optionally, in addition to the first offset, the first information may further include at least one of the following information: a scrolling direction of the first scroll control based on the scroll event, a scrolling speed, and a size of the first scroll control. If the first scroll control is a scroll bar, the size of the first scroll control is the length of the scroll bar.
[0031] The first offset is the distance between the initial position and the target position of the first scrolling control. The initial position is the position of the first scrolling control before the scrolling event occurs, and the target position is the position of the first scrolling control after the scrolling event occurs. Optionally, the position of the first scrolling control is represented by coordinates. Any position in the entire scrolling area of the first scrolling control can be used as the zero point and represented as the coordinates (0, 0). Other positions can be represented as coordinates (x, y) relative to the zero point. The first offset can be determined by calculating the difference between the coordinates of the initial position and the target position.
[0032] Step S104 : determining a first scroll ratio of the first scroll control according to the first offset and a first scroll distance of the first scroll control, where the first scroll distance is determined according to the first size information and the second size information of the first table.
[0033] The first size information of the first table may include the total size of the table, which may include the total height and / or total width of the table. The second size information may include the area size of a preset loading area, which refers to an area pre-set for loading table content for the user, also known as a visible area, and the area size of the preset loading area includes the height and / or width of the preset loading area. For non-visible areas that are hidden (i.e., not visible to the user), the table content therein may not be loaded.
[0034] Optionally, when determining the first scroll ratio, firstly calculate the first scroll distance of the first scroll control according to the total table size of the first table and the area size of the preset loading area; then calculate the first scroll ratio according to the first offset and the first scroll distance.
[0035] For a horizontal scrolling event, the first scrolling distance includes a first scrolling width. First, the first scrolling width of the first scrolling control is calculated based on the total width of the first table and the width of the preset loading area. Then, the first scrolling ratio is calculated based on the first offset in the horizontal direction and the first scrolling width. The first scrolling ratio R x The calculation method can be expressed by the following formula (1):
[0036] R x =L1 / (L 总 -L2) (1)
[0037] Wherein, L1 represents the first offset in the transverse direction. 总 represents the total width of the first table, and L2 represents the area width of the preset loading area of the first table.
[0038] For a vertical scrolling event, the first scrolling distance includes a first scrolling height. First, the first scrolling height of the first scrolling control is calculated based on the total height of the first table and the height of the preset loading area. Then, the first scrolling ratio is calculated based on the first offset in the vertical direction and the first scrolling height. The first scrolling ratio R y The calculation method can be expressed by the following formula (2):
[0039] R y =H1 / (H 总 -H2) (2)
[0040] Wherein, H1 represents the first offset in the longitudinal direction, H 总 represents the total height of the first table, and H2 represents the area height of the preset loading area of the first table.
[0041] In some embodiments, when calculating the first scroll distance, the difference between the total size of the first table and the size of the preset loading area is first calculated, and then the first scroll distance is determined based on the difference. Optionally, the difference between the total size of the first table and the size of the preset loading area is determined as the first scroll distance.
[0042] After the first scrolling distance (ie, the first scrolling width or the first scrolling height) is calculated, a ratio between the first offset and the first scrolling distance is calculated, and the ratio is the first scrolling ratio.
[0043] Step S106 , determining a first loading area of the third table according to the first scrolling ratio and the third size information of the third table, and loading the table content in the first loading area, wherein the third table includes the first table and a second table having a synchronous scrolling relationship with the first table.
[0044] Among them, the third size information may include the area size of the preset loading area of the third table. The preset loading area refers to the area pre-set for loading table content for users, which can also be called the visible area. The area size of the preset loading area includes the height and / or width of the preset loading area.
[0045] Tables with a synchronous scrolling relationship refer to multiple tables that share the same scrolling behavior, that is, when the user scrolls the scroll control of one of the tables, the other associated tables will also scroll synchronously. The second table that has a synchronous scrolling relationship with the first table can be determined intelligently by the electronic device or customized by the user. The synchronous scrolling relationship between the second table and the first table may include at least one of the following types: multiple tables have the same data, the data of multiple tables are associated (such as a master-slave table relationship, a row and column comparison relationship, etc.), and multiple tables belong to the same data view. Among them, multiple tables belong to the same data view, which can also be understood as multiple data display areas in the same data view. For example, in the same data view, the data view of frozen columns and a scrolling area in the data view can be regarded as tables with a synchronous scrolling relationship. Of course, users can also customize the table synchronous scrolling rules according to their needs. For example, some tables are configured to support only vertical synchronous scrolling, and other tables are configured to support both horizontal and vertical synchronous scrolling.
[0046] The size of the preset loading area of the first table and the size of the preset loading area of the second table can be the same or different. The first loading area of the first table and the first loading area of the second table can also be the same or different. The first loading area refers to the current visible area. For the same table, its first loading area varies depending on the position of the scroll control. That is, as the scroll control is scrolled, the position information of the first loading area changes in real time.
[0047] Optionally, determining the first loading area of the third table is to determine the position information of the first loading area. The position information of the first loading area can be characterized by the index (or identifier) of the initial row, the end row, the initial column, and the end column. In the case where the scrolling event is a horizontal scrolling event, the indexes of the starting column and the end column of the first loading area can be calculated, so as to load the table content in the first loading area based on the indexes of the starting column and the end column. In the case where the scrolling event is a vertical scrolling event, the indexes of the starting row and the end row of the first loading area can be calculated, so as to load the table content in the first loading area based on the indexes of the starting row and the end row.
[0048] Optionally, to reduce frequent DOM operations and data loading, the scroll state of each third table can be cached. Thus, in a synchronous scrolling scenario, the previous scroll state can be read from the cache and the target position corresponding to the current scroll event can be determined based on the previous scroll state, avoiding repeated calculations. The scroll state can include at least one of the following: a scroll scale and a target position to which the scroll control has scrolled.
[0049] The cross-table synchronous scrolling mechanism provided by the embodiment of the present application is suitable for complex scenarios such as multi-table data comparison and multi-table synchronous display. The core of achieving cross-table synchronous scrolling is to ensure that when each table is scrolled horizontally or vertically, other tables can be scrolled synchronously, ensuring the synchronous display effect and consistency of data in multiple tables. For example, when the user scrolls the first scroll control horizontally, the system will load the unloaded table content in the first loading area of the first table, and synchronously control the second scroll control of the second table to scroll horizontally, so that multiple tables with a synchronous scrolling relationship can synchronously display the column data in their respective first loading areas at the corresponding scroll positions.
[0050] Adopting the technical solution of the embodiment of the present application, in response to the scroll event of the first scroll control for the first table, by determining the first information of the first scroll control, the first information includes the first offset of the first scroll control based on the scroll event; according to the first offset and the first scroll distance of the first scroll control, the first scroll ratio of the first scroll control is determined, the first scroll distance is determined according to the first size information and the second size information of the first table; according to the first scroll ratio and the third size information of the third table, the first loading area of the third table is determined, and the table content within the first loading area is loaded. The third table includes the first table and the second table that has a synchronous scrolling relationship with the first table. It can be seen that as long as a scroll event occurs in the first scroll control of the first table, the synchronous scrolling of the first table and the second table can be triggered, thereby realizing a cross-table synchronous scrolling mechanism. This mechanism can greatly reduce the frequency of operations when users view multiple tables and improve the efficiency of loading table content. In addition, in the cross-table synchronous scrolling mechanism, the synchronous scrolling of the second table is triggered based on the scrolling ratio of the first scrolling control, so that multiple tables with synchronous scrolling relationships can scroll according to the same scrolling ratio without considering the size and table structure of each table, thereby ensuring the data consistency of multiple tables during synchronous scrolling and improving the flexibility and response speed of synchronous operations of multiple tables.
[0051] In one embodiment, the first information further includes the horizontal direction and / or the vertical direction of the scrolling of the first scroll control based on the scroll event. When determining the first loading area of the third table based on the first scroll ratio and the third size information of the third table, the following steps A1-A2 may be performed:
[0052] Step A1: Determine second information of a second scroll control of a second table according to a first scroll ratio and a horizontal scroll direction and / or a vertical scroll direction.
[0053] The second information may include at least one of the following: a second offset of the second scrolling control based on the first scrolling ratio, a second scrolling direction, and a second scrolling ratio.
[0054] The second direction in which the second scrolling control scrolls is the same as the first direction in which the first scrolling control scrolls. The scrolling controls of any table in the third table scroll according to the first scrolling ratio. Optionally, the second offset can be determined based on the first scrolling ratio, the total table size of the second table, and the area size of the preset loading area of the second table. For example, if the second direction is a horizontal direction, the first scrolling ratio, the total table width of the second table, and the area width of the preset loading area of the second table can be substituted into the above formula (1) to calculate the second offset. If the second direction is a vertical direction, the first scrolling ratio, the total table height of the second table, and the area height of the preset loading area of the second table can be substituted into the above formula (2) to calculate the second offset.
[0055] In step A2, according to the second information, the second scroll control is controlled to scroll to the first position, and the table area corresponding to the first position and matching the second size information is determined as the first loading area. The first position can be understood as the target position to which the scroll control is about to scroll.
[0056] After executing step A2, the table content in the first loading area of the second table is loaded.
[0057] Optionally, the second information may also include a scrolling step size, which is the scrolling speed of the second scroll control and is defined as the length of time the second scroll control scrolls. The scrolling speed of the second scroll control may be the same as or different from the scrolling speed of the first scroll control. When the total table size of the first table and the total table size of the second table are similar, the scrolling distance of the second scroll control and the first scroll control will be relatively close. In this case, the scrolling speeds of the second scroll control and the first scroll control may be the same or similar. When the total table size of the first table and the total table size of the second table differ significantly, the scrolling distance of the second scroll control and the first scroll control will also differ significantly. In this case, the scrolling speed of the second scroll control can be adjusted to ensure that the second scroll control and the first scroll control scroll to their respective target positions at the same time as much as possible, thereby ensuring that the table contents of the first and second tables are loaded synchronously. For example, if the total table size of the second table is larger than the total table size of the first table, the scrolling speed of the second scroll control will be faster than the scrolling speed of the first scroll control. If the total table size of the second table is smaller than the total table size of the first table, the scrolling speed of the second scroll control will be slower than the scrolling speed of the first scroll control.
[0058] Optionally, considering that multiple tables may scroll asynchronously due to certain reasons when scrolling synchronously, such as different first size information of different tables (e.g., deviations in total table height and total table width), loading delays, calculation errors, etc., after loading the table content in the first loading area, the third information of the second scroll control of the third table can be checked to ensure scrolling consistency between the third tables. The third information may include at least one of the following: the actual scroll offset of the second scroll control, the actual scroll direction, and the actual scroll ratio.
[0059] When detecting the third information of the second scroll control of the third table, the first size information of the third table can be obtained, and the actual scroll distance of the second scroll control of the third table can be determined. Then, based on the table size information of the third table and the actual scroll distance, the actual scroll ratio of the second scroll control of the third table can be calculated. If the actual scroll ratio is different from the scroll ratio corresponding to the current scroll event (i.e., the first scroll ratio), it is determined that there is a scroll deviation in the third table.
[0060] The third information of the second scroll control of the third table may be detected periodically or at a specific time. For example, one minute after the table contents in the first loading area of all third tables are loaded, the third information of the second scroll control of each third table may be detected.
[0061] Optionally, third information of the second scrolling control is determined based on the first position of the second scrolling control and the second position of the second scrolling control. The second position of the second scrolling control refers to the position of the second scrolling control before the scrolling event occurs, and the first position refers to the target position to which the second scrolling control should scroll after the scrolling event occurs. In response to a mismatch between the third information and the second information, the first position of the second scrolling control is adjusted, and based on the adjusted first position, the first loading area of the third table is redefined, and the table content within the redefined first loading area is loaded.
[0062] When adjusting the first position of the second scroll control, the offset of the second scroll control can be recalculated based on the first scroll ratio, and then the correct first position of the second scroll control can be determined based on the offset, thereby adjusting the second scroll control to the correct first position. After adjusting the first position, the first loading area of the third table changes accordingly, so the first loading area needs to be redefined.
[0063] In this embodiment, in the cross-table synchronous scrolling scenario, by performing synchronous scrolling according to the same scrolling ratio, each table can be scrolled according to the difference in their respective sizes, achieving accurate synchronization between multiple tables and ensuring scrolling consistency during data comparison and display. Even in the case of inconsistent column widths and row heights, smooth synchronization can still be maintained. In addition, through the scrolling deviation detection mechanism, the actual scrolling information (i.e., the third information) of each table is detected, and automatic correction is performed when the actual scrolling information does not match the calculated scrolling information, thereby ensuring the correctness and synchronization of the synchronous scrolling results of multiple tables and the table content loading results.
[0064] In one embodiment, the first information includes a first speed of the first scroll control scrolling based on the scroll event. When loading the table content in the first loading area, the following steps B1-B2 may be performed:
[0065] Step B1: determining a first loading strategy for the first loading area according to the first speed and structural information of the first loading area.
[0066] The structural information of the first loading area refers to the organization of data in the first loading area, and may include at least one of the following: the amount of data in the table content within the first loading area, the number of levels within the first loading area, the level types, the level relationships, and the amount of data in each level. The third table includes multiple nodes, and hierarchical relationships exist between the multiple nodes. Level types may include parent nodes, child nodes, root nodes, and other types.
[0067] The first loading strategy includes at least one of the following: a loading batch, a number of loaded levels, and a loaded level type. The loading batch refers to the number of times the table content is loaded for the current scrolling event. The number of loaded levels may include the number of levels loaded in a single load and / or the total number of levels loaded for the current scrolling event. The loaded level type refers to the level type of the node loaded for the current scrolling event, such as a parent node or a child node.
[0068] Optionally, when determining the first loading strategy, the loading batch is positively correlated with the scrolling speed of the scroll control, and the number of loaded levels is negatively correlated with the scrolling speed. The slower the scroll control scrolls, the fewer loading batches and the greater the number of levels loaded, meaning a greater amount of data is loaded at a time. For example, only a few adjacent rows of data may be loaded at a time to reduce unnecessary data rendering. The faster the scroll control scrolls, the more loading batches and the fewer levels loaded, meaning a smaller amount of data is loaded at a time. Because the scroll control can predict the area to be scrolled to when scrolling at high speed, it can load a larger amount of data in batches, ensuring smooth rendering of table content and avoiding blank areas when the scroll control scrolls at high speed. Furthermore, the faster the scroll control scrolls, the fewer child nodes are loaded within a level type, meaning that data corresponding to parent nodes is loaded first, while data for child nodes can be collapsed first. For example, when loading fewer levels, data corresponding to parent nodes may be loaded first, while data for child nodes may be collapsed. Data for child nodes may be loaded only when the user expands the parent node.
[0069] Step B2: Load the table content in the first loading area based on the first loading strategy.
[0070] In this embodiment, the third table has a table structure with hierarchically nested data. This table structure typically includes a parent-child relationship, where each parent node can include multiple child nodes, and can even continue to nest deeper levels. Optionally, the data of the third table is constructed into a tree-like data model based on the hierarchical relationship between parent and child nodes. In the tree-like data model, each parent node points to its child nodes, and each node is assigned a unique index or identifier. Based on this, when loading the table content in the first loading area, the node corresponding to the first loading area can be found from the tree-like data model, thereby obtaining the data of the node corresponding to the first loading area.
[0071] Optionally, based on the first loading strategy, after loading the table content within the first loading area, the data loading status can be monitored in real time or periodically, and the loaded table content can be dynamically and flexibly adjusted based on the data loading status. The data loading status includes the amount of loaded data corresponding to each node. If the amount of data of the child nodes of a parent node is too large, the expansion depth of the parent node can be automatically limited, for example, by collapsing the child nodes and hiding the data corresponding to the child nodes. If the amount of data of a node is small, the node can be fully expanded to improve the visualization effect.
[0072] Optionally, based on the first loading strategy, after loading the table content in the first loading area, the user's expansion and folding operations on the parent node are monitored. When a user's expansion operation on a parent node is detected, the data corresponding to the child nodes under the parent node is obtained according to the index or identifier of the parent node, thereby dynamically loading the data of the child nodes under the parent node. By only loading the data corresponding to the child nodes related to the parent node, the data of the entire third table will not be loaded, thereby saving unnecessary data rendering processes. When a user's folding operation on a parent node is detected, the data of all child nodes under the parent node is removed, and the DOM elements and data resources of the removed child nodes are released, thereby avoiding the situation where memory usage is too high. Therefore, when the user performs relevant operations (such as expansion operations, folding operations, etc.) on the first loading area, this embodiment does not trigger the redrawing process of the entire table, but only loads or hides the first loading area corresponding to the relevant operation. By updating the table content in the first loading area in real time, the user's interaction requests can be processed smoothly, the response time is reduced, and the interaction of the table is made more natural and flexible.
[0073] In this embodiment, when processing a table with a hierarchical nested structure, the data of all child nodes is not loaded at once. Instead, an incremental loading technique is used. That is, based on the user's scrolling of the scroll control or the expansion of the node, the data of the child nodes within the first loading area is loaded on demand, thereby avoiding the problem of loading too much data and reducing the efficiency of table loading. In addition, when expanding multiple levels of data, only the data of the level within the current visible area is loaded, rather than loading the entire level of data at once. When a scroll event occurs, the data of the other levels is loaded based on the scroll event, thereby improving the efficiency of table data loading.
[0074] Furthermore, if a certain level of data is expanded based on a scroll event of a scroll control, the scroll event can continue to be monitored to ensure that the level of data within the first loading area can be dynamically updated as the scroll control scrolls. For expanded nodes that exceed the first loading area, for example, if the scroll control scrolls down and the node data above exceeds the first loading area, this part of the node data can be automatically removed, thereby ensuring that the amount of loaded data and memory usage are always within a reasonable range, avoiding the situation where loading too much data will reduce the efficiency of table loading.
[0075] In one embodiment, the size of the preset loading area can be updated according to the data volume of the table content in the first loading area and / or the operation frequency of the first table. The size of the preset loading area is positively correlated with the data volume of the table content and the operation frequency.
[0076] In one embodiment, before responding to the scroll event of the first scroll control for the first table, the third table is initialized and the data source of the third table is prepared. Optionally, when initializing the third table, it is necessary to determine the basic structural information of the third table and the area size of the preset loading area. First, define the row and column structure of the table, determine the width and height of the table, and reserve the scrolling area of the scroll control. Secondly, initialize the basic configuration parameters of the table, such as row height, column width, data volume, paging settings and other parameters. Then, determine the area size of the preset loading area of the table for subsequent visual data loading. Afterwards, configure the boundaries and thresholds of the two-way virtual scrolling to determine the fragmented loading strategy under different data volumes.
[0077] After initializing the third table, the data source of the third table is prepared. Optionally, the data source provided by the user is processed, the total data volume, hierarchical structure, and data arrangement are analyzed, and the third table is generated based on the analysis results. Specifically, first, the data source provided by the user is obtained, and it is determined whether the data source is a simple two-dimensional structure or a hierarchical nested structure (such as a tree table, a grouped table, etc.). Then, the obtained data source is paged or blocked for storage so that data can be loaded on demand during subsequent loading.
[0078] If the data source has a hierarchical nested structure, a tree-like data model corresponding to the data source is constructed. In this tree-like data model, an index tree is constructed based on the hierarchical position of the nodes, with each parent node pointing to its child nodes. The expansion state, display state, and index (or identifier) of each node are cached in memory for fast search and update. Furthermore, a unique index or identifier is assigned to each node to ensure that the corresponding node data can be quickly located based on the index (or identifier) when expanding or collapsing the node.
[0079] Based on the table structure constructed in this embodiment, the location information of each parent node and its child nodes can be pre-stored. The location information can be represented by the node index (or identifier). Therefore, when the user expands a parent node or performs a scrolling operation on the scroll control, the relevant node can be quickly located according to the location information of each node in the tree data model, thereby improving the loading efficiency of the table content.
[0080] For the third table of the hierarchical nested structure, when the parent node is expanded, only the data corresponding to the child nodes of the current level (i.e., the child nodes pointed to by the parent node) are loaded according to the position information of the parent node (such as the index or identifier), and the child nodes of the deeper levels are not processed. When the child node needs to be displayed, its data source and parent-child relationship can be quickly located through the position information of the child node (such as the index or identifier) without re-parsing the entire tree structure. When the parent node is collapsed, the data corresponding to its child nodes are removed according to the position information of the parent node (such as the index or identifier), thereby avoiding updating the entire table. After the child node is removed, the DOM element corresponding to the child node will be recycled for subsequent use, thereby reducing the overhead of DOM operations.
[0081] Optionally, when a parent node is expanded or collapsed, the display state of related nodes can be updated in real time in memory. When expanding a parent node, the display state of the parent node can be updated to "expanded", and when collapsing the parent node, the display state of the child nodes pointed to by the parent node can be updated to "hidden". When the parent node is expanded again, the display state of its child nodes is dynamically restored. When loading multi-level data, parent nodes can be processed first, followed by the child nodes they point to, to ensure the correct rendering order of the child nodes.
[0082] Optionally, when a parent node is expanded for the first time, only the basic data of the child nodes can be loaded, and the loading of deeper nodes can be delayed to avoid performance bottlenecks caused by one-time loading.
[0083] If a batch expansion or collapse operation is received for multi-level data, batch processing can be used for display, that is, the expansion or collapse operations of multiple nodes are executed in batches to ensure the stability of system performance. In addition, delayed loading and fragmented loading can also be used. The delayed loading method is to load after a period of time (such as 2 seconds) after receiving the expansion or collapse operation. The fragmented loading method is to divide the preset loading area into multiple sub-areas, and load one sub-area at a time, and load it multiple times until the table content in the preset loading area is loaded.
[0084] After initializing the third table and preparing its data source, if you need to render the third table, perform the following steps C1-C3:
[0085] Step C1 : In response to a rendering request for a third table, obtaining a third scroll ratio corresponding to the third table from a database.
[0086] The database is used to cache the scroll ratio corresponding to each scroll event. A rendering request can be initiated in various situations, such as when opening the third table for the first time; reopening the third table after closing it; restoring the third table when it is minimized; or rendering the third table when it is running in the background.
[0087] Step C2: determining a second loading area of the third table according to the third scroll ratio, the third size information of the third table, and the fourth size information.
[0088] The third size information may include the total size of the third table, which may include the total height and / or total width of the table. The fourth size information may include the size of the preset loading area of the third table. The second loading area is the area loaded when the third table was last closed. The size of the second loading area is the size of the pre-configured preset loading area.
[0089] Step C3: loading the table content in the second loading area.
[0090] Alternatively, if the database does not store the scroll ratio, it indicates that the third table is opened for the first time or no scroll event has occurred since it was opened. In this case, the second loading area of the third table can be determined to be the initial position of the table, such as the area including the first row and first column.
[0091] Optionally, when the third table is opened for the first time, only the first-level data of the third table, that is, the data corresponding to the parent node, can be loaded, and the data corresponding to the child nodes can be omitted to ensure performance during the initial load. For hidden child nodes, the data corresponding to the child nodes under the parent node can be loaded when the user expands its parent node.
[0092] Based on the table structure constructed in this embodiment, when loading the table content in the second loading area of the third table, first locate the index or identifier of the starting row, starting column, ending row and ending column of the second loading area, and then extract the data block corresponding to the second loading area from the data source based on the index or identifier, and only render the content of the data block, that is, the table content in the second loading area. The table content in the second loading area can be cached in the form of DOM elements, so that when scrolling back to the same loading area later, this part of the table content can be quickly rendered based on the cached DOM elements. At the same time, for the table content that has exceeded the second loading area, the DOM elements corresponding to this part of the table content can be removed, thereby freeing up memory space.
[0093] In one embodiment, after determining the second loading region of the third table based on the third scroll ratio, the third size information of the third table, and the fourth size information (i.e., executing step C2 above), hierarchical information corresponding to the second loading region may be determined; and a second loading strategy for the second loading region may be determined based on the hierarchical information. When loading the table content within the second loading region (i.e., executing step C3 above), the table content within the second loading region may be loaded based on the second loading strategy.
[0094] The hierarchical information corresponding to the second loading region refers to the hierarchical organization of data in the second loading region, typically used to represent parent-child relationships, grouping relationships, or multi-level classifications between data. The hierarchical information may include at least one of the following: the number of levels, the type of levels, the relationships between levels, and the amount of data per level. The second loading strategy includes the number and / or type of levels loaded within the second loading region.
[0095] In one embodiment, the load of scrolling operations can be distributed to avoid system performance bottlenecks caused by synchronized scrolling. For example, when the scrolling speed of a first scroll control exceeds a preset speed threshold, synchronization of the primary table can be prioritized, and synchronization of other secondary tables can be delayed. The primary table can be pre-configured by the user, or the first table can be automatically determined as the primary table.
[0096] Optionally, a synchronized scrolling priority for multiple third tables can be pre-configured. The synchronized scrolling priority is used to indicate the order in which the multiple third tables are synchronized. After a scroll event occurs, the multiple third tables are synchronized according to the pre-configured synchronized scrolling priority. This ensures that the synchronized scrolling of the multiple tables complies with the priority order, allowing users to view the content of the primary table first.
[0097] If the table is reopened, for example, after closing the table and then reopening it, the table content caching and table layout can be completed first, and then the scroll position can be restored according to the cached scroll ratio to ensure the stability of synchronous scrolling.
[0098] In one embodiment, if a first condition is met, the table content within the first loading area of the third table is cached. The first condition includes at least one of the following: a first scrolling speed of the first scroll control is less than or equal to a preset speed threshold, the number of levels corresponding to the first loading area is greater than or equal to a preset number threshold, the frequency of scrolling of the first scroll control within the first loading area is greater than or equal to a preset frequency threshold, and the browser performance corresponding to the third table meets preset performance requirements. Browser performance may include at least one of the following: browser memory usage, browser frame rate, table rendering speed on the browser page, etc.
[0099] For example, if a user repeatedly scrolls the same area of a table, the table contents in that area can be cached to avoid repeated data loading. If the node hierarchy in the area is deep and the user may repeatedly expand and collapse the same level, caching the table contents in that area can avoid repeated data calculation and loading.
[0100] Optionally, after caching the table content in the first loading area of the third table, the table content in the first loading area of the third table is cleared if a second condition is met. The second condition includes at least one of the following: a scrolling speed of the first scroll control is greater than a preset speed threshold, the number of levels corresponding to the first loading area is less than a preset number threshold, the amount of cached data is greater than or equal to a preset data amount threshold, or the browser performance does not meet a preset performance requirement.
[0101] In one embodiment, in response to a user interaction operation in the first table, such as a click, batch editing (e.g., dragging, selecting, etc.), etc., the first table is processed accordingly based on the interaction operation. For batch editing operations, such as dragging, selecting, etc., a local rendering method can be used to process the table. That is, only the table cells affected by the interaction operation are updated without updating the entire table.
[0102] Optionally, when the first table is processed accordingly, the user's interactive operations can be distributed to specific table cells through an event delegation mechanism, so that other cells unrelated to the interactive operations are not affected, thereby reducing the number of DOM operations.
[0103] In addition, in the event delegation mechanism, the scroll event can also be bound to the parent container of the table, and the parent container will handle the events of all cells at the same time.
[0104] In one embodiment, memory recycling can be automatically performed for node data that has been removed, releasing no longer needed DOM elements and data resources, thereby avoiding excessive memory usage. Specifically, after the table content scrolls out of the first loading area (i.e., the visible area), the DOM elements and data resources of this part of the table content are automatically cleared.
[0105] Optionally, unused memory blocks can be regularly checked and intelligent garbage collection mechanisms can be implemented to release long-unused resources, ensuring that memory usage remains within a reasonable range. For frequently expanded or collapsed hierarchical data, memory caching can be used to manage it. Specifically, data that is not collapsed can be temporarily retained in the cache. When it is needed to render this data again, it can be directly read from the cache to avoid repeated loading.
[0106] In one embodiment, the performance of the third table can be continuously or periodically monitored, and when a table degradation is detected, a lazy loading mechanism and / or an on-demand loading mechanism can be automatically enabled to reduce the frequency of DOM operations and improve the smoothness of scrolling and interaction.
[0107] Lazy loading can include any of the following: row lazy loading, column lazy loading, or batch loading. Row lazy loading loads only the table rows within the first loading area, and then loads new rows when scrolling. Column lazy loading loads only the table columns within the first loading area. Batch loading loads hierarchical data by first loading the parent node's data and then loading the child nodes' data when the parent node is expanded.
[0108] In one embodiment, after loading the table content in the first loading area, the scrolling status of the scroll control of the first table and the data loading progress of the third table are recorded, and this recorded data is fed back to the user to ensure that the user can understand the table content in real time. The user can customize the third table, such as adjusting the table style, table size, table paging method, etc. The electronic device dynamically adjusts the rendering effect in the first loading area based on the user's adjustment operations.
[0109] In summary, specific embodiments of the present subject matter have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions recited in the claims can be performed in a different order and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing may be advantageous.
[0110] The above is a data processing method provided in an embodiment of the present application. Based on the same idea, an embodiment of the present application also provides a data processing device.
[0111] Figure 2 is a schematic block diagram of a data processing device according to an embodiment of the present application, such as Figure 2 As shown, the device includes:
[0112] A first determining module 21 is configured to determine first information of a first scrolling control in response to a scrolling event of a first scrolling control of a first table; the first information includes a first offset of the first scrolling control based on the scrolling event;
[0113] a second determining module 22, configured to determine a first scrolling ratio of the first scrolling control according to the first offset and a first scrolling distance of the first scrolling control; the first scrolling distance being determined according to the first size information and the second size information of the first table;
[0114] The loading module 23 is used to determine the first loading area of the third table according to the first scrolling ratio and the third size information of the third table, and load the table content in the first loading area; the third table includes the first table and a second table with a synchronous scrolling relationship with the first table.
[0115] In one embodiment, the first information further includes a horizontal direction and / or a vertical direction of the first scroll control based on the scroll event;
[0116] When the loading module 23 determines the first loading area of the third table according to the first scrolling ratio and the third size information of the third table, the loading module 23 performs the following steps:
[0117] determining second information of a second scroll control of the second table according to the first scroll ratio and the horizontal direction of the scroll and / or the vertical direction of the scroll;
[0118] According to the second information, the second scroll control is controlled to scroll to a first position, and a table area corresponding to the first position and matching the second size information is determined as the first loading area.
[0119] In one embodiment, the apparatus further comprises:
[0120] a third determining module, configured to determine third information of the second scrolling control according to the first position and the second position of the second scrolling control after the table content in the first loading area is loaded;
[0121] The adjustment module is configured to adjust the first position in response to the mismatch between the third information and the second information; redefine the first loading area of the third table based on the adjusted first position, and load the table content in the redetermined first loading area.
[0122] In one embodiment, the first size information includes the total size of the table; the second size information includes the area size of the preset loading area;
[0123] The device further comprises:
[0124] A fourth determining module is configured to, before determining a first scrolling ratio of the first scrolling control according to the first offset and the first scrolling distance of the first scrolling control,
[0125] a calculation module, configured to calculate a difference between the total size of the table and the size of the preset loading area;
[0126] The first scroll distance is determined according to the difference.
[0127] In one embodiment, the first scroll information further includes a first scrolling speed of the first scroll control based on the scrolling event;
[0128] When loading the table content in the first loading area, the loading module 23 performs the following steps:
[0129] determining a first loading strategy for the first loading area according to the first speed and structural information of the first loading area;
[0130] Based on the first loading strategy, the table content in the first loading area is loaded.
[0131] In one embodiment, the apparatus further comprises:
[0132] An update module is used to update the area size of the preset loading area according to the data volume of the table content in the first loading area and / or the operation frequency of the first table; the area size of the preset loading area is positively correlated with the data volume of the table content and the operation frequency.
[0133] In one embodiment, the apparatus further comprises:
[0134] an acquisition module, configured to acquire, from a database, a third scroll ratio corresponding to the third table in response to a rendering request for the third table, before determining the first information of the first scroll control in response to the scroll event of the first scroll control for the first table;
[0135] a fifth determining module, configured to determine a second loading area of the third table according to the third scrolling ratio, the third size information and the fourth size information of the third table;
[0136] The second loading module is used to load the table content in the second loading area.
[0137] In one embodiment, the apparatus further comprises:
[0138] a sixth determining module, configured to determine, after determining the second loading area of the third table according to the third scrolling ratio, the third size information of the third table, and the fourth size information, determine level information corresponding to the second loading area;
[0139] a seventh determining module, configured to determine a second loading strategy for the second loading area according to the hierarchical information;
[0140] When loading the table content in the second loading area, the loading module 23 performs the following steps:
[0141] Based on the second loading strategy, the table content in the second loading area is loaded.
[0142] In one embodiment, the apparatus further comprises:
[0143] A cache module is used to cache the table content in the first loading area of the third table when a first condition is met; the first condition includes at least one of the following: the first scrolling speed of the first scrolling control is less than or equal to a preset speed threshold, the number of levels corresponding to the first loading area is greater than or equal to a preset number threshold, the frequency of the first scrolling control in the first loading area is greater than or equal to a preset frequency threshold, and the browser performance corresponding to the third table meets the preset performance requirements.
[0144] In one embodiment, the apparatus further comprises:
[0145] A clearing module is configured to clear the table content in the first loading area of the third table after caching the table content in the first loading area of the third table when a first condition is met, and then clear the table content in the first loading area of the third table when a second condition is met; the second condition includes at least one of the following: the first speed is greater than the preset speed threshold, the number of levels corresponding to the first loading area is less than the preset number threshold, the amount of cached data is greater than or equal to the preset data amount threshold, and the browser performance does not meet the preset performance requirements.
[0146] The device using the embodiment of the present application responds to a scroll event of a first scroll control for a first table by determining first information of the first scroll control, the first information including a first offset of the first scroll control based on the scroll event; determining a first scroll ratio of the first scroll control based on the first offset and the first scroll distance of the first scroll control, the first scroll distance being determined based on the first size information and the second size information of the first table; determining a first loading area of the third table based on the first scroll ratio and the third size information of the third table, and loading the table content within the first loading area. The third table includes the first table and a second table that has a synchronous scrolling relationship with the first table. It can be seen that as long as a scroll event occurs in the first scroll control of the first table, the synchronous scrolling of the first table and the second table can be triggered, thereby realizing a cross-table synchronous scrolling mechanism. This mechanism can greatly reduce the frequency of operations when users view multiple tables and improve the efficiency of loading table content. In addition, in the cross-table synchronous scrolling mechanism, the synchronous scrolling of the second table is triggered based on the scrolling ratio of the first scrolling control, so that multiple tables with synchronous scrolling relationships can scroll according to the same scrolling ratio without considering the size and table structure of each table, thereby ensuring the data consistency of multiple tables during synchronous scrolling and improving the flexibility and response speed of synchronous operations of multiple tables.
[0147] Those skilled in the art should understand that Figure 2 The data processing device in can be used to implement the data processing method described above, and the detailed description should be similar to the description of the method part above. To avoid redundancy, it will not be repeated here.
[0148] Based on the same idea, the embodiment of the present application also provides an electronic device, such as Figure 3 As shown. Electronic devices may have relatively large differences due to different configurations or performances, and may include one or more processors 301 and memory 302, and the memory 302 may store one or more storage applications or data. Among them, the memory 302 may be a temporary storage or a persistent storage. The application stored in the memory 302 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the electronic device. Furthermore, the processor 301 can be configured to communicate with the memory 302 to execute a series of computer executable instructions in the memory 302 on the electronic device. The electronic device may also include one or more power supplies 303, one or more wired or wireless network interfaces 304, one or more input and output interfaces 305, and one or more keyboards 306.
[0149] Specifically, in this embodiment, the electronic device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer-executable instructions for the electronic device, and the one or more programs are configured to be executed by one or more processors, including computer-executable instructions for performing the following:
[0150] In response to a scroll event of a first scroll control of a first table, determining first information of the first scroll control; the first information includes a first offset of the first scroll control scrolled based on the scroll event;
[0151] determining a first scroll ratio of the first scroll control according to the first offset and a first scroll distance of the first scroll control; the first scroll distance is determined according to first size information and second size information of the first table;
[0152] According to the first scroll ratio and the third area size of the third table, the first loading area of the third table is determined, and the table content in the first loading area is loaded; the third table includes the first table and a second table with a synchronous scrolling relationship with the first table.
[0153] Adopting the technical solution of the embodiment of the present application, in response to the scroll event of the first scroll control for the first table, by determining the first information of the first scroll control, the first information includes the first offset of the first scroll control based on the scroll event; according to the first offset and the first scroll distance of the first scroll control, the first scroll ratio of the first scroll control is determined, the first scroll distance is determined according to the first size information and the second size information of the first table; according to the first scroll ratio and the third size information of the third table, the first loading area of the third table is determined, and the table content within the first loading area is loaded. The third table includes the first table and the second table that has a synchronous scrolling relationship with the first table. It can be seen that as long as a scroll event occurs in the first scroll control of the first table, the synchronous scrolling of the first table and the second table can be triggered, thereby realizing a cross-table synchronous scrolling mechanism. This mechanism can greatly reduce the frequency of operations when users view multiple tables and improve the efficiency of loading table content. In addition, in the cross-table synchronous scrolling mechanism, the synchronous scrolling of the second table is triggered based on the scrolling ratio of the first scrolling control, so that multiple tables with synchronous scrolling relationships can scroll according to the same scrolling ratio without considering the size and table structure of each table, thereby ensuring the data consistency of multiple tables during synchronous scrolling and improving the flexibility and response speed of synchronous operations of multiple tables.
[0154] The present application also provides a computer-readable storage medium storing one or more computer programs. The one or more computer programs include instructions. When executed by an electronic device including multiple application programs, the instructions enable the electronic device to perform the various processes of the above-mentioned data processing method embodiment, and are specifically used to perform:
[0155] In response to a scroll event of a first scroll control of a first table, determining first information of the first scroll control; the first information includes a first offset of the first scroll control scrolled based on the scroll event;
[0156] determining a first scroll ratio of the first scroll control according to the first offset and a first scroll distance of the first scroll control; the first scroll distance is determined according to first size information and second size information of the first table;
[0157] According to the first scroll ratio and the third area size of the third table, the first loading area of the third table is determined, and the table content in the first loading area is loaded; the third table includes the first table and a second table with a synchronous scrolling relationship with the first table.
[0158] Adopting the technical solution of the embodiment of the present application, in response to the scroll event of the first scroll control for the first table, by determining the first information of the first scroll control, the first information includes the first offset of the first scroll control based on the scroll event; according to the first offset and the first scroll distance of the first scroll control, the first scroll ratio of the first scroll control is determined, the first scroll distance is determined according to the first size information and the second size information of the first table; according to the first scroll ratio and the third size information of the third table, the first loading area of the third table is determined, and the table content within the first loading area is loaded. The third table includes the first table and the second table that has a synchronous scrolling relationship with the first table. It can be seen that as long as a scroll event occurs in the first scroll control of the first table, the synchronous scrolling of the first table and the second table can be triggered, thereby realizing a cross-table synchronous scrolling mechanism. This mechanism can greatly reduce the frequency of operations when users view multiple tables and improve the efficiency of loading table content. In addition, in the cross-table synchronous scrolling mechanism, the synchronous scrolling of the second table is triggered based on the scrolling ratio of the first scrolling control, so that multiple tables with synchronous scrolling relationships can scroll according to the same scrolling ratio without considering the size and table structure of each table, thereby ensuring the data consistency of multiple tables during synchronous scrolling and improving the flexibility and response speed of synchronous operations of multiple tables.
[0159] An embodiment of the present application provides a computer program product, including a computer program, which is executed by a processor to implement the various processes of the above-mentioned data processing method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0160] The systems, devices, modules, or units described in the above embodiments may be implemented by computer chips or entities, or by products having certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0161] For the convenience of description, the above devices are described as being divided into various units according to their functions. Of course, when implementing this application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0162] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0163] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0164] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0165] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0166] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0167] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0168] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0169] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0170] The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communications network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0171] The various embodiments in this application are described in a progressive manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the system embodiment is generally similar to the method embodiment, so the description is relatively simple. For relevant parts, refer to the partial description of the method embodiment.
[0172] The foregoing is merely an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modifications, equivalent replacements, improvements, etc. made within the principles of the present application should all be included within the scope of the claims of the present application.
Claims
1. A data processing method, characterized in that: include: In response to a scroll event of a first scroll control on a first table, determining first information of the first scroll control; The first information includes a first offset of the first scroll control scrolled based on the scroll event; determining a first scroll ratio of the first scroll control according to the first offset and a first scroll distance of the first scroll control; the first scroll distance is determined according to first size information and second size information of the first table; According to the first scroll ratio and the third size information of the third table, a first loading area of the third table is determined, and the table content in the first loading area is loaded; the third table includes the first table and a second table with a synchronous scrolling relationship with the first table.
2. The method according to claim 1, characterized in that The first information further includes a horizontal scrolling direction and / or a vertical scrolling direction of the first scroll control based on the scrolling event; The determining, according to the first scrolling ratio and the third size information of the third table, a first loading area of the third table includes: determining second information of a second scroll control of the second table according to the first scroll ratio and the horizontal direction of the scroll and / or the vertical direction of the scroll; According to the second information, the second scroll control is controlled to scroll to a first position, and a table area corresponding to the first position and matching the second size information is determined as the first loading area.
3. The method according to claim 2, characterized in that After loading the table content in the first loading area, the method further includes: determining third information of the second scrolling control according to the first position and the second position of the second scrolling control; In response to the third information not matching the second information, the first position is adjusted; based on the adjusted first position, a first loading area of the third table is re-determined, and the table content in the re-determined first loading area is loaded.
4. The method according to claim 1, wherein The first size information includes the total size of the table; the second size information includes the area size of the preset loading area; Before determining the first scroll ratio of the first scroll control according to the first offset and the first scroll distance of the first scroll control, the method further includes: Calculating the difference between the total size of the table and the area size of the preset loading area; The first scroll distance is determined according to the difference.
5. The method according to claim 1, wherein The first information further includes a first scrolling speed of the first scroll control based on the scrolling event; The loading of the table content in the first loading area includes: determining a first loading strategy for the first loading area according to the first speed and structural information of the first loading area; Based on the first loading strategy, the table content in the first loading area is loaded.
6. The method according to claim 1, characterized in that The method further comprises: The area size of the preset loading area is updated according to the data volume of the table content in the first loading area and / or the operation frequency of the first table; the area size of the preset loading area is positively correlated with the data volume of the table content and the operation frequency.
7. The method according to claim 1, characterized in that Before determining the first information of the first scroll control in response to a scroll event of the first scroll control on the first table, the method further includes: In response to a rendering request for the third table, obtaining a third scroll ratio corresponding to the third table from a database; determining a second loading area of the third table according to the third scroll ratio, the third size information and the fourth size information of the third table; The table content in the second loading area is loaded.
8. The method according to claim 7, characterized in that After determining the second loading area of the third table according to the third scroll ratio, the third size information of the third table, and the fourth size information, the method further includes: Determining level information corresponding to the second loading area; determining a second loading strategy for the second loading area according to the hierarchical information; The loading of the table content in the second loading area includes: Based on the second loading strategy, the table content in the second loading area is loaded.
9. The method according to claim 1, characterized in that The method further comprises: When a first condition is met, the table content in the first loading area of the third table is cached; the first condition includes at least one of the following: a first scrolling speed of the first scrolling control is less than or equal to a preset speed threshold, the number of levels corresponding to the first loading area is greater than or equal to a preset number threshold, the frequency of scrolling of the first scrolling control in the first loading area is greater than or equal to a preset frequency threshold, and the browser performance corresponding to the third table meets the preset performance requirements.
10. The method according to claim 9, characterized in that After caching the table content in the first loading area of the third table when the first condition is met, the method further includes: If the second condition is met, clear the table content in the first loading area of the third table; the second condition includes at least one of the following: the first speed is greater than the preset speed threshold, the number of levels corresponding to the first loading area is less than the preset number threshold, the amount of cached data is greater than or equal to the preset data amount threshold, and the browser performance does not meet the preset performance requirements.
11. A data processing device, characterized in that: include: A first determining module, configured to determine first information of a first scrolling control in response to a scrolling event of a first scrolling control of a first table; The first information includes a first offset of the first scroll control scrolled based on the scroll event; a second determining module, configured to determine a first scrolling ratio of the first scrolling control according to the first offset and a first scrolling distance of the first scrolling control; the first scrolling distance being determined according to the first size information and the second size information of the first table; A loading module is used to determine a first loading area of the third table according to the first scrolling ratio and the third size information of the third table, and load the table content in the first loading area; the third table includes the first table and a second table with a synchronous scrolling relationship with the first table.
12. An electronic device, characterized in that: The method comprises a processor and a memory electrically connected to the processor, wherein the memory stores a computer program, and the processor is configured to call and execute the computer program from the memory to implement the method according to any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that The storage medium is used to store a computer program, and the computer program can be executed by a processor to implement the method according to any one of claims 1 to 10.
14. A computer program product, characterized in that The method comprises a computer program, wherein the computer program is executed by a processor to implement the method according to any one of claims 1 to 10.