CN115658144A - Spreadsheet formula on-demand calculation method and device - Google Patents

Spreadsheet formula on-demand calculation method and device Download PDF

Info

Publication number
CN115658144A
CN115658144A CN202211575907.1A CN202211575907A CN115658144A CN 115658144 A CN115658144 A CN 115658144A CN 202211575907 A CN202211575907 A CN 202211575907A CN 115658144 A CN115658144 A CN 115658144A
Authority
CN
China
Prior art keywords
cell
target cell
cells
value
parameters
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202211575907.1A
Other languages
Chinese (zh)
Other versions
CN115658144B (en
Inventor
翟晨辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xi'an Grape City Software Co ltd
Original Assignee
Xi'an Grape City Software Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xi'an Grape City Software Co ltd filed Critical Xi'an Grape City Software Co ltd
Priority to CN202211575907.1A priority Critical patent/CN115658144B/en
Publication of CN115658144A publication Critical patent/CN115658144A/en
Application granted granted Critical
Publication of CN115658144B publication Critical patent/CN115658144B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application discloses a spreadsheet formula on-demand calculation method and device, and belongs to the technical field of spreadsheet information processing. The method specifically comprises the following steps: creating a storage unit for each cell of the spreadsheet; the storage unit is used for storing cache values, states and formulas of the cells, and the states comprise state parameters: valid parameters and invalid parameters; when the value of one cell is changed, setting the state parameters of the changed cell and all the subsequent cells on the dependency chain as invalid parameters; and when the value of the target cell is obtained, if the target cell has a formula and the state parameter is an invalid parameter, executing an updating step. The method realizes the on-demand calculation of the cells in the spreadsheet and avoids the problems of system blockage and repeated calculation caused by updating a large amount of data in the spreadsheet at one time.

Description

Spreadsheet formula on-demand calculation method and device
Technical Field
The application relates to the technical field of spreadsheet information processing, in particular to a spreadsheet formula on-demand calculation method and device.
Background
Spreadsheets are a class of computer programs or components that can input and output, display data, and manipulate data in an electronic device. Spreadsheets are typically made up of one or more worksheets, each worksheet being made up of a number of rows and columns that intersect to form cells, each cell being identified by its row and column number (also called the cell address). Various types of information can be input and displayed in the cells, including: numerical values, characters, dates, images, links, mathematical formulas, objects and the like, and incidence relations can be established among all the cells, so that the method is widely applied to the fields of intelligent office, data management, statistics and the like.
The cells of the spreadsheet can be related by formulas to realize mathematical operations. When the value in one cell changes, other cells that depend on it need to be recalculated. In the prior art, after the value of one cell is changed, the values of all cells having a dependency relationship with the cell are automatically updated at one time, but when the number of cells depending on the cell is very large, a large number of cells are time-consuming to calculate, and the load of a processor is increased, so that obvious blockage occurs, and user experience is affected. On the other hand, the updated cell data is not used completely, and the method of one-time complete update increases many unnecessary calculations, and even may cause repeated calculations, which increases unnecessary processing time and processing cost, and causes waste of computing resources.
Disclosure of Invention
The embodiment of the application provides a spreadsheet formula on-demand calculation method and device, and solves the problems that in the prior art, after the value of a cell is changed, the cell depending on the spreadsheet formula can be updated all at one time, the processor load is increased by calculating a large amount of data, and the data in a large number of cells which are not used for the moment can be updated, so that unnecessary processing time and processing cost are increased, and the waste of calculation resources is caused. According to the method and the device, the cells in the electronic table are calculated as required, and the cells can be calculated only when the data in the cells or the cells appear in the visible area during interface refreshing, so that unnecessary cell calculation is reduced, system blockage is avoided, and user experience is improved.
In a first aspect, an embodiment of the present application provides an on-demand spreadsheet formula calculating method, including: creating a storage unit for each cell of the spreadsheet; the storage unit is used for storing cache values, states and formulas of the cells, and the states comprise state parameters: valid parameters and invalid parameters; when the value of one cell changes, setting the state parameters of the cell with the changed value and all the following cells on the dependency chain thereof as the invalid parameters; when the value of a target cell is obtained, if the formula exists in the target cell and the state parameter is the invalid parameter, executing an updating step; the updating step includes: determining a dependent cell of the target cell, and updating the target cell according to the dependent cell of the target cell and the storage unit; changing the updated state parameter of the target cell to the valid parameter.
With reference to the first aspect, in a first possible implementation manner, the spreadsheet further includes a valuation function and a value function; the assignment function is used for changing the values in the cells, and the dereferencing function is used for obtaining the values in the cells.
With reference to the first possible implementation manner of the first aspect, in a second possible implementation manner, the obtaining of the value of the target cell includes obtaining a value of the target cell by the value function or a visible area appearing in a refresh interface.
With reference to the first aspect, in a third possible implementation manner, the cache value is used to store a latest update result of the cell.
With reference to the first aspect, in a fourth possible implementation manner, the updating the target cell according to the dependent cell and the storage unit of the target cell includes: calculating the target cell according to the formula of the target cell and the dependent cell thereof by using a calculation engine; and storing the calculation result into the cache value of the target cell and returning the calculation result to the target cell.
With reference to the fourth possible implementation manner of the first aspect, in a fifth possible implementation manner, the updating the target cell according to the dependent cell and the storage unit of the target cell further includes: and if the dependent cells have the dependency relationship, updating the dependent cells until the state parameters of all the predecessor cells of the target cells on the dependency chain are the effective parameters.
In a second aspect, an embodiment of the present application provides an on-demand spreadsheet formula calculating apparatus, including: the system comprises a creating storage unit module, a storing unit module and a processing module, wherein the creating storage unit module is used for creating a storage unit for each cell of the spreadsheet; the storage unit is used for storing cache values, states and formulas of the cells, and the states comprise state parameters: valid parameters and invalid parameters; a modified parameter module, configured to, when a value of one of the cells changes, set the state parameters of the cell with the changed value and all subsequent cells on its dependency chain as the invalid parameter; the updating module is used for executing an updating step if the target cell has the formula and the state parameter is the invalid parameter when the value of the target cell is obtained; the updating step includes: determining a dependent cell of the target cell, and updating the target cell according to the dependent cell and the storage unit of the target cell; changing the updated state parameter of the target cell to the valid parameter.
With reference to the second aspect, in a first possible implementation manner, the spreadsheet further includes a valuation function and a value function; the assignment function is used for changing the values in the cells, and the dereferencing function is used for obtaining the values in the cells.
With reference to the first possible implementation manner of the second aspect, in a second possible implementation manner, the obtaining of the value of the target cell includes obtaining the value of the target cell by the value function or a visible area appearing in a refresh interface.
With reference to the second aspect, in a third possible implementation manner, the cache value is used to store a latest update result of the cell.
With reference to the second aspect, in a fourth possible implementation manner, the updating the target cell according to the dependent cell and the storage unit of the target cell includes: calculating the target cell according to the formula of the target cell and the dependent cell thereof by using a calculation engine; and storing the calculation result into the cache value of the target cell and returning the calculation result to the target cell.
With reference to the fourth possible implementation manner of the second aspect, in a fifth possible implementation manner, the updating the target cell according to the dependent cell and the storage unit of the target cell further includes: and if the dependent cells have the dependency relationship, updating the dependent cells until the state parameters of all the predecessor cells of the target cells on the dependency chain are the effective parameters.
In a third aspect, an embodiment of the present application provides an apparatus, where the apparatus includes: a processor; a memory for storing processor-executable instructions; the processor, when executing the executable instructions, performs the method as described in the first aspect or any possible implementation manner of the first aspect.
In a fourth aspect, embodiments of the present application provide a non-transitory computer-readable storage medium, which includes a program or instructions for storing a computer program or instructions, which, when executed, cause a method according to the first aspect or any one of the possible implementations of the first aspect to be implemented.
One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:
according to the embodiment of the application, a spreadsheet formula on-demand calculation method and a spreadsheet formula on-demand calculation device are adopted, a storage unit is established for each cell in a spreadsheet, when data in the spreadsheet are changed, only state parameters of cells on a dependency chain are changed, whether the cells are updated or not is judged, updating of cells which are not used currently is delayed, only data in the cells which are used currently is updated, the situation that system blocking is caused by updating a large amount of data at one time is avoided, meanwhile, repeated calculation can be avoided for the established cell storage unit, spreadsheet on-demand calculation is achieved by combining the establishment of the cell storage unit and the updating delay, the problem that all cells with dependency relationships are updated at one time is effectively solved, the problem that system blocking is caused by overlarge calculated amount, the calculation performance can be improved, and unnecessary processing time and processing cost are reduced.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments of the present application or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a flow chart of a spreadsheet formula on-demand calculation method provided by an embodiment of the present application;
FIG. 2 is a schematic step diagram of an update step provided in an embodiment of the present application;
FIG. 3 is a schematic diagram illustrating a step of updating target sheets and lattices according to an embodiment of the present application;
FIG. 4 is a method roadmap for an on-demand spreadsheet formula calculation method provided by embodiments of the present application;
FIG. 5 is a schematic diagram of an on-demand spreadsheet formula computing device according to an embodiment of the present application;
fig. 6 is a schematic diagram of a spreadsheet dependency provided by an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It is to be understood that the embodiments described are only a few embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Some of the techniques involved in the embodiments of the present application are described below to aid in understanding, and they should be considered merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
The spreadsheet establishes the relationship between cells through formulas, and after a value in one cell changes, other cells depending on it need to be recalculated. In the embodiments of the present application, all cells that depend on a cell are referred to as successor cells, and all cells that are depended on by the cell are referred to as predecessor cells. As shown in fig. 6, B1 has the formula: = A1+2, C1 has the formula: b1 × 2, D1 has the formula: = E1 × 2. We can get such dependencies: b1 depends on A1, C1 depends on B1, and D1 depends on E1. From the above dependency relationships, it can be determined that in both dependency chains: c1- > B1- > A1 and D1- > E1. In the dependency chain C1- > B1- > A1, cell C1 is a successor cell of cell B1, and cell A1 is a predecessor cell of cell B1. When the value in cell A1 changes, subsequent cells B1 and C1 on the dependency chain need to be recalculated; when the value in the cell B1 changes, only the successor cell C1 needs to be recalculated, and the predecessor cell A1 does not need; when the value in cell E1 changes, the subsequent cell D1 on the dependency chain needs to be recalculated. The C1- > B1- > A1 and D1- > E1 are an expression form of a dependency chain in the embodiment of the present application, where "- >" is used to indicate a unidirectional dependency relationship between cells, and "<" - "may also be used to identify a unidirectional dependent relationship between cells, and a person skilled in the art may adopt other various forms when explaining a dependency chain, and is not used to specifically limit the protection scope of the embodiment of the present application.
On the other hand, a cell in the spreadsheet where no formula exists may have its value modified, and other cells that depend on a formula to calculate a value may actually be formulas, and only the calculation result of the formula is displayed in the cell, and a cell in the spreadsheet may have its formula modified or may have its formula modified to a specific value, but the cell will lose all its predecessor cells after the formula is modified to the specific value. Wherein the values in the cells may be text, boolean types or others in addition to formulas and numeric values. In the spreadsheet shown in fig. 6, since no formula exists in the cells A1 and E1, the numerical values in the cells can be directly modified, and since no formula exists in the cells A1 and E1, the numerical values in the cells B1, C1, and D1 can be directly obtained when the interface is refreshed or obtained, the cells with the formula need to be judged whether to be updated when the interface is refreshed or the cell values are obtained, so as to determine whether to update the values in the cells.
FIG. 1 is a flowchart of an on-demand spreadsheet formula calculation method according to an embodiment of the present application, including step 101 to step 103. FIG. 1 is only one execution sequence shown in the embodiment of the present application, and does not represent the only execution sequence of the spreadsheet formula on-demand calculation method, and the steps shown in FIG. 1 can be executed in parallel or reversed in case of achieving the final result.
Step 101: creating a storage unit for each cell of the spreadsheet; the storage unit is used for storing cache values, states and formulas of the cells, and the states comprise state parameters: valid parameters and invalid parameters. The method comprises the following specific steps:
in the embodiment of the application, three storage units are arranged for each cell, and Value, status and Formula, that is, a cache Value, a state and a Formula are stored respectively, the state includes two state parameters, that is, an effective parameter and an invalid parameter, the effective parameter is used for representing the effective state, the invalid parameter is used for representing the invalid state, the effective parameter is Valid, and the invalid parameter is Dirty. The cached value of the cell is used to store the latest update result of the cell. The spreadsheet also comprises an assignment function and a value function; the valuation function is used for changing the value in the cell, and the valuing function is used for obtaining the value in the cell. In the embodiment of the application, the assignment function uses SetValue (), the value function uses GetValue (), the cell is not calculated and updated when the assignment function SetValue (object value) is used, and only when the value is obtained by using GetValue (), whether the cell needs to be calculated is judged, and calculation is triggered. Even if the value in a certain cell is changed for countless times, the cell depending on the cell cannot be updated immediately along with the change of the cell, and the cell is judged and updated once only when the cell is obtained, so that the system efficiency can be greatly improved, and multiple calculations are avoided. Wherein, value, status, formula, valid, dirty, setValue () and GetValue () in the embodiments of the present application are only examples, and do not serve as limitations to the embodiments of the present application, and a person skilled in the art should understand them as a name, which can be modified according to actual situations.
Step 102: when the value of one of the cells changes, the state parameters of the cell with the changed value and all the subsequent cells on the chain of which the cell depends are set as invalid parameters. Specifically, when the value in one cell is changed, the dependency chain of the cell with the changed value is determined, the state parameters of the cell and all the subsequent cells on the dependency chain of the cell are changed into invalid parameters, only the cells with the invalid state parameters on the dependency chain are updated in the subsequent updating process, and other cells or the cells with the valid state parameters do not need to be calculated. The formula of the cell without the formula in the embodiment of the application is null in the storage unit established for the cell, and null is used for representing the cell. On the other hand, there are various ways to confirm the dependency chain and establish the dependency chain in the prior art, which are not described in detail herein, and the embodiments of the present application only obtain the accurate dependency relationship according to the dependency chain, and further use the dependency chain to update data, and do not limit the establishment method and the confirmation method of the dependency chain.
Step 103: and when the value of the target cell is obtained, if the target cell has a formula and the state parameter is an invalid parameter, executing an updating step. As shown in steps 403 to 405 in fig. 4, the target cell is determined when the value in the target cell is obtained, and the calculation step is performed only when the target cell has the formula and the status parameter is an invalid parameter. If the target cell does not have a formula or the state parameter is a valid parameter, the value can be directly obtained. As shown in fig. 2, the updating step includes steps 201 to 202, which are specifically as follows:
step 201: and determining a dependent cell of the target cell, and updating the target cell according to the dependent cell and the storage unit of the target cell. As shown in fig. 3, updating the target cell according to the dependent cell and the storage unit of the target cell includes steps 301 to 302, which are as follows:
step 301: and calculating the target cell according to the formula of the target cell and the dependent cell thereof by using a calculation engine. And calling a calculation engine to calculate the target cell according to the formula of the target cell and the value in the dependent cell. As shown in steps 407 to 410 in fig. 4, when obtaining a value in a first dependent cell, it is further required to determine whether a second dependent cell exists in the first dependent cell of the target cell, and if the second dependent cell does not exist in the first dependent cell, directly returning the value in the first dependent cell and substituting the value into a formula for calculation; and if the first dependent cell has a second dependent cell, judging and calculating the first dependent cell according to the updating steps 403 to 410 of the target cell, and if the second dependent cell also has a third dependent cell, performing iterative calculation by taking the second dependent cell as the first dependent cell until the values in all the precursor cells of the target cell are calculated. The computing engine is in a working state in a default state, but a user can control the computing engine to stop working according to a preset API, so that in order to ensure that the step can be correctly executed when the computing engine is used, a person skilled in the art can add a step of judging whether the computing engine works according to actual conditions, and the method still belongs to the protection scope of the invention.
Step 302: and storing the calculation result into the cache value of the target cell and returning the calculation result to the target cell. Specifically, the calculation result calculated by the calculation engine in step 201 is stored in the cache value of the target cell, and then the calculation result is returned to the target cell.
Step 202: and changing the updated state parameters of the target cells into effective parameters. Specifically, after a cell whose state parameter is an invalid parameter is updated, the state parameter of the cell needs to be changed to a valid parameter. In step 301, if there are dependent cells in the dependent cells of the current target cell, it is necessary to iteratively calculate values in all predecessor cells, and change the state parameters of the dependent cells after each calculation into effective parameters until the state parameters of all predecessor cells in the dependency chain are all effective parameters. In the embodiment of the application, as long as the state parameter of the cell is an effective parameter, the cell does not need to be calculated and updated when the value taking judgment is carried out, but the cache value is returned to the value taking function, so that unnecessary repeated calculation is avoided.
The step 103 of obtaining the value of the target cell includes obtaining the value of the target cell by the value function or a visible area appearing in the refresh interface. Specifically, in the embodiment of the present application, the calculation is postponed, that is, after the values in the cells are changed by the assignment function, the subsequent cells of all the cells with the changed values are not updated immediately, and when the cells are valued by the value function, it is determined whether the cells need to be updated and calculated according to the established storage unit, the cells obtained by the value function are target cells, and the target cells include a single cell with the value obtained by the value function or a cell with the value obtained by the value function in the visible area when the interface is refreshed. When the value in one cell is changed, the system sends an asynchronous message for refreshing the interface, a large amount of updating calculation is triggered when the interface is refreshed, but the data in the whole electronic form is very much, a user can only see dozens of cells in the current visible area, so that the value taking function only obtains the value in one cell in the current visible area when the interface is refreshed, the purpose of updating the cells in the visible area is achieved, other cells can postpone calculation, and the value is obtained again for updating calculation when the cells appear in the visible area of the interface, so that a large amount of cell updating is postponed, only dozens of cells in the visible area need to be calculated each time, and the calculation workload of each updating of the system is effectively reduced.
It should be noted that, in the embodiment of the present application, the dependency chain mentioned in updating the calculation is not necessarily the whole complete dependency chain, and also includes a segment of the dependency chain on the whole dependency chain. Specifically, in step 102, the state parameters of the cell with the changed value and all the following cells on the dependency chain thereof are set as invalid parameters, where the dependency chain is the entire complete dependency chain, and in other steps of performing update calculation, the mentioned dependency chain is the section of dependency chain from the cell with the changed value to the target cell with the obtained value. For example, if there is a dependency chain F1- > E1- > D1- > C1- > B1- > A1, after the value in the cell A1 is changed, the state parameters of all cells on the dependency chain need to be modified to be invalid parameters, and when the value in the cell D1 is obtained, the determined dependency chain is the dependency chain from the predecessor cell A1 to the cell D1 of the cell D1. The difference between the two implementation processes can be recognized by those skilled in the art according to the method idea of the on-demand computation in the embodiment of the present application.
Although the present application provides method steps as described in an embodiment or flowchart, additional or fewer steps may be included based on conventional or non-inventive efforts. The sequence of steps recited in this embodiment is only one of many steps in execution sequence, and does not represent a unique order of execution. When the device or the client product in practice executes, it can execute sequentially or in parallel according to the method shown in the embodiment or the figures (for example, in the context of parallel processors or multi-thread processing).
As shown in fig. 5, an embodiment of the present application further provides a spreadsheet formula on-demand computing device 500. The device comprises: a create memory location module 501, a modify parameter module 502, and an update module 503.
The create storage unit module 501 is used for creating storage units for each cell of the spreadsheet; the storage unit is used for storing cache values, states and formulas of the cells, and the states comprise state parameters: valid parameters and invalid parameters. The create memory cell module 501 is specifically configured to set three memory cells for each cell, and respectively store a cache value, a state, and a formula. The state comprises two state parameters, namely an effective parameter and an ineffective parameter, the effective parameter is used for representing the effective state, and the ineffective parameter is used for representing the ineffective state. The cell cache value is used to store the latest cell update result. The spreadsheet also comprises an assignment function and a value function; the assignment function is used to change the values in the cells, and the dereferencing function is used to obtain the values in the cells. In the embodiment of the application, the assigning function uses SetValue (), the value taking function uses GetValue (), the cell is not calculated and updated when the assigning function SetValue (object value) is used, and only when the GetValue () is used to obtain a value, whether the cell needs to be calculated is judged, and calculation is triggered.
The modify parameter module 502 is used to set the status parameters of the cells with changed values and all subsequent cells on their dependency chain as the invalid parameter when the value of one of the cells changes. The modified parameter module 502 is specifically configured to, when a value in a cell is changed, determine a dependency chain of the cell whose value is changed, set the state parameters of the cell and all subsequent cells on the dependency chain as invalid parameters, only update the subsequent cells on the dependency chain in a subsequent update process, and the cells whose other unrelated or unchanged state parameters are not required to be calculated.
The updating module 503 is configured to, when obtaining the value of the target cell, if the formula exists in the target cell and the status parameter is the invalid parameter, execute an updating step; the updating step comprises: determining a dependent cell of the target cell, and updating the target cell according to the dependent cell and the storage unit of the target cell; changing the updated state parameter of the target cell into the valid parameter. The updating module 503 is specifically configured to determine the target cell according to the storage unit when obtaining the value in the target cell, and perform the updating step only when the target cell has the formula and the status parameter is an invalid parameter. The updating module 503 updates the target cell with the dependent cell and the storage unit of the target cell, and is specifically configured to calculate the target cell according to the formula of the target cell and the dependent cell thereof by using a calculation engine; and storing the calculation result into the cache value of the target cell and returning the calculation result to the target cell. The method specifically comprises the steps of determining a dependent cell of a target cell according to a determined dependent chain of the target cell, and calling a calculation engine to calculate the target cell according to a formula of the target cell and a value in the dependent cell. And storing the calculation result into the cache value of the target cell, returning the calculation result to the target cell, and changing the state parameter of the target cell into an invalid parameter. If the dependent cells of the current target cell still have dependent cells, values in all predecessor cells need to be calculated in an iterative mode, and the state parameters of the dependent cells after calculation is completed each time are changed into effective parameters until the state parameters of all predecessor cells on the dependent chain are all the effective parameters. In the embodiment of the application, as long as the state parameter of the cell is an effective parameter, the cell does not need to be calculated and updated when the value taking judgment is carried out, but the cache value is returned to the value taking function, so that unnecessary repeated calculation is avoided.
The storage medium includes, but is not limited to, a Random Access Memory (RAM), a Read-Only Memory (ROM), a Cache, a Hard disk (Hard disk), or a Memory card (HDD). The memory may be used to store computer program instructions.
The apparatuses or modules illustrated in the above embodiments may be specifically implemented by a computer chip or an entity, or implemented by a product with certain functions. For convenience of description, the above devices are described as being divided into various modules by functions, which are described separately. The functionality of the modules may be implemented in the same one or more software and/or hardware implementations of the present application. Of course, a module that implements a certain function may also be implemented by a plurality of sub-modules or a combination of sub-units.
The methods, apparatus or modules described herein may be implemented in a computer readable program code means for a controller in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, application Specific Integrated Circuits (ASICs), programmable logic controllers and embedded microcontrollers, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, atmel AT91SAM, microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may therefore be considered as a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be conceived to be both a software module implementing the method and a structure within a hardware component.
An embodiment of the present application further provides an apparatus, including: a processor; a memory for storing processor-executable instructions; when the processor executes the executable instructions, the method according to the embodiment of the application is realized.
Embodiments of the present application also provide a non-transitory computer-readable storage medium having stored thereon a computer program or instructions, which, when executed, cause the method as described in embodiments of the present application to be implemented.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing module, or each of the modules may exist alone, or two or more modules may be integrated into one module.
The storage medium includes, but is not limited to, a Random Access Memory (RAM), a Read-Only Memory (ROM), a Cache, a Hard disk (Hard disk), or a Memory card (HDD). The memory may be used to store computer program instructions.
From the above description of the embodiments, it is clear to those skilled in the art that the present application can be implemented by software plus necessary hardware. Based on such understanding, the technical solution of the present application, which essentially or contributes to the prior art, may be embodied in the form of a software product, and may also be embodied in the implementation process of data migration. The computer software product may be stored in a storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, mobile terminal, server, or network device, etc.) to perform the methods described in the various embodiments or portions of the embodiments of the present application.
The embodiments in the present specification are described in a progressive manner, and the same or similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. All or portions of the present application are operational with numerous general purpose or special purpose computing system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, mobile communication terminals, multiprocessor systems, microprocessor-based systems, programmable electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like.
The above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the present application; although the present application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; such modifications or substitutions do not depart from the spirit and scope of the present disclosure.

