Table data processing method and device, terminal equipment and storage medium
Patent Information
- Application Number
- CN202610485296.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-14
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2046-04-14
AI Technical Summary
[0003]本公开实施例提供一种表格数据处理方法、装置、终端设备及存储介质,用于解决现有技术中,用户无法及时获取单元格相关的内容,导致内容显示的效率较低的技术问题
[0022]This disclosure provides a table data processing method, apparatus, terminal device, and storage medium. In response to receiving a data generation instruction for a first cell in a first view, the terminal device creates a first task based on a front-end task state machine. The first task includes a task identifier and information about the first cell. Based on the task identifier and the information about the first cell, a fragment of first data is generated in the back-end. The first data is the data to be displayed in the first cell. The fragment of the first data is streamed from the back-end to the front-end, and the fragment of the first data and its identifier are stored in the front-end. The identifier of the fragment is used to indicate the generation order of the fragments of the first data. In response to the first cell being within a window, the terminal device can, based on a preset rendering frequency and the identifier of the fragment, trim the first fragment from the stored fragments of the first data and output the first fragment in the first cell in real-time incrementally according to preset data units. In the above method, the terminal device can render the first data when the first cell is within the viewport, which saves resources. Furthermore, since the backend can stream fragments of the first data, the frontend can trim and render according to the rendering frequency. Therefore, the frontend and backend can be decoupled, avoiding jumps in data display. Users can obtain the data displayed in the cell in a timely manner, thereby improving the data display efficiency of the cell and enhancing the user experience.
Smart Images

