Data processing method and device, storage medium, computer device, and program product
By creating an editing layer and modification queue during the report editing process, delaying the refresh of locally modified data, and merging snapshot files in the server cache, the problems of excessive resource consumption and data loss in online report editing are solved, improving editing efficiency and data recovery capabilities.
Patent Information
- Application Number
- CN202111456519.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-01
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2041-12-01
AI Technical Summary
Online report editing consumes excessive network resources and time, and data loss is easily caused by abnormal power outages or network interruptions.
By obtaining editing operation instructions, it is determined whether it is a cell modification operation, forming an editing layer and displaying it on top. Modified data is detected and stored in the modification queue. Once the refresh conditions are met, it is refreshed into the report. A modification snapshot file is generated and the data is merged and saved in the server cache.
It reduces the frequency of data refresh, improves report editing efficiency, reduces network resources and time consumption, and ensures data recovery in abnormal situations.
Smart Images

Figure CN114239507B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computers, in particular to a data processing method and device, a storage medium, a computer device and a program product. BACKGROUND
[0002] In the current era of data explosion, when editing a report online, a large data report online editing situation is encountered. At present, in the report display, data transmission, server saving and emergency situation, there is too much consumption of network resources and time, and in the case of abnormal power failure or network interruption, the data content is easily discarded. For example, when the report is displayed, the entire table is refreshed after each modification, which consumes a lot of network resources and time. When data is transmitted, the entire report content is transmitted each time, which also consumes a lot of network resources and time. When the server is saved, the entire report content needs to be saved each time, which also consumes a lot of resources and time. Moreover, when online editing, if abnormal conditions such as network interruption or power failure occur, the previously modified content will be lost. SUMMARY
[0003] The embodiments of the present application provide a data processing method and device, a storage medium, a computer device and a program product, which can improve the report editing efficiency and effectively reduce the consumption of network resources and time.
[0004] In a first aspect, a data processing method is provided, which includes: obtaining an editing operation instruction triggered for a target report; determining whether the editing operation instruction is an operation of modifying a target cell in the target report; if the editing operation instruction is an operation of modifying the target cell in the target report, copying the target cell to form an editing layer and displaying the editing layer on top; detecting a modification operation in the editing layer corresponding to the target cell and obtaining modification data corresponding to the modification operation; storing the modification data in a modification queue until the modification data in the modification queue meets a report refreshing condition, and then refreshing the modification data in the modification queue to the target report.
[0005] In a second aspect, a data processing method is provided, which includes: obtaining a modification snapshot file sent by a terminal device, the modification snapshot file being a snapshot generated based on modification data corresponding to an editing operation of the terminal device on a target report; storing the modification snapshot file in a cache of a server; if the modification snapshot file is continuously updated within a preset time period and the data amount of the modification data in the modification snapshot file is greater than a preset percentage of the original size of the target report, merging the modification data corresponding to the modification snapshot file and the original data corresponding to the target report, and saving the merged content to a database.
[0006] In a third aspect, a data processing apparatus is provided, and the apparatus comprises:
[0007] a first obtaining unit, configured to obtain an edit operation instruction triggered for a target report;
[0008] a first judging unit, configured to judge whether the edit operation instruction is an operation of modifying a target cell in the target report;
[0009] a first processing unit, configured to, if the edit operation instruction is the operation of modifying the target cell in the target report, copy the target cell to form an edit layer, and display the edit layer on top;
[0010] a second processing unit, configured to detect a modification operation for the edit layer corresponding to the target cell, and obtain modification data corresponding to the modification operation;
[0011] a third processing unit, configured to store the modification data in a modification queue, and when the modification data in the modification queue meets a report refreshing condition, refresh the modification data in the modification queue to the target report.
[0012] In a fourth aspect, a data processing apparatus is provided, and the apparatus comprises:
[0013] a second obtaining unit, configured to obtain a modification snapshot file sent by a terminal device, the modification snapshot file being generated based on modification data corresponding to an edit operation performed by the terminal device on a target report;
[0014] a caching unit, configured to store the modification snapshot file in a cache of a server;
[0015] a fourth processing unit, configured to, if the modification snapshot file is continuously updated within a preset time period, and a data volume of the modification data in the modification snapshot file is greater than a preset percentage of an original size of the target report, merge the modification data corresponding to the modification snapshot file and original data corresponding to the target report, and save the merged content to a database.
[0016] In a fifth aspect, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program, the computer program being adapted to be loaded by a processor to execute steps in the data processing method according to any one of the above embodiments.
[0017] In a sixth aspect, a computer device is provided, which includes a processor and a memory, and the memory stores a computer program. The processor is configured to execute the steps of the data processing method according to any one of the preceding embodiments by invoking the computer program stored in the memory.
[0018] In a seventh aspect, a computer program product is provided, which includes computer instructions. When the computer instructions are executed by a processor, the steps of the data processing method according to any one of the preceding embodiments are implemented.
[0019] The embodiment of the present application obtains an editing operation instruction triggered for a target report; determines whether the editing operation instruction is an operation of modifying a target cell in the target report; if the editing operation instruction is the operation of modifying the target cell in the target report, copies the target cell to form an editing layer and displays the editing layer on top; detects a modification operation on the editing layer corresponding to the target cell and obtains modification data corresponding to the modification operation; stores the modification data in a modification queue, and when the modification data in the modification queue meets a report refreshing condition, refreshes the modification data in the modification queue to the target report. The embodiment of the present application buffers the modification data by using the modification queue, delays refreshing the modification data generated by the modification operation on the cell, and only when the modification data in the modification queue meets the report refreshing condition, the modification data in the modification queue is refreshed to the target report, thereby reducing the data refreshing frequency, improving the report editing efficiency, and effectively reducing the consumption of network resources and time. BRIEF DESCRIPTION OF DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort.
[0021] Figure 1 The structural schematic diagram of the data processing system provided by the embodiment of the present application.
[0022] Figure 2 The first flowchart of the data processing method provided by the embodiment of the present application.
[0023] Figure 3 The application scenario schematic diagram of the data processing method provided by the embodiment of the present application.
[0024] Figure 4 The second flowchart of the data processing method provided by the embodiment of the present application.
[0025] Figure 5This is a schematic diagram of the third flow chart of the data processing method provided in an embodiment of the present application.
[0026] Figure 6 This is a first structural diagram of a data processing device provided in an embodiment of the present application.
[0027] Figure 7 This is a second structural diagram of the data processing device provided in an embodiment of the present application.
[0028] Figure 8 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts are within the scope of protection of this application.
[0030] The embodiments of the present application provide a data processing method, apparatus, computer device, and storage medium. Specifically, the data processing method of the embodiments of the present application can be executed by a computer device, wherein the computer device can be a terminal or a server.
[0031] In today's era of data explosion, when editing reports online, you often encounter the situation of editing large data reports online. Currently, there is an excessive consumption of network resources and time during report display, data transmission, server storage, and emergency situations. In the event of an abnormal power outage or network disconnection, data content can easily be lost. For example, when displaying a report, the entire table is refreshed after each modification, which consumes a lot of network resources and time. When transmitting data, the entire report content is transferred each time, which also consumes a lot of network resources and time. When saving on the server, the entire report content needs to be saved every time, which also consumes a lot of resources and time. Moreover, when editing online, if a network or power outage occurs, all previously modified content will be lost.
[0032] For example, in actual application, all operations during editing in the table area are counted, and the statistical results are as follows:
[0033] The proportion of operations in which a cell or a range of cells is selected for operation is 78.56%;
[0034] Clicking on the report settings pop-up window accounts for 12.78% of the time.
[0035] The proportion of operations to select a row or column: 5.36%;
[0036] The proportion of file type operations, such as selecting other reports or saving, saving as, exporting, etc., is 2.13%;
[0037] Modifying global report settings, such as theme operations, accounted for 1.17%;
[0038] The above statistical results show that most operations on reports are performed on parts of the report, that is, a few cells or a row or column. If the operating cost of this part can be optimized, the overall effect will definitely be greatly improved.
[0039] Please refer to Figure 1 , Figure 1 The data processing system provided in the embodiment of the present application is a schematic diagram of the structure of the data processing system. The data processing system includes a terminal 10 and a server 20, etc. The terminal 10 and the server 20 are connected via a network, such as a wired or wireless network connection.
[0040] The terminal 10 can be used to display a graphical user interface. The terminal is used to interact with the user through the graphical user interface, for example, by downloading and installing a corresponding application program through the terminal and running. In the embodiments of the present application, the terminal 10 can be a terminal device used by the user. In the report editing process, an editing operation instruction triggered for a target report is obtained; it is judged whether the editing operation instruction is an operation of modifying a target cell in the target report; if the editing operation instruction is an operation of modifying the target cell in the target report, the target cell is copied to form an editing layer, and the editing layer is displayed on top; a modification operation corresponding to the target cell in the editing layer is detected, and modification data corresponding to the modification operation is obtained; the modification data is stored in a modification queue, and when the modification data in the modification queue meets a report refreshing condition, the modification data in the modification queue is refreshed to the target report. Further, when the number of modifications in the modification queue exceeds a preset number, or the proportion of the modified cells in the total number of cells exceeds a third preset proportion, the modification data in the modification queue is merged, a modified snapshot file is generated for the merged modification data, the modified snapshot file includes report information of the target report, the merged modification data, and cell information corresponding to the merged modification data, and the modified snapshot file is sent to the server for storage. The server 20 obtains the modified snapshot file sent by the terminal device. The modified snapshot file is a snapshot generated based on the modification data corresponding to the editing operation of the terminal device on the target report, and the modified snapshot file is stored in the cache of the server. If the modified snapshot file is continuously updated within a preset time period, and the data amount of the modification data in the modified snapshot file is greater than a preset percentage of the original size of the target report, the modification data corresponding to the modified snapshot file and the original data corresponding to the target report are merged, and the merged content is saved to the database.
[0041] The following will be described in detail. It should be noted that the order of the following embodiments is not limited as the priority order of the embodiments.
[0042] Please refer to Figures 2 to 4 , Figure 2 and Figure 4 are flowcharts of data processing methods provided by the embodiments of the present application, Figure 3 is an application scenario diagram of the data processing method provided by the embodiments of the present application. The data processing method can be applied to a terminal device configured with a report editing application program, and the method comprises:
[0043] In step 210, an editing operation instruction triggered for a target report is obtained.
[0044] For example, the terminal device can capture an edit operation instruction triggered by a user for a corresponding operation on a target report. For example, the corresponding operation of the user on the target report can include an operation of modifying a target cell in the target report, such as selecting a single cell for operation, selecting a certain piece of cell or a certain row and column for operation, and the like. For example, the corresponding operation of the user on the target report can include an operation irrelevant to the cell, such as modifying a global setting of the report (such as a theme operation and the like), clicking a report setting to pop up a new window operation or a file type operation (such as selecting another report or saving, saving as, exporting, and the like), and the like.
[0045] In step 220, it is determined whether the edit operation instruction is an operation of modifying a target cell in the target report.
[0046] For example, selecting a single cell for operation requires delayed refreshing of the report; selecting a certain piece of cell or a certain row and column for operation can be determined whether to require delayed refreshing of the report by calculating the proportion of the number of cells; modifying the global setting of the report cannot delay refreshing of the report; and clicking the report setting to pop up a new window operation or the file type operation is irrelevant to the table, and the report can be refreshed in real time when the operation is performed. Based on the above refreshing principle, before responding to the edit operation instruction, it is determined whether the edit operation instruction is an operation of modifying a target cell in the target report.
[0047] Optionally, before determining whether the edit operation instruction is an operation of modifying a target cell in the target report, the method further includes:
[0048] It is determined whether the number of cells of all cells in the target report exceeds a preset number of cells.
[0049] If the number of cells of all cells in the target report exceeds the preset number of cells, it is determined whether the edit operation instruction is an operation of modifying a target cell in the target report.
[0050] Specifically, most operations on the report are for a part of the report, that is, a few cells or a certain row and column. The data processing method provided by the embodiments of the present application is mainly for optimizing the operation on the part of the report, and therefore when performing the report editing operation, it can also be determined whether the number of cells of all cells in the target report exceeds a preset number of cells, and if the number of cells exceeds the preset number of cells, optimization needs to be started. For example, the preset number of cells is 5000, that is, the number of rows * the number of columns > 5000, and optimization needs to be started. For example, 5000 is an empirical determination, and the preset number of cells can also be set according to the performance and actual situation.
[0051] In step 230, if the editing operation instruction is a modification operation on the target cell in the target report, the target cell is copied to form an editing layer, and the editing layer is displayed on top.
[0052] For example, referring to Figure 3 When the target cell selected by the user is the area 310 in the figure, the target cell in the selected area 310 is copied to form an editing layer 320, and the editing layer 320 is displayed on top.
[0053] Optionally, before the target cell is copied to form an editing layer, the method further includes: determining whether the proportion of the number of the target cells to the total number of cells is less than a first preset proportion; and copying the target cell to form an editing layer if the proportion of the number of the target cells to the total number of cells is less than the first preset proportion.
[0054] For example, when the user selects a few cells for modification, the cells in this block are copied and directly overlaid on the entire cells, all modifications are operated on the few cells, and are not merged to the subsequent entire cells, and then other operations are performed, and unified refreshing is performed again.
[0055] For example, when the user selects a single cell for operation, that is, a single cell modification, the selected cell is copied to form an editing layer, and the editing layer is displayed on top to overlay the main cells, so that the corresponding modification operation is performed on the editing layer (copied cell).
[0056] For example, when the user selects a certain piece of cells or a certain row or column for operation, that is, a plurality of cell modification, the proportion of the number of the selected target cells to the total number of cells is calculated, if the proportion of the number of the target cells to the total number of cells is less than a first preset proportion (such as 10%), the selected plurality of cells are copied to form an editing layer, and the editing layer is displayed on top to overlay the main cells, so that the corresponding modification operation is performed on the editing layer (copied cell).
[0057] In step 240, a modification operation on the editing layer corresponding to the target cell is detected, and modification data corresponding to the modification operation is obtained.
[0058] For example, a modification operation on the editing layer (copied cell) corresponding to the target cell is detected, and modification data corresponding to the modification operation is obtained, and the modification data corresponding to the modification operation is saved in a modification queue.
[0059] In step 250, the modification data is stored in a modification queue, and when the modification data in the modification queue meets a report refreshing condition, the modification data in the modification queue is refreshed into the target report.
[0060] Optionally, the storing of the modification data in the modification queue and the refreshing of the modification data in the modification queue into the target report when the modification data in the modification queue meets a report refreshing condition comprises: storing the modification data in the modification queue according to the modification time; determining that the modification data in the modification queue meets the report refreshing condition when the proportion of the number of cells in the modified queue to the total number of cells exceeds a second preset proportion, or the number of layers of the editing layer formed by copying the target cells exceeds a preset number of layers; and refreshing the modification data in the modification queue into the target report.
[0061] For example, the storing of the modification data in the modification queue according to the modification time can ensure the accuracy of the report refreshing by refreshing the modification data in the modification queue into the target report according to the modification time when refreshing the target report. When the proportion of the number of cells in the modified queue to the total number of cells exceeds the second preset proportion, or the number of layers of the editing layer formed by copying the target cells exceeds the preset number of layers, it indicates that the report refreshing condition is met. In order to reduce the data storage pressure of the modification queue and ensure the timely updating of the report data, the modification data in the modification queue needs to be refreshed into the target report when the report refreshing condition is met.
[0062] For example, if the proportion of the number of cells in the modification queue to the total number of cells exceeds the second preset proportion, or the number of layers of the editing layer formed by copying the target cells exceeds the preset number of layers, the entire report is refreshed once. For example, the second preset proportion is set to 30%, and the preset number of layers is set to 10. If the number of cells in the modification queue exceeds 30% of the total number of cells, or the number of layers of the editing layer exceeds 10, the entire report is refreshed once. The second preset proportion, the preset number of layers, and other constants described above are empirical values obtained through experiments, and can be adjusted according to specific conditions in practice.
[0063] Optionally, after determining whether the editing operation instruction is a modification operation on the target cell in the target report, the method further comprises: if the editing operation instruction is not a modification operation on the target cell in the target report, storing the modification data generated in response to the editing operation instruction in a modification queue and refreshing the modification data into the target report in real time.
[0064] Specifically, if the editing operation instruction is not a modification operation on the target cell in the target report, it is indicated that some of the editing operations (such as modifying the global settings of the report) cannot delay refreshing the report, and the proportion of the operation is small, which has little effect on the actual situation, and thus needs to be refreshed to the target report in real time. Some editing operations (such as clicking the report settings to pop up a new window operation or a file type operation) are irrelevant to the table in the report, and the target report can be refreshed in real time when the operation is performed.
[0065] For example, when the user modifies the global settings of the report, the modification data generated based on the editing operation instruction needs to be refreshed to the target report in real time, and the proportion of this part of the operation is small, which has little effect on the actual situation.
[0066] For example, when the user clicks the report settings to pop up a new window operation or a file type operation, which is irrelevant to the table, a new dialog box or a page switching operation will be performed, and the operations in the modification queue will be submitted to the main cell one by one, and the entire cell in the report will be refreshed in real time.
[0067] Optionally, after judging whether the proportion of the number of the target cells in the total number of cells is less than a first preset proportion, the method further comprises:
[0068] If the proportion of the number of the target cells in the total number of cells is not less than the first preset proportion, the modification data generated in response to the editing operation instruction is stored in the modification queue and is refreshed to the target report in real time.
[0069] For example, if the proportion of the number of the target cells in the total number of cells is not less than the first preset proportion, it is indicated that most of the cells in the report are involved in the modification operation, which does not belong to the case of modifying a small part of the cells in the report. Therefore, for this case of modifying most of the cells, the effect of the report optimization performed by the delay refreshing mode is not too obvious, and thus the editing layer does not need to be copied out, and the modification data generated in response to the editing operation instruction is refreshed to the target report in real time.
[0070] Specifically, for the operation of modifying a single cell, the delay refreshing is performed. For the operation of modifying multiple cells, the delay refreshing is performed according to the proportion of the number of the selected cells in the total number of cells. For the operation of modifying the global settings of the report, or the operation irrelevant to the table, or the case that the proportion of the number of the cells in the modification queue in the total number of cells exceeds a second preset proportion, or the case that the number of the copied layers exceeds a preset number of layers, the entire cell in the report is refreshed.
[0071] Optionally, the method further comprises: when the number of modifications in the modification queue exceeds a preset number, or the proportion of modified cells in the total number of cells exceeds a third preset proportion, merging the modification data in the modification queue; and generating a modification snapshot file for the merged modification data, wherein the modification snapshot file comprises report information of the target report, the merged modification data, and editing object information corresponding to the merged modification data.
[0072] Optionally, the method further comprises: sending the modification snapshot file to a server for storage.
[0073] For example, originally, the entire report data needs to be transmitted to the server every time the report is saved. Now that the modification queue is provided in the front end, the data can be transmitted according to the modification queue. When the number of modifications in the modification queue exceeds a preset number (for example, 10) or the proportion of modified cells in the total number of cells exceeds a third preset proportion (for example, 25%), the modification data in the modification queue is merged. Then, a modification snapshot file is generated in the local terminal device corresponding to the merged modification data. The modification snapshot file can save the report information of the target report, the merged modification data, and the editing object information corresponding to the merged modification data. Through the modification snapshot file, the related contents of the modification data are saved, so that when the report is edited and the data is stored, the entire report does not need to be saved to the server, but only the modification snapshot file needs to be saved to the server, thereby reducing the network resource consumption in the data transmission process and reducing the server storage pressure.
[0074] Optionally, the method further comprises: obtaining an opening instruction triggered for the target report; and if it is detected that the target report is abnormally closed before the opening instruction, updating the target report according to the modification data corresponding to the modification snapshot file in response to the opening instruction, so as to display the modification data corresponding to the modification snapshot file in the currently opened target report.
[0075] For example, if an abnormal condition such as network disconnection or power failure occurs, the modification data corresponding to the abnormal condition when the abnormal condition occurs or before the abnormal condition occurs can be saved through the modification snapshot file. After the condition of the local terminal device is restored or the network is reconnected, the front end will apply the modification data corresponding to the modification snapshot file generated by the terminal device to the currently edited target report in response to the opening instruction triggered for the target report, so that the modification data modified before can be restored to the target report when the abnormal condition is recovered.
[0076] For example, each time the abnormal condition is triggered, the terminal device automatically transmits the modification data corresponding to the current snapshot file to the server, and the server places the modification data corresponding to the snapshot file in the cache. If the user clicks the save after multiple modifications, only the newly added modification data (the differential part) needs to be submitted to the server, and the entire report does not need to be transmitted each time the save is performed.
[0077] Specifically, when the user opens a target report, the server first searches in the cache. If the target report and the modification snapshot file are found in the cache, the target report and the modification snapshot file are combined and then transmitted to the front end for display. If the target report and the modification snapshot file are not found in the cache, the target report is taken from the database, and a copy of the report data is placed in the cache and transmitted to the front end. When the user makes a modification each time, the front end does not refresh the table immediately. Instead, the modified cell is copied and overlaid on the original report, and the modified content is recorded in the modification queue. Only when the modification data reaches a certain amount or an operation unrelated to the report is performed, the front end applies the modification data to the table and refreshes the cells in the report. When the modification data reaches a certain amount, a modification snapshot file is generated locally on the user side, and the snapshot file is transmitted to the cache of the server. If an abnormal condition occurs at this time, such as network disconnection or power failure, the user can still combine the local modification snapshot file with the original report to save the previous modifications after reconnecting to the server. After the user clicks the save instruction, a modification snapshot file is immediately generated, and the modification snapshot file that has not been uploaded is uploaded to the cache of the server. The server does not immediately save the data to the database, but waits until the modification data reaches a certain amount before saving the data to the database. If the modification data does not reach a certain amount, the modification data and the report are combined and then saved to the database at an idle time (such as midnight).
[0078] To better illustrate the data processing method provided in the embodiments of the present application, refer to Figure 4 The flow of the data processing method provided in the embodiments of the present application can be summarized as follows:
[0079] Step 401: An editing operation instruction triggered for a target report is acquired.
[0080] Step 402: Whether the number of all cells in the target report exceeds a preset number of cells is determined. If yes, step 403 is performed; if no, step 408 is performed.
[0081] Step 403: Whether the editing operation instruction is an operation of modifying a target cell in the target report is determined. If yes, step 404 is performed; if no, step 408 is performed.
[0082] Step 404, judging whether the proportion of the number of the target cell to the total number of cells is less than a first preset proportion. If yes, step 405 is executed; if no, step 408 is executed.
[0083] Step 405, copying the target cell to form an editing layer, and displaying the editing layer on top.
[0084] Step 406, detecting a modification operation corresponding to the target cell in the editing layer, and obtaining modification data corresponding to the modification operation.
[0085] Step 407, storing the modification data in a modification queue, and refreshing the modification data in the modification queue to the target report when the modification data in the modification queue meets a report refreshing condition.
[0086] Step 408, storing modification data generated in response to the editing operation instruction in a modification queue, and refreshing the modification data to the target report in real time.
[0087] Step 409, merging the modification data in the modification queue when the number of modifications in the modification queue exceeds a preset number, or the proportion of the modified cells to the total number of cells exceeds a third preset proportion.
[0088] Step 410, generating a modification snapshot file for the merged modification data, wherein the modification snapshot file contains report information of the target report, the merged modification data, and cell information corresponding to the merged modification data.
[0089] Step 411, obtaining an opening instruction triggered for the target report.
[0090] Step 412, if it is detected that the target report is abnormally closed before the opening instruction, updating the target report according to the modification data corresponding to the modification snapshot file in response to the opening instruction, so as to display the modification data corresponding to the modification snapshot file in the currently opened target report.
[0091] Step 413, sending the modification snapshot file to a server for storage.
[0092] All the above technical solutions can be combined to form optional embodiments of the present application, which will not be described here.
[0093] The embodiment of the present application acquires an editing operation instruction triggered for a target report; determines whether the editing operation instruction is an operation of modifying a target cell in the target report; if the editing operation instruction is the operation of modifying the target cell in the target report, copies the target cell to form an editing layer and displays the editing layer on top; detects a modification operation on the editing layer corresponding to the target cell and acquires modification data corresponding to the modification operation; stores the modification data in a modification queue until the modification data in the modification queue meets a report refreshing condition, and then refreshes the modification data in the modification queue to the target report. The embodiment of the present application buffers the modification data through the modification queue, delays refreshing the modification data generated by the modification operation on the cell, and only when the modification data in the modification queue meets the report refreshing condition, the modification data in the modification queue is refreshed to the target report, thereby reducing the data refreshing frequency, improving the report editing efficiency, and effectively reducing the consumption of network resources and time.
[0094] Please refer to Figure 5 , Figure 5 The third flow diagram of the data processing method provided by the embodiment of the present application is shown. The data processing method can be applied to a server, and the method comprises the following steps:
[0095] In step 510, a modification snapshot file sent by a terminal device is acquired. The modification snapshot file is generated based on modification data corresponding to an editing operation on a target report by the terminal device.
[0096] In step 520, the modification snapshot file is stored in a cache of the server.
[0097] In step 530, if the modification snapshot file is continuously updated within a preset time period, and the data amount of the modification data in the modification snapshot file is greater than a preset percentage of the original size of the target report, the modification data corresponding to the modification snapshot file and the original data corresponding to the target report are merged, and the merged content is saved to a database.
[0098] In step 540, if the modification snapshot file is not continuously updated within a preset time period, the modification data corresponding to the modification snapshot file and the original data corresponding to the target report are merged in an idle period of the server, and the merged content is uploaded to the database.
[0099] Generally, the server needs to submit the report content to the database for saving each time. However, this way of saving the entire report each time results in a very large amount of data stored each time.
[0100] After the modified snapshot file is obtained, the modified snapshot file is maintained in the cache each time, and each time the user clicks the save does not necessarily trigger the operation of saving to the database. When the data amount of the modified data in the modified snapshot file is greater than the preset percentage (such as 25%) of the original size of the report, the modified data corresponding to the modified snapshot file and the original report are actually merged, and then the data is saved to the database. If the modified snapshot file is not updated continuously, the modified data corresponding to the modified snapshot file and the content after the report is merged are uploaded to the database in the idle time of the server. In this way, it is ensured that the modification amount each time is not very large, and the database is not caused instantaneous pressure.
[0101] All the above technical solutions can be combined to form optional embodiments of the present application, which will not be repeated here.
[0102] The embodiment of the present application obtains the modified snapshot file sent by the terminal device, and stores the modified snapshot file in the cache of the server. If the modified snapshot file is continuously updated within a preset time period, and the data amount of the modified data in the modified snapshot file is greater than the preset percentage of the original size of the target report, the modified data corresponding to the modified snapshot file and the original data corresponding to the target report are merged, and the merged content is saved to the database. This can reduce the instantaneous pressure of saving data on the database and reduce network resource consumption.
[0103] In order to better implement the object attribute recognition model training method of the embodiment of the present application, the embodiment of the present application also provides a data processing device. Please refer to Figure 6 , Figure 6 The first structure diagram of the data processing device provided by the embodiment of the present application is shown in the figure. The data processing device 600 can include:
[0104] The first acquisition unit 610 is configured to acquire an editing operation instruction triggered for a target report;
[0105] The first judgment unit 620 is configured to judge whether the editing operation instruction is an operation of modifying a target cell in the target report;
[0106] The first processing unit 630 is configured to copy the target cell to form an editing layer and display the editing layer on top if the editing operation instruction is an operation of modifying the target cell in the target report;
[0107] The second processing unit 640 is configured to detect a modification operation corresponding to the target cell in the editing layer and acquire modified data corresponding to the modification operation;
[0108] The third processing unit 650 is configured to store the modification data in a modification queue, and when the modification data in the modification queue meets a report refreshing condition, refresh the modification data in the modification queue into the target report.
[0109] Optionally, before copying the target cell to form the edit layer, the first judging unit 620 is further configured to judge whether the proportion of the number of the target cell in the total number of cells is less than a first preset proportion.
[0110] The first processing unit 630 is configured to copy the target cell to form the edit layer if the proportion of the number of the target cell in the total number of cells is less than the first preset proportion.
[0111] Optionally, the third processing unit 650 can be configured to: store the modification data in the modification queue according to the order of modification time; when the proportion of the number of cells in the modified queue in the total number of cells exceeds a second preset proportion, or the number of the edit layers formed by copying the target cell exceeds a preset number of layers, determine that the modification data in the modification queue meets the report refreshing condition; and refresh the modification data in the modification queue into the target report.
[0112] Optionally, before judging whether the edit operation instruction is a modification operation for the target cell in the target report, the first judging unit 620 can be configured to: judge whether the number of all cells in the target report exceeds a preset number of cells; and if the number of all cells in the target report exceeds the preset number of cells, judge whether the edit operation instruction is a modification operation for the target cell in the target report.
[0113] Optionally, the third processing unit 650 can be further configured to: if the edit operation instruction is not a modification operation for the target cell in the target report, store the modification data generated in response to the edit operation instruction in a modification queue, and refresh the modification data into the target report in real time.
[0114] Optionally, the third processing unit 650 can be further configured to: when the number of modifications in the modification queue exceeds a preset number, or the proportion of the modified cells in the total number of cells exceeds a third preset proportion, merge the modification data in the modification queue; and generate a modification snapshot file for the merged modification data, wherein the modification snapshot file contains report information of the target report, the merged modification data, and edit object information corresponding to the merged modification data.
[0115] Optionally, the third processing unit 650 can also be configured to acquire an opening instruction triggered for the target report; and in response to the opening instruction, update the target report according to the modification data corresponding to the modification snapshot file, to display the modification data corresponding to the modification snapshot file in the target report currently opened, if it is detected that the target report is abnormally closed before the opening instruction.
[0116] Optionally, the third processing unit 650 can also be configured to send the modification snapshot file to a server for storage.
[0117] The embodiment of the present application further provides another data processing apparatus. Please refer to Figure 7 , Figure 7 The second structural schematic diagram of the data processing apparatus provided by the embodiment of the present application is shown in FIG. 7. The data processing apparatus 700 can include:
[0118] The second acquisition unit 710 is configured to acquire a modification snapshot file sent by a terminal device, wherein the modification snapshot file is generated based on modification data corresponding to editing operation of the target report by the terminal device.
[0119] The cache unit 720 is configured to store the modification snapshot file in a cache of a server.
[0120] The fourth processing unit 730 is configured to merge the modification data corresponding to the modification snapshot file and the original data corresponding to the target report, and save the merged content to a database, if the modification snapshot file is continuously updated within a preset time period, and the data volume of the modification data in the modification snapshot file is greater than a preset percentage of the original size of the target report.
[0121] Optionally, the fourth processing unit 730 can also be configured to merge the modification data corresponding to the modification snapshot file and the original data corresponding to the target report, and upload the merged content to a database, if the modification snapshot file is not continuously updated within a preset time period.
[0122] It should be noted that the functions of the data processing apparatus 600 or the data processing apparatus 700 in the embodiment of the present application can correspond to the specific implementation manners of any of the above method embodiments, which will not be described here.
[0123] Each unit in the above-mentioned data processing device may be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned units may be embedded in or independent of a processor in a computer device in the form of hardware, or may be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each of the above-mentioned units.
[0124] For example, the data processing device 600 can be integrated into a terminal having a storage device and a processor installed thereon and having computing capabilities, or the data processing device 600 is the terminal. For example, the data processing device 700 can be integrated into a server having a storage device and a processor installed thereon and having computing capabilities, or the data processing device 700 is the server. The terminal can be a device such as a smart phone, a tablet computer, a laptop computer, a smart TV, a smart speaker, a wearable smart device, a personal computer (PC), etc. The terminal can also include a client, which can be a video client, a browser client, or an instant messaging client, etc. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.
[0125] Optionally, the present application also provides a computer device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0126] Figure 8 A schematic diagram of the structure of a computer device provided in an embodiment of the present application is shown in FIG. Figure 8 As shown, computer device 800 may include: a communication interface 801, a memory 802, a processor 803, and a communication bus 804. Communication interface 801, memory 802, and processor 803 communicate with each other via communication bus 804. Communication interface 801 is used for data communication between device 800 and external devices. Memory 802 may be used to store software programs and modules. Processor 803 executes software programs and modules stored in memory 802, such as the software programs for corresponding operations in the aforementioned method embodiments.
[0127] Optionally, the processor 803 may call software programs and modules stored in the memory 802 to perform the following operations:
[0128] An editing operation instruction triggered by a target report is acquired; it is judged whether the editing operation instruction is an operation of modifying a target cell in the target report; if the editing operation instruction is the operation of modifying the target cell in the target report, the target cell is copied to form an editing layer, and the editing layer is displayed on top; a modification operation corresponding to the target cell in the editing layer is detected, and modification data corresponding to the modification operation is acquired; the modification data is stored in a modification queue, and when the modification data in the modification queue meets a report refreshing condition, the modification data in the modification queue is refreshed into the target report.
[0129] Optionally, the processor 803 can also invoke the software programs and modules stored in the memory 802 to perform the following operations:
[0130] A modification snapshot file sent by a terminal device is acquired, the modification snapshot file being generated based on modification data corresponding to an editing operation of the terminal device on a target report; the modification snapshot file is stored in a cache of a server; if the modification snapshot file is continuously updated within a preset time period, and a data volume of the modification data in the modification snapshot file is greater than a preset percentage of an original size of the target report, the modification data corresponding to the modification snapshot file and original data corresponding to the target report are merged, and the merged content is saved to a database.
[0131] Optionally, the computer device 800 can be integrated in a terminal or a server that has a storage and is installed with a processor and has a computing capability, or the computer device 800 is the terminal or the server. The terminal can be a smart phone, a tablet computer, a notebook computer, a smart television, a smart speaker, a wearable smart device, a personal computer, or the like. The server can be a physical server, a server cluster or a distributed system composed of multiple physical servers, a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, and basic cloud computing services such as big data and artificial intelligence platforms.
[0132] The present application also provides a computer readable storage medium for storing a computer program. The computer readable storage medium can be applied to a computer device, and the computer program causes the computer device to perform corresponding procedures in the data processing method in the embodiments of the present application. For brevity, details are not repeated here.
[0133] The application further provides a computer program product, which comprises computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes corresponding procedures in the data processing method in the embodiments of the application. For brevity, details are not repeated here.
[0134] The application further provides a computer program, which comprises computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes corresponding procedures in the data processing method in the embodiments of the application. For brevity, details are not repeated here.
[0135] It should be understood that the processor in the embodiments of the application can be an integrated circuit chip with a processing capability of signals. In the implementation process, each step of the method embodiments can be completed by integrated logic circuits of hardware in the processor or instructions in the form of software. The processor can be a general processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. Each method, step and logic block diagram disclosed in the embodiments of the application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in combination with the embodiments of the application can be directly embodied as a hardware code processor for execution, or a combination of hardware and software modules in the code processor for execution. The software module can be located in a random access memory, a flash memory, a read only memory, a programmable read only memory or an electrically erasable programmable memory, a register or other mature storage medium in the art. The storage medium is located in the memory, and the processor reads the information in the memory and combines the hardware to complete the steps of the above method.
[0136] It is to be understood that the memory in the embodiments of the present application can be a volatile memory or a nonvolatile memory, or can include both volatile and nonvolatile memory. Among them, the nonvolatile memory can be a read-only memory (Read-Only Memory, ROM), a programmable read-only memory (Programmable ROM, PROM), an erasable programmable read-only memory (Erasable PROM, EPROM), an electrically erasable programmable read-only memory (Electrically EPROM, EEPROM) or a flash memory. The volatile memory can be a random access memory (Random Access Memory, RAM) used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (Static RAM, SRAM), dynamic random access memory (Dynamic RAM, DRAM), synchronous dynamic random access memory (Synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (Synchlink DRAM, SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DR RAM). It should be noted that the memory of the system and method described herein is intended to include, but not limited to, these and any other suitable types of memory.
[0137] It should be understood that the above-mentioned memory is exemplary but not limiting, for example, the memory in the embodiments of the present application can also be static random access memory (static RAM, SRAM), dynamic random access memory (dynamic RAM, DRAM), synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (double data rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (synch link DRAM, SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DR RAM) and the like. That is, the memory in the embodiments of the present application is intended to include, but not limited to, these and any other suitable types of memory.
[0138] Those skilled in the art can clearly understand that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0139] Those skilled in the art can clearly understand that, for the convenience and brevity of the description, the specific working processes of the above-described system, device and unit can refer to the corresponding processes in the foregoing method embodiments, which will not be repeated here.
[0140] In several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division, and there can be another division manner in actual implementation. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interface, device or unit, and can be electrical, mechanical or other forms.
[0141] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e. they can be located in one place or distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
[0142] In addition, each functional unit in the embodiments of the present application can be integrated into a processing unit, or each unit can exist physically, or two or more units can be integrated into one unit.
[0143] If the functions are realized in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the parts that make contributions to the prior art or parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, a server) to execute all or part of the steps of the methods described in the embodiments of the present application. The foregoing storage medium includes: U disk, mobile hard disk, ROM, RAM, magnetic disk or optical disk and various program codes that can be stored.
[0144] The above description is provided as an enabling teaching of the application and is not intended to limit its scope in any way. Any modification of the application in keeping with the spirit thereof that is apparent to those skilled in the art is to be considered within the scope of the application as defined by the appended claims.
Claims
1. A data processing method, characterized in that: The method comprises: Get the editing operation instructions triggered for the target report; Determining whether the editing operation instruction is an operation for modifying a target cell in the target report; If the editing operation instruction is an operation for modifying a target cell in the target report, the target cell is copied to form an editing layer, and the editing layer is displayed at the top; detecting a modification operation on the target cell in the editing layer, and acquiring modification data corresponding to the modification operation; The modified data is stored in a modification queue, and when the modified data in the modification queue meets a report refresh condition, the modified data in the modification queue is refreshed into the target report.
2. The data processing method according to claim 1, wherein: Before copying the target cell to form an editing layer, the method further includes: Determining whether the ratio of the number of target cells to the total number of cells is less than a first preset ratio; If the ratio of the number of cells of the target cell to the total number of cells is smaller than a first preset ratio, the target cell is copied to form an editing layer.
3. The data processing method according to claim 1, wherein: The step of storing the modified data in a modification queue until the modified data in the modification queue meets a report refresh condition, and then refreshing the modified data in the modification queue to the target report, comprises: Storing the modified data in a modification queue in the order of modification time; When the ratio of the number of cells in the modification queue to the total number of cells exceeds a second preset ratio, or the number of editing layers formed by copying the target cell exceeds a preset number of layers, determining that the modified data in the modification queue meets the report refresh condition; Refresh the modified data in the modification queue to the target report.
4. The data processing method according to claim 1, wherein: Before determining whether the editing operation instruction is an operation for modifying a target cell in the target report, the method further includes: Determine whether the number of cells in the target report exceeds a preset number of cells; If the number of cells in all cells of the target report exceeds a preset number of cells, it is determined whether the editing operation instruction is an operation for modifying a target cell in the target report.
5. The data processing method according to claim 1, wherein: After determining whether the editing operation instruction is an operation for modifying a target cell in the target report, the method further includes: If the editing operation instruction is not an operation for modifying a target cell in the target report, the modification data generated in response to the editing operation instruction is stored in a modification queue and refreshed to the target report in real time.
6. The data processing method according to claim 1 or 5, characterized in that: The method further comprises: When the number of modifications in the modification queue exceeds a preset number, or the ratio of modified cells to the total number of cells exceeds a third preset ratio, merging the modified data in the modification queue; A modification snapshot file is generated for the merged modified data, wherein the modification snapshot file includes report information of the target report, the merged modified data, and editing object information corresponding to the merged modified data.
7. The data processing method according to claim 6, wherein: The method further comprises: Obtaining an opening instruction triggered for the target report; If it is detected that the target report is abnormally closed before the open instruction, the target report is updated according to the modified data corresponding to the modified snapshot file in response to the open instruction, so as to display the modified data corresponding to the modified snapshot file in the currently opened target report.
8. The data processing method according to claim 7, wherein: The method further comprises: The modified snapshot file is sent to the server for storage.
9. A data processing method, characterized in that: The method comprises: Obtain a modification snapshot file sent by a terminal device, the modification snapshot file being a snapshot generated based on the modification data after the terminal device performs an editing operation on a target report and generates corresponding modification data, wherein the step of the terminal device performing an editing operation on the target report comprises: obtaining an editing operation instruction triggered on the target report; determining whether the editing operation instruction is an operation for modifying a target cell in the target report; if the editing operation instruction is an operation for modifying a target cell in the target report, copying the target cell to form an editing layer, and displaying the editing layer at the top; detecting a modification operation corresponding to the target cell in the editing layer, and obtaining modification data corresponding to the modification operation; storing the modification data in a modification queue until the modification data in the modification queue meets a report refresh condition, and then refreshing the modification data in the modification queue to the target report; Storing the modified snapshot file in a cache of the server; If the modified snapshot file is continuously updated within a preset period of time, and the amount of modified data in the modified snapshot file is greater than a preset percentage of the original size of the target report, the modified data corresponding to the modified snapshot file and the original data corresponding to the target report are merged, and the merged content is saved to the database.
10. The data processing method according to claim 9, wherein: The method further comprises: If the modified snapshot file is not continuously updated within a preset period, the modified data corresponding to the modified snapshot file and the original data corresponding to the target report are merged during an idle period of the server, and the merged content is uploaded to the database.
11. A data processing device, characterized in that: The device comprises: A first acquiring unit is configured to acquire an editing operation instruction triggered on a target report; A first judging unit is configured to judge whether the editing operation instruction is an operation for modifying a target cell in the target report; a first processing unit configured to, if the editing operation instruction is an operation for modifying a target cell in the target report, copy the target cell to form an editing layer, and display the editing layer on top; a second processing unit, configured to detect a modification operation on the target cell in the editing layer and obtain modification data corresponding to the modification operation; The third processing unit is configured to store the modified data in a modification queue, and refresh the modified data in the modification queue into the target report when the modified data in the modification queue meets a report refresh condition.
12. A data processing device, characterized in that: The device comprises: The second acquisition unit is used to acquire a modification snapshot file sent by the terminal device, wherein the modification snapshot file is a snapshot generated based on the modification data after the terminal device performs an editing operation on the target report and generates corresponding modification data, wherein the step of the terminal device performing an editing operation on the target report includes: acquiring an editing operation instruction triggered on the target report; determining whether the editing operation instruction is an operation for modifying a target cell in the target report; if the editing operation instruction is an operation for modifying a target cell in the target report, copying the target cell to form an editing layer, and displaying the editing layer on top; detecting the modification operation corresponding to the target cell in the editing layer, and acquiring modification data corresponding to the modification operation; storing the modification data in a modification queue until the modification data in the modification queue meets the report refresh condition, and then refreshing the modification data in the modification queue to the target report; A cache unit, configured to store the modified snapshot file in a cache of a server; The fourth processing unit is used to merge the modified data corresponding to the modified snapshot file and the original data corresponding to the target report if the modified snapshot file is continuously updated within a preset time period and the amount of modified data in the modified snapshot file is greater than a preset percentage of the original size of the target report, and save the merged content to the database.
13. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor to execute the steps in the data processing method according to any one of claims 1 to 10.
14. A computer device, characterized in that: The computer device includes a processor and a memory, wherein a computer program is stored in the memory, and the processor is configured to execute the steps of the data processing method according to any one of claims 1 to 10 by calling the computer program stored in the memory.
15. A computer program product comprising computer instructions, characterized in that When the computer instructions are executed by a processor, the steps in the data processing method according to any one of claims 1 to 10 are implemented.
Citation Information
Patent Citations
Method and system for modifying erasure code data in cloud storage
CN105677508A
Method for modifying and saving table cell information in reporting system
CN105787019A