Claims (9)

1. An on-demand spreadsheet formula calculation method, comprising:
creating a storage unit for each cell of the spreadsheet; the storage unit is used for storing cache values, states and formulas of the cells, and the states comprise state parameters: valid parameters and invalid parameters;
when the value of one cell changes, setting the state parameters of the cell with the changed value and all the following cells on the dependency chain thereof as the invalid parameters;
when the value of a target cell is obtained, if the formula exists in the target cell and the state parameter is the invalid parameter, executing an updating step; the updating step includes: determining a dependent cell of the target cell, and updating the target cell according to the dependent cell of the target cell and the storage unit; changing the updated state parameter of the target cell into the valid parameter.
2. The method of claim 1, wherein the spreadsheet further comprises a valuation function and a valuation function;
the assignment function is used for changing the values in the cells, and the dereferencing function is used for obtaining the values in the cells.
3. The method of claim 2, wherein the obtaining the value of the target cell comprises obtaining the value of the target cell by the value function or a visible area appearing when the interface is refreshed.
4. The method of claim 1, wherein the cache value is used to store a last cell update result.
5. The method of claim 1, wherein the updating the target cell according to the dependent cell and the storage unit of the target cell comprises:
calculating the target cell according to the formula of the target cell and the dependent cell thereof by using a calculation engine;
and storing the calculation result into the cache value of the target cell and returning the calculation result to the target cell.
6. The method of claim 5, wherein the updating the target cell according to the dependent cell and the storage unit of the target cell, further comprises:
and if the dependent cells have the dependency relationship, updating the dependent cells until the state parameters of all the predecessor cells of the target cells on the dependency chain are the effective parameters.
7. An on-demand spreadsheet formula calculation device, comprising:
the creating storage unit module is used for creating storage units for each cell of the spreadsheet; the storage unit is used for storing cache values, states and formulas of the cells, and the states comprise state parameters: valid parameters and invalid parameters;
a modified parameter module, configured to, when a value of one of the cells changes, set the state parameters of the changed cell and all subsequent cells on its dependency chain as the invalid parameter;
the updating module is used for executing an updating step if the target cell has the formula and the state parameter is the invalid parameter when the value of the target cell is obtained; the updating step includes: determining a dependent cell of the target cell, and updating the target cell according to the dependent cell of the target cell and the storage unit; changing the updated state parameter of the target cell to the valid parameter.
8. An apparatus, comprising:
a processor;
a memory for storing processor-executable instructions;
the processor, when executing the executable instructions, implements the method of any of claims 1 to 6.
9. A non-transitory computer-readable storage medium comprising instructions for storing a computer program or instructions that, when executed, cause the method of any one of claims 1 to 6 to be implemented.
CN202211575907.1A 2022-12-09 2022-12-09 Electronic form formula on-demand calculation method and device Active CN115658144B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211575907.1A CN115658144B (en) 2022-12-09 2022-12-09 Electronic form formula on-demand calculation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211575907.1A CN115658144B (en) 2022-12-09 2022-12-09 Electronic form formula on-demand calculation method and device

