Table processing method and device, electronic equipment, computer readable storage medium and computer program product
Patent Information
- Application Number
- CN202510513116.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-22
- Publication Date
- 2026-10-23
AI Technical Summary
相关技术中的渲染层计算方法,需要对表格的整个区域进行计算,导致在数据计算过程中,产生冗余的计算量,并且延长计算耗时,使得用户的等待时间较长
[0022]在接收针对表格中的目标区域的编辑操作,且目标区域的尺寸超出屏幕的尺寸的情况下,将目标区域划分为可视区域和非可视区域;针对可视区域执行第一计算任务,得到可视区域中每个第一单元格的第一计算结果,根据每个第一单元格的第一计算结果更新可视区域;在第一计算任务完成的情况下,针对非可视区域执行第二计算任务,得到非可视区域中每个第二单元格的第二计算结果,以更新非可视区域,上述方案通过分阶段执行针对目标区域的计算任务,能够减少每个阶段的计算过程中的资源占用,同时减少每个阶段的计算量;优先处理可视区域,能够快速响应用户的编辑操作,让用户及时看到可视区域的更新结果,无需等待整个表格计算完成,从而提供了更流畅的用户体验。
Smart Images

Figure CN122965448A_ABST
Abstract
Description
Technical Field
[0001] This application relates to computer technology, and more particularly to a form processing method, apparatus, electronic device, computer-readable storage medium, and computer program product. Background Technology
[0002] When an edit operation is received on a table, causing changes to the text content or style of a portion of the table, the rendering layer needs to calculate the updated data and render the table based on this updated data to display the edited table. Current rendering layer calculation methods require calculations across the entire table area, resulting in redundant computations and increased processing time, leading to longer user wait times. Summary of the Invention
[0003] This application provides a table processing method, apparatus, electronic device, computer-readable storage medium, and computer program product that can quickly display the data and style of the edited table.
[0004] The technical solution of this application embodiment is implemented as follows:
[0005] This application provides a table processing method, the method including:
[0006] Receive editing operations for a target area in the table;
[0007] If the size of the target area exceeds the size of the screen, a visible area and a non-visible area are determined within the target area, wherein the visible area is the area of the target area that is displayed on the screen, and the non-visible area is the area of the target area that is not displayed on the screen;
[0008] Perform a first calculation task in response to the editing operation for the visible area, obtain a first calculation result for each first cell in the visible area, and update the visible area based on the first calculation result of each first cell;
[0009] Upon completion of the first calculation task, a second calculation task is performed for the non-visual area in response to the editing operation, resulting in a second calculation result for each second cell in the non-visual area, wherein the second calculation result for each second cell is used to update the non-visual area.
[0010] In the above scheme, the step of performing a second computational task for the non-visual area in response to the editing operation during the waiting period before displaying the non-visual area includes:
[0011] During the waiting period before the non-visual area is displayed, and while the load for performing the computational task is less than a load threshold, a second computational task for responding to the editing operation is performed on the non-visual area.
[0012] This application provides a form processing apparatus, the apparatus comprising:
[0013] The receiving module is used to receive editing operations on the target area in the table;
[0014] A determining module is configured to determine a visible area and a non-visible area within the target area when the size of the target area exceeds the size of the screen, wherein the visible area is the area of the target area that is visible on the screen, and the non-visible area is the area of the target area that is not visible on the screen;
[0015] An execution module is configured to perform a first calculation task in response to the editing operation for the visible area, obtain a first calculation result for each first cell in the visible area, and update the visible area based on the first calculation result of each first cell; when the first calculation task is completed, a second calculation task in response to the editing operation is performed for the non-visible area, obtain a second calculation result for each second cell in the non-visible area, wherein the second calculation result of each second cell is used to update the non-visible area.
[0016] This application provides an electronic device, the electronic device comprising:
[0017] Memory is used to store executable instructions or computer programs.
[0018] When a processor executes computer-executable instructions or computer programs stored in the memory, it implements the table processing method provided in the embodiments of this application.
[0019] This application provides a computer-readable storage medium storing a computer program or computer-executable instructions for implementing the table processing method provided in this application when executed by a processor.
[0020] This application provides a computer program product, including a computer program or computer executable instructions. When the computer program or computer executable instructions are executed by a processor, they implement the table processing method provided in this application.
[0021] The embodiments of this application have the following beneficial effects:
[0022] When receiving an editing operation targeting a specific area in a table, and the target area exceeds the screen size, the target area is divided into a visible area and a non-visible area. A first calculation task is performed on the visible area to obtain a first calculation result for each first cell, and the visible area is updated based on the first calculation result of each first cell. Once the first calculation task is completed, a second calculation task is performed on the non-visible area to obtain a second calculation result for each second cell, thus updating the non-visible area. This scheme reduces resource consumption and computational load in each stage by performing calculation tasks on the target area in stages. Prioritizing the visible area allows for a faster response to user editing operations, enabling users to see the updated results of the visible area immediately without waiting for the entire table to be calculated, thus providing a smoother user experience. Attached Figure Description
[0023] Figure 1 This is a schematic diagram of the architecture of the table processing system 100 provided in an embodiment of this application;
[0024] Figure 2 This is a schematic diagram of the structure of the terminal 400 provided in the embodiments of this application;
[0025] Figure 3A This is a first flowchart illustrating the table processing method provided in this application embodiment;
[0026] Figure 3B This is a second flowchart illustrating the table processing method provided in the embodiments of this application;
[0027] Figure 3C This is a schematic diagram of the third process of the table processing method provided in the embodiments of this application;
[0028] Figure 3D This is a schematic diagram of the fourth process of the table processing method provided in the embodiments of this application;
[0029] Figure 3E This is a schematic diagram of the fifth process of the table processing method provided in the embodiments of this application;
[0030] Figure 3F This is a sixth flowchart illustrating the table processing method provided in the embodiments of this application;
[0031] Figure 4A This is a schematic diagram illustrating the calculation range of the table provided in the embodiments of this application;
[0032] Figure 4B This is a first schematic diagram illustrating the editing operations performed in an embodiment of this application;
[0033] Figure 4CThis is a second schematic diagram illustrating the editing operations performed in an embodiment of this application;
[0034] Figure 4D This is a third schematic diagram illustrating the editing operations performed in an embodiment of this application;
[0035] Figure 4E This is a fourth schematic diagram illustrating the editing operations performed in the embodiments of this application;
[0036] Figure 4F This is the fifth schematic diagram illustrating the editing operations performed in this application embodiment;
[0037] Figure 5 This is a first schematic diagram of the cell style provided in the embodiments of this application;
[0038] Figure 6 This is a second schematic diagram of the cell style provided in the embodiments of this application;
[0039] Figure 7 This is a schematic diagram illustrating the relationship between computing tasks provided in the embodiments of this application;
[0040] Figure 8 This is a schematic diagram of the seventh process of the table processing method provided in the embodiments of this application;
[0041] Figure 9 This is a schematic diagram illustrating data updates provided in an embodiment of this application;
[0042] Figure 10 This is a schematic diagram of the region division provided in an embodiment of this application;
[0043] Figure 11 This is a schematic diagram of the computational task partitioning provided in the embodiments of this application.
[0044] It should be noted that the terms "first" and "second" mentioned above are only used to distinguish between different options and do not represent the degree of superiority or inferiority of the options or their priority in the implementation process. Detailed Implementation
[0045] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0046] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0047] In the following description, the terms "first / second / third" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first / second / third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0048] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0049] Unless otherwise specified, "at least one" as used below refers to one or more cases, and "multiple" can refer to two or more cases.
[0050] Unless otherwise defined, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in the embodiments of this application is for the purpose of describing the embodiments of this application only and is not intended to limit this application.
[0051] In the implementation of this application, the collection and processing of relevant data should strictly comply with the requirements of relevant laws and regulations, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of laws and regulations and the authorization of the personal information subject.
[0052] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.
[0053] 1) Tables: A common form of data organization and presentation used to systematically arrange and display information. They can be online tables, i.e., table applications that run on a web platform, which users can access and use through a browser or a dedicated client application; or local tables, i.e., tables created and managed by table software installed on a local computer or other device. The data in local tables is stored on the hard drive or other storage media of the local device, and users need to install the corresponding table software on the local device to use it.
[0054] 2) Target area: refers to the area in the table that is being edited. It can be the area corresponding to the row or column where the editing operation is performed, or the area corresponding to the row and column containing the cell being edited.
[0055] 3) Visible area: Within the current screen display range, the portion of the table's target area that can be directly seen by the user.
[0056] 4) Non-visible area: Within the current screen display range, the portion of the table's target area that cannot be directly seen by the user.
[0057] 5) Cell: A cell is a small square formed by the intersection of rows and columns in a table. It is the smallest unit for storing and displaying data. All data in a table is placed in different cells, and information is organized and presented through the orderly arrangement of cells. It is the basic unit that constitutes a table. A table consists of several rows and columns, and each cell has its specific location, uniquely identified by its row number and column header. For example, in common spreadsheet software, the first row is usually represented by the number "1", and the first column is usually represented by the letter "A". Therefore, the cell located in the first row and first column can be represented as "A1".
[0058] 6) Alignment type: This refers to the way data within a cell is arranged horizontally and vertically in spreadsheet software to achieve a clearer and more standardized display. For example, horizontal alignment types include left alignment, center alignment, right alignment, justified alignment, and distributed alignment, while vertical alignment types include top alignment, center alignment, and bottom alignment.
[0059] 7) Calculation task: When editing a table, a series of data processing and calculation operations are performed to present the updated table after editing, so as to complete the rendering and display of the table based on the obtained calculation data.
[0060] 8) Responding to: used to indicate the conditions or states on which the operation is performed. When the conditions or states on which the operation is performed are met, one or more operations may be performed in real time or with a set delay. Unless otherwise specified, there is no restriction on the order in which the multiple operations are performed.
[0061] 9) Human-Computer Interaction Interface: An interface used to provide human-computer interaction functions. Examples include graphical user interfaces (GUIs), augmented reality (AR) interfaces, virtual reality (VR) interfaces, voice user interfaces (VUIs), interactive projection interfaces (using projection technology to display information on a flat surface), eye-tracking interfaces (interfaces controlled by detecting the user's gaze), holographic interfaces (three-dimensional holograms formed by projecting images using holographic projection technology, allowing viewing of stereoscopic images without special glasses), multimodal interfaces (interfaces combining multiple interaction methods, such as tactile, visual, and auditory interaction), and brain-machine interfaces (BMIs).
[0062] When an edit operation is received on a table, causing changes to the text content or style of a portion of the table, the rendering layer needs to calculate the updated data and render the table based on this updated data to display the edited table. Current rendering layer calculation methods require calculations across the entire table area, resulting in redundant computations and increased processing time, leading to longer user wait times.
[0063] Based on the above analysis, the applicant found that the table processing methods of related technologies cannot quickly display the data and style of the edited table. In response to the above problems, this application provides a table processing method, apparatus, electronic device, computer-readable storage medium, and computer program product that can quickly display the data and style of the edited table.
[0064] The following describes exemplary applications of the electronic devices provided in the embodiments of this application. These electronic devices can be implemented as various types of terminals such as laptops, tablets, desktop computers, set-top boxes, smartphones, smart speakers, smartwatches, smart TVs, and in-vehicle terminals, or as servers. Exemplary applications of the electronic devices as terminals will be described below.
[0065] See Figure 1 , Figure 1 This is a schematic diagram of the architecture of the table processing system 100 provided in the embodiments of this application. In order to support a table processing application, the terminal 400 (exemplarily showing the human-computer interaction interface 411) connects to the server 200 through the network 300. The network 300 can be a wide area network or a local area network, or a combination of the two.
[0066] In some embodiments, the terminal 400 is configured to receive an editing operation on a target area in a table, divide the target area into a visible area and a non-visual area, perform a first calculation task for the visible area in response to the editing operation, obtain a first calculation result for each first cell in the visible area, and update the visible area based on the first calculation result; if the first calculation task is completed, perform a second calculation task on the non-visual area, obtain a second calculation result for each second cell in the non-visual area, and update the non-visual area based on the second calculation result. The updated visible area and non-visual area are then displayed on the human-computer interaction interface 411.
[0067] In some embodiments, the terminal 400 receives an editing operation on a target area in a table, divides the target area into a visible area and a non-visual area, and sends the result to the server 200. The server 200 performs a first calculation task on the visible area in response to the editing operation, obtains a first calculation result for each first cell in the visible area, and updates the visible area based on the first calculation result. If the first calculation task is completed, a second calculation task is performed on the non-visual area, obtains a second calculation result for each second cell in the non-visual area, and updates the non-visual area based on the second calculation result. The updated visible area and non-visual area are then sent to the terminal 400 and displayed on the human-computer interaction interface 411.
[0068] The table processing method provided in this application can be applied to any scenario where online or local tables are read or edited. For example, it can be applied to the following scenarios:
[0069] 1) Content Marketing and Creation: When a user needs to generate an advertising plan for a product, the terminal 400 receives the editing operations of the target area of the advertising data table, performs calculation tasks in stages for the visible and non-visual areas of the target area, updates the advertising data table based on the calculation results, and displays it to the user.
[0070] 2) Education and Academic Research: It can be used for editing and updating tables such as academic reports, teaching syllabi, and course lesson plans. For example, terminal 400 is used to receive editing operations from teachers on target areas in teaching syllabus tables, perform calculation tasks in stages on the visible and non-visual areas of the target area, update the teaching syllabus table based on the calculation results, and display it to the teacher.
[0071] 3) News reporting and media can be used for editing and updating schedules such as those for feature interviews. For example, terminal 400 can receive editing operations from a reporter for a feature interview schedule, perform calculation tasks in stages for the visible and invisible areas of the target area, update the feature interview schedule based on the calculation results, and display it to the reporter.
[0072] 4) Business Reporting and Financial Analysis: This can be used for editing and updating financial reports, market analyses, annual summaries, and other forms. For example, if a company's finance department needs to prepare quarterly financial report forms, the terminal 400 receives editing operations from finance personnel for these forms. It performs calculations in stages, targeting both visible and invisible areas of the target region, and updates the quarterly financial report forms based on the calculation results, displaying the updated forms to the finance personnel.
[0073] In some embodiments, server 200 may be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. Terminals and servers can be connected directly or indirectly via wired or wireless communication, which is not limited in this embodiment.
[0074] See Figure 2 , Figure 2 This is a schematic diagram of the structure of the terminal 400 provided in the embodiment of this application. Figure 2 The terminal 400 shown includes at least one processor 410, a memory 450, at least one network interface 420, and a user interface 430. The various components in the terminal 400 are coupled together via a bus system 440. It is understood that the bus system 440 is used to implement communication between these components. In addition to a data bus, the bus system 440 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 2 The general labeled all buses as Bus System 440.
[0075] The processor 410 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.
[0076] User interface 430 includes one or more output devices 431 that enable the presentation of media content, including one or more speakers and / or one or more visual displays. User interface 430 also includes one or more input devices 432, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
[0077] The memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state storage, hard disk drives, optical disk drives, etc. The memory 450 may optionally include one or more storage devices physically located away from the processor 410.
[0078] The memory 450 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), and the volatile memory may be random access memory (RAM). The memory 450 described in this application embodiment is intended to include any suitable type of memory.
[0079] In some embodiments, memory 450 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or subsets or supersets thereof, as illustrated below.
[0080] Operating system 451 includes system programs for handling various basic system services and performing hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., for implementing various basic business functions and handling hardware-based tasks;
[0081] The network communication module 452 is used to reach other electronic devices via one or more (wired or wireless) network interfaces 420, exemplary network interfaces 420 including: Bluetooth, WiFi, and Universal Serial Bus (USB), etc.
[0082] Presentation module 453 is configured to enable the presentation of information (e.g., a user interface for operating peripheral devices and displaying content and information) via one or more output devices 431 (e.g., a display screen, a speaker, etc.) associated with user interface 430;
[0083] The input processing module 454 is used to detect and translate one or more user inputs or interactions from one or more input devices 432.
[0084] In some embodiments, the apparatus provided in this application can be implemented in software. Figure 2 A table processing device 455 stored in memory 450 is shown. It may be software in the form of programs and plug-ins, including the following software modules: receiving module 4551, determining module 4552 and execution module 4553. These modules are logical and can therefore be arbitrarily combined or further split according to the functions implemented.
[0085] In some embodiments, the terminal or server can implement the table processing method provided in this application by running various computer-executable instructions or computer programs. For example, computer-executable instructions can be microprogram-level commands, machine instructions, or software instructions. Computer programs can be native programs or software modules in an operating system; they can be native applications (APPs), i.e., programs that need to be installed in the operating system to run; or they can be applets that can be embedded in any APP, i.e., programs that only need to be downloaded to a browser environment to run, such as online form APP scenarios, online form applet scenarios in instant messaging APPs, and browser scenarios that can display and process online forms. In summary, the aforementioned computer-executable instructions can be any form of instruction, and the aforementioned computer programs can be any form of application, module, or plugin.
[0086] The table processing method provided in this application will be described in conjunction with exemplary applications and implementations of the terminals provided in the embodiments of this application.
[0087] See Figure 3A , Figure 3A This is a first flowchart illustrating the table processing method provided in this application embodiment. Taking the terminal as the execution subject as an example, it will be combined with... Figure 3A Steps 101 to 104 are described below.
[0088] In step 101, an editing operation is received for the target area in the table.
[0089] Here, the table can be an online table, which is a table application that runs on a web platform and can be accessed and used by users through a browser or file editing client application; or it can be a local table, which is a table created and managed by table software installed on a local computer or other device. The data of a local table is stored on the hard drive or other storage media of the local terminal, and users need to install the corresponding table software on the local terminal to use it.
[0090] In some embodiments, receiving an editing operation on a target area in a table can be achieved by performing the following processing: displaying a local table in response to an open operation of the spreadsheet software on the terminal; and receiving an editing operation on a target area in the table. Here, the editing operation on the target area in the table can be any of the following: adjusting the height of the target row of the target area, adjusting the width of the target column of the target area, or editing the data of the target cell of the target area.
[0091] In step 102, if the size of the target area exceeds the size of the screen, the visible area and the invisible area in the target area are determined, wherein the visible area is the area of the target area that is displayed on the screen, and the invisible area is the area of the target area that is not displayed on the screen.
[0092] In some embodiments, when the size of the target area exceeds the size of the screen, the area of the target area that is displayed on the screen can be regarded as the visible area, and the area of the target area that is not displayed can be regarded as the non-visible area.
[0093] As an example, see Figure 4B , Figure 4B This is a first schematic diagram illustrating the editing operations performed in an embodiment of this application. For example... Figure 4B As shown, the area of the target region that is visible on the screen is area 461, and the area of the target region that is not visible on the screen is area 462. Therefore, area 461 can be regarded as the visible area and area 462 as the non-visible area.
[0094] In step 103, a first calculation task for responding to an editing operation is performed on the visible area to obtain a first calculation result for each first cell in the visible area, and the visible area is updated based on the first calculation result of each first cell.
[0095] Here, in response to an editing operation on the target area of the table, the first calculation task for the visible area of the target area can be performed first to obtain the first calculation result of each cell in the visible area. Subsequently, the updated visible area can be rendered through the rendering layer based on the first calculation result.
[0096] In some embodiments, see Figure 3B , Figure 3B This is a schematic diagram of the second process of the table processing method provided in the embodiments of this application. Figure 3A In step 103, "perform a first calculation task for the visible area in response to an editing operation, and obtain a first calculation result for each first cell in the visible area," can be achieved through... Figure 3B Steps 1031 to 1032 are implemented, and the details are explained below.
[0097] In step 1031, when the editing operation is to adjust the height of the target row in the target area, the updated height and updated position of the target row, as well as the updated positions of other rows, are determined based on the height adjustment value of the editing operation. The other rows are the rows in the visible area that are located in the adjustment direction of the target row.
[0098] In some embodiments, when the editing operation is aimed at the height of the target row in the target area, the height and position of the target row after the update can be determined based on the height adjustment value, and the positions of other rows below the target row in the visible area can be adjusted downwards based on the height adjustment value to obtain the updated positions of the other rows.
[0099] As an example, see further. Figure 4B , Figure 4B In the view above, each row has a height of H1, and the vertical coordinate range of each row's position is [y(i), y(i+1)], where i is the row number. Currently, the vertical coordinate range of the 6th row in the visible area is [y6, y7]. In response to adjusting the height of the bottom border of the 6th row downwards, we obtain... Figure 4B In the view below, the height of the 6th row is H1+H. At this time, the range of the ordinate of the updated position of the 6th row is [y6, y7+H]; the range of the ordinate of the updated position of the other rows below the 6th row is [y(i)+H, y(i+1)+H].
[0100] In step 1032, when the editing operation is to adjust the width of the target column of the target area, the updated width and updated position of the target column, as well as the updated positions of other columns, are determined based on the width adjustment value of the editing operation. The other columns are columns in the visible area that are located in the adjustment direction of the target column.
[0101] In some embodiments, when the editing operation is aimed at the width of the target column in the target area, the updated width and position of the target column can be determined based on the width adjustment value, and the positions of other columns below the target column in the visible area can be adjusted downwards based on the width adjustment value to obtain the updated positions of the other columns.
[0102] As an example, see Figure 4C , Figure 4C This is a second schematic diagram of the editing operation provided in the embodiments of this application. For example... Figure 4C As shown, Figure 4C In the view above, each column has a width of W1, and the horizontal coordinate range of each column's position is [x(j), x(j+1)], where j is the column's sequential number. At this point, the horizontal coordinate range of the 4th column's position is [x4, x5]. In response to adjusting the width of the right border of the 4th column to the right by W, we obtain... Figure 4C In the view below, the width of column 4 is W1+W. At this time, the x-coordinate of the updated position of column 4 is in the range of [x4, x5+W]; the x-coordinate of the updated position of the other columns to the right of column 4 is in the range of [x(j)+W, x(j+1)+W].
[0103] In this embodiment, when editing a target row or column within a target area, the calculation process only requires calculating the updated height of the target row or the updated width of the target column, as well as the positions of other rows or columns in the adjustment direction of the target row or column. It avoids calculating the entire target area, focusing only on the target row or column and the affected portion in its adjustment direction. This avoids calculating numerous other irrelevant rows and columns. Compared to calculating the entire target area, only data related to the target row / column and its affected portion needs to be stored, significantly reducing memory usage, computational load, and computation time. This allows users to quickly complete the necessary calculations and update the interface after editing. Due to the reduced computational load and significantly shortened response time, users can immediately see the adjustment effect of the target row / column and the updates to the positions of related rows / columns without long waiting times.
[0104] In some embodiments, step 103, "performing a first calculation task for the visible area in response to an editing operation, and obtaining a first calculation result for each first cell in the visible area," can be achieved by performing the following process: when the editing operation is for editing the data of a target cell in the target area, and the preset format of the target cell is automatic line wrapping and fixed line height, the position of the updated data in the target cell is determined based on the length of the updated data in the target cell, the width of the target cell, and the alignment type of the target cell.
[0105] Here, when editing data in a target cell within a target area, if the target cell's default format is automatic wrapping and fixed row height (e.g., 1 cm), the height and position of the updated cell's row will not change, nor will the height and position of other rows in the visible area. The only calculations needed are the updated data within the target cell and its display position within that cell. In this case, the position of the updated data within the target cell can be determined based on the length of the updated data, the width of the target cell, and the alignment type of the target cell.
[0106] For example, if the length of the updated data is 15, the width of the target cell is 3 centimeters, and the length of data that each row in the target cell can hold is 8, then the length of data that the first row in the target cell can hold is 8, and the length of data that the second row can hold is 7. Finally, based on the alignment type of the target cell, the position of the data in the second row within the target cell can be determined.
[0107] As an example, see Figure 5 , Figure 5 This is a first schematic diagram of the cell style provided in the embodiments of this application. Figure 5The image on the left shows the display effect of three cells with the preset automatic line wrapping after editing. Cell 501 is left-aligned, cell 502 is center-aligned, and cell 503 is right-aligned. Therefore, the last row of data in cell 501 after the update is left-aligned, the last row of data in cell 502 after the update is center-aligned, and the last row of data in cell 503 after the update is right-aligned.
[0108] In this embodiment, when the target cell's preset format is automatic line wrapping and fixed line height, only the updated data in the target cell and its display position within the target cell need to be calculated. No calculations are required for other cells within the visible area. Focusing solely on the target cell significantly reduces the amount of data to be processed and the computational complexity. This is especially beneficial when dealing with large tables; if only one cell's data is modified, only that cell's update is calculated, avoiding unnecessary calculations for numerous other unrelated cells. This effectively reduces the load on the terminal's CPU. For devices with limited memory resources, such as mobile terminals, it avoids lag caused by insufficient memory, speeds up data updates and display, and allows users to see the updated results more quickly after editing the target cell, without long waiting times, thus improving the responsiveness and smoothness of the operation.
[0109] In some embodiments, step 103, "performing a first calculation task for the visible area in response to an editing operation, and obtaining a first calculation result for each first cell in the visible area," can be achieved by performing the following processing: when the editing operation is for editing the data of a target cell in the target area, and the preset format corresponding to the target cell is automatic line wrapping and non-fixed line height, the updated height and updated position of the row containing the target cell, as well as the updated positions of other rows in the visible area, are determined based on the length of the updated data in the target cell and the width of the target cell, wherein the other rows are the rows below the target cell; the position of the updated data in the target cell is determined based on the alignment type of the target cell.
[0110] As an example, see Figure 4D , Figure 4D This is a third schematic diagram illustrating the editing operation provided in the embodiments of this application. For example... Figure 4DAs shown, the target area includes a visible area 471 and a non-visible area 472. When an edit operation is received targeting cell 473 in the visible area 471, and the preset format of target cell 473 is automatic text wrapping and non-fixed row height, the updated height and position of the row containing target cell 473 (i.e., row 6), as well as the updated positions of rows below row 6 in the visible area, can be determined based on the length of the updated data and the width of target cell 473. Furthermore, the position of the updated data within target cell 473 can be determined based on the alignment type of the target cell.
[0111] like Figure 4D As shown, Figure 4D In the view above, each row has a height of H1, and the vertical coordinate range of each row is [y(i), y(i+1)], where i is the row number. Therefore, the vertical coordinate range of the 6th row is [y6, y7]. If the updated data length of target cell 473 is 8, the target cell width is 1.5 cm, and each row of the target cell holds 3 data points, then the first row of the target cell holds 3 data points, the second row holds 3 data points, and the first row holds 2 data points. Therefore, the updated height of the 6th row containing target cell 473 is H1+H, and the vertical coordinate range of the updated position of the 6th row is [y6, y7+H]. The vertical coordinate range of the updated positions of the other rows below the 6th row is [y(i)+H, y(i+1)+H].
[0112] In this embodiment, when the preset format of the target cell is automatic text wrapping and non-fixed line height, if an editing operation is received for the data in the target cell, it only needs to calculate the updated height and position of the row containing the target cell, the updated positions of other rows below the target cell in the visible area, and the position of the updated data in the target cell. It does not need to calculate the data in other rows in the visible area, focusing only on the target cell, its row, and the affected rows below it, thus avoiding the calculation of a large amount of irrelevant row data within the visible area. Because the calculation scope is reduced, the time required to perform the calculation task is significantly reduced, allowing users to quickly see the updated results after editing the target cell without a long waiting time.
[0113] In other embodiments, see Figure 3C , Figure 3C This is a schematic diagram of the third process of the table processing method provided in the embodiments of this application. (Regarding...) Figure 3AIn step 103, "execute a first calculation task for the visible area in response to the editing operation, and obtain the first calculation result for each first cell in the visible area," if the editing operation is used to edit the data of the target cell in the target area, and the preset format of the target cell is not automatic line wrapping, and the length of the updated data of the target cell corresponding to the editing operation exceeds the width of the target cell, then the following can be executed: Figure 3C The processing steps 1033 to 1034 are explained in detail below.
[0114] Here, "the length of the updated data in the target cell exceeding the width of the target cell" means that the length of data that the width of the target cell can accommodate is less than the length of the updated data. For example, if the length of the updated data in the target cell is 8, the width of the target cell is 1.5 cm, and the length of data that each row of the target cell can accommodate is 3, then the length of the updated data in the target cell exceeds the width of the target cell.
[0115] In step 1033, if there is no data in the cell corresponding to the alignment type of the target cell, the coverage of the target cell in the direction is determined according to the length of the updated data, and the border line of the target cell in the direction is canceled.
[0116] In some embodiments, if the cells in the alignment type corresponding to the target cell in the visible area have no data, the updated data exceeding the target cell can cover the cells in the corresponding direction. The coverage area of the target cell in the corresponding direction is then determined based on the length of the updated data, and the border line of the target cell in that direction is removed. The data in other rows or columns remains unchanged. In this case, the data in the rows or columns outside the visible area also remains unchanged, and it is not necessary to recalculate the data in the outside visible area.
[0117] As an example, see Figure 4E , Figure 4E This is the fourth schematic diagram illustrating the editing operation provided in the embodiments of this application. For example... Figure 4E In the top view shown, the target area includes a visible area 471 and a non-visible area 472. When an edit operation is received targeting cell 473 within the visible area 471, and the default format of cell 473 is non-automatic text wrapping, the alignment type of cell 473 is center alignment, and there is no data in the cells on either side of the target cell, the coverage area of the target cell 473 in the corresponding direction can be determined based on the length of the updated data in the target cell 473. For example, as... Figure 4EIn the view below, the length of the updated data in target cell 473 is 8. The updated data covers the left cell C6 and the right cell E6, and the border lines on the left and right sides of target cell 473 are not displayed.
[0118] In step 1034, if the cells in the direction corresponding to the alignment type of the target cell contain data, then the data covered by the cells in the direction in the updated data is determined.
[0119] In some embodiments, if the cells in the alignment type corresponding to the target cell in the visible area contain data, the updated data exceeding the target cell can be covered by the cells in the corresponding alignment type. The data in other rows or columns will not change. In this case, the data in the rows or columns outside the visible area will also not change, and it is not necessary to recalculate the data in the outside visible area.
[0120] As an example, see Figure 4F , Figure 4F This is the fifth schematic diagram illustrating the editing operation provided in the embodiments of this application. For example... Figure 4F In the top view shown, the target area includes a visible area 471 and a non-visible area 472. When an edit operation is received on target cell 473 within the visible area 471, and the default format of target cell 473 is non-automatic text wrapping, and the alignment type of target cell 473 is left-aligned, and the data "stop" is present in cell E6 to the right of target cell 473, the data covered by cell E6 in the updated data of target cell 473 can be determined based on the length of the updated data in target cell 473. For example, as... Figure 4F In the view below, the length of the updated data in target cell 473 is 5, and the width of target cell 473 can accommodate a data length of 3. Therefore, the first 3 data are displayed in target cell 473, and the last 2 data are covered by cell E6.
[0121] In this embodiment, when the target cell is set to non-automatic line wrapping, the coverage between cells and the border display effect of related cells are determined based on whether there is data in the cells corresponding to the alignment type of the target cell. This eliminates the need to calculate data from other rows or columns. When the table data volume is large, calculating data from all rows and columns would place a heavy burden on storage resources. By focusing only on the target cell and its related cells in its alignment direction, the processing of a large amount of other irrelevant data is avoided, significantly reducing the computational pressure on the terminal's central processing unit and improving the efficiency of the calculation process. Furthermore, due to the reduced calculation scope, the terminal can more quickly complete the calculation tasks for the target cell and its related cells. After a user operates on the target cell, the user can see the updated coverage and border display effect in a short time, without long waiting times, thus improving the responsiveness of the operation.
[0122] In other embodiments, Figure 3A In step 103, “perform a first calculation task for the visible area in response to the editing operation, and obtain the first calculation result of each first cell in the visible area” can be achieved by performing the following process: when the editing operation is used to edit the target cell of the target area, and the length of the updated data of the target cell does not exceed the width of the target cell, determine the position of the updated data in the target cell according to the length of the updated data and the alignment type of the target cell.
[0123] Here, when the length of the updated data in the target cell does not exceed the width of the target cell, the position of the updated data within the target cell is determined based on the length of the updated data and the alignment type of the target cell. For example, if the length of the updated data is 3, the width of the target cell can accommodate a data length of 5, and the alignment type of the target cell is center alignment, the updated data will be displayed in the center of the target cell. In this case, the data in other rows or columns in both the visible and invisible areas will not change.
[0124] In some embodiments, see Figure 3D , Figure 3D This is a schematic diagram of the fourth process of the table processing method provided in the embodiments of this application. Figure 3A In step 103, "perform a first calculation task for the visible area in response to an editing operation, and obtain a first calculation result for each first cell in the visible area," can be achieved through... Figure 3D Steps 1035 to 1036 are implemented, and the details are explained below.
[0125] In step 1035, a first marker is obtained for each first cell, wherein the first marker is used to indicate that the calculation task for the first cell has not been executed.
[0126] In some embodiments, during table initialization or when editing operations are performed on a target area of the table, a preset first marker can be obtained for each first cell in the visible area. For example, if the first marker is 0, it indicates that the calculation task for the first cell has not been executed.
[0127] In step 1036, a first calculation task for responding to an editing operation is performed on the visible area to obtain a first calculation result for each first cell in the visible area, and the first tag corresponding to the first cell is updated to a second tag, wherein the second tag is used to indicate that the calculation task for the first cell has been completed.
[0128] In some embodiments, after the first cell of the visible area has undergone a first calculation task, the original first label of the first cell can be updated to a second label to indicate that the calculation task for the current first cell has been completed and there is no need to perform the calculation task again.
[0129] As an example, cell 1 in the visible area is marked as 0 before the first calculation task is performed, and the mark is updated to 1 after the first calculation task is performed, indicating that the calculation task of cell 1 has been completed.
[0130] This application's embodiments determine the cells to be calculated by obtaining a tag value for each cell. This avoids repeatedly executing calculations on the same cell or having some cells not undergoing calculations. Accurately identifying the cells to be calculated using the tag value avoids redundant processing of already calculated cells, significantly reducing computational load, improving computational efficiency, and allowing for more effective utilization of the terminal's computing resources. Furthermore, repeated calculations lead to the storage of unnecessary intermediate results in memory, increasing memory usage. Using tag values ensures that each cell is calculated only once, reducing the amount of temporary data stored in memory. This is particularly important for spreadsheet applications processing large tables or running on devices with limited memory resources, helping to prevent performance degradation or crashes of the terminal device due to insufficient memory.
[0131] See also Figure 3A The following will be an explanation following step 103 above.
[0132] In step 104, if the first calculation task is completed, a second calculation task is performed for the non-visual area in response to the editing operation, and a second calculation result is obtained for each second cell in the non-visual area, wherein the second calculation result of each second cell is used to update the non-visual area.
[0133] Here, if the first calculation task for the visible area is completed, the second calculation task for the non-visible area can be performed before updating the visible area based on the first calculation result, or the second calculation task for the non-visible area can be performed after updating the visible area based on the first calculation result.
[0134] By performing phased calculations as described above, the system first completes the computation tasks within the user's currently visible area, then processes the non-visible areas. This distributed approach avoids sudden increases in resource consumption, allowing for more stable utilization of the terminal device's computing resources. Furthermore, prioritizing the visible area allows resources to be concentrated on processing the data most needed by the user; since the data volume in the visible area is relatively small, the computation time is correspondingly reduced. After completing the calculations for the visible area, the system then utilizes idle resources to process the non-visible areas, avoiding premature calculations of unnecessary data and thus improving overall computational efficiency.
[0135] In some embodiments, the step 104 above, "when the first computing task is completed, perform a second computing task for responding to an editing operation for a non-visual area", can be implemented by performing the following process: when the first computing task is completed and a viewing operation for a non-visual area is received, perform a second computing task for responding to an editing operation for the non-visual area.
[0136] Here, the viewing operation for non-visual areas can be a table scrolling operation or a triggering operation of a preset direction control within the table. If the first calculation task is completed, the second calculation task for the non-visual area can be executed only upon receiving a viewing operation for that area. If no viewing operation for the non-visual area is received after completing the first calculation task, the second calculation task for the non-visual area does not need to be executed.
[0137] By employing the above method, the timing of executing the second computational task for the non-visual area is determined based on the viewing opportunity. This second computational task is only executed when a viewing operation is received, avoiding pre-calculation of data that the user may not be interested in. Furthermore, given the limited computing resources of the terminal device, prioritizing the completion of the first computational task for the visible area ensures that the user can see the data of interest in a timely manner. The second computational task is then performed only when the user needs to view the non-visual area. This achieves a rational allocation of system resources, allowing the system to dynamically adjust resource usage between different tasks and improve resource utilization.
[0138] In some other embodiments, the step 104 above, "when the first calculation task is completed, perform a second calculation task for responding to editing operations for the non-visual area", can be implemented by performing the following process: when the first calculation task is completed, if the number of rows in the non-visual area exceeds the number of rows threshold, or the number of columns in the non-visual area exceeds the number of columns threshold, perform a second calculation task for responding to editing operations for the non-visual area.
[0139] Here, after completing the first calculation task for the visible area, the size of the non-visible area can be evaluated. For example, the number of rows and columns in the non-visible area can be counted separately and compared with pre-set row and column thresholds. If the number of rows (columns) in the non-visible area exceeds the row (column) threshold, it means that the non-visible area has a large amount of data in the vertical (horizontal) direction, containing a large number of rows (columns). At this point, even if no explicit viewing action from the user has been received regarding the non-visible area, a second calculation task for the non-visible area can be automatically triggered. Pre-calculating can avoid long waiting times when the user subsequently views the area.
[0140] By employing the methods described above, pre-calculating non-visual areas with a large number of rows or columns can distribute the computational load across different time periods, avoiding a concentrated period of computation when the user views the area, thereby reducing system load peaks within a short timeframe. Furthermore, pre-calculation can utilize idle terminal resources, improving data processing efficiency. This allows users to quickly access pre-calculated results when they need to view non-visual areas, eliminating the need to wait for the computation process and significantly shortening user waiting time.
[0141] In some other embodiments, the step 104 above, "when the first computing task is completed, perform a second computing task for responding to editing operations for the non-visual area", can be achieved by performing the following process: when the first computing task is completed, during the waiting period before displaying the non-visual area, perform a second computing task for responding to editing operations for the non-visual area.
[0142] Here, the waiting time before displaying the non-visual area refers to the period during which no other editing operations on the table are received after the first calculation task is completed. During this waiting time before displaying the non-visual area, the idle period of user operation can be utilized to proactively execute a second calculation task for the non-visual area in response to editing operations. This fully utilizes resources such as the CPU and memory that might otherwise be idle, improving the utilization rate of computing resources and allowing the terminal's computing performance to be used more effectively, thus avoiding the waste of idle computing resources.
[0143] Compared to starting calculations only when the non-visible area is displayed, which forces users to wait for the calculations to complete before seeing the full and accurate content, the above method performs a second calculation task for the non-visible area in response to editing operations during the waiting time before the non-visible area is displayed. By completing the second calculation task in advance during the waiting time, users can see the results immediately when the non-visible area is displayed, greatly shortening the actual waiting time for users and improving the smoothness of operation.
[0144] In some embodiments, the aforementioned waiting time may be determined in any of the following ways:
[0145] Method 1: Obtain the preset interval for automatic page turning in the table and use it as the waiting time for non-visible areas.
[0146] Here, the preset interval for automatic page turning of the table refers to the time interval from the start of the countdown when the currently visible area of the page is displayed to the time interval when the page automatically turns to the next non-visible area. For example, the preset interval for the table to automatically turn to the next page from the current page can be 2 minutes, and the preset interval of 2 minutes is used as the waiting time for the non-visible area.
[0147] Method 2: Determine the average historical viewing time for each of the multiple historically visible areas, and use this average as the waiting time for non-visible areas.
[0148] In some embodiments, the historical viewing duration corresponding to multiple historical visible areas can be obtained, and the average of the historical viewing durations corresponding to multiple historical visible areas can be used as the waiting time for non-visible areas.
[0149] Here, the historical viewing duration corresponding to the historical visible area refers to the time interval from the start of the timer when the historical visible area is displayed to the time interval when a viewing operation for a non-visible area is received.
[0150] As an example, the historical viewing time corresponding to historical visible area 1 is 1 minute, the historical viewing time corresponding to historical visible area 2 is 3 minutes, and the historical viewing time corresponding to historical visible area 3 is 2 minutes. Therefore, the average historical viewing time corresponding to the three historical visible areas is 2 minutes. That is, for the currently displayed visible area, the waiting time for the non-visible area is 2 minutes.
[0151] This application embodiment obtains the preset interval for automatic page turning of the table as the waiting time for the non-visible area. Since the preset interval for automatic page turning allows the table to automatically display the content of the non-visible area at a fixed rhythm, obtaining the preset interval for automatic page turning of the table as the waiting time for the non-visible area allows users to have a clear expectation of the display rhythm of the table content. Using the average of the historical viewing times corresponding to multiple historical visible areas as the waiting time for the non-visible area allows computing resources to be allocated specifically during the waiting period according to the user's regular viewing rhythm, ensuring efficient resource utilization.
[0152] Method 3: Based on the historical display duration corresponding to multiple historical visible areas, a pre-trained time series model is used to predict the display duration of the visible areas, which is then used as the waiting time for the non-visible areas.
[0153] In some embodiments, a pre-trained time series model can be trained by performing the following process: obtaining the historical visible area of the sample and the historical display duration corresponding to each historical visible area of the sample; calling the initialized time series model to predict the historical visible area of the sample to obtain the predicted display duration; calculating the loss value using a preset loss function based on the difference between the historical display duration and the predicted display duration; and updating the parameters of the initialized time series model based on the loss value to obtain the pre-trained time series model.
[0154] As examples, time series models can be Long Short-Term Memory Networks (LSTM), Gated Recurrent Units (GRU), Bidirectional Long Short-Term Memory Networks (Bi-LSTM), Autoregressive Integrated Moving Average Models (ARIMA), Seasonal Autoregressive Integrated Moving-Average Models (SARIMA), Exponential Smoothing (ES), and Transformer models.
[0155] The loss function can be the Mean Squared Error Loss (MSE), Mean Absolute Error Loss (MAE), Root Mean Squared Error Loss (RMSE), Mean Absolute Percentage Error Loss (MAPE), or Mean Squared Logarithmic Error Loss (MSLE).
[0156] This application embodiment uses a pre-trained time series model to predict the display duration of the visible area based on the historical display duration corresponding to multiple historical visible areas. This prediction serves as the waiting time for the non-visible area. The time series model can learn the correlation between historical visible areas and historical display duration, thereby predicting the display duration of the visible area based on the visible area and improving the accuracy of the prediction.
[0157] In some embodiments, the above-mentioned "performing a second computational task for responding to an editing operation on a non-visual area during a waiting period before displaying a non-visual area" can be achieved by performing the following process: during a waiting period before displaying a non-visual area, and during a period when the load for performing the computational task is less than a load threshold, performing a second computational task for responding to an editing operation on a non-visual area.
[0158] Here, during the waiting time before displaying the non-visual area, the load of the computational tasks is considered to determine whether to execute a second computational task for the non-visual area. The second computational task for the non-visual area is executed only if the load is less than the load threshold; if the load of the computational tasks is greater than or equal to the load threshold, it indicates that the current computational resources are strained and cannot handle additional computational tasks for the non-visual area, so the second computational task for the non-visual area is not executed temporarily.
[0159] This application embodiment optimizes system resource allocation by executing a second computational task for responding to editing operations on the non-visible area during the waiting period before displaying the non-visible area and while the load for performing computational tasks is less than a load threshold. The decision to execute the second computational task is based on the computational task load. When the system load is low, computational tasks on the non-visible area are executed promptly, improving data update speed; when the load is high, tasks are paused to avoid excessive resource concentration, ensuring a balanced distribution of computational resources among different tasks. This strategy fully utilizes resources for computation when resources are abundant, avoiding resource idleness; and rationally allocates resources when resources are scarce, prioritizing the execution of critical tasks. This improves the overall utilization rate of computational resources and reduces resource waste.
[0160] In some embodiments, step 104 above, "performing a second calculation task for the non-visual area in response to an editing operation, and obtaining a second calculation result for each second cell in the non-visual area," can be achieved by performing the following processing:
[0161] When editing operations are used to edit the data of the target cell in the target area, and the preset format of the target cell is automatic text wrapping and non-fixed row height, the height adjustment value of the row where the target cell is located is determined based on the length of the updated data of the target cell and the width of the target cell; based on the height adjustment value, the range of the updated vertical coordinate of each row in the non-visible area is determined.
[0162] As an example, see further. Figure 4D The target area includes a visible area 471 and a non-visual area 472. When an editing operation is received for the target cell 473 in the visible area 471, and the preset format of the target cell 473 is automatic line wrapping and non-fixed line height, the updated height and updated position of the row (i.e., the 6th row) of the target cell 473 can be determined according to the length of the updated data and the width of the target cell 473, as well as the updated position of the rows below the 6th row in the non-visual area.
[0163] like Figure 4D As shown, Figure 4DIn the view above, each row has a height of H1, and the vertical coordinate range of each row is [y(i), y(i+1)], where i is the row number. Therefore, the vertical coordinate range of the 6th row is [y6, y7]. If the updated data length of target cell 473 is 8, the target cell width is 1.5 cm, and each row of the target cell holds 3 data points, then the first row of the target cell holds 3 data points, the second row holds 3 data points, and the first row holds 2 data points. With the height adjustment value H, the updated height of the non-visible area corresponding to the 6th row of target cell 473 is H1+H, and the vertical coordinate range of the updated position of the 6th row in the non-visible area is [y6, y7+H]. The vertical coordinate range of the updated positions of the other rows below the 6th row in the non-visible area is [y(i)+H, y(i+1)+H].
[0164] In this embodiment of the application, after the first calculation task is completed, if the preset format corresponding to the target cell is automatic line wrapping and non-fixed line height, and an editing operation is received for the data of the target cell, it is only necessary to calculate the updated height and updated position of the row where the target cell is located in the non-visual area, as well as the updated positions of other rows below the row where the target cell is located in the non-visual area. It is not necessary to calculate the data of other rows in the non-visual area. By focusing only on the row where the target cell is located and the affected rows below it, the calculation of a large amount of irrelevant row data in the non-visual area is avoided, and the calculation time is greatly reduced.
[0165] In some embodiments, see Figure 3E , Figure 3E This is a schematic diagram of the fifth process of the table processing method provided in the embodiments of this application. Figure 3A In step 104, "perform a second calculation task for the non-visual area in response to the editing operation, and obtain a second calculation result for each second cell in the non-visual area," this can be achieved through... Figure 3E Steps 1041 to 1042 are implemented, and the details are explained below.
[0166] In step 1041, when the editing operation is to adjust the height of the target row in the target area, the updated vertical coordinate range of each row in the non-visible area is determined based on the height adjustment value of the editing operation. The change trend of the height adjustment value relative to the original height of the target row is opposite to the change trend of the vertical coordinate.
[0167] In some embodiments, the range of the updated vertical coordinates for each row in the non-visible area can be determined based on the height adjustment value of the editing operation. If the height adjustment value is an increase relative to the original height of the target row, the value of the vertical coordinate decreases; if the height adjustment value is a decrease relative to the original height of the target row, the value of the vertical coordinate increases.
[0168] As an example, see further. Figure 4B , Figure 4B In the view above, each row has a height of H1, and the y-coordinate range of each row's position is [y(i), y(i+1)], where i is the row number. At this point, the y-coordinate range of the 6th row in the non-visible area is [y6, y7]. In response to adjusting the height of the bottom border of the 6th row downwards, we obtain... Figure 4B In the view below, the height of the 6th row in the non-visible area is H1+H. At this time, the range of the ordinate of the updated position of the 6th row in the non-visible area is [y6, y7+H]; the range of the ordinate of the updated position of the other rows below the 6th row in the non-visible area is [y(i)+H, y(i+1)+H].
[0169] In step 1042, when the editing operation is aimed at the width of the target column in the target area, the updated horizontal coordinate range of each column in the non-visible area is determined according to the width adjustment value of the editing operation, wherein the trend of the width adjustment value relative to the original width of the target column is the same as the trend of the horizontal coordinate.
[0170] In some embodiments, the range of the horizontal coordinate for each column in the non-visible area can be determined based on the width adjustment value of the editing operation. If the width adjustment value is an increase relative to the original width of the target column, the value of the horizontal coordinate increases; if the width adjustment value is a decrease relative to the original width of the target column, the value of the horizontal coordinate decreases.
[0171] As an example, see further. Figure 4C ,like Figure 4C As shown, Figure 4C In the view above, the width of each column in the non-visible area is W1, and the horizontal coordinate range of each column's position is [x(j), x(j+1)], where j is the sequential number of the column. At this point, the horizontal coordinate range of the 4th column in the non-visible area is [x4, x5]. In response to adjusting the width of the right border of the 4th column in the table to the right by W, we obtain... Figure 4CIn the view below, the width of the 4th column in the non-visible area is W1+W. At this time, the x-coordinate of the updated position of the 4th column in the non-visible area is in the range of [x4, x5+W]; the x-coordinate of the updated position of the other columns to the right of the 4th column in the non-visible area is in the range of [x(j)+W, x(j+1)+W].
[0172] In this embodiment of the application, when performing editing operations on target rows or target columns within the visible area of the target region, after completing the first calculation task for the visible area, for the non-visible area, it is only necessary to calculate the updated height of the target row or the updated width of the target column, as well as the positions of other rows or columns located in the adjustment direction of the target row or target column. It is not necessary to calculate the entire range of the non-visible area, but only to focus on the target row or target column and the affected part in its adjustment direction. This avoids the calculation of a large number of other irrelevant rows and columns. Compared to calculating the entire range of the non-visible area, it is only necessary to store the data related to the target row / column and the affected part, which can significantly reduce memory usage, reduce the amount of calculation, and save calculation time.
[0173] In some embodiments, see Figure 3F , Figure 3F This is a schematic diagram of the sixth process of the table processing method provided in the embodiments of this application. Figure 3A In step 104, "perform a second computational task for non-visual areas in response to editing operations," which can be achieved through... Figure 3F Steps 1043 to 1045 are implemented, and the details are explained below.
[0174] In step 1043, the prediction duration of the second computing task corresponding to the non-visible area is determined.
[0175] Here, the predicted duration of the second computing task corresponding to the non-visual area refers to the estimated time required to complete the second computing task.
[0176] In some embodiments, the non-visual area is an area that is an extension of the visible area by a preset multiple; the above step 1043 is achieved by performing the following process: obtaining the computation time of the first computation task, wherein the computation time is the time consumed to complete the first computation task; and determining the prediction time of the second computation task corresponding to the non-visual area based on the computation time and the preset multiple.
[0177] As an example, the computation time for the first computation task is 3 seconds, and the range of the non-visual area is 5 times the area expanded outward from the visible area. Therefore, the prediction time for the second computation task corresponding to the non-visual area is 15 seconds.
[0178] In step 1044, the non-visible area is divided into multiple sub-regions based on the prediction duration and duration threshold, and the sub-computation task corresponding to each sub-region is determined. The number of sub-regions is obtained by rounding up the ratio of the prediction duration to the duration threshold.
[0179] Here, the duration threshold is the maximum duration for the load to execute a single computation task.
[0180] As an example, if the prediction duration of the second calculation task is 15 seconds and the duration threshold is 60 seconds, then the non-visible area can be divided into 15 sub-regions.
[0181] In step 1045, the sub-computation task corresponding to each sub-region is executed.
[0182] In some embodiments, the sub-computation task corresponding to each sub-region can be determined based on the position of the sub-region in the non-visual area. For example, if there are 10 rows in the non-visual area, and sub-region 1 is located in the first and second rows of the non-visual area, then if the second computation task is to calculate the range of vertical coordinates corresponding to rows 1 to 10, then the sub-computation task corresponding to sub-region 1 is to calculate the range of vertical coordinates corresponding to rows 1 and 2.
[0183] In some embodiments, after performing the above step 104, "perform a second calculation task for the non-visible area in response to an editing operation to obtain a second calculation result for each second cell in the non-visible area", the following processing can be performed: in response to a viewing operation for the non-visible area, update the non-visible area according to the second calculation result for each second cell in the non-visible area.
[0184] Here, after obtaining the second calculation result of each second cell in the non-visual area, in response to receiving a viewing operation for the non-visual area (such as a sliding operation for a table), rendering can be performed based on the second calculation result of each second cell in the non-visual area to obtain the rendered non-visual area.
[0185] In summary, this embodiment of the application, when receiving an editing operation on a target area in a table, and the size of the target area exceeds the screen size, divides the target area into a visible area and a non-visible area; performs a first calculation task on the visible area to obtain a first calculation result for each first cell in the visible area, and updates the visible area based on the first calculation result of each first cell; after the first calculation task is completed, performs a second calculation task on the non-visible area to obtain a second calculation result for each second cell in the non-visible area, thereby updating the non-visible area. This scheme, by performing the calculation task on the target area in stages, can reduce resource consumption and computational load in each stage; prioritizing the processing of the visible area allows for a rapid response to the user's editing operation, enabling the user to see the updated results of the visible area promptly without waiting for the entire table to be calculated, thus providing a smoother user experience.
[0186] The following will describe an exemplary application of the embodiments of this application in the application scenario of editing online tables.
[0187] When an edit operation is received for an online table, causing changes to the text content or style of parts of the table, the rendering layer needs to calculate the updated data for each cell in real time and render the table based on this updated data. Current rendering layer calculation methods require calculations over a large area of the table or segmented calculations based on behavior dimensions, failing to achieve fine-grained calculations at the cell level. This results in redundant computations during actual calculations, hindering optimal performance optimization.
[0188] The table processing method provided in this application supports calculations accurate to the specific cell range, controlling the computational load at the cell level and avoiding redundant calculations, thus achieving better performance. Combined with the asynchronous task splitting into smaller chunks, it avoids time-consuming computation scenarios during the rendering layer calculation process. By finely controlling the scope of user interaction, the computation is kept to a minimum, greatly reducing the computational load. Only the user-observable portion of the data is calculated at a time, with the remaining data being calculated asynchronously through splitting into smaller chunks, significantly reducing user waiting time and memory usage, greatly improving the user experience.
[0189] Taking adjusting the column width of a target column in a table as an example, the calculation range for adjusting column width in related technologies is: the row-by-row result of the target column range, including the row height of the target column, the border line of the target column, and the covering cells of the target column. The range of a single calculation is the entire table range. However, the table processing method provided in this application reduces the single calculation range to the range within the visible area. The remaining uncalculated area (non-visible area) will be calculated asynchronously by splitting it into smaller pieces, without blocking subsequent user operations.
[0190] As an example, see Figure 4A , Figure 4A This is a schematic diagram illustrating the calculation range of the table provided in the embodiments of this application. For example... Figure 4A The table shows a visible area, a non-visual area 1, and a non-visual area 2. The single calculation range of related technologies is the entire table range, that is, all ranges including the visible area, non-visual area 1, and non-visual area 2. The single calculation range of the table processing method provided in this application embodiment is the range of the visible area.
[0191] When data or styles in a table change in response to editing operations, the rendering layer can detect events to calculate updated data in the table and then render the updated table based on that data. Specifically, first, the rendering layer detects changes in the data layer. When the data in the data layer changes, the rendering layer filters out the relevant data and performs synchronous calculations on the data in each cell of the table. The time required increases with the scope of the calculation. Then, the data is converted into the data needed by the rendering layer. Finally, the rendering layer renders the updated table based on the data.
[0192] For the rendering layer, the data needed to draw the table on the canvas cannot be entirely obtained from the data layer. For example, in the following cases, data calculated by the rendering layer is required to correctly draw the table data onto the canvas, as explained in detail below.
[0193] 1. Calculate by line breaks or cell wrapping (calculation range: cells).
[0194] When the cell's default format is automatic line wrapping, and the length of the updated data exceeds the cell's width, the updated data will automatically wrap to the next line after filling the current line. Since the data length measurement depends on the server, it needs to be calculated through the rendering layer.
[0195] As an example, see Figure 5 , Figure 5 This is a first schematic diagram of the cell style provided in the embodiments of this application. Figure 5The image on the left shows the display effect of three cells with the preset automatic text wrapping format after editing. Cell 501 is left-aligned, cell 502 is center-aligned, and cell 503 is right-aligned. Figure 5 The right-hand area 504 shows the display effect of data of different font sizes when the alignment type is left-aligned and the default format is automatic line wrapping.
[0196] 2. Row height calculation (calculation range: the row containing the cell)
[0197] When the row containing a cell is not set to a fixed row height, the height of the row may be increased by cells that automatically wrap. Therefore, the actual rendered row height also needs to be calculated based on the line breaks or wraps.
[0198] 3. Calculation of covered or hidden cells (calculation range: the row containing the cell).
[0199] If the cell's row is not set to wrap automatically, when the length of the updated data exceeds the width of the current cell, the data will expand in the corresponding direction based on the cell's alignment type and whether there is data in the cells in that direction, resulting in data covering both the left and right sides.
[0200] As an example, see Figure 6 , Figure 6 This is a second schematic diagram illustrating the cell style provided in an embodiment of this application. For example... Figure 6 The data in cell D2 shown exceeds the width of cell D2, and neither cell C2 to the left nor cell E2 to the right contains data. Therefore, the data in cell D2 will expand horizontally. Figure 6 The data in cell D3 is longer than the width of cell D3. Cell C3 to the left of cell D3 is empty, while cell E3 to the right contains the data "stop". Therefore, the data in cell D3 extends to the left, and part of the data on the right is covered by cell E3.
[0201] 4. Border line calculation (calculation range: the row containing the cell).
[0202] Due to the influence of overlay cells, the border lines between overlay cells (cells that cover other cells) and hidden cells (cells that are covered) will be obscured by the data that exceeds the border and will be hidden.
[0203] As an example, see further. Figure 6 ,like Figure 6The data in cell D2 is longer than the width of cell D2. Since there is no data in cell C2 to the left and cell E2 to the right of cell D2, the data in cell D2 expands to the left and right, covering cells C2 and E2. Therefore, cell D2 is a covered cell, and cells C2 and E2 are both hidden cells.
[0204] The influence and dependencies between the computational tasks corresponding to the above four situations are as follows: Figure 7 As shown, Figure 7 This is a schematic diagram illustrating the relationship between computing tasks provided in the embodiments of this application. For example... Figure 7 As shown, the calculation tasks for cross-column centering information calculation, row height information calculation, overlay cell information calculation, and border line information calculation are performed row-by-row; the calculation task for line-by-line information calculation is performed on demand, meaning that only the row that is updated is calculated. Specifically, cross-column centering information calculation affects line-by-line information calculation and overlay cell information calculation; line-by-line information calculation affects overlay cell calculation and row height calculation; and overlay cell calculation affects border line information calculation.
[0205] The table processing method provided in the embodiments of this application is described below. This application provides a complete asynchronous calculation scheme, combined with the ability to perform precise cell calculations, to keep the computational load of each editing operation within a minimum range. A fine-grained calculation task manager provides a calculation manager that manages the sequential dependencies of various calculation tasks and finely controls the changes in the scope of influence of each editing operation, thereby achieving calculations at the smallest granularity.
[0206] See Figure 8 , Figure 8 This is a schematic diagram of the seventh process of the table processing method provided in the embodiments of this application. For example... Figure 8 As shown, when the data layer detects a data change, it manages large task sharding through the large task sharder. This means splitting the data calculation into calculation tasks corresponding to the visible area and the non-visible area respectively. The first calculation task of the visible area is completed first in conjunction with the fine calculation task manager. The table display interface is then updated and displayed to the user based on the calculation results obtained from the calculation task.
[0207] Here, the non-visible area can be an area expanded by a preset multiple of the visible area. For example, it could be a rendering layer data area calculated asynchronously by multiplying the visible area horizontally by 3 times and vertically by 15 times. The calculation of each multiple of the visible area is considered a single calculation task. After one task is completed, the next technical task will be scheduled. The task priority order is: current view (visible area) range, below the view range, above the view range, right side of the view range, and left side of the view range. It should be noted that the rendering layer can perform calculation tasks based on the current visible area to obtain the data required for rendering, without having to calculate the rendering data for the entire table.
[0208] When the table interface changes in response to scrolling or zooming, a computation task can be asynchronously constructed for the non-visible area. A second computation task is then executed via an asynchronous task manager. If the prediction duration of the second computation task exceeds a duration threshold (e.g., 50 milliseconds for a single computation task), the non-visible area can be split into multiple regions, and sub-computation tasks corresponding to each region can be executed. During computation, cells are marked using a dirty data manager to indicate whether the computation for the corresponding cell is complete. Once computation is complete, the dirty data is updated. In response to a scrolling operation, the above steps are repeated based on the updated interface after the scrolling operation stops. If the marked cell data for a completed computation is 1 in the dirty data manager, the computation is skipped and not repeated.
[0209] This application provides a computation manager that achieves computation at the smallest granularity by managing the sequential dependencies of various computation tasks and finely controlling the changes in the scope of influence of each editing operation.
[0210] In some embodiments, when a data change occurs, the rendering layer calculation manager schedules each calculator to perform calculations in sequence and generates a calculated scope of impact for the dependent calculators to use.
[0211] As an example, in response to an edit operation on cell B2, the calculation range for cell B2 is A. For the specific calculation process, please refer to [link to relevant documentation]. Figure 9 , Figure 9 This is a schematic diagram illustrating data updates provided in an embodiment of this application. For example... Figure 9 As shown, based on the calculation range A, the old cross-column centering information is queried, and the original cross-column centering information is found to be in the range of cells B1-B2. Then, based on the calculation range A, the extended calculator obtains the extended and updated range B, corresponding to cells B1-B2, and provides it to the calculation manager.
[0212] The Calculation Manager passes the calculation range B corresponding to cells B1-B2 to the calculators corresponding to the column centering information, cell style information, and row break information for calculation, and calculates the row height information based on the row break information. The Calculation Manager then passes the calculation range B corresponding to cells B1-B2 to the old covering cell information. After calculating the extended range, the calculation range B is expanded and updated to the calculation range C. Calculation range C and the updated calculation range are then passed to the covering cell information to obtain the extended range; calculation range C is then expanded and updated to the calculation range D. If, after the covering cell information calculation is completed, the influence range of cells B1-B2 expands to cells B1-B4, the Calculation Manager passes the updated calculation range D of cells B1-B4 to the border line calculator for calculation. By performing calculation tasks in this way, calculations can be performed according to precise ranges, avoiding redundant calculation logic.
[0213] The large task slicer provided in this application embodiment is mainly responsible for splitting the range of user operation data for each operation into a visible area and a non-visual area.
[0214] As an example, see Figure 10 , Figure 10 This is a schematic diagram of the region division provided in an embodiment of this application. For example... Figure 10 As shown, given that the entire editing range of the table is A1-Z500, and the data range displayed in the human-computer interaction interface on the terminal screen (i.e., the visible area) is H100-Q199, the large task slicer can divide the entire editing range A1-Z500 into two parts: a visible area and a non-visible area. The visible area is area 1001, corresponding to the data H100-Q199, a total of 10 rows and 100 columns. This data range is passed to the fine-grained calculation task manager for synchronous calculation. The non-visible area includes areas 1002, 1003, 1004, and 1005. Area 1002 corresponds to the data A1-Z99, area 1003 corresponds to the data A100-Z199, area 1004 corresponds to the data R100-Z199, and area 1005 corresponds to the data A200-Z500. The data range of the non-visible area is passed to the dirty data manager for marking dirty data for calculation.
[0215] Here, the dirty data manager is primarily responsible for marking whether the data in each cell has been calculated and whether it needs to be updated. During synchronous calculations of cells within the visible area, or asynchronous calculations of cells outside the visible area, the manager first checks the flag bit of each cell. If it's confirmed that recalculation is needed, the calculation is performed again; if the flag bit is 1, the calculation for that range is skipped. This is divided into the following scenarios:
[0216] 1. When the table is first loaded, the data has not been calculated. At this time, the marker positions of all cells are empty, indicating that the corresponding cells need to be calculated.
[0217] 2. Once the rendering layer has completed its calculation for a cell, it marks the corresponding cell as 1, indicating that the corresponding cell does not need to be calculated again.
[0218] 3. When an editing operation is received for a table, the corresponding cells can be marked as 0 based on the scope of influence passed by the large task slicer, indicating that the corresponding cells need to be recalculated.
[0219] In some embodiments, during the initial table initialization, the acquired computation tasks include: performing synchronous computation tasks on the visible area (corresponding to the first computation task above), and performing asynchronous computation tasks on the non-visible area (corresponding to the second computation task above), ensuring that the computation time of a single computation task does not exceed 50 milliseconds. This ensures that the user is unaware of the computation process and can smoothly use other table functions. For example, the non-visible area is an area constructed based on the visible area, which is 3 times larger horizontally and 5 times larger vertically.
[0220] As an example, see Figure 11 , Figure 11 This is a schematic diagram of the computation task division provided in the embodiment of this application. When the current visible area 1101 of the table includes 10 columns and 50 rows of cells, the rendering layer data of 30 columns and 750 rows corresponding to area 1102 will be calculated, and the area outside area 1102 will not be calculated.
[0221] Furthermore, to prevent each computation task from taking too long, when the computation time of a single task exceeds a time threshold (e.g., 50 milliseconds), the task can be split into two parts. For example, ensure that each computation task has a range of no more than 10 columns and 100 rows (corresponding to a computation time of no more than 50 milliseconds). See also the example below. Figure 11 The region 1103 in the left view can be divided into 8 sub-regions on the right, and the sub-computation tasks corresponding to each sub-region can be executed respectively.
[0222] The table processing method provided in this application ensures that the number of cells in each calculation task does not exceed a threshold (e.g., 10 columns and 100 rows), effectively avoiding the problem of calculation task progress lag caused by the rendering layer calculating a large number of cell data at once. Simultaneously, it eliminates the need to calculate the entire table's rendering layer data, effectively reducing the computational load during task execution. It can preheat areas near the visible area (e.g., areas 3 times the horizontal and 5 times the vertical width), enabling rapid rendering based on the calculated rendering data and display of the rendered interface upon receiving a user scrolling operation.
[0223] This application embodiment performs calculation tasks on the visible area through the rendering layer to obtain rendering data, which can reduce lag during data loading and large-scale editing operations on tables (such as adjusting column width, setting styles for large selection areas, etc.).
[0224] This application provides a comparison of the calculation time of row-by-row calculation in related technologies when performing editing operations (such as inserting one column) on tables of different sizes, with the calculation time of the table processing method provided in this application, as shown in Table 1.
[0225] Table 1
[0226]
[0227] Table 1 shows the calculation time per row in related technologies and the table processing method provided in this application embodiment, with a visible area of 22 rows * 12 columns, for tables with different column numbers (empty, 50, 100, 500, 1000, 2000, and 5000 columns), respectively, when the table is first opened and when inserting one column. Tests show that for tables of different sizes, even when receiving very large amounts of data, the table processing method provided in this application embodiment can complete the calculation within a relatively short time, reducing user waiting time. Furthermore, the larger the data size of the table, the more significant the optimization effect of the table processing method provided in this application embodiment.
[0228] Since the table processing method provided in this application embodiment does not require the complete calculation of the entire table data, but only the data near the visible area, the overall memory resource usage has also been optimized. Moreover, the optimization effect is more obvious in tables with larger data scales. The experimental data is shown in Table 2.
[0229] Table 2
[0230]
[0231] Table 2 shows the experimental results of stable memory usage after initial screen loading for different table sizes (empty table, 60 rows * 50 columns, 60 rows * 100 columns, 60 rows * 500 columns, 60 rows * 1000 columns, 60 rows * 2000 columns, 60 rows * 5000 columns, 500 rows * 500 columns, 500 rows * 100 columns, 500 rows * 500 columns, 500 rows * 1000 columns, 500 rows * 2000 columns, and 500 rows * 5000 columns) in the case of a visible area of 22 rows * 12 columns. The unit of resource usage results is megabytes (MB). Tests show that for different table sizes, the table processing method provided in this application significantly reduces resource usage compared to related technologies. The optimization effect of the table processing method provided in this application is more significant for larger tables.
[0232] This application embodiment performs synchronous calculation tasks (corresponding to the first calculation task mentioned above) on the visible area of the table displayed on the screen, and performs asynchronous calculation tasks (corresponding to the second calculation task mentioned above) on the non-visible area of the table. This allows the rendering layer to first calculate the data that the user can observe, and then perform asynchronous calculations on the data in the remaining areas in a split manner. This reduces the amount of computation in synchronous calculations, greatly reduces user waiting time, reduces memory usage, and significantly improves the user's experience.
[0233] The following description continues to illustrate the exemplary structure of the table processing device 455 provided in the embodiments of this application as a software module. In some embodiments, such as Figure 2 As shown, the software modules stored in the table processing device 455 in the memory 450 may include:
[0234] The receiving module 4551 is used to receive editing operations on the target area in the table.
[0235] The determination module 4552 is used to determine the visible area and the non-visible area in the target area when the size of the target area exceeds the size of the screen. The visible area is the area of the target area that is displayed on the screen, and the non-visible area is the area of the target area that is not displayed on the screen.
[0236] The execution module 4553 is used to perform a first calculation task for the visible area in response to an editing operation, obtain a first calculation result for each first cell in the visible area, and update the visible area based on the first calculation result of each first cell; when the first calculation task is completed, it performs a second calculation task for the non-visible area in response to an editing operation, obtains a second calculation result for each second cell in the non-visible area, wherein the second calculation result of each second cell is used to update the non-visible area.
[0237] In some embodiments, the execution module 4553 is further configured to, when the editing operation is to adjust the height of the target row in the target area, determine the updated height and updated position of the target row, and the updated positions of other rows, based on the height adjustment value of the editing operation, wherein the other rows are rows in the visible area located in the adjustment direction of the target row; and when the editing operation is to adjust the width of the target column in the target area, determine the updated width and updated position of the target column, and the updated positions of other columns, based on the width adjustment value of the editing operation, wherein the other columns are columns in the visible area located in the adjustment direction of the target column.
[0238] In some embodiments, the execution module 4553 is further configured to, when the editing operation is to adjust the height of the target row in the target area, determine the updated vertical coordinate range of each row in the non-visible area based on the height adjustment value of the editing operation, wherein the change trend of the height adjustment value relative to the original height of the target row is opposite to the change trend of the vertical coordinate; and when the editing operation is to adjust the width of the target column in the target area, determine the updated horizontal coordinate range of each column in the non-visible area based on the width adjustment value of the editing operation, wherein the change trend of the width adjustment value relative to the original width of the target column is the same as the change trend of the horizontal coordinate.
[0239] In some embodiments, the execution module 4553 is further configured to determine the position of the updated data in the target cell based on the length of the updated data in the target cell, the width of the target cell, and the alignment type of the target cell when the editing operation is for editing the data of the target cell in the target area, and the preset format of the target cell is automatic line wrapping and fixed line height.
[0240] In some embodiments, the execution module 4553 is further configured to, when the editing operation is for editing the data of the target cell in the target area, and the preset format corresponding to the target cell is automatic wrapping and non-fixed line height, determine the updated height and updated position of the row where the target cell is located, and the updated position of other rows in the visible area, based on the length of the updated data of the target cell and the width of the target cell, wherein the other rows are the rows below the target cell; and determine the position of the updated data in the target cell based on the alignment type of the target cell.
[0241] In some embodiments, the execution module 4553 is further configured to, when the editing operation is used to edit the data of the target cell in the target area, and the preset format corresponding to the target cell is automatic text wrapping and non-fixed row height, determine the height adjustment value of the row where the target cell is located based on the length of the updated data of the target cell and the width of the target cell; and determine the updated vertical coordinate range of each row in the non-visible area based on the height adjustment value.
[0242] In some embodiments, the execution module 4553 is further configured to, when the editing operation is used to edit the data of the target cell in the target area, and the preset format corresponding to the target cell is non-automatic line wrapping, if the length of the updated data of the target cell corresponding to the editing operation exceeds the width of the target cell, perform the following processing: if there is no data in the cell corresponding to the alignment type of the target cell, determine the coverage area of the target cell in the direction according to the length of the updated data, and cancel the display of the border line of the target cell in the direction; if there is data in the cell corresponding to the alignment type of the target cell, determine the data in the updated data that is covered by the cell in the direction.
[0243] In some embodiments, the execution module 4553 is further configured to determine the position of the updated data in the target cell based on the length of the updated data and the alignment type of the target cell when the editing operation is used to edit the target cell of the target area and the length of the updated data in the target cell does not exceed the width of the target cell.
[0244] In some embodiments, the execution module 4553 is further configured to determine the prediction duration of the second computing task corresponding to the non-visual area; divide the non-visual area into multiple sub-regions according to the prediction duration and the duration threshold, determine the sub-computing task corresponding to each sub-region, wherein the number of sub-regions is obtained by rounding up the ratio of the prediction duration to the duration threshold; and execute the sub-computing task corresponding to each sub-region.
[0245] In some embodiments, the non-visual area is an area that is an extension of the visible area by a preset multiple; the execution module 4553 is further configured to obtain the computation time of the first computation task, wherein the computation time is the time consumed to complete the first computation task; and determine the prediction time of the second computation task corresponding to the non-visual area based on the computation time and the preset multiple.
[0246] In some embodiments, the execution module 4553 is further configured to obtain a preset first mark for each first cell, wherein the first mark is used to indicate that the calculation task for the first cell has not been executed; execute a first calculation task for the visible area in response to the editing operation, obtain a first calculation result for each first cell in the visible area, and update the first mark corresponding to the first cell to a second mark, wherein the second mark is used to indicate that the calculation task for the first cell has been completed.
[0247] In some embodiments, the execution module 4553 is further configured to update the non-visual area in response to a viewing operation for the non-visual area based on a second calculation result of each second cell in the non-visual area.
[0248] In some embodiments, the execution module 4553 is further configured to perform a second calculation task for responding to an editing operation on the non-visual area upon completion of the first calculation task and receipt of a viewing operation for the non-visual area.
[0249] In some embodiments, the execution module 4553 is further configured to, upon completion of the first calculation task, perform a second calculation task for the non-visual area in response to an editing operation if the number of rows in the non-visual area exceeds a row threshold or the number of columns in the non-visual area exceeds a column threshold.
[0250] In some embodiments, the execution module 4553 is further configured to, upon completion of the first computational task, perform a second computational task for the non-visual area during a waiting period before displaying the non-visual area, in response to an editing operation.
[0251] In some embodiments, the execution module 4553 is further configured to determine the waiting time in any of the following ways: obtaining the preset interval of automatic page turning of the table as the waiting time of the non-visible area; determining the average of the historical viewing time corresponding to multiple historical visible areas respectively, and using the average as the waiting time of the non-visible area; predicting the display time of the visible area using a pre-trained time series model based on the historical display time corresponding to multiple historical visible areas respectively, and using it as the waiting time of the non-visible area.
[0252] In some embodiments, the execution module 4553 is further configured to perform a second computational task for responding to an editing operation on the non-visual area during a waiting period before the non-visual area is displayed and during a period when the load for performing the computational task is less than a load threshold.
[0253] This application provides a computer program product including a computer program or computer-executable instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer-executable instructions from the computer-readable storage medium and executes the computer-executable instructions, causing the electronic device to perform the table processing method described above in this application.
[0254] This application provides a computer-readable storage medium storing computer-executable instructions or a computer program. When the computer-executable instructions or the computer program are executed by a processor, the processor will execute the table processing method provided in this application. For example, ... Figure 3A The table processing method is shown.
[0255] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a variety of devices including one or any combination of the above-mentioned memories.
[0256] In some embodiments, computer-executable instructions may take the form of programs, software, software modules, scripts, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment.
[0257] As an example, computer-executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple co-located files (e.g., files that store one or more modules, subroutines, or code sections).
[0258] As an example, computer-executable instructions can be deployed to execute on a single electronic device, or on multiple electronic devices located at one location, or on multiple electronic devices distributed across multiple locations and interconnected via a communication network.
[0259] In summary, this embodiment of the application, when receiving an editing operation on a target area in a table, and the size of the target area exceeds the screen size, divides the target area into a visible area and a non-visible area; performs a first calculation task on the visible area to obtain a first calculation result for each first cell in the visible area, and updates the visible area based on the first calculation result of each first cell; after the first calculation task is completed, performs a second calculation task on the non-visible area to obtain a second calculation result for each second cell in the non-visible area, thereby updating the non-visible area. This scheme, by performing the calculation task on the target area in stages, can reduce resource consumption and computational load in each stage; prioritizing the processing of the visible area allows for a rapid response to the user's editing operation, enabling the user to see the updated results of the visible area promptly without waiting for the entire table to be calculated, thus providing a smoother user experience.
[0260] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.
Claims
1. A table processing method, characterized in that, The method includes: Receive editing operations for a target area in the table; If the size of the target area exceeds the size of the screen, a visible area and a non-visible area are determined within the target area, wherein the visible area is the area of the target area that is displayed on the screen, and the non-visible area is the area of the target area that is not displayed on the screen; Perform a first calculation task in response to the editing operation for the visible area, obtain a first calculation result for each first cell in the visible area, and update the visible area based on the first calculation result of each first cell; Upon completion of the first calculation task, a second calculation task is performed for the non-visual area in response to the editing operation, resulting in a second calculation result for each second cell in the non-visual area, wherein the second calculation result for each second cell is used to update the non-visual area.
2. The method according to claim 1, characterized in that, The step of performing a first calculation task in response to the editing operation on the visible area, and obtaining a first calculation result for each first cell in the visible area, includes: When the editing operation is to adjust the height of the target row in the target area, the updated height and updated position of the target row, as well as the updated positions of other rows, are determined based on the height adjustment value of the editing operation, wherein the other rows are the rows in the visible area located in the adjustment direction of the target row; When the editing operation is to adjust the width of the target column of the target area, the updated width and updated position of the target column, as well as the updated positions of other columns, are determined based on the width adjustment value of the editing operation, wherein the other columns are columns in the visible area located in the adjustment direction of the target column.
3. The method according to claim 1, characterized in that, The second calculation task performed on the non-visual area in response to the editing operation, to obtain a second calculation result for each second cell in the non-visual area, includes: When the editing operation is to adjust the height of the target row in the target area, the updated vertical coordinate range of each row in the non-visible area is determined based on the height adjustment value of the editing operation, wherein the change trend of the height adjustment value relative to the original height of the target row is opposite to the change trend of the vertical coordinate. When the editing operation is applied to the width of the target column in the target area, the updated horizontal coordinate range of each column in the non-visible area is determined based on the width adjustment value of the editing operation, wherein the trend of the width adjustment value relative to the original width of the target column is the same as the trend of the horizontal coordinate.
4. The method according to claim 1, characterized in that, The step of performing a first calculation task in response to the editing operation on the visible area, and obtaining a first calculation result for each first cell in the visible area, includes: When the editing operation is used to edit the data of the target cell in the target area, and the preset format of the target cell is automatic line wrapping and fixed line height, the position of the updated data in the target cell is determined according to the length of the updated data in the target cell, the width of the target cell, and the alignment type of the target cell.
5. The method according to claim 1, characterized in that, The step of performing a first calculation task in response to the editing operation on the visible area, and obtaining a first calculation result for each first cell in the visible area, includes: When the editing operation is used to edit the data of the target cell in the target area, and the preset format corresponding to the target cell is automatic line wrapping and non-fixed line height, the updated height and updated position of the row where the target cell is located, as well as the updated position of other rows in the visible area, are determined according to the length of the updated data of the target cell and the width of the target cell, wherein the other rows are the rows below the target cell; The position of the updated data in the target cell is determined based on the alignment type of the target cell.
6. The method according to claim 1, characterized in that, The second calculation task performed on the non-visual area in response to the editing operation, to obtain a second calculation result for each second cell in the non-visual area, includes: When the editing operation is used to edit the data of the target cell in the target area, and the preset format of the target cell is automatic line wrapping and non-fixed line height, the height adjustment value of the row where the target cell is located is determined according to the length of the updated data of the target cell and the width of the target cell; Based on the height adjustment value, determine the updated vertical coordinate range of each row in the non-visible area.
7. The method according to claim 1, characterized in that, The step of performing a first calculation task in response to the editing operation on the visible area, and obtaining a first calculation result for each first cell in the visible area, includes: When the editing operation is used to edit the data of a target cell in the target area, and the preset format of the target cell is non-automatic line wrapping, if the length of the updated data of the target cell corresponding to the editing operation exceeds the width of the target cell, the following processing is performed: If there is no data in the cell corresponding to the alignment type of the target cell, the coverage area of the target cell in that direction is determined according to the length of the updated data, and the border line of the target cell in that direction is not displayed. If the cells in the direction corresponding to the alignment type of the target cell contain data, then the data in the updated data that is covered by the cells in that direction is determined.
8. The method according to claim 1, characterized in that, The step of performing a first calculation task in response to the editing operation on the visible area, and obtaining a first calculation result for each first cell in the visible area, includes: In the editing operation, the target cell of the target area is edited, and the length of the updated data of the target cell does not exceed the width of the target cell. Based on the length of the updated data and the alignment type of the target cell, the position of the updated data in the target cell is determined.
9. The method according to claim 1, characterized in that, The second computational task performed on the non-visual area in response to the editing operation includes: Determine the prediction duration of the second computing task corresponding to the non-visual area; Based on the predicted duration and duration threshold, the non-visual area is divided into multiple sub-regions, and a sub-computation task corresponding to each sub-region is determined. The number of sub-regions is obtained by rounding up the ratio of the predicted duration to the duration threshold. Execute the sub-computation task corresponding to each of the sub-regions.
10. The method according to claim 9, characterized in that, The non-visual area is an area that is a preset multiple of the visual area. Determining the prediction duration of the second computing task corresponding to the non-visual area includes: Obtain the computation time of the first computation task, wherein the computation time is the time consumed to complete the first computation task; Based on the calculation duration and the preset multiple, the prediction duration of the second calculation task corresponding to the non-visible area is determined.
11. The method according to claim 1, characterized in that, The step of performing a first calculation task in response to the editing operation on the visible area, and obtaining a first calculation result for each first cell in the visible area, includes: Obtain a preset first tag for each first cell, wherein the first tag is used to indicate that the calculation task for the first cell has not been executed; A first calculation task is performed for the visible area in response to the editing operation to obtain a first calculation result for each of the first cells in the visible area, and the first tag corresponding to the first cell is updated to a second tag, wherein the second tag is used to indicate that the calculation task for the first cell has been completed.
12. The method according to claim 1, characterized in that, After performing a second computational task in response to the editing operation on the non-visual area to obtain a second computational result for each second cell in the non-visual area, the method further includes: In response to a viewing operation targeting the non-visual area, the non-visual area is updated based on a second calculation result for each second cell in the non-visual area.
13. The method according to claim 1, characterized in that, Upon completion of the first computational task, the execution of a second computational task for the non-visual area in response to the editing operation includes: Upon completion of the first computational task and upon receiving a viewing operation for the non-visual area, a second computational task is performed for the non-visual area in response to the editing operation.
14. The method according to claim 1, characterized in that, Upon completion of the first computational task, the execution of a second computational task for the non-visual area in response to the editing operation includes: If, after the first calculation task is completed, the number of rows in the non-visual area exceeds a row threshold, or the number of columns in the non-visual area exceeds a column threshold, a second calculation task is performed for the non-visual area in response to the editing operation.
15. The method according to any one of claims 1 to 14, characterized in that, Upon completion of the first computational task, the execution of a second computational task for the non-visual area in response to the editing operation includes: If the first computational task is completed, during the waiting period before the non-visual area is displayed, a second computational task for responding to the editing operation is performed on the non-visual area.
16. The method according to claim 15, characterized in that, The waiting time is determined in any of the following ways: The preset interval for automatic page turning of the table is obtained and used as the waiting time for the non-visible area; Determine the average historical viewing time corresponding to multiple historical visible areas, and use the average value as the waiting time for the non-visible area; Based on the historical display duration corresponding to the multiple historical visible areas, a pre-trained time series model is used to predict the display duration of the visible areas, which is then used as the waiting duration of the non-visible areas.
17. A form processing device, characterized in that, The device includes: The receiving module is used to receive editing operations on the target area in the table; A determining module is configured to determine a visible area and a non-visible area within the target area when the size of the target area exceeds the size of the screen, wherein the visible area is the area of the target area that is visible on the screen, and the non-visible area is the area of the target area that is not visible on the screen; An execution module is configured to perform a first calculation task in response to the editing operation for the visible area, obtain a first calculation result for each first cell in the visible area, and update the visible area based on the first calculation result of each first cell; when the first calculation task is completed, a second calculation task in response to the editing operation is performed for the non-visible area, obtain a second calculation result for each second cell in the non-visible area, wherein the second calculation result of each second cell is used to update the non-visible area.
18. An electronic device, characterized in that, The electronic device includes: Memory is used to store executable instructions or computer programs. A processor, when executing computer-executable instructions or computer programs stored in the memory, implements the table processing method according to any one of claims 1 to 16.
19. A computer-readable storage medium storing computer-executable instructions or a computer program, characterized in that, When the computer-executable instructions or computer program are executed by a processor, they implement the table processing method according to any one of claims 1 to 16.
20. A computer program product comprising computer-executable instructions or a computer program, characterized in that, When the computer-executable instructions or computer program are executed by a processor, they implement the table processing method according to any one of claims 1 to 16.