Figure CN122021586B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of chart display technology, and in particular to a method, apparatus, terminal device, and storage medium for processing tabular data. Background Technology
[0002] The cells in a chart may require artificial intelligence (AI) to determine their content. For example, cells might need to be filled with AI-translated English text. However, users cannot access the cell content in a timely manner, resulting in inefficient content display. Summary of the Invention
[0003] This disclosure provides a table data processing method, apparatus, terminal device, and storage medium to solve the technical problem in the prior art where users cannot obtain cell-related content in a timely manner, resulting in low content display efficiency.
[0004] In a first aspect, embodiments of this disclosure provide a tabular data processing method, which includes:
[0005] In response to receiving a data generation instruction for the first cell in the first view, a first task is created based on the front-end task state machine. The first task includes a task identifier and information about the first cell.
[0006] Based on the task identifier and the information of the first cell, a fragment of the first data is generated in the backend. The first data is the data to be displayed in the first cell.
[0007] The backend transmits segments of the first data to the frontend in a streaming manner, and stores the segments of the first data and their identifiers at the frontend. The identifiers of the segments are used to indicate the generation order of the segments of the first data.
[0008] In response to the first cell being within the viewport, based on the preset rendering frequency and the fragment identifier, the first fragment is cropped from the fragments of the stored first data;
[0009] The first segment is output in real time incrementally according to the preset data units in the first cell.
[0010] Secondly, embodiments of this disclosure provide a tabular data processing apparatus, including a creation module, a generation module, a transmission module, a storage module, a cropping module, and an output module, wherein:
[0011] The creation module is used to, in response to receiving a data generation instruction for the first cell in the first view, create a first task based on the front-end task state machine. The first task includes a task identifier and information about the first cell.
[0012] The generation module is used to generate a fragment of the first data in the backend based on the task identifier and the information of the first cell. The first data is the data to be displayed in the first cell.
[0013] The transmission module is used to stream segments of the first data from the backend to the frontend.
[0014] The storage module is used to store fragments of the first data and their identifiers at the front end. The identifiers of the fragments are used to indicate the generation order of the fragments of the first data.
[0015] The cropping module is used to crop a first segment from the stored first data segments in response to the first cell being within the viewport, based on a preset rendering frequency and the segment identifier;
[0016] The output module is used to output the first segment in real time incrementally according to the preset data units in the first cell.
[0017] Thirdly, this disclosure provides a terminal device, including: a processor and a memory;
[0018] The memory stores the instructions that the computer executes;
[0019] The processor executes computer execution instructions stored in memory, causing at least one processor to perform the first aspect above and various tabular data processing methods that may be involved in the first aspect.
[0020] Fourthly, this disclosure provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the first aspect above and various possible tabular data processing methods involved in the first aspect.
[0021] Fifthly, this disclosure provides a computer program product, including a computer program that, when executed by a processor, implements the first aspect above and various tabular data processing methods that may be involved in the first aspect.
[0022] This disclosure provides a table data processing method, apparatus, terminal device, and storage medium. In response to receiving a data generation instruction for a first cell in a first view, the terminal device creates a first task based on a front-end task state machine. The first task includes a task identifier and information about the first cell. Based on the task identifier and the information about the first cell, a fragment of first data is generated in the back-end. The first data is the data to be displayed in the first cell. The fragment of the first data is streamed from the back-end to the front-end, and the fragment of the first data and its identifier are stored in the front-end. The identifier of the fragment is used to indicate the generation order of the fragments of the first data. In response to the first cell being within a window, the terminal device can, based on a preset rendering frequency and the identifier of the fragment, trim the first fragment from the stored fragments of the first data and output the first fragment in the first cell in real-time incrementally according to preset data units. In the above method, the terminal device can render the first data when the first cell is within the viewport, which saves resources. Furthermore, since the backend can stream fragments of the first data, the frontend can trim and render according to the rendering frequency. Therefore, the frontend and backend can be decoupled, avoiding jumps in data display. Users can obtain the data displayed in the cell in a timely manner, thereby improving the data display efficiency of the cell and enhancing the user experience. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0024] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of the present disclosure;
[0025] Figure 2 A flowchart illustrating a tabular data processing method provided in an embodiment of this disclosure;
[0026] Figure 3 A schematic diagram illustrating the generation process of a content generation instruction provided in an embodiment of this disclosure;
[0027] Figure 4 A schematic diagram illustrating a fragment storage method provided in an embodiment of this disclosure;
[0028] Figure 5 A schematic diagram illustrating a fragment storage method provided in an embodiment of this disclosure;
[0029] Figure 6 This is a schematic diagram illustrating a method for deleting a fragment of first data according to an embodiment of the present disclosure;
[0030] Figure 7 This is a schematic diagram of a method for receiving a segment corresponding to a second task, provided by an embodiment of this disclosure;
[0031] Figure 8 This is a schematic diagram of the structure of a tabular data processing device provided in an embodiment of the present disclosure;
[0032] Figure 9 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this disclosure. Detailed Implementation
[0033] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0034] It is understood that before using the technical solutions disclosed in the embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure through appropriate means in accordance with relevant laws and regulations, and user authorization should be obtained. For example, in response to receiving a user's active request, a prompt message may be sent to the user to clearly inform the user that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware such as electronic devices, applications, servers, or storage media that perform the operations of the technical solutions of this disclosure, based on the prompt message.
[0035] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0036] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0037] Below, in conjunction with Figure 1 The application scenarios of the embodiments of this disclosure will be described.
[0038] Figure 1 This is a schematic diagram illustrating an application scenario provided by an embodiment of this disclosure. Please refer to [link / reference]. Figure 1This includes a table view. The table view can include multiple cells. Specifically, it can include cells filled with text A, cells filled with text B, cells filled with text C, and cells filled with the English text corresponding to text A. The English text in the English-filled cells can be AI-generated text translations, thus improving the intelligence of the table view and allowing users to quickly fill in the table, enhancing the user experience.
[0039] It should be noted that, Figure 1 These are examples of application scenarios for embodiments of this disclosure and are not intended to limit the application scenarios of embodiments of this disclosure.
[0040] In related technologies, in spreadsheet-based products (such as spreadsheets and multidimensional table applications), when the content of a cell depends on a time-consuming calculation task to be generated (e.g., calling AI services for text creation, running a complex formula engine, pulling and processing data from external data sources), after the user triggers the calculation task, the interface displays a loading status (such as a rotating icon) and locks the relevant cell or the entire work area until the backend completes all calculations and returns the final result, at which point the cell can display the result. However, in the above method, the user must passively wait, unable to perform other operations or perceive the intermediate progress of the calculation. When the calculation time is long (e.g., exceeding several seconds) or the network is unstable, the data display efficiency of the cell is low, the user experience is poor, and it is easy to create the illusion that the application is unresponsive.
[0041] To address the technical problems in related technologies, this disclosure provides a table data processing method. In response to receiving a data generation instruction for a first cell in a first view, a terminal device can create a first task based on a front-end task state machine. Based on the task identifier and information of the first cell in the first task, a fragment of first data is generated in the back-end. Based on the streaming transmission of the first data fragment from the back-end to the front-end, the terminal device can store the fragment of first data and its identifier in the front-end. The identifier of the fragment is used to indicate the generation order of the fragments. In response to the first cell being within a viewport, the terminal device can trim the first fragment from the stored first data fragments based on a preset rendering frequency and the fragment identifier, and output the first fragment in the first cell in real-time incrementally according to preset data units. In response to moving the first cell out of the viewport, the output of the first fragment in the first cell is stopped. In the above method, since the terminal device can render the first data when the first cell is within the viewport and can pause the rendering of the first data when the first cell moves out of the viewport, resources can be saved. Furthermore, since the backend can stream fragments of the first data and the frontend can trim and render the fragments of the first data according to the rendering frequency, the frontend and backend can be decoupled, avoiding jumps in data display. Users can obtain the data displayed in the cell in a timely manner, thereby improving the data display efficiency in the cell and enhancing the user experience.
[0042] The technical solutions of this disclosure and how they solve the aforementioned technical problems will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of this disclosure will now be described with reference to the accompanying drawings.
[0043] Figure 2 This is a flowchart illustrating a tabular data processing method provided in an embodiment of this disclosure. Please refer to [link / reference]. Figure 2 The method may include:
[0044] S201. In response to receiving a data generation instruction for the first cell in the first view, a first task is created based on the front-end task state machine. The first task includes a task identifier and information about the first cell.
[0045] The execution entity of this disclosure embodiment can be a terminal device or a table data processing device installed in the terminal device. The table data processing device can be implemented based on software, or it can be implemented based on a combination of software and hardware; this disclosure embodiment does not limit this.
[0046] The first view can refer to the table interface containing structured data displayed on the front end. For example, the first view can be the direct carrier for user interaction with cells; in other words, the first view can be the spreadsheet page used by the user. For example, the first view can be a visual representation of the first table (a logical collection of data, consisting of multiple fields (columns) and records (rows)), which can contain elements such as rows, columns, and cells, and supports operations such as scrolling and zooming.
[0047] In some embodiments, the first cell can be the smallest data unit formed by the intersection of rows and columns in the first view. For example, the first cell can be the basic unit for data storage, display and interaction in the first video, and has a location identifier (e.g., a combination of row number and column number). The first cell can carry data such as text, numbers, formula results, etc., but this disclosure does not limit this aspect.
[0048] In some embodiments, a data generation instruction can refer to an operation instruction used to generate the data to be displayed in the first cell. For example, the data generation instruction can be a user-triggered instruction, typically initiated by clicking a control, entering a command, etc., and can serve as a start signal for the entire table data processing flow.
[0049] For example, an AI analysis button (i.e., a data generation control) can be set on the right side of the first cell. When the user clicks the button, the terminal device triggers a data generation instruction and generates the data to be displayed in the first cell based on the data generation instruction.
[0050] In some embodiments, the task state machine can be a logical module for managing the lifecycle of a task. For example, the task state machine can record the status of the first task (pending, processing, completed, canceled), associated cell information, task identifier, etc., which can ensure data consistency when multiple tasks are running concurrently and avoid conflicts between new and old tasks.
[0051] In some embodiments, the first task can be a data generation task for the first cell, that is, a task for generating the first data. The task identifier can be a unique identifier assigned to each task by the task state machine. In the process of generating, transmitting, storing and rendering task-related data (such as fragments of the first data), the data will carry the task identifier, thereby avoiding confusion between multiple tasks corresponding to the same cell and improving the accuracy of data processing.
[0052] In some embodiments, the information of the first cell may include the cell's position (e.g., row and column), associated cells (e.g., the cell where the object to be translated is located), the type of information to be generated by the first cell, the AI identifier to be used by the first cell, and any other information related to the generation of the first data. This disclosure does not limit this.
[0053] In some embodiments, the terminal device responds to receiving a data generation instruction for a first cell in a first view. Specifically, this may involve: displaying a first view, which is a view of a first table, the first view including multiple cells, each cell including a corresponding data generation control, and responding to receiving a trigger instruction for the content generation control corresponding to the first cell among the multiple cells. In this way, the terminal device can flexibly generate the first data to be displayed in the cell based on user operations, improving the flexibility of user interaction and the accuracy of the first data.
[0054] In some embodiments, the first table can be any table, and this disclosure does not limit this; and the first view can be a view of one first table or a view of multiple first tables, and this disclosure does not limit this.
[0055] Below, in conjunction with Figure 3 The process of generating data generation instructions is explained.
[0056] Figure 3 This is a schematic diagram illustrating the generation process of a data generation instruction provided in an embodiment of this disclosure. Please refer to [link / reference]. Figure 3 The system includes a first view, which may contain multiple cells. The first view may include cells filled with text A, cells filled with text B, cells filled with text C, and cells a, b, and c. Cells a, b, and c each contain a data generation control. When a user clicks the data generation control in cell a, the terminal device can generate a content generation instruction for cell a.
[0057] S202. Based on the task identifier and the information of the first cell, generate a fragment of the first data in the backend.
[0058] In some embodiments, the first data can be the data to be displayed in the first cell. For example, the first data can be the complete data to be displayed in the first cell, or the first data can be the target result generated by the backend.
[0059] In some embodiments, the first data may include multiple segments, that is, multiple segments may be combined to form the first data. For example, when the first data is text content, the segments of the first data may include multiple text segments composed of multiple character combinations. For example, if the first data is text: Product A's sales revenue last year was 500,000 yuan, a year-on-year increase of 12%, the backend can split it into 3 segments, where segment A is: product sales revenue; segment B is: 500,000 yuan; and segment C is: a year-on-year increase of 12%. It should be noted that the first data can also be split into any number of segments, and this disclosure does not limit this.
[0060] In some embodiments, the terminal device can generate a fragment of the first data in the backend based on the following feasible implementation: adding the first task to the backend task processing queue and marking the task status of the first task as pending; when starting to process the first task, generating a fragment of the first data in the backend based on the task identifier and the information of the first cell, and marking the task status as being processed. In this way, the terminal device can accurately manage multiple tasks based on their task status, avoiding task execution errors and improving the accuracy of the first data.
[0061] In some embodiments, when the terminal device starts processing the first task in the backend, it can generate fragments of the first data based on the task identifier and the information of the first cell, mark the task status as being processed, and transmit the status to the task state machine. For example, the terminal device can determine the first data based on the information of the first cell, generate fragments of the first data, and add the task identifier to each fragment of the first data. When the terminal device starts generating the first data in the backend, it can transmit the fragments of the first data to the frontend in batches.
[0062] S203, a segment of the first data transmitted from the backend to the frontend in a streaming manner.
[0063] In some embodiments, streaming transmission can refer to a transmission method where data is generated and transmitted simultaneously. For example, the backend can split the complete data into multiple consecutive segments without waiting for its generation, and transmit them to the frontend in batches according to the generation order of the segments. For instance, if the backend needs to generate text A, which includes 10 characters, the backend will first push the first 3 characters to the frontend, then the middle 3 characters, and finally the remaining 4 characters, instead of waiting for all 10 characters to be generated before pushing them to the frontend all at once. Here, the frontend can refer to the logic layer and carrier that interacts with the user, used to receive user operations, display data, etc., while the backend can refer to the logic layer responsible for data processing, business logic execution, and content generation, used to receive frontend instructions, execute calculation tasks, generate data segments, and transmit them to the frontend.
[0064] In some embodiments, the front-end and back-end can communicate based on a Long-Polling Message Service. The Long-Polling Message Service can include a status channel and a streaming channel. The status channel can be used to transmit the status of a task (e.g., pending, processing, completed), and the streaming channel can be used to transmit fragments of the first data.
[0065] In some embodiments, after the task state machine creates the first task, it can send a signal indicating that the first task has started to the backend through a state channel. After receiving the signal, the backend can add the first task to the task processing queue and broadcast the task status of the first task as queued (i.e., pending processing). The backend can also transmit the task status to the task state machine through a state channel.
[0066] In some embodiments, when the backend begins actual computation, it generates a fragment of first data. The backend can then transmit the generated fragment of first data to the frontend in batches via a streaming channel.
[0067] S204. Store the fragments and their identifiers of the first data at the front end.
[0068] The segment identifier can be used to indicate the generation order of the segments of the first data. For example, the segment identifier can be a unique identifier marking the generation order of the segments. This segment identifier can ensure that the front end performs cropping and rendering of the segments of the first data according to the order in which the segments of the first data are generated, avoiding out-of-order segment rendering due to network latency and improving the accuracy of data display. Optionally, the segment identifier can be a continuous number, a timestamp, or a string containing sequence information, etc., and this embodiment of the disclosure does not limit this.
[0069] In some embodiments, the terminal device stores fragments of the first data and their identifiers at the front end, in the following two cases:
[0070] Case 1: The first data segment is a full segment.
[0071] Specifically, when the fragment of the first data is a full fragment, in response to receiving the fragment and its identifier of the first data pushed by the backend, the old fragment of the first data is replaced with the new fragment of the first data in the cache based on the generation order corresponding to the fragment identifier.
[0072] In some embodiments, a full fragment can indicate that the fragment of the first data is all the generated fragments. For example, the first data includes 10 characters. When the backend generates 3 characters for the first time, the backend can transmit those 3 characters to the frontend for the first time. When the backend generates 3 characters for the second time, the backend can transmit the currently generated 6 characters to the frontend for the second time (i.e., those 6 characters form a fragment). When the backend generates the remaining 4 characters for the third time, the backend can transmit the currently generated 10 characters to the frontend for the third time.
[0073] In some embodiments, when a terminal device receives fragments transmitted multiple times, it can determine the generation order of the fragments based on the fragment identifiers. Since the new fragments already include the old fragments, the terminal device can overwrite the old fragments based on the new fragments, thereby improving resource utilization and saving cache.
[0074] Below, in conjunction with Figure 4 The process of storing fragments in this case will be explained.
[0075] Figure 4 This is a schematic diagram illustrating a fragment storage method provided in an embodiment of this disclosure. Please refer to [link / reference]. Figure 4 This includes a cache. The cache contains stored fragment 0. When the front-end receives fragment 2 from the back-end, since fragment 2 was generated later than fragment 0, the front-end can delete fragment 0 from the cache and store fragment 2. When the front-end receives fragment 1 from the back-end, since fragment 1 was generated earlier than fragment 2, the front-end can discard fragment 1 and retain fragment 2. When the front-end receives fragment 3 from the back-end, since fragment 3 was generated later than fragment 2, the front-end can delete fragment 2 from the cache and retain fragment 3.
[0076] Case 2: The first data segment is an incremental segment.
[0077] When the first data segment is an incremental segment, the first data segment and its identifier are stored in the cache at the front end.
[0078] In some embodiments, an incremental fragment can indicate that a fragment of the first data is a newly generated fragment since the last transmission. For example, if the first data includes 10 characters, when the backend generates 3 characters for the first time, the backend can transmit those 3 characters to the frontend for the first time. When the backend generates 4 characters for the second time, the backend can transmit the 4 newly generated characters to the frontend for the second time. When the backend generates the remaining 3 characters for the third time, the backend can transmit the last 3 newly generated characters to the frontend for the third time.
[0079] In some embodiments, when the front end receives the fragments transmitted by the back end, since each fragment is an incremental fragment, the front end can store each fragment and its identifier in the cache, waiting for it to be rendered on screen.
[0080] Below, in conjunction with Figure 5 The process of storing fragments in this case will be explained.
[0081] Figure 5 This is a schematic diagram illustrating a fragment storage method provided in an embodiment of this disclosure. Please refer to [link / reference]. Figure 5This includes a cache. The cache contains stored fragment 0. When the front-end receives fragment 2 from the back-end, it can store fragment 2. Similarly, when the front-end receives fragment 1 from the back-end, it can store fragment 1. In other words, in case 1, the new fragment's content includes the content of the old fragment; therefore, the front-end can update the old fragment with the new fragment. In case 2, the content of the fragments does not overlap; therefore, the front-end can store multiple fragments transmitted by the back-end.
[0082] S205. In response to the first cell being within the window, based on the preset rendering frequency and the segment identifier, the first segment is cropped from the segments of the stored first data.
[0083] In some embodiments, the window can be an area visible to the user in the current first view. In other words, the first cell being within the window indicates that the first cell is within the screen display area. Cells outside the window area require scrolling to be seen. The size of the window is determined by the front-end interface size and the table scaling ratio, which are not limited in this embodiment.
[0084] In some embodiments, the first fragment may be a fragment to be rendered. For example, the cache includes fragment A, and the first fragment may be fragment A or a portion of fragment A; this disclosure does not limit this.
[0085] In some embodiments, the rendering frequency can indicate the rendering interval and the length of the segment being rendered. For example, the rendering frequency can instruct the front-end to retrieve a segment of 2-4 characters from the cache every 30ms for rendering. It should be noted that the rendering frequency can also be any other feasible frequency, and this embodiment does not limit it. For example, if the back-end transmits a segment of 100 characters at a time, the front-end will trim 2-4 characters each time (the segment length can be preset) at 30ms intervals, and render it in 25-50 times, presenting a gradual increase in length rather than the jump caused by displaying 100 characters all at once, thereby improving the user experience.
[0086] In some embodiments, the terminal device may trim the first segment based on the following two feasible implementation methods:
[0087] One feasible implementation method:
[0088] When the first data segment is a full segment, the position of the segment to be rendered is obtained. Based on the rendering frequency, the rendering interval and the segment length for each rendering are determined. Based on the segment position, rendering interval, and segment length, the first segment is trimmed from the stored first data segments. In this way, since the cache can store segments transmitted in full, the terminal device can accurately trim the first segment from the first data segments, improving the accuracy of the first segment and thus improving the accuracy of rendering.
[0089] In some embodiments, the fragment position can be the current position to be rendered. For example, a fragment position of 0 can indicate that rendering starts from the first character, and a fragment position of 10 can indicate that rendering starts from the tenth character. For example, the rendering interval can be 30ms, and the fragment length for each rendering can be 2-4 characters, which can improve the rendering effect.
[0090] For example, the preset rendering frequency is 30ms, the fragment length is 3 characters / time, and the current rendering position is pos: 0; the latest full fragment in the cache is T001_001, the content of which is: the sales amount of product A is 500,000 yuan; in the first 30ms: pos=0<11 (total number of fragment characters), 0-2 characters "product A" are extracted as the first fragment; pos is updated to 0+3=3; in the second 30ms: pos=3<11, 3-5 characters "sales amount" are extracted as the first fragment; pos is updated to 6, ..., until 11 characters are trimmed.
[0091] One feasible implementation method:
[0092] When the first data segment is an incremental segment, the first identifier of the segment to be rendered is obtained; the presence of the first identifier is checked among the stored segment identifiers; if the first identifier exists among the stored segment identifiers, the first segment is trimmed from the first data segment corresponding to the first identifier based on the rendering frequency; if the first identifier does not exist among the stored segment identifiers, the system waits for the front end to store the segment corresponding to the first identifier, and then trims the first segment from the first data segment corresponding to the first identifier based on the rendering frequency. In this way, the front end does not need to sort the stored first data segments, saving system resources.
[0093] The first identifier can be the identifier of the currently rendered segment. For example, the first data includes 10 segments. When the 5th segment is being rendered, the first identifier can be 5, and when the 7th segment is being rendered, the first identifier can be 7. This embodiment of the present disclosure does not limit this.
[0094] In some embodiments, since the backend pushes fragments of the first data to the frontend based on incremental transmission in this implementation, the frontend can cache the fragments of the first data pushed by the backend. In this way, when rendering, the frontend can check in the cache whether the fragment that needs to be rendered exists. If it exists, the fragment can be rendered. If it does not exist, rendering can be paused until the fragment exists in the cache, and then the fragment can be rendered.
[0095] For example, the preset rendering frequency is 30ms, the fragment length is 3 characters / time, and the current rendering is of the 4th fragment. In the first 30ms, check if the 4th fragment exists in the cache. If it does not exist, pause the rendering of the fragment in the first 30ms. In the second 30ms, continue to check if the 4th fragment exists in the cache. If it exists, then based on the rendering frequency, trim the first fragment from the 4th fragment. In the next 30ms after the 4th fragment finishes rendering, check if the 5th fragment exists in the cache. If it does not exist, continue to wait. If it exists, then based on the rendering frequency, render the 5th fragment, and so on, until all fragments are rendered, at which point the first task is marked as completed.
[0096] It should be noted that when the rendering interval indicated by the rendering frequency is 30ms, the terminal device can check every 30ms whether the first cell is within the viewport. If it is within the viewport, the first segment can be trimmed based on the segment length. If it is not within the viewport, the rendering of the first segment can be paused.
[0097] S206. Output the first segment in real time incrementally according to the preset data units in the first cell.
[0098] In some embodiments, the terminal device can incrementally output the first segment in the first cell, which can improve the user's browsing effect and enhance the user experience.
[0099] In some embodiments, the above-described tabular data processing method further includes: pausing the output of the first segment in the first cell in response to moving the first cell out of the viewport. This can save system resources.
[0100] In some embodiments, the above-described tabular data processing method further includes: in response to moving the first cell back into the window, continuing to output the first segment in the first cell from the position where the first segment was paused.
[0101] In some embodiments, the length of the preset data unit may be the same as the length of the segment during rendering, or it may be less than the length of the segment during each rendering. This disclosure does not limit this aspect.
[0102] In some embodiments, the front end may include a view streaming rendering engine that can start a timer. At each time interval (e.g., 30ms), the engine checks whether the first cell corresponding to the current task is within the viewport. If it is, the engine reads some new text from the cache, appends it to the "view streaming data," and notifies the view layer to perform a partial redraw, so the user can see the text grow. If it is not within the viewport (due to the user scrolling or switching views), the engine pauses rendering of the task, but the cache still stores the fragment transmitted from the backend. When the first cell re-enters the viewport, the rendering engine resumes rendering from where it left off.
[0103] In some embodiments, after the first task is completed, the terminal device can display the first data in the first cell. Furthermore, the terminal device can encapsulate the first data into a ChangeSet (CS) for persistence. This CS will be pushed to the front-ends of other collaborators, updating the final value of the corresponding first cell in their front-ends. For example, the first view can be an online view, which multiple users can edit. When a user edits the first cell in the first view, the first data can be incrementally displayed in the first cell on that user's front-end, but not on the front-ends of other users. After the first data is displayed, the final value of the first cell can be displayed on the front-ends of other users. This improves the efficiency and experience of multi-user collaborative editing.
[0104] In some embodiments, if the user edits the first segment while it is being displayed in the first cell, the display of the first segment is stopped, and the displayed first segment is overwritten in the first cell based on the user's edited content, which can improve the user experience.
[0105] This disclosure provides a method for processing tabular data. In response to receiving a data generation instruction for a first cell in a first view, a terminal device can create a first task based on a front-end task state machine, add the first task to a back-end task processing queue, and mark the task status of the first task as pending. When processing the first task begins, a fragment of first data is generated in the back-end based on the task identifier and the information of the first cell, and the task status is marked as being processed. The front-end stores the fragments of first data and their identifiers. In response to the first cell being within the viewport, based on a preset rendering frequency and the fragment identifier, the first fragment is trimmed from the stored fragments of first data, and the first fragment is output incrementally in the first cell in real time according to preset data units. Thus, the terminal device can render the first data when the first cell is within the viewport, and can pause the rendering of the first data when the first cell moves out of the viewport, thereby saving resources. Furthermore, since the back-end can stream the fragments of first data, the front-end can trim and render the fragments of first data according to the rendering frequency, thus achieving decoupling between the front-end and back-end, avoiding jumps in data display, and allowing users to obtain the data displayed in the cell in a timely manner, thereby improving the user experience.
[0106] exist Figure 2 Based on the illustrated embodiment, the above-described tabular data processing method further includes a method for deleting fragments of first data related to the first task. The following will describe this method in conjunction with... Figure 6 The method for deleting fragments of the first data on a terminal device is explained.
[0107] Figure 6 This is a schematic diagram illustrating a method for deleting a fragment of first data according to an embodiment of this disclosure. Please refer to... Figure 6 The method flow may include:
[0108] S601: Based on the task state machine, obtain the task status of the first task pushed by the backend.
[0109] In some embodiments, the backend can push task status (e.g., pending, processing, completed) based on status channels.
[0110] In some embodiments, when the front end receives a fragment of the first data transmitted through the streaming channel, the task state machine can determine that the current task state is in the process state.
[0111] In some embodiments, when the first data is pushed to the first cell of the front end of other collaborators via CS, the terminal device can determine that the task status of the first task is completed.
[0112] S602. When the task status is completed, delete the fragment of the first data related to the first task.
[0113] In some embodiments, after the first task is completed, the backend broadcasts a "task completed" signal via a status channel. Upon receiving this signal, the frontend's task state machine can perform data cleanup, which includes deleting cached content related to the first task and ensuring that the view layer displays the final, consistent value from the data model, rather than a streaming intermediate state.
[0114] In some embodiments, the task state machine can receive multiple task states, with the task state pushed by the state channel having the highest priority. The task state machine always uses the signal from this channel as the final basis for state transitions. The priority of the streaming channel is lower than that of the state channel; when the streaming channel transmits data, it indicates that the first task has actually moved from "queuing" to "in progress." The CS push has the lowest priority; the arrival of a CS also implicitly indicates that the first task has been completed, but due to potential network latency, the task state machine only uses it as an auxiliary signal for determining the task state. Through this priority strategy, the task state machine can effectively cope with network latency and message out-of-order delivery, ensuring eventual consistency of the state.
[0115] This disclosure provides a method for deleting fragments of first data. Based on a task state machine, the method obtains the task status of a first task pushed from the backend. When the task status is "completed," the fragments of first data related to the first task are deleted. In this way, the terminal device can obtain the current task status of the first task through multiple methods. Furthermore, by employing a priority strategy among these methods, the terminal device can accurately determine the task status of the first task, thereby effectively addressing network latency and message out-of-order delivery, ensuring eventual consistency of the state, and improving the accuracy and efficiency of task management.
[0116] Based on any of the above embodiments, the above table data processing method further includes a method for receiving a fragment of the first data corresponding to the second task. Below, in conjunction with... Figure 7 The method for receiving the segment corresponding to the second task is explained.
[0117] Figure 7 This is a schematic diagram illustrating a method for receiving a segment corresponding to a second task, provided as an embodiment of this disclosure. Please refer to... Figure 7 The method process includes:
[0118] S701, In response to receiving a data generation instruction for the first cell in the first view again, a second task is created based on the task state machine at the front end.
[0119] In some embodiments, since the fragments of the first data are incrementally output in the first cell, the user can know in real time whether the currently generated data meets expectations. If the currently generated data does not meet expectations, the user can click the data generation control of the first cell again to regenerate the first data of the first cell. However, since the fragments of the previous first task have not been fully generated, the terminal device needs to regenerate the data generation task of the first cell, that is, the second task.
[0120] In some embodiments, the task identifier of the second task is different from that of the first task. For example, when the user clicks the data generation control in the first cell again, the front-end task state machine can create a new task for that first cell. This new task has a different task identifier than the previous one, which can avoid data display conflicts and save system resources.
[0121] S702, delete the segment of the first data corresponding to the first task, stop receiving the segment of the first data corresponding to the first task transmitted from the backend, and receive the segment corresponding to the second task transmitted from the backend.
[0122] In some embodiments, when the front-end receives a data generation instruction for the first cell again, it can check whether there is an active first task (status: pending or being processed). If a first task exists, the task state machine updates its status to "cancelled" and performs old task cleanup, that is, deletes all fragments corresponding to the first task identifier in the cache, sends an instruction to the front-end streaming channel to "stop receiving first task fragments", and discards any subsequent first task fragments received directly, and clears the rendering progress parameters of the first task. The task state machine can create a second task, assign a new task identifier (different from the first task), set its status to "pending", associate it with the information of the first cell, and send the start signal of the second task to the back-end. When the back-end executes the second task, it pushes the fragment of the first data corresponding to the second task to the front-end. The front-end can then start receiving the fragment of the second task and repeat the above streaming display process of the first cell.
[0123] For example, when a user triggers a new task (task B) in the same cell, the task state machine updates the currently active task ID to B. The front end will then begin receiving data for task B and proactively discard any subsequently arriving data that is still marked as the old task A. This ensures that the view layer displays the latest task's data, improving the user experience.
[0124] This disclosure provides a method for receiving a fragment corresponding to a second task. In response to receiving a data generation instruction for a first cell in a first view, the method creates a second task based on the front-end task state machine, deletes the fragment of the first data corresponding to the first task, stops receiving the fragment of the first data corresponding to the first task pushed from the back-end, and receives the fragment of the first data corresponding to the second task pushed from the back-end. In this way, the terminal device can accurately manage tasks within the same cell through task identifiers, avoiding conflicts between tasks, and ensuring that the view layer always displays the latest streaming content of the task, improving the user experience.
[0125] Figure 8 This is a schematic diagram of a tabular data processing apparatus provided in an embodiment of this disclosure. Please refer to [link / reference]. Figure 8 The table data processing device 800 includes a creation module 801, a generation module 802, a transmission module 803, a storage module 804, a cropping module 805, and an output module 806, wherein:
[0126] The creation module 801 is used to, in response to receiving a data generation instruction for the first cell in the first view, create a first task based on the front-end task state machine, the first task including a task identifier and information of the first cell;
[0127] The generation module 802 is used to generate a fragment of the first data in the backend based on the task identifier and the information of the first cell. The first data is the data to be displayed in the first cell.
[0128] The transmission module 803 is used to stream segments of first data from the backend to the frontend.
[0129] The storage module 804 is used to store fragments of the first data and their identifiers at the front end, wherein the identifiers of the fragments are used to indicate the generation order of the fragments of the first data.
[0130] The cropping module 805 is used to crop a first segment from the stored first data segments in response to the first cell being in the view window, based on a preset rendering frequency and the segment identifier;
[0131] The output module 806 is used to output the first segment in real time incrementally according to the preset data units in the first cell.
[0132] According to one or more embodiments of this disclosure, the generation module 802 is specifically used for:
[0133] Add the first task to the backend task processing queue and mark the task status of the first task as pending.
[0134] When the first task begins to be processed, based on the task identifier and the information in the first cell, a fragment of the first data is generated in the backend, and the task status is marked as being processed.
[0135] According to one or more embodiments of this disclosure, the storage module 804 is specifically used for:
[0136] When the fragment of the first data is a full fragment, in response to receiving the fragment and its identifier of the first data pushed by the backend, the old fragment of the first data is replaced with the new fragment of the first data in the cache based on the generation order corresponding to the fragment identifier.
[0137] When the first data segment is an incremental segment, the first data segment and its identifier are stored in the cache at the front end.
[0138] According to one or more embodiments of this disclosure, the cropping module 805 is specifically used for:
[0139] Get the position of the fragment that needs to be rendered;
[0140] Based on the rendering frequency, determine the rendering interval duration and the fragment length for each rendering;
[0141] Based on the fragment position, rendering interval duration, and fragment length, the first fragment is cropped from the fragments of the first data that have been stored.
[0142] According to one or more embodiments of this disclosure, the cropping module 805 is specifically used for:
[0143] Get the first identifier of the fragment that needs to be rendered;
[0144] Determine if a first identifier exists among the stored fragment identifiers;
[0145] In response to the presence of a first identifier among the stored fragment identifiers, based on the rendering frequency, the first fragment is cropped from the fragment of the first data corresponding to the first identifier;
[0146] If the first identifier is not found among the stored fragment identifiers, after the front end stores the fragment of the first data corresponding to the first identifier, the first fragment is cropped from the fragment of the first data corresponding to the first identifier based on the rendering frequency.
[0147] According to one or more embodiments of this disclosure, the storage module 804 is further configured to:
[0148] Based on the task state machine, obtain the task status of the first task pushed by the backend;
[0149] When the task status is completed, delete the fragment of the first data related to the first task.
[0150] According to one or more embodiments of this disclosure, the transmission module 803 is further configured to:
[0151] In response to receiving a data generation instruction for the first cell in the first view, a second task is created based on the front-end task state machine. The task identifier of the second task is different from that of the first task.
[0152] The fragment of the first data corresponding to the first task is deleted, and the reception of the fragment of the first data corresponding to the first task transmitted from the backend is stopped, while the fragment of the first data corresponding to the second task transmitted from the backend is received.
[0153] According to one or more embodiments of this disclosure, the generation module 802 is specifically used for:
[0154] Display the first view, which is a view of the first table. The first view includes multiple cells, and each cell includes a corresponding data generation control.
[0155] Responds to receiving a trigger command for the data generation control corresponding to the first cell in a set of multiple cells.
[0156] The technical effects of the embodiments disclosed herein are similar to those of any of the embodiments described above, and will not be repeated here.
[0157] Figure 9 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this disclosure. Please refer to [link / reference]. Figure 9 It shows a structural schematic diagram suitable for implementing the terminal device 900 of the embodiments of this disclosure. Figure 9 As shown, the terminal device 900 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 into a random access memory (RAM) 903. The RAM 903 also stores various programs and data required for the operation of the terminal device 900. The processing unit 901, ROM 902, and RAM 903 are interconnected via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0158] Typically, the following devices can be connected to I / O interface 905: input devices 906 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 907 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 908 including, for example, magnetic tapes, hard disks, etc.; and communication devices 909. Communication device 909 allows terminal device 900 to exchange data via wireless or wired communication with other devices. Although Figure 9 A terminal device 900 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0159] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 909, or installed from a storage device 908, or installed from a ROM 902. When the computer program is executed by a processing device 901, it performs the functions defined in the methods of embodiments of this disclosure.
[0160] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), or any suitable combination thereof.
[0161] The aforementioned computer-readable medium may be included in the aforementioned terminal device; or it may exist independently and not assembled into the terminal device.
[0162] The aforementioned computer-readable medium carries one or more programs, which, when executed by the terminal device, cause the terminal device to perform the method shown in the above embodiments.
[0163] When the first cell is within the viewport, the terminal device can render the first data, which saves resources. Furthermore, since the backend can stream fragments of the first data, the frontend can trim and render according to the rendering frequency. Therefore, the frontend and backend can be decoupled, avoiding jumps in data display. Users can obtain the data displayed in the cell in a timely manner, thereby improving the data display efficiency of the cell and enhancing the user experience.
[0164] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0165] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0166] The units described in the embodiments of this disclosure can be implemented in software or in hardware. The name of a unit does not necessarily limit the unit itself; for example, the first acquisition unit can also be described as "a unit that acquires at least two Internet Protocol addresses".
[0167] The functions described above herein can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that may be used, without limitation, include: Field-Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application-Specific Standard Products (ASSPs), Systems-on-Chip (SOCs), Complex Programmable Logic Devices (CPLDs), etc. In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0168] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0169] In a first aspect, embodiments of this disclosure provide a tabular data processing method, which includes:
[0170] In response to receiving a data generation instruction for the first cell in the first view, a first task is created based on the front-end task state machine. The first task includes a task identifier and information about the first cell.
[0171] Based on the task identifier and the information of the first cell, a fragment of the first data is generated in the backend. The first data is the data to be displayed in the first cell.
[0172] The backend transmits segments of the first data to the frontend in a streaming manner, and stores the segments of the first data and their identifiers at the frontend. The identifiers of the segments are used to indicate the generation order of the segments of the first data.
[0173] In response to the first cell being within the viewport, based on the preset rendering frequency and the fragment identifier, the first fragment is cropped from the fragments of the stored first data;
[0174] The first segment is output in real time incrementally according to the preset data units in the first cell.
[0175] According to one or more embodiments of this disclosure, generating a fragment of first data in the backend includes:
[0176] Add the first task to the backend task processing queue and mark the task status of the first task as pending.
[0177] When the first task begins to be processed, based on the task identifier and the information in the first cell, a fragment of the first data is generated in the backend, and the task status is marked as being processed.
[0178] According to one or more embodiments of this disclosure, storing fragments of first data and their identifiers at the front end includes:
[0179] When the fragment of the first data is a full fragment, in response to receiving the fragment and its identifier of the first data pushed by the backend, the old fragment of the first data is replaced with the new fragment of the first data in the cache based on the generation order corresponding to the fragment identifier.
[0180] When the first data segment is an incremental segment, the first data segment and its identifier are stored in the cache at the front end.
[0181] According to one or more embodiments of this disclosure, when the fragment of the first data is a full fragment; based on a preset rendering frequency and the fragment identifier, the first fragment is trimmed from the stored fragments of the first data, including:
[0182] Get the position of the fragment that needs to be rendered;
[0183] Based on the rendering frequency, determine the rendering interval duration and the fragment length for each rendering;
[0184] Based on the fragment position, rendering interval duration, and fragment length, the first fragment is cropped from the fragments of the first data that have been stored.
[0185] According to one or more embodiments of this disclosure, when the fragment is an incremental fragment; based on a preset rendering frequency and the fragment's identifier, cropping a first fragment from the stored first data fragment includes:
[0186] Get the first identifier of the fragment that needs to be rendered;
[0187] Determine if a first identifier exists among the stored fragment identifiers;
[0188] In response to the presence of a first identifier among the stored fragment identifiers, based on the rendering frequency, the first fragment is cropped from the fragment of the first data corresponding to the first identifier;
[0189] If the first identifier is not found among the stored fragment identifiers, after the front end stores the fragment of the first data corresponding to the first identifier, the first fragment is cropped from the fragment of the first data corresponding to the first identifier based on the rendering frequency.
[0190] According to one or more embodiments of this disclosure, it further includes:
[0191] Based on the task state machine, obtain the task status of the first task pushed by the backend;
[0192] When the task status is completed, delete the fragment of the first data related to the first task.
[0193] According to one or more embodiments of this disclosure, it further includes:
[0194] In response to receiving a data generation instruction for the first cell in the first view, a second task is created based on the front-end task state machine. The task identifier of the second task is different from that of the first task.
[0195] The fragment of the first data corresponding to the first task is deleted, and the reception of the fragment of the first data corresponding to the first task transmitted from the backend is stopped, while the fragment of the first data corresponding to the second task transmitted from the backend is received.
[0196] According to one or more embodiments of this disclosure, responding to receiving a data generation instruction for a first cell in a first view includes:
[0197] Display the first view, which is a view of the first table. The first view includes multiple cells, and each cell includes a corresponding data generation control.
[0198] Responds to receiving a trigger command for the data generation control corresponding to the first cell in a set of multiple cells.
[0199] Secondly, embodiments of this disclosure provide a tabular data processing apparatus. This tabular data processing apparatus includes a creation module, a generation module, a transmission module, a storage module, a cropping module, and an output module, wherein:
[0200] The creation module is used to, in response to receiving a data generation instruction for the first cell in the first view, create a first task based on the front-end task state machine. The first task includes a task identifier and information about the first cell.
[0201] The generation module is used to generate a fragment of the first data in the backend based on the task identifier and the information of the first cell. The first data is the data to be displayed in the first cell.
[0202] The transmission module is used to stream segments of the first data from the backend to the frontend.
[0203] The storage module is used to store fragments of the first data and their identifiers at the front end. The identifiers of the fragments are used to indicate the generation order of the fragments of the first data.
[0204] The cropping module is used to crop a first segment from the stored first data segments in response to the first cell being within the viewport, based on a preset rendering frequency and the segment identifier;
[0205] The output module is used to output the first segment in real time incrementally according to the preset data units in the first cell.
[0206] According to one or more embodiments of this disclosure, the generation module is specifically used for:
[0207] Add the first task to the backend task processing queue and mark the task status of the first task as pending.
[0208] When the first task begins to be processed, based on the task identifier and the information in the first cell, a fragment of the first data is generated in the backend, and the task status is marked as being processed.
[0209] According to one or more embodiments of this disclosure, the storage module is specifically used for:
[0210] When the fragment of the first data is a full fragment, in response to receiving the fragment and its identifier of the first data pushed by the backend, the old fragment of the first data is replaced with the new fragment of the first data in the cache based on the generation order corresponding to the fragment identifier.
[0211] When the first data segment is an incremental segment, the first data segment and its identifier are stored in the cache at the front end.
[0212] According to one or more embodiments of this disclosure, the cropping module is specifically used for:
[0213] Get the position of the fragment that needs to be rendered;
[0214] Based on the rendering frequency, determine the rendering interval duration and the fragment length for each rendering;
[0215] Based on the fragment position, rendering interval duration, and fragment length, the first fragment is cropped from the fragments of the first data that have been stored.
[0216] According to one or more embodiments of this disclosure, the cropping module is specifically used for:
[0217] Get the first identifier of the fragment that needs to be rendered;
[0218] Determine if a first identifier exists among the stored fragment identifiers;
[0219] In response to the presence of a first identifier among the stored fragment identifiers, based on the rendering frequency, the first fragment is cropped from the fragment of the first data corresponding to the first identifier;
[0220] If the first identifier is not found among the stored fragment identifiers, after the front end stores the fragment of the first data corresponding to the first identifier, the first fragment is cropped from the fragment of the first data corresponding to the first identifier based on the rendering frequency.
[0221] According to one or more embodiments of this disclosure, the storage module is further configured to:
[0222] Based on the task state machine, obtain the task status of the first task pushed by the backend;
[0223] When the task status is completed, delete the fragment of the first data related to the first task.
[0224] According to one or more embodiments of this disclosure, the transmission module is further configured to:
[0225] In response to receiving a data generation instruction for the first cell in the first view, a second task is created based on the front-end task state machine. The task identifier of the second task is different from that of the first task.
[0226] The fragment of the first data corresponding to the first task is deleted, and the reception of the fragment of the first data corresponding to the first task transmitted from the backend is stopped, while the fragment of the first data corresponding to the second task transmitted from the backend is received.
[0227] According to one or more embodiments of this disclosure, the generation module is specifically used for:
[0228] Display the first view, which is a view of the first table. The first view includes multiple cells, and each cell includes a corresponding data generation control.
[0229] Responds to receiving a trigger command for the data generation control corresponding to the first cell in a set of multiple cells.
[0230] Thirdly, this disclosure provides a terminal device including: a processor and a memory;
[0231] The memory stores the instructions that the computer executes;
[0232] The processor executes computer execution instructions stored in memory, causing at least one processor to perform the first aspect above and various tabular data processing methods that may be involved in the first aspect.
[0233] Fourthly, this disclosure provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the first aspect above and various possible tabular data processing methods involved in the first aspect.
[0234] Fifthly, this disclosure provides a computer program product, including a computer program that, when executed by a processor, implements the first aspect above and various tabular data processing methods that may be involved in the first aspect.
[0235] The names of the messages or information exchanged between multiple devices in this disclosure are for illustrative purposes only and are not intended to limit the scope of these messages or information. It is understood that the data involved in this technical solution (including but not limited to the data itself, its acquisition, or its use) shall comply with the requirements of applicable laws, regulations, and relevant provisions. Data may include information, parameters, and messages, such as flow switching indication information.
[0236] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0237] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in sequential order. Multitasking and parallel processing may be advantageous in certain environments. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments. Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely exemplary forms of implementing the claims.
Claims
1. A method for processing tabular data, wherein, include: In response to receiving a data generation instruction for the first cell in the first view, a first task is created based on the front-end task state machine. The first task includes a task identifier and information about the first cell. Based on the task identifier and the information of the first cell, a fragment of first data is generated in the backend, and the first data is the data to be displayed in the first cell; The front-end and the back-end communicate based on a long-chain message service, which includes a status channel and a streaming channel. The status channel is used to transmit the status of the task, and the streaming channel is used to transmit fragments of the first data. The status channel has a higher priority than the streaming channel. Based on the backend, the first data segments are streamed to the frontend, and the frontend stores the first data segments and their identifiers, whereby the identifiers indicate the generation order of the first data segments. In response to the first cell being within the viewport, based on a preset rendering frequency and the identifier of the fragment, the first fragment is cropped from the fragments of the stored first data; The viewport is the area visible to the user in the first view; The first segment is output incrementally in real time according to the preset data units in the first cell; In response to moving the first cell out of the viewport, pause the output of the first fragment in the first cell; In response to moving the first cell back into the viewport, continue outputting the first segment in the first cell, starting from the position where the first segment was paused.
2. The method according to claim 1, wherein, The step of generating a fragment of first data in the backend based on the task identifier and the information of the first cell includes: Add the first task to the task processing queue of the backend and mark the task status of the first task as pending; When the first task is started, based on the task identifier and the information of the first cell, a fragment of the first data is generated in the backend, and the task status is marked as being processed.
3. The method according to claim 1, wherein, The step of storing fragments of the first data and the identifiers of the fragments at the front end includes: When the fragment of the first data is a full fragment, in response to receiving the fragment and the identifier of the first data pushed by the backend, based on the generation order corresponding to the identifier of the fragment, the old fragment of the first data is replaced with the new fragment of the first data in the cache; When the first data segment is an incremental segment, the first data segment and the segment's identifier are stored in the cache at the front end.
4. The method according to claim 1, wherein, When the first data segment is a full segment; based on a preset rendering frequency and the segment's identifier, the first segment is trimmed from the stored first data segments, including: Get the position of the fragment that needs to be rendered; Based on the rendering frequency, determine the rendering interval duration and the fragment length for each rendering; Based on the fragment position, the rendering interval duration, and the fragment length, the first fragment is cropped from the fragments of the stored first data.
5. The method according to claim 1, wherein, When the segment is an incremental segment; based on a preset rendering frequency and the segment's identifier, the first segment is trimmed from the stored first data segments, including: Get the first identifier of the fragment that needs to be rendered; Determine if a first identifier exists among the stored fragment identifiers; In response to the presence of the first identifier among the stored fragment identifiers, based on the rendering frequency, the first fragment is cropped from the fragment of the first data corresponding to the first identifier; In response to the absence of the first identifier among the stored fragment identifiers, after the front end stores the fragment of the first data corresponding to the first identifier, the first fragment is cropped from the fragment of the first data corresponding to the first identifier based on the rendering frequency.
6. The method according to claim 1, wherein, Also includes: Based on the task state machine, obtain the task status of the first task pushed by the backend; When the task status is completed, the fragments of the first data related to the first task are deleted.
7. The method according to claim 1, wherein, Also includes: In response to receiving a data generation instruction for the first cell in the first view, a second task is created based on the front-end task state machine. The task identifier of the second task is different from that of the first task. The process involves deleting a segment of the first data corresponding to the first task, stopping the reception of segments of the first data corresponding to the first task transmitted from the backend, and receiving segments of the second task transmitted from the backend.
8. The method according to claim 1, wherein, The response to receiving a data generation instruction for a first cell in the first view includes: Display a first view, which is a view of a first table. The first view includes multiple cells, and each cell includes a corresponding data generation control. In response to receiving a trigger instruction for the data generation control corresponding to the first cell among the plurality of cells.
9. A tabular data processing device, wherein, It includes a creation module, a generation module, a transmission module, a storage module, a trimming module, and an output module, among which: The creation module is used to, in response to receiving a data generation instruction for the first cell in the first view, create a first task based on the front-end task state machine, wherein the first task includes a task identifier and information of the first cell; The generation module is used to generate a fragment of first data in the backend based on the task identifier and the information of the first cell, wherein the first data is the data to be displayed in the first cell; the frontend and the backend communicate based on a long-chain message service, wherein the long-chain message service includes a status channel and a streaming channel, wherein the status channel is used to transmit the status of the task, and the streaming channel is used to transmit the fragment of the first data; the priority of the status channel is higher than the priority of the streaming channel. The transmission module is used to stream segments of the first data from the backend to the frontend. The storage module is used to store fragments of the first data and the identifiers of the fragments at the front end, wherein the identifiers of the fragments are used to indicate the generation order of the fragments of the first data. The cropping module is used to, in response to the first cell being within the viewport, crop a first segment from the stored first data segments based on a preset rendering frequency and the segment's identifier; the viewport is the area visible to the user in the first view. The output module is used to output the first segment in real time incrementally according to preset data units in the first cell; The device is also configured to, in response to removing the first cell from the viewport, pause the output of the first segment in the first cell; In response to moving the first cell back into the viewport, continue outputting the first segment in the first cell, starting from the position where the first segment was paused.
10. A terminal device, wherein, include: Processor and memory; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the tabular data processing method as described in any one of claims 1-8.
11. A computer-readable storage medium, wherein, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the tabular data processing method as described in any one of claims 1-8.
12. A computer program product, wherein, Includes a computer program, which, when executed by a processor, implements the tabular data processing method as described in any one of claims 1-8.
Citation Information
Patent Citations
AI streaming output rich text real-time rendering method based on minimum rendering unit recognition
CN120763417A