Publications (2)

Publication Number Publication Date
CN115658144A true CN115658144A (en) 2023-01-31
CN115658144B CN115658144B (en) 2023-05-02

Family

ID=85020095

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211575907.1A Active CN115658144B (en) 2022-12-09 2022-12-09 Electronic form formula on-demand calculation method and device

Country Status (1)

Country Link
CN (1) CN115658144B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090228776A1 (en) * 2008-03-05 2009-09-10 Microsoft Corporation Dynamic formulas for spreadsheet cells
CN102939585A (en) * 2010-06-15 2013-02-20 微软公司 Creating text functions from a spreadsheet
CN107766314A (en) * 2017-10-20 2018-03-06 网易(杭州)网络有限公司 The data processing method and device of electrical form
CN108268564A (en) * 2017-01-04 2018-07-10 珠海金山办公软件有限公司 The asynchronous computing method and device of network function in electrical form
CN110008447A (en) * 2019-03-26 2019-07-12 湖南华美信息系统有限公司 The processing method and processing device of electrical form
CN112819309A (en) * 2021-01-25 2021-05-18 江西五十铃汽车有限公司 Employee performance scoring and payroll calculation system based on EXCEL software
CN112905090A (en) * 2021-02-08 2021-06-04 北京字跳网络技术有限公司 Spreadsheet processing method, device, terminal and storage medium
CN113420537A (en) * 2021-06-22 2021-09-21 平安科技(深圳)有限公司 Method, device, equipment and storage medium for processing electronic form data
CN114281823A (en) * 2021-12-17 2022-04-05 北京百度网讯科技有限公司 Table processing method, device, equipment, storage medium and product

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090228776A1 (en) * 2008-03-05 2009-09-10 Microsoft Corporation Dynamic formulas for spreadsheet cells
CN101965564A (en) * 2008-03-05 2011-02-02 微软公司 The dynamic formula that is used for electronic form unit grid
CN102939585A (en) * 2010-06-15 2013-02-20 微软公司 Creating text functions from a spreadsheet
CN108268564A (en) * 2017-01-04 2018-07-10 珠海金山办公软件有限公司 The asynchronous computing method and device of network function in electrical form
CN107766314A (en) * 2017-10-20 2018-03-06 网易(杭州)网络有限公司 The data processing method and device of electrical form
CN110008447A (en) * 2019-03-26 2019-07-12 湖南华美信息系统有限公司 The processing method and processing device of electrical form
CN112819309A (en) * 2021-01-25 2021-05-18 江西五十铃汽车有限公司 Employee performance scoring and payroll calculation system based on EXCEL software
CN112905090A (en) * 2021-02-08 2021-06-04 北京字跳网络技术有限公司 Spreadsheet processing method, device, terminal and storage medium
CN113420537A (en) * 2021-06-22 2021-09-21 平安科技(深圳)有限公司 Method, device, equipment and storage medium for processing electronic form data
CN114281823A (en) * 2021-12-17 2022-04-05 北京百度网讯科技有限公司 Table processing method, device, equipment, storage medium and product

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
HIROYUKI AOKI: "A method of safe and efficient editing in tabular forms using a descriptive grammar of semantic structures" *
张忠华;李红岩;: "数据库与复杂电子表格间数据交换研究" *

