Electronic spreadsheet formula calculation anti-stuck method, device, equipment and storage medium
By responding to user operations in a spreadsheet, the problem of page stuck is solved, and the user experience and computing efficiency are improved.
Patent Information
- Application Number
- CN202411629208.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-15
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-11-15
AI Technical Summary
When the prior art processes a large number of citation formulas in a spreadsheet, the page will be stuck, the user cannot perform any operations, and the experience will be poor.
After calculating the first formula with zero reference number, responding to the user operation every time the first preset time is passed, and after iterative calculation of the circular reference formula, responding to the user operation every time the second preset time is passed, the response to the user operation is realized.
It solves the problem of page stuck, realizes the response to user operations during the calculation of the spreadsheet, improves the user experience, and avoids invalid formula calculations after the user edits, improving calculation efficiency.
Smart Images

Figure CN119129568B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, specifically to the field of electronic spreadsheet technology, and in particular to a method, device, equipment and storage medium for preventing electronic spreadsheet formula calculation from getting stuck. Background Art
[0002] A spreadsheet is a type of computer program that simulates a paper calculation table and can perform various complex calculations on input data and formulas and display them to the user.
[0003] At present, when calculating formulas in a spreadsheet, the Kahn algorithm is generally used to calculate the formulas one by one.
[0004] However, the existing Kahn algorithm will continue to process formulas without responding to user operations until all calculations are completed when there are a large number of formulas that reference formulas in the spreadsheet. For users, the page will be stuck for a long time, making it impossible for users to perform any operations on the spreadsheet, which is a poor experience. Summary of the invention
[0005] The embodiments of the present application provide a method, device, equipment and storage medium for preventing spreadsheet formula calculations from getting stuck, thereby solving the problem in the prior art of causing page jams and user inability to operate. This achieves response to user operations during the calculation process of the spreadsheet, improves user experience, and avoids invalid formula calculations after the user re-edits the spreadsheet, thereby improving calculation efficiency.
[0006] In a first aspect, an embodiment of the present application provides a method for preventing spreadsheet formula calculation from being stuck, comprising:
[0007] The determination step includes: determining the formula to be calculated according to the electronic spreadsheet; determining the number of formula references of the formula to be calculated according to the formula to be calculated. Determine the existence of the first formula, calculate the first formula, obtain and store the calculation result, update the first formula and the second formula, determine to respond to the user operation according to the first preset rule, and perform the first preset action according to the user's operation type; wherein the first formula includes a formula to be calculated with a formula reference number of zero, and the second formula includes a formula to be calculated that references the first formula, and the first preset rule includes every first preset time period, and the operation type includes an editing operation and a general operation; according to the user's operation type, perform the first preset action, including: when the operation type is a general operation, continue to calculate the first formula until the first formula does not exist; when the operation type is an editing operation, perform the determination step. Determine that there is a circular reference formula and that the preset number of iterations has not been reached, iteratively calculate the circular reference formula, determine to respond to the user operation according to a second preset rule, and execute a second preset action according to the user's operation type; wherein the circular reference formula is a formula to be calculated with a circular reference, and the second preset rule includes every second preset time period; according to the user's operation type, execute the second preset action, including: when the operation type is a general operation, continue to calculate the circular reference formula until the preset number of iterations is reached and stop calculating; when the operation type is an editing operation, execute the determination step.
[0008] In combination with the first aspect, in a possible implementation method, according to the user's operation type, a first preset action is executed, which also includes: when the operation type is a general operation, the obtained calculation results and the remaining calculation number are displayed; when the operation type is an editing operation, the obtained calculation results are displayed; according to the user's operation type, a second preset action is executed, which also includes: when the operation type is a general operation, continuing to calculate the circular reference formula, displaying the obtained calculation results, the remaining calculation number and the remaining iteration number; when the operation type is an editing operation, displaying the obtained calculation results.
[0009] In combination with the first aspect, in a possible implementation method, before determining the first formula according to the number of formula references, calculating the first formula, obtaining the calculation result and storing it, the method also includes: determining the hierarchical association relationship of the formula to be calculated; when the operation type is an editing operation, displaying the obtained calculation result, including: determining the target calculation result from the obtained calculation results according to the target formula to be calculated corresponding to the editing operation, and the hierarchical association relationship of the target formula to be calculated, and displaying it.
[0010] In combination with the first aspect, in a possible implementation method, when the operation type is an editing operation, a determination step is executed, including: when the operation type is an editing operation, a determination step is executed, and a re-execution mark is set; based on the spreadsheet, a formula to be calculated is determined, including: based on the spreadsheet, a hierarchical association relationship of the formula to be calculated, the formula to be calculated corresponding to the editing operation, and the re-execution mark, the formula to be calculated is determined.
[0011] In combination with the first aspect, in a possible implementation method, the first preset rule also includes: every time the first preset formula is calculated multiple times; the second preset rule also includes: every time the second preset formula is calculated multiple times; according to the first preset rule, determining to respond to the user operation includes: every time the first preset time period passes, and / or every time the first preset formula is calculated multiple times, determining to respond to the user operation; according to the second preset rule, determining to respond to the user operation includes: every time the second preset time period passes, and / or every time the second preset formula is calculated multiple times, determining to respond to the user operation.
[0012] In combination with the first aspect, in a possible implementation manner, the method further includes: when displaying the obtained calculation results, setting a calculated mark for the cell corresponding to the calculation result.
[0013] In combination with the first aspect, in a possible implementation method, the operation type also includes pausing the calculation operation, and executing the first preset action according to the user's operation type, and also includes: when the operation type is to suspend the calculation operation, stop the calculation and display the obtained calculation results; according to the user's operation type, execute the second preset action, and also include: when the operation type is to suspend the calculation operation, stop the calculation and display the obtained calculation results.
[0014] In a second aspect, an embodiment of the present application provides a spreadsheet formula calculation anti-stuck device, including: a determination module, a first processing module and a second processing module.
[0015] The determination module is used to determine the formula to be calculated according to the electronic form; and to determine the formula reference quantity of the formula to be calculated according to the formula to be calculated.
[0016] The first processing module is used to determine the first formula according to the number of formula references, calculate the first formula, obtain and store the calculation result, update the first formula and the second formula, determine to respond to the user operation according to the first preset rule, and execute the first preset action according to the user's operation type; wherein the first formula includes a formula to be calculated whose number of formula references is zero, the second formula includes a formula to be calculated that references the first formula, the first preset rule includes every time a first preset time has passed, the operation type includes an editing operation and a general operation; according to the user's operation type, execute the first preset action, including: when the operation type is a general operation, continue to calculate the first formula until the first formula does not exist; when the operation type is an editing operation, execute the determination module.
[0017] The second processing module is used to determine whether there is a circular reference formula and the preset number of iterations has not been reached, iteratively calculate the circular reference formula, determine to respond to the user operation according to the second preset rule, and execute the second preset action according to the user's operation type; wherein the circular reference formula is a formula to be calculated with a circular reference, and the second preset rule includes every second preset time period; according to the user's operation type, execute the second preset action, including: when the operation type is a general operation, continue to calculate the circular reference formula until the preset number of iterations is reached and stop the calculation; when the operation type is an editing operation, execute the determination module.
[0018] In conjunction with the second aspect, in a possible implementation, the first processing module, when executing the first preset action according to the user's operation type, is further used to: when the operation type is a general operation, display the obtained calculation result and the remaining number of calculations; when the operation type is an editing operation, display the obtained calculation result. The second processing module, when executing the second preset action according to the user's operation type, is further used to: when the operation type is a general operation, continue to calculate the circular reference formula, display the obtained calculation result, the remaining number of calculations, and the remaining number of iterations; when the operation type is an editing operation, display the obtained calculation result.
[0019] In conjunction with the second aspect, in a possible implementation, the determination module is further used to: determine the hierarchical association relationship of the formula to be calculated. The first processing module and the second processing module, when the operation type is an editing operation and the obtained calculation result is displayed, are specifically used to: determine and display the target calculation result from the obtained calculation results according to the target formula to be calculated corresponding to the editing operation and the hierarchical association relationship of the target formula to be calculated.
[0020] In conjunction with the second aspect, in a possible implementation, the first processing module and the second processing module, when the operation type is an editing operation and the determination module is executed, are specifically used to: when the operation type is an editing operation, execute the determination module and set a re-execution mark. The determination module, when determining the formula to be calculated based on the electronic spreadsheet, is used to: determine the formula to be calculated based on the electronic spreadsheet, the hierarchical association relationship of the formula to be calculated, the formula to be calculated corresponding to the editing operation, and the re-execution mark.
[0021] In combination with the second aspect, in a possible implementation, the first preset rule further includes: every time the first preset formula is calculated, the number of times; the second preset rule further includes: every time the second preset formula is calculated, the number of times. The first processing module, when determining to respond to a user operation according to the first preset rule, is specifically used to: every time the first preset time length has passed, and / or every time the first preset formula is calculated, determine the response to the user operation. The second processing module, when determining to respond to a user operation according to the second preset rule, is specifically used to: every time the second preset time length has passed, and / or every time the second preset formula is calculated, determine the response to the user operation.
[0022] In conjunction with the second aspect, in a possible implementation manner, the first processing module and the second processing module set a calculated mark for a cell corresponding to the calculation result when displaying the obtained calculation result.
[0023] In conjunction with the second aspect, in a possible implementation, the operation type further includes a pause calculation operation. The first processing module, when executing the first preset action according to the user's operation type, is further used to: when the operation type is a pause calculation operation, stop the calculation and display the obtained calculation result. The second processing module, when executing the second preset action according to the user's operation type, is further used to: when the operation type is a pause calculation operation, stop the calculation and display the obtained calculation result.
[0024] In a third aspect, an embodiment of the present application provides a device, comprising: a processor; a memory for storing processor executable instructions; and a method for implementing the first aspect or any possible implementation of the first aspect when the processor executes the executable instructions.
[0025] In a fourth aspect, an embodiment of the present application provides a non-volatile computer-readable storage medium, which includes a device for storing a computer program or instruction. When the computer program or instruction is executed, the method of the first aspect or any possible implementation method of the first aspect is implemented.
[0026] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:
[0027] The embodiment of the present application solves the problem in the prior art that the page is stuck and the user cannot operate by responding to the user operation every first preset time according to the first preset rule after calculating the first formula with zero formula references, and continuing to calculate the first formula or restarting according to the user operation type, and responding to the user operation every second preset time according to the second preset rule after iteratively calculating the circular reference formula, and continuing to calculate the circular reference formula or restarting according to the user operation type, thereby achieving response to user operations during the calculation process of the spreadsheet, improving user experience, and avoiding invalid formula calculations after the user re-edits the spreadsheet, thereby improving calculation efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0029] Figure 1 A schematic diagram of a flow chart of a method for calculating an anti-stuck condition using a spreadsheet formula provided in an embodiment of the present application;
[0030] Figure 2 Another schematic flow chart of a method for preventing jamming by using a spreadsheet formula to calculate an anti-jamming condition provided in an embodiment of the present application;
[0031] Figure 3 A schematic diagram of the composition of an anti-stuck device calculated using a spreadsheet formula provided in an embodiment of the present application. DETAILED DESCRIPTION
[0032] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0033] The following describes some of the techniques involved in the embodiments of the present application to facilitate understanding, and they should be considered as merely exemplary. Therefore, it should be appreciated by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, some descriptions of well-known functions and structures are omitted in the following description.
[0034] A spreadsheet is a type of computer program that simulates a paper calculation table and can perform various complex calculations on input data and formulas and display them to the user.
[0035] At present, when calculating formulas in a spreadsheet, the Kahn algorithm is generally used to calculate the formulas one by one.
[0036] However, the existing Kahn algorithm will continue to process formulas without responding to user operations until all calculations are completed when there are a large number of formulas that reference formulas in the spreadsheet. For users, the page will be stuck for a long time, making it impossible for users to perform any operations on the spreadsheet, which is a poor experience.
[0037] Against this background, the present disclosure provides a method for preventing spreadsheet formula calculations from getting stuck, which can respond to user operations and improve user experience.
[0038] The execution subject of the electronic spreadsheet formula calculation anti-stuck method provided by the embodiment of the present disclosure may be a computer or a server, or may also be other electronic devices with data processing capabilities; or, the execution subject of the method may also be a processor (such as a central processing unit (CPU)) in the above electronic device; or, the execution subject of the method may also be an application (application, APP) installed in the above electronic device that can implement the function of the method; or, the execution subject of the method may also be a functional module or unit in the above electronic device that has the function of the method, etc. There is no limitation on the execution subject of the method herein.
[0039] The following is an exemplary description of the anti-stuck calculation method using the spreadsheet formula in conjunction with the accompanying drawings.
[0040] Figure 1 : is a flow chart of the method for preventing jamming by calculating electronic spreadsheet formulas provided in the embodiment of the present application. Figure 1 This is only an execution order shown in the embodiment of the present application, and does not represent the only execution order of the spreadsheet formula calculation anti-stuck method. If the final result can be achieved, Figure 1 The steps shown can be performed in parallel or in reverse. Figure 1 As shown, the method may include:
[0041] The determining step includes S101 to S104.
[0042] S101. Determine the formula to be calculated according to the electronic spreadsheet.
[0043] Exemplarily, the execution subject may identify the cell content according to each cell with content in the electronic form to determine whether there is a formula in the cell, and if there is a formula, determine the formula as the formula to be calculated. For example, a predetermined format may be set for the formula content, and whether there is a formula in the cell content may be determined according to the predetermined format. It can be understood that the cell corresponds to the formula to be calculated one by one.
[0044] S102. Determine the formula reference quantity of the formula to be calculated according to the formula to be calculated.
[0045] Exemplarily, the number of formula references of a formula to be calculated can be determined according to the number of other formulas to be calculated contained in the formula to be calculated. For example, taking cell A1: =1, cell A2: =A1+1, cell A3: =A1+A2 as examples, the formulas to be calculated corresponding to each cell are =1, =A1+1, =A1+A2, respectively. Then the number of formula references of the formula to be calculated corresponding to cell A1 is 0, the number of formula references of the formula to be calculated corresponding to cell A2 is 1, and the number of formula references of the formula to be calculated corresponding to cell A3 is 2.
[0046] S103, determining the first formula according to the number of formula references, calculating the first formula, obtaining and storing the calculation result, updating the first formula and the second formula, determining a response to the user operation according to the first preset rule, and executing the first preset action according to the user's operation type.
[0047] Among them, the first formula includes a formula to be calculated with a formula reference quantity of zero, the second formula includes a formula to be calculated that references the first formula, the first preset rule includes every time a first preset time period has passed, and the operation type includes an editing operation and a general operation.
[0048] According to the user's operation type, a first preset action is executed, including: when the operation type is a general operation, continuing to calculate the first formula until the first formula does not exist; when the operation type is an editing operation, executing a determination step.
[0049] For example, continuing with the above example, the formula to be calculated corresponding to cell A1 is the first formula, and the formula to be calculated corresponding to cells A2 and A3 are both the second formula. If there is also cell A4: =A2+A3, the formula to be calculated corresponding to cell A4 is not the second formula.
[0050] Exemplarily, after the first formula is calculated, the number of formula references of the second formula that references the first formula may be reduced by one, and the first formula and the second formula may be re-determined.
[0051] For example, continuing with the above example, after the formula to be calculated corresponding to cell A1 is calculated, the formula to be calculated corresponding to cell A2 can be determined as the first formula, and the formula to be calculated corresponding to cells A3 and A4 can be determined as the second formula.
[0052] It should be noted that when the first formula does not exist, S104 may continue to be executed.
[0053] For example, editing operations may include operations that affect the content of the electronic table, such as modifying the cell content, and general operations may include operations that do not affect the content of the electronic table, such as switching tables, scrolling tables, changing formats, etc., which are not limited.
[0054] Exemplarily, there is no limit on the size of the first preset duration. Preferably, the first preset duration may be 200 milliseconds.
[0055] In some embodiments, determining to respond to the user operation according to the first preset rule can be achieved by recording a timestamp.
[0056] For example, when executing S101, timestamp 1 may be recorded, and timestamp 2 may be recorded after the first formula and the second formula are updated. When the time difference between timestamp 1 and timestamp 2 is greater than or equal to the first preset duration, timestamp 1 may be updated to respond to the user operation. When the user operation is a general operation, timestamp 2 may be updated after the updated first formula is calculated and the first formula and the second formula are updated. When the time difference between the updated timestamp 1 and the updated timestamp 2 is greater than or equal to the first preset duration, timestamp 1 may be updated to respond to the user operation again.
[0057] It should be noted that when the first preset rule is not satisfied, S103 may be re-executed until the first formula does not exist.
[0058] For example, when executing S101, timestamp 1 may be recorded, and after the first formula and the second formula are updated, timestamp 2 may be recorded. When the time difference between timestamp 1 and timestamp 2 is less than the first preset time length, the first formula is continuously calculated without responding to user operations until the first formula does not exist.
[0059] It can be understood that when the operation type is an editing operation, the calculation can be stopped and S101 can be executed again.
[0060] It can be understood that when there is no user operation, S103 can be re-executed until the first formula does not exist.
[0061] S104, determining that there is a circular reference formula and the preset number of iterations has not been reached, performing iterative calculations on the circular reference formula, determining a response to the user operation according to a second preset rule, and executing a second preset action according to the user's operation type.
[0062] Among them, the circular reference formula is a formula to be calculated with circular reference, and the second preset rule includes every time a second preset time period has passed.
[0063] According to the user's operation type, a second preset action is executed, including: when the operation type is a general operation, continuing to calculate the circular reference formula until the preset number of iterations is reached and the calculation is stopped; when the operation type is an editing operation, executing a determination step.
[0064] Exemplarily, taking cell B1: =B1+1 and cell B2: =B1 as examples, the formula to be calculated corresponding to cell B1 is a circular reference formula; taking cell C1: =C2 and cell C2: =C1+1 as examples, the formulas to be calculated corresponding to cells C1 and C2 are both circular reference formulas; taking cell D1: =D3, cell D2: =D1+1 and cell D3: =D2+1 as examples, the formulas to be calculated corresponding to cells D1, D2 and D3 are all circular reference formulas.
[0065] It can be understood that circular reference is common knowledge in the art, and the formula for determining circular reference is also well known to those skilled in the art, which will not be described in detail here.
[0066] It should be noted that when there is no circular reference formula, the calculation can be stopped, and all the formulas to be calculated in the spreadsheet have been calculated.
[0067] Exemplarily, there is no limit on the size of the second preset time length. Preferably, the second preset time length may be 200 milliseconds.
[0068] In some embodiments, similar to the example in S103, the response to the user operation may be determined according to the second preset rule by recording a timestamp.
[0069] For example, after performing an iterative calculation on the circular reference formula, timestamp 3 can be recorded, and when the time difference between timestamp 3 and timestamp 2 (same as the above example) is greater than or equal to the second preset duration, timestamp 2 can be updated to respond to the user operation. When the user operation is a general operation, after performing an iterative calculation on the circular reference formula, timestamp 3 can be updated, and when the time difference between the updated timestamp 3 and the updated timestamp 2 is greater than or equal to the second preset duration, timestamp 2 can be updated to respond to the user operation again.
[0070] It should be noted that, when the second preset rule is not satisfied, S104 may be re-executed until a preset number of iterations is reached.
[0071] For example, after performing one iterative calculation on the circular reference formula, timestamp 3 can be recorded. When the time difference between timestamp 3 and timestamp 2 (the same as the above example) is less than the second preset time length, no response is given to user operations, and the iterative calculation of the circular reference formula continues until the preset number of iterations is stopped.
[0072] It can be understood that when the operation type is an editing operation, the calculation can be stopped and S101 can be executed again.
[0073] It can be understood that when there is no user operation, S104 can be re-executed until the calculation stops at a preset number of iterations.
[0074] The disclosed embodiment solves the problem in the prior art that the page is stuck and the user cannot operate by responding to the user operation every first preset time period according to a first preset rule after calculating the first formula with zero formula references, and continuing to calculate the first formula or restarting according to the user's operation type, and responding to the user operation every second preset time period according to the second preset rule after iteratively calculating the circular reference formula, and continuing to calculate the circular reference formula or restarting according to the user's operation type. The embodiment achieves response to user operations during the calculation process of the spreadsheet, improves user experience, and avoids invalid formula calculations after the user re-edits the spreadsheet, thereby improving calculation efficiency.
[0075] In some possible implementations, executing the first preset action according to the user's operation type also includes: when the operation type is a general operation, displaying the obtained calculation results and the remaining calculation quantity; when the operation type is an editing operation, displaying the obtained calculation results.
[0076] Executing a second preset action according to the user's operation type also includes: when the operation type is a general operation, continuing to calculate the circular reference formula, displaying the obtained calculation results, the remaining number of calculations and the remaining number of iterations; when the operation type is an editing operation, displaying the obtained calculation results.
[0077] Exemplarily, the calculation result and the remaining calculation amount may be displayed to the user via a display device.
[0078] By way of example, the display device may be a display, a projection (eg, a three-dimensional projection, a flat projection, etc.), an AR or VR device, etc.
[0079] Exemplarily, the remaining number of calculations may be the number of uncalculated to-be-calculated formulas, or the percentage of uncalculated to-be-calculated formulas to the total number of to-be-calculated formulas, or the remaining number of calculations to be performed, without limitation.
[0080] Similarly, the remaining number of iterations may be the remaining number of iterations, or may be the percentage of the remaining number of iterations to the total number of iterations, and there is no limitation on this.
[0081] This embodiment can realize real-time display of calculation results and calculation progress by displaying the obtained calculation results, the remaining number of calculations, and the remaining number of iterations to the user according to the operation type.
[0082] In some possible implementations, before determining the first formula according to the number of formula references, calculating the first formula, obtaining the calculation result and storing it, the method further includes: determining a hierarchical association relationship of the formulas to be calculated.
[0083] When the operation type is edit operation, the obtained calculation results are displayed, including:
[0084] According to the target formula to be calculated corresponding to the editing operation and the hierarchical association relationship of the target formula to be calculated, the target calculation result is determined and displayed from the obtained calculation results.
[0085] Exemplarily, the hierarchical association relationship of the formulas to be calculated may be determined according to the reference relationship between the formulas to be calculated.
[0086] For example, taking cell A1: =1, cell A2: =A1+1, cell A3: =A1+A2, cell A4: =A1+2 as examples, it can be determined that cell A1 is the highest level, cells A2 and A4 are the next level, and cell A3 is the lowest level.
[0087] It can be understood that the hierarchical association relationship is used to indicate the calculation priority between the formulas to be calculated.
[0088] Exemplarily, continuing with the above example, when the editing operation is to edit cell A3, the calculation results of the formulas to be calculated corresponding to cells A1, A2, and A4 can all be determined as the target calculation results. It can be understood that at this time, the formulas to be calculated corresponding to cells A1, A2, and A4 have all been calculated. When the editing operation is to edit cell A2, the calculation results of the formulas to be calculated corresponding to cells A1 and A4 can all be determined as the target calculation results. It can be understood that at this time, the formula to be calculated corresponding to cell A4 may or may not have been calculated.
[0089] This embodiment determines the hierarchical association relationship of the formulas to be calculated, determines and displays the target calculation result from the obtained calculation results according to the target formula to be calculated corresponding to the editing operation and the hierarchical association relationship of the target formula to be calculated, and does not display the calculation result calculated after the target formula to be calculated corresponding to the editing operation, thereby avoiding the display of invalid information.
[0090] In some possible implementations, when the operation type is an editing operation, executing a determination step includes: when the operation type is an editing operation, executing a determination step and setting a re-execution mark.
[0091] Determining a formula to be calculated according to the electronic spreadsheet includes: determining the formula to be calculated according to the electronic spreadsheet, a hierarchical association relationship of the formula to be calculated, the formula to be calculated corresponding to the editing operation, and a re-execution mark.
[0092] Exemplarily, continuing with the above example, when the editing operation is to edit cell A3, the formula corresponding to cell A3 can be determined as the formula to be calculated. It can be understood that at this time, the formulas corresponding to cells A1, A2, and A4 have all been calculated and will not change, and the previous calculation results can be used directly. When the editing operation is to edit cell A2, the formulas corresponding to cells A2 and A3 can both be determined as the formula to be calculated. It can be understood that at this time, the formulas corresponding to cells A1 and A4 have all been calculated and will not change, and the previous calculation results can be used directly.
[0093] It can be understood that after the formula to be calculated is re-determined, the hierarchical association relationship of the formula to be calculated can be updated again according to the formula to be calculated.
[0094] This embodiment performs a determination step when the operation type is an editing operation, and sets a re-execution mark. The formula to be calculated is determined according to the spreadsheet, the hierarchical association relationship of the formula to be calculated, the formula to be calculated corresponding to the editing operation, and the re-execution mark. The formula calculated before the formula corresponding to the editing operation may not be determined as the formula to be calculated, thereby reducing the amount of calculation.
[0095] In some possible implementations, the first preset rule further includes: the number of calculations performed using the first preset formula; and the second preset rule further includes: the number of calculations performed using the second preset formula.
[0096] Determining a response to the user operation according to a first preset rule includes: determining a response to the user operation every time a first preset time period has passed and / or every time a first preset formula is calculated a number of times.
[0097] Determining the response to the user operation according to the second preset rule includes: determining the response to the user operation every time a second preset time period has passed, and / or every time a second preset formula is calculated a number of times.
[0098] For example, the formulas to be calculated that have been calculated to obtain calculation results may be counted, and a response to the user operation may be determined after a certain number of calculations have been completed.
[0099] In this embodiment, the flexibility of the method can be improved by setting the first preset rule to also include the number of calculations per first preset formula, and the second preset rule to also include the number of calculations per second preset formula.
[0100] In some possible implementations, the method further includes:
[0101] When displaying the obtained calculation results, a calculated mark is set for the cell corresponding to the calculation result.
[0102] Exemplarily, the calculated mark may be a format setting for a cell, for example, filling a background color for the cell, adding a superscript, setting a color for a border, etc., without limitation.
[0103] This embodiment sets a calculated mark for the cell corresponding to the calculation result when displaying the obtained calculation result, so that the cell corresponding to the calculated formula to be calculated can be highlighted, thereby realizing a more prominent real-time calculation progress display.
[0104] In some possible implementations, the operation type also includes pausing the calculation operation, executing the first preset action according to the user's operation type, and further including: when the operation type is pausing the calculation operation, stopping the calculation and displaying the obtained calculation results.
[0105] Executing a second preset action according to the user's operation type also includes: when the operation type is to pause the calculation operation, stopping the calculation and displaying the obtained calculation result.
[0106] Exemplarily, a pause calculation control may be added to the user interface of the electronic spreadsheet, and an operation of a user clicking or touching the pause calculation control is determined as a pause calculation operation, thereby stopping the calculation.
[0107] It is understandable that a start calculation control may be added to the user interface of the electronic spreadsheet, and the user clicks the start calculation control to instruct the electronic device to continue the calculation after pausing the calculation.
[0108] In this embodiment, the operation type also includes a pause calculation operation. When the operation type is a pause calculation operation, the calculation is stopped and the obtained calculation results are displayed. The calculation can be actively paused to reduce the waste of computing resources.
[0109] The above embodiments introduce the electronic table formula calculation anti-stuck method provided by the embodiments of the present disclosure. Figure 2 , through a specific example, the spreadsheet formula calculation anti-stuck method is explained in more detail. Figure 2 Another flowchart of a method for calculating an anti-stuck state using a spreadsheet formula provided in an embodiment of the present disclosure is shown below. Figure 2 As shown, the method may include:
[0110] S201, determine the formula to be calculated and record the first moment according to the electronic spreadsheet, and / or the hierarchical association relationship of the formula to be calculated, the formula to be calculated corresponding to the editing operation and the re-execution mark; determine the number of formula references of the formula to be calculated according to the formula to be calculated, and determine or update the hierarchical association relationship of the formula to be calculated.
[0111] The hierarchical association relationship is used to indicate the calculation priority between the formulas to be calculated.
[0112] S202, determine whether there is a first formula in the formulas to be calculated. If there is the first formula, execute S203; if not, execute S208.
[0113] The first formula includes a formula to be calculated whose formula reference quantity is zero.
[0114] S203, calculate the first formula, obtain and store the calculation result, update the first formula and the second formula, and record or update the second moment.
[0115] The second formula includes a formula to be calculated that refers to the first formula.
[0116] S204, determining whether the first calculated duration is greater than the first preset duration. If the first calculated duration is not greater than the first preset duration, executing S202; if the first calculated duration is greater than the first preset duration, executing S205.
[0117] The first calculation duration is the difference between the second moment and the first moment.
[0118] S205, update the first moment, detect the user operation and respond, determine the user operation type. If there is no user operation, or the user operation is a general operation, execute S206; if the user operation is an editing operation, execute S207.
[0119] S206, display the obtained calculation results and the number of remaining formulas to be calculated, and execute S202.
[0120] S207, display the target calculation result, set the re-execution mark, and execute S201.
[0121] The target calculation result is the calculation result obtained before the target formula to be calculated corresponding to the editing operation.
[0122] S208, determine whether there is a circular reference formula. If there is a circular reference formula, execute S209; if there is no circular reference formula, end.
[0123] Among them, the circular reference formula is a formula to be calculated that has a circular reference.
[0124] S209, determining whether the circular reference formula has reached a preset number of iterations. If not, executing S210; if reaching the preset number of iterations, ending.
[0125] S210, recalculate the circular reference formula, and record or update the third moment.
[0126] S211, determine whether the second calculated duration is greater than the second preset duration. If the second calculated duration is not greater than the second preset duration, execute S209; if the second calculated duration is greater than the second preset duration, execute S212.
[0127] The second calculation duration is the difference between the third moment and the second moment.
[0128] S212, update the second time, detect the user operation and respond, determine the user operation type. If there is no user operation, or the user operation is a general operation, execute S213; if the user operation is an editing operation, execute S214.
[0129] S213, display the obtained calculation results, the remaining number of calculations and the remaining number of iterations, and execute S209.
[0130] S214, display the target calculation result, set the re-execution mark, and execute S201.
[0131] The beneficial effects and specific implementation methods of this embodiment can refer to the aforementioned embodiments and will not be described in detail here.
[0132] Although the present application provides method operation steps such as embodiments or flow charts, more or fewer operation steps may be included based on conventional or non-creative labor. The order of steps listed in this embodiment is only one way of executing the order of many steps and does not represent the only execution order. When the actual device or client product is executed, it can be executed in the order of the method shown in this embodiment or the accompanying drawings or in parallel (for example, in a parallel processor or multi-threaded processing environment).
[0133] The embodiment of the present application also provides a spreadsheet formula calculation anti-stuck device. Figure 3 A schematic diagram of the composition of an anti-stuck device calculated using a spreadsheet formula provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, the device may include: a determination module 301 , a first processing module 302 , and a second processing module 303 .
[0134] The determination module 301 is used to determine the formula to be calculated according to the electronic form; and determine the formula reference quantity of the formula to be calculated according to the formula to be calculated.
[0135] The first processing module 302 is used to determine the first formula according to the number of formula references, calculate the first formula, obtain and store the calculation result, update the first formula and the second formula, determine to respond to the user operation according to the first preset rule, and execute the first preset action according to the user's operation type; wherein the first formula includes a formula to be calculated whose number of formula references is zero, the second formula includes a formula to be calculated that references the first formula, the first preset rule includes every first preset time period, the operation type includes an editing operation and a general operation; according to the user's operation type, execute the first preset action, including: when the operation type is a general operation, continue to calculate the first formula until the first formula does not exist; when the operation type is an editing operation, execute the determination module.
[0136] The second processing module 303 is used to determine whether there is a circular reference formula and the preset number of iterations has not been reached, iteratively calculate the circular reference formula, determine to respond to the user operation according to the second preset rule, and execute the second preset action according to the user's operation type; wherein the circular reference formula is a formula to be calculated with a circular reference, and the second preset rule includes every second preset time period; according to the user's operation type, execute the second preset action, including: when the operation type is a general operation, continue to calculate the circular reference formula until the preset number of iterations is reached and stop calculating; when the operation type is an editing operation, execute the determination module.
[0137] In some possible embodiments, the first processing module 302, when executing the first preset action according to the user's operation type, is further used to: when the operation type is a general operation, display the obtained calculation result and the remaining calculation quantity; when the operation type is an editing operation, display the obtained calculation result. The second processing module 303, when executing the second preset action according to the user's operation type, is further used to: when the operation type is a general operation, continue to calculate the circular reference formula, display the obtained calculation result, the remaining calculation quantity and the remaining iteration quantity; when the operation type is an editing operation, display the obtained calculation result.
[0138] In some possible embodiments, the determination module 301 is further used to: determine the hierarchical association relationship of the formula to be calculated. The first processing module 302 and the second processing module 303, when the operation type is an editing operation and the obtained calculation result is displayed, are specifically used to: determine and display the target calculation result from the obtained calculation results according to the target formula to be calculated corresponding to the editing operation and the hierarchical association relationship of the target formula to be calculated.
[0139] In some possible embodiments, the first processing module 302 and the second processing module 303, when the operation type is an editing operation and the determination module is executed, are specifically used to: when the operation type is an editing operation, execute the determination module and set a re-execution mark. The determination module 301, when determining the formula to be calculated according to the electronic form, is used to: determine the formula to be calculated according to the electronic form, the hierarchical association relationship of the formula to be calculated, the formula to be calculated corresponding to the editing operation and the re-execution mark.
[0140] In some possible embodiments, the first preset rule further includes: every time the first preset formula is calculated, the number of times; the second preset rule further includes: every time the second preset formula is calculated, the number of times. The first processing module 302, when determining to respond to a user operation according to the first preset rule, is specifically used to: every time the first preset time period has passed, and / or, every time the first preset formula is calculated, determine the response to the user operation. The second processing module 303, when determining to respond to a user operation according to the second preset rule, is specifically used to: every time the second preset time period has passed, and / or, every time the second preset formula is calculated, determine the response to the user operation.
[0141] In some possible embodiments, the first processing module 302 and the second processing module 303 set calculated marks for cells corresponding to the calculation results when displaying the obtained calculation results.
[0142] In some possible embodiments, the operation type also includes pausing the calculation operation. The first processing module 302, when executing the first preset action according to the user's operation type, is further used to: when the operation type is pausing the calculation operation, stop the calculation and display the obtained calculation result. The second processing module 303, when executing the second preset action according to the user's operation type, is further used to: when the operation type is pausing the calculation operation, stop the calculation and display the obtained calculation result.
[0143] The beneficial effects and specific implementation methods of the device embodiment can be referred to the aforementioned method embodiment, and will not be described in detail here.
[0144] Some modules in the apparatus described in the present application can be described in the general context of computer executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, classes, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0145] The devices or modules described in the above application embodiments can be implemented by computer chips or entities, or by products with certain functions. For the convenience of description, the above devices are described in various modules according to their functions. When implementing the embodiments of the present application, the functions of each module can be implemented in the same or multiple software and / or hardware. Of course, the module that implements a certain function can also be implemented by combining multiple sub-modules or sub-units.
[0146] The methods, devices or modules described in this application can be implemented in the form of computer-readable program codes. The controller can be implemented in any appropriate manner. For example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program codes (such as software or firmware) that can be executed by the (micro)processor, logic gates, switches, application-specific integrated circuits (English: Application Specific Integrated Circuit; Abbreviation: ASIC), programmable logic controllers and embedded microcontrollers. Examples of controllers include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20 and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in the form of pure computer-readable program codes, the controller can be implemented in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers and embedded microcontrollers by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included in it for implementing various functions can also be regarded as structures within the hardware component. Or even, the means for realizing various functions may be regarded as both a software module for realizing the method and a structure within a hardware component.
[0147] An embodiment of the present application further provides a device, comprising: a processor; a memory for storing processor executable instructions; when the processor executes the executable instructions, the method described in the embodiment of the present application is implemented.
[0148] The embodiments of the present application also provide a non-volatile computer-readable storage medium on which a computer program or instruction is stored. When the computer program or instruction is executed, the method described in the embodiments of the present application is implemented.
[0149] In addition, each functional module in each embodiment of the present invention may be integrated into one processing module, or each module may exist independently, or two or more modules may be integrated into one module.
[0150] The above storage media include but are not limited to random access memory (RAM), read-only memory (ROM), cache, hard disk drive (HDD) or memory card. The memory can be used to store computer program instructions.
[0151] It can be seen from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus necessary hardware. Based on this understanding, the technical solution of the present application can be essentially or partly reflected in the prior art in the form of a software product, or it can be reflected in the implementation process of data migration. The computer software product can be stored in a storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a mobile terminal, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.
[0152] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. All or part of this application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, mobile communication terminals, multi-processor systems, microprocessor-based systems, programmable electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc.
[0153] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit the present application. Although the present application has been described in detail with reference to the aforementioned embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some or all of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the present application.
Claims
1. A method for preventing electronic spreadsheet formula calculation from getting stuck, characterized in that: include: A determination step, the determination step comprising: S101, determining a formula to be calculated according to a spreadsheet; S102, determining the formula reference quantity of the formula to be calculated according to the formula to be calculated; S103, determining a first formula according to the number of formula references, calculating the first formula, obtaining and storing the calculation result, and updating the first formula and the second formula; determining a response to a user operation according to a first preset rule, and performing a first preset action according to the user's operation type; wherein the first formula includes a formula to be calculated whose number of formula references is zero, and the second formula includes a formula to be calculated that references the first formula, and the first preset rule includes every first preset time period, and the operation type includes an editing operation and a general operation, wherein the editing operation is an operation that affects the content of the electronic form, and the general operation is an operation that does not affect the content of the electronic form; The performing of the first preset action according to the user's operation type includes: when the operation type is a general operation, continuing to calculate the first formula until the first formula does not exist in the electronic form; when the operation type is an editing operation, performing the determining step; S104, when the first formula does not exist, it is determined that there is a circular reference formula and the preset number of iterations has not been reached, iteratively calculating the circular reference formula, determining to respond to the user operation according to a second preset rule, and executing a second preset action according to the user's operation type; wherein the circular reference formula is a formula to be calculated with a circular reference, and the second preset rule includes every second preset time period; The second preset action is executed according to the user's operation type, including: when the operation type is a general operation, continuing to calculate the circular reference formula until the preset number of iterations is reached and stopping the calculation; when the operation type is an editing operation, executing the determination step.
2. The method according to claim 1, characterized in that The performing of the first preset action according to the user's operation type further includes: when the operation type is a general operation, displaying the obtained calculation result and the remaining calculation quantity; when the operation type is an editing operation, displaying the obtained calculation result; The executing of the second preset action according to the user's operation type also includes: when the operation type is a general operation, continuing to calculate the circular reference formula, displaying the obtained calculation results, the remaining number of calculations and the remaining number of iterations; when the operation type is an editing operation, displaying the obtained calculation results.
3. The method according to claim 1, characterized in that: Before determining the first formula according to the formula reference quantity, calculating the first formula, obtaining the calculation result and storing it, the method further includes: determining the hierarchical association relationship of the formula to be calculated; When the operation type is an edit operation, the obtained calculation results are displayed, including: According to the target formula to be calculated corresponding to the editing operation and the hierarchical association relationship of the target formula to be calculated, the target calculation result is determined from the obtained calculation results and displayed.
4. The method according to claim 3, characterized in that When the operation type is an editing operation, executing the determining step includes: When the operation type is an editing operation, executing the determining step and setting a re-execution flag; Determining the formula to be calculated according to the electronic spreadsheet includes: The formula to be calculated is determined according to the electronic form, the hierarchical association relationship of the formula to be calculated, the formula to be calculated corresponding to the editing operation and the re-execution mark.
5. The method according to claim 1, characterized in that: The first preset rule also includes: the number of times the first preset formula is calculated; the second preset rule also includes: the number of times the second preset formula is calculated; The determining the response to the user operation according to the first preset rule includes: determining the response to the user operation every time a first preset time period has passed and / or every time a first preset formula is calculated a number of times; Determining the response to the user operation according to the second preset rule includes: determining the response to the user operation every time a second preset time period has passed and / or every time a second preset formula is calculated a number of times.
6. The method according to claim 2, characterized in that The method further comprises: When displaying the obtained calculation results, a calculated mark is set for the cell corresponding to the calculation result.
7. The method according to claim 1, characterized in that The operation type also includes a pause calculation operation, and the performing of the first preset action according to the user's operation type also includes: when the operation type is a pause calculation operation, stopping the calculation and displaying the obtained calculation result; The performing of the second preset action according to the user's operation type further includes: when the operation type is to pause the calculation operation, stopping the calculation and displaying the obtained calculation result.
8. An anti-stuck device for electronic spreadsheet formula calculation, characterized in that: include: A determination module, used for determining a formula to be calculated according to a spreadsheet; According to the formula to be calculated, determining the formula reference quantity of the formula to be calculated; A first processing module is used to determine a first formula according to the number of formula references, calculate the first formula, obtain and store the calculation result, update the first formula and the second formula, determine to respond to the user operation according to a first preset rule, and execute a first preset action according to the user's operation type; wherein the first formula includes a formula to be calculated whose number of formula references is zero, and the second formula includes a formula to be calculated that references the first formula, and the first preset rule includes that every time a first preset time has passed, the operation type includes an editing operation and a general operation, the editing operation is an operation that affects the content of the electronic form, and the general operation is an operation that does not affect the content of the electronic form; the execution of the first preset action according to the user's operation type includes: when the operation type is a general operation, continue to calculate the first formula until the first formula does not exist; when the operation type is an editing operation, execute the determination module; A second processing module is used to determine, when the first formula does not exist, that there is a circular reference formula and the preset number of iterations has not been reached, iteratively calculate the circular reference formula, determine to respond to the user operation according to a second preset rule, and execute a second preset action according to the user's operation type; wherein the circular reference formula is a formula to be calculated with a circular reference, and the second preset rule includes every second preset time period; the second preset action is executed according to the user's operation type, including: when the operation type is a general operation, continue to calculate the circular reference formula until the preset number of iterations is reached and stop the calculation; when the operation type is an editing operation, execute the determination module.
9. A device for executing a method for preventing a spreadsheet formula from being stuck, characterized in that: include: processor; a memory for storing processor-executable instructions; When the processor executes the executable instructions, the method according to any one of claims 1 to 7 is implemented.
10. A non-volatile computer-readable storage medium, characterized in that: The device comprises a computer program or an instruction for storing the computer program or the instruction, which, when executed, enables the method according to any one of claims 1 to 7 to be implemented.
Citation Information
Patent Citations
Data display optimization method and device, terminal equipment and storage medium
CN107704576A
Custom formula execution method and related equipment
CN114742030A