Also Published As

Publication number Publication date
CN115658144B (en) 2023-05-02

Similar Documents

Publication Publication Date Title
US11568129B2 (en) Spreadsheet recalculation algorithm for directed acyclic graph processing
EP3893112A2 (en) Method and apparatus for scheduling deep learning reasoning engines, device, and medium
US20150205633A1 (en) Task management in single-threaded environments
US9600335B2 (en) Method and system for efficient execution of ordered and unordered tasks in multi-threaded and networked computing
CN111625546A (en) Data writing method, device, equipment and medium
CN113986497B (en) Queue scheduling method, device and system based on multi-tenant technology
CN110532045A (en) A kind of striding course call method and relevant apparatus
CN111625322A (en) Data processing method, system and equipment
CN115658144B (en) Electronic form formula on-demand calculation method and device
CN111555987B (en) Current limiting configuration method, device, equipment and computer storage medium
CN111736975A (en) Request control method and device, computer equipment and computer readable storage medium
CN113377295B (en) Data storage and reading method, device and equipment for multi-producer single-consumer
CN116243978A (en) Data protocol method, device, medium and training system in distributed training
CN114721876A (en) Data backup method, device and medium
CN112817992B (en) Method, apparatus, electronic device and readable storage medium for executing change task
CN113747423A (en) Cloud mobile phone state synchronization method, device, equipment, storage medium and program product
CN107562527B (en) Real-time task scheduling method for SMP (symmetric multi-processing) on RTOS (remote terminal operating system)
CN116244324B (en) Task data relation mining method and device, electronic equipment and storage medium
US10158580B2 (en) Utilizing access control data structures for sharing computing resources
CN115408164A (en) Application program management method and device, electronic equipment and storage medium
CN117971458A (en) Data analysis method, device, electronic equipment and storage medium
CN116204310A (en) Resource scheduling method, device, equipment and storage medium
CN111857995A (en) Process scheduling method and device, storage medium and electronic device
CN115578200A (en) Data processing method and device, electronic equipment and storage medium
CN117631923A (en) Curve change method and device based on key data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant