Table data processing method and device, medium, electronic equipment and program product
By encapsulating the parameters of spreadsheet formulas into calculation nodes and performing calculations based on node relationships, the problem of call stack overflow is solved, improving the performance and stability of spreadsheet formula calculations and ensuring the continuity of formula calculations and the traceability of anomalies.
Patent Information
- Application Number
- CN202511511816.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-21
- Publication Date
- 2026-01-20
AI Technical Summary
Existing spreadsheet formula calculations are prone to causing call stack overflows, especially when faced with recursive calls, which affects system stability and performance.
The parameters of the target expression are encapsulated into computation nodes that match the parameter types, and computation is performed based on the relationships between computation nodes. The calculation result of the cell is obtained through logical functions, thus avoiding stack overflow caused by deep call chains.
It enables continuous calculation of cell formulas without overflowing the stack, improving the performance and stability of formula calculation, keeping the complexity of formula calculation at O(n), and being able to trace the stack information of the call in abnormal situations.
Smart Images

Figure CN121365656A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of computer, in particular, to a data processing method and device of a table, a medium, an electronic device and a program product. BACKGROUND
[0002] In an electronic table, the performance and stability of formula calculation are crucial to user experience and system stability. However, the formula calculation of the related electronic table drives synchronous calculation through chain calling, which causes the call stack to be continuously deepened when the formula dependence in the electronic table is deep, and eventually causes the call stack to overflow. Moreover, when facing recursive calls, the call stack is also continuously deepened, thereby causing the call stack to overflow. SUMMARY
[0003] This summary is provided to introduce a selection of concepts that are further described below in the detailed description. This summary is not intended to identify key or essential features of the claimed subject matter, nor is it used to limit the scope of the claimed subject matter's scope.
[0004] In a first aspect, the present disclosure provides a data processing method of a table, comprising: determining a target expression corresponding to a formula included in a target cell; based on the target expression, encapsulating each parameter included in the target expression into a calculation node matched with a parameter type corresponding to the parameter, and executing the calculation nodes based on an association relationship between the calculation nodes to obtain a calculation result of the target cell, wherein the calculation node is used to calculate a calculation result corresponding to the parameter through a logical function matched with the parameter type.
[0005] In a second aspect, the present disclosure provides a data processing device of a table, comprising: a determination module configured to determine a target expression corresponding to a formula included in a target cell; a calculation module configured to, based on the target expression, encapsulate each parameter included in the target expression into a calculation node matched with a parameter type corresponding to the parameter, and execute the calculation nodes based on an association relationship between the calculation nodes to obtain a calculation result of the target cell, wherein the calculation node is used to calculate a calculation result corresponding to the parameter through a logical function matched with the parameter type.
[0006] In a third aspect, the present disclosure provides a computer-readable medium having a computer program stored thereon, the computer program being executed by a processing device to implement the steps of the method of the first aspect.
[0007] In a fourth aspect, the present disclosure provides an electronic device, comprising: a storage device having a computer program stored thereon; a processing device configured to execute the computer program in the storage device to implement the steps of the method of the first aspect.
[0008] In a fifth aspect, the present disclosure provides a computer program product comprising a computer program configured to implement the steps of the method of the first aspect when executed by a processor.
[0009] According to the above technical solution, by encapsulating each parameter included in the target expression corresponding to the formula included in the target cell into a calculation node matched with a parameter type corresponding to the parameter, the calculation node is configured to calculate a calculation result corresponding to the parameter by using a logical function matched with the parameter type, and then execute the calculation nodes based on the association relationship between the calculation nodes to obtain the calculation result of the target cell. The calculation result of the formula of the cell can be calculated by various types of calculation nodes, and the formula of the cell and the formula of the cell dependent on the formula can be continuously calculated without stack explosion in synchronous calculation. This not only improves the performance of formula calculation, but also guarantees the stability of formula calculation.
[0010] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF DRAWINGS
[0011] The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by describing in detail some embodiments with reference to the attached drawings. The same or similar reference numerals refer to the same or similar elements throughout the drawings. It is to be understood that the drawings are schematic, and the sizes of the elements and the like are not necessarily to scale. In the drawings: Figure 1 is a flowchart of a data processing method of a table according to some embodiments.
[0012] Figure 2 is a flowchart of a data processing method of a table according to yet some embodiments.
[0013] Figure 3 is a schematic diagram of a base class according to some embodiments.
[0014] Figure 4 is a structural schematic diagram of a data processing apparatus of a table according to some embodiments.
[0015] Figure 5 is a structural schematic diagram of an electronic device according to some embodiments. DETAILED DESCRIPTION
[0016] Embodiments of the present disclosure will be described below in greater detail with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is understood that the present disclosure can be embodied in various forms and should not be construed as being limited to the embodiments set forth herein, but rather, the embodiments are provided so that the present disclosure can be more thoroughly and completely understood. It should be understood that the drawings of the present disclosure and the embodiments are only for illustrative purposes and are not intended to limit the scope of protection of the present disclosure.
[0017] It should be understood that each step recited in the method embodiments of the present disclosure can be performed in different orders and / or in parallel. In addition, the method embodiments can include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0018] The term "comprising" and variations thereof as used herein are open-ended, that is, "comprising but not limited to." The term "based on" is "based, at least in part, on." The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments." Related terms are defined in the following description.
[0019] It should be noted that the terms "first", "second", and the like in the present disclosure are only used to distinguish different devices, modules or units, and are not intended to limit the order or interdependence of the functions performed by these devices, modules or units.
[0020] It should be noted that the terms "one", "multiple" in the present disclosure are illustrative and not limiting, and those skilled in the art should understand that unless otherwise explicitly stated in the context, it should be understood as "one or more".
[0021] The names of the messages or information exchanged between the devices in the embodiments of the present disclosure are only for illustrative purposes, and are not intended to limit the scope of the messages or information.
[0022] Figure 1 is a flowchart of a data processing method of a table according to some embodiments. As shown in Figure 1 The present disclosure provides a data processing method of a table, which can be specifically performed by a data processing device of a table, and the device can be implemented by software and / or hardware. As shown in Figure 1 The method can include the following steps.
[0023] In step 110, it is determined that the formula included in the target cell corresponds to a target expression.
[0024] Here, the target cell can refer to a cell selected by a user and requiring a formula calculation, and the formula included in the target cell can refer to a formula edited in the target cell. The target expression corresponding to the formula can refer to a mathematical expression that does not depend on specific symbols to determine the priority of operations.
[0025] Exemplarily, the target expression can be a reverse Polish expression. The reverse Polish expression describes the formula in the manner of a postfix expression. For example, the formula "a + (b - c)" corresponds to the target expression "a, b, c, -, +".
[0026] In step 120, based on the target expression, each parameter included in the target expression is encapsulated into a calculation node matching the parameter type corresponding to the parameter, and the calculation nodes are executed based on the association relationship between the calculation nodes to obtain the calculation result of the target cell, wherein the calculation node is used to calculate the calculation result corresponding to the parameter by a logical function matching the parameter type.
[0027] Here, for each parameter included in the target expression, the parameter is encapsulated into a calculation node matching the parameter type corresponding to the parameter. That is, parameters belonging to different parameter types will be encapsulated into different calculation nodes. Each calculation node is used to calculate the calculation result corresponding to the parameter by a logical function matching the parameter type. Different types of calculation nodes have different configured logical functions, and the corresponding calculation result can be calculated by the configured logical function. For example, for a parameter of a function type, the function can be encapsulated into a function calculation node, and the function calculation node is used to calculate the calculation result of the function.
[0028] The association relationship between the calculation nodes can refer to the parent-child relationship between the calculation nodes. For example, the calculation node y is a child calculation node of the calculation node x. Based on the association relationship between the calculation nodes, the calculation nodes are executed, which can be executing the parent calculation node corresponding to the child calculation node after executing the child calculation node, until the root calculation node is executed to obtain the calculation result corresponding to the target cell.
[0029] It should be noted that due to the special complexity of the formula, for different types of calculation nodes, different logical functions can be used to return the execution of the parent calculation node or generate a new calculation node. By combining different types of calculation nodes, the calculation result corresponding to the formula included in the target cell can be calculated.
[0030] If the formula included in the target cell depends on the calculation result of the formula included in the other cell, when the formula included in the dependent cell is calculated, the dependent cell can be taken as the target cell, and the calculation result corresponding to the dependent cell can be calculated based on the method provided in the above embodiments.
[0031] It is worth mentioning that in the embodiments of the present disclosure, by encapsulating the parameters in the target expression as the calculation nodes, the formula calculation is actually split into multiple calculation nodes, and executing each calculation node is equivalent to executing a calculation task. When a calculation node is executed, the corresponding parent calculation node or newly generated calculation node is returned. Thus, the deep formula call chain is converted into various types of calculation nodes with an association relationship for operation. Each time a calculation node is executed, only the parameters corresponding to the calculation node are stacked, thereby avoiding stack explosion.
[0032] For example, for the formula "1+2", the "+" corresponds to the function calculation node. When the function calculation node is executed, the calculation result obtained is 3, and the calculation result of the formula is obtained. Even if the formula of the target cell is more complex, different types of calculation nodes can be configured to obtain the calculation result corresponding to the formula of the target cell.
[0033] Thus, by encapsulating the parameters included in the target expression corresponding to the formula of the target cell as the calculation nodes matched with the parameter types corresponding to the parameters, wherein the calculation nodes are used to calculate the calculation results corresponding to the parameters through the logical functions matched with the parameter types, and then executing the calculation nodes based on the association relationship between the calculation nodes, the calculation result of the target cell is obtained. The calculation result of the formula of the cell can be calculated through various types of calculation nodes. The formula of the cell and the formula of the cell dependent on the formula can be continuously calculated without stack explosion in synchronous calculation. Not only the performance of formula calculation can be improved, but also the stability of formula calculation can be guaranteed.
[0034] In some implementable embodiments, in step 120, the cell calculation node can be constructed based on the target expression of the target cell, and the constructed calculation node is traversed through the target variable until the target variable is empty, and the calculation result of the target cell is obtained.
[0035] Here, when the dependency count of the calculation node pointed to by the target variable is non-zero, a target operation matched with the parameter type included in the target expression associated with the calculation node is executed. The target operation includes at least one of constructing a child calculation node matched with the parameter type, controlling the dependency count of the pointed calculation node to be reduced by 1, and adding the parameter corresponding to the parameter type to the parameter list. When the target operation is to construct a child calculation node matched with the parameter type, the target variable is controlled to point to the child calculation node. When the dependency count of the computing node pointed to by the target variable is zero, a logic function of the computing node corresponding to the context information and the parameter list of the computing node is executed, and the target variable is controlled to point to a target value; wherein, if the logic function generates a new computing node, the target value is the new computing node, and if the logic function does not generate a new computing node, the target value is a parent computing node corresponding to the computing node pointed to by the target variable, and the parent computing node corresponding to the cell computing node is empty.
[0036] It should be understood that when the computing node is constructed by traversing the target variable, it is detected whether the target variable points to the computing node, and at the beginning, the target variable points to the cell computing node. If the target variable points to the computing node, it is detected whether the dependency count corresponding to the computing node pointed to by the target variable is 0. For the case that the dependency count is not zero, the corresponding operation is performed, and for the case that the dependency count is 0, the corresponding operation is performed.
[0037] Figure 2 The flowchart of the data processing method of the table according to still some embodiments is shown. As shown in FIG. 6, in some implementable embodiments, the data processing method of the table provided by the embodiments of the present disclosure can include the following steps. Figure 2
[0038] S201, constructing a cell computing node based on a target expression corresponding to a formula included in a target cell.
[0039] Here, the cell computing node is used to obtain the calculation result of the formula from the parameter list and write the calculation result into the target cell. The parameter list is used to store the parameters involved in the calculation process of the formula.
[0040] It should be noted that all parameters involved in the formula calculation are stored in the parameter list. For example, the constant, the calculation result of the function, the expression range and other parameters included in the formula are stored in the parameter list, and when the computing node is executed, the parameters depended on by the computing node are taken out from the parameter list.
[0041] In the embodiments of the present disclosure, when the cell computing node is executed, the calculation result of the formula of the target cell is written into the target cell to display the calculation result of the formula in the target cell of the table. That is, the cell computing node is not actually responsible for the formula calculation of the target cell, but writes the calculation result of the formula calculated by cooperating with other types of computing nodes into the target cell.
[0042] It should be understood that constructing the cell computing node based on the target expression corresponding to the formula included in the target cell can mean recording the target expression in the system and constructing the cell computing node corresponding to the target cell.
[0043] S202, detecting whether the target variable points to a computing node, the target variable initially points to a cell computing node.
[0044] Here, the target variable can be a variable set by a user, for example, the target variable can be a. It should be understood that the target variable can be understood as a pointer in nature, which points to a computing node or a null value. In the initial state, the target variable points to the cell computing node corresponding to the target cell. That is, when step S202 is performed for the first time, the target variable points to the cell computing node corresponding to the target cell.
[0045] It should be noted that when the target variable does not point to a computing node, but points to a null value, it indicates that the formula calculation of the target cell has ended. At this time, the logical function of the cell computing node corresponding to the target cell has been executed, and the calculation result of the target cell has been written into the target cell.
[0046] S203, in the case where the target variable points to a computing node, detecting whether the dependency count corresponding to the computing node pointed to by the target variable is 0.
[0047] Here, when the target variable points to a computing node, it indicates that there are still computing nodes to be executed, and then it is further detected whether the dependency count corresponding to the computing node pointed to by the target variable is 0. For example, the target variable initially points to the cell computing node corresponding to the target cell, and then it can be detected whether the dependency count of the pointed cell computing node is equal to 0.
[0048] Here, the dependency count of the computing node is used to indicate how many dependencies are left to be completed. When the dependency count is equal to 0, it indicates that the dependencies of the computing node are all completed, and then the logical function corresponding to the computing node can be executed. When the dependency count is not equal to 0, it indicates that there are still uncompleted dependencies of the computing node, and then the logical function corresponding to the computing node is not executed until the dependency count of the computing node is changed to 0.
[0049] It should be noted that the dependency count is related to the node type of the computing node, and the value of the dependency count corresponding to the computing node of different node types is different. In the embodiment of the present disclosure, the dependency count of the cell computing node can be set to 1.
[0050] It should be understood that when the step S203 is performed for the first time, since the target variable initially points to the cell computing node corresponding to the target cell, and the dependency count of the cell computing node is 1, the step S204 is performed. That is, the computing process for the target cell is actually triggered by the cell computing node corresponding to the target cell, and finally the computing result corresponding to the target cell is written into the target cell.
[0051] S204, in the case where the dependency count is not 0, performing a target operation matching the parameter type included in the target expression associated with the computing node pointed to by the target variable, and returning to the step S202; the target operation includes at least one of constructing a sub-computing node matching the parameter type, controlling the dependency count corresponding to the computing node pointed to by the target variable to be reduced by 1, and adding a parameter corresponding to the parameter type to the parameter list, and in the case where the target operation is to construct a sub-computing node matching the parameter type, controlling the sub-computing node pointed to by the target variable.
[0052] Here, when the dependency count corresponding to the computing node pointed to by the target variable is not 0, it indicates that there are still dependencies to be completed for the computing node pointed to by the target variable, and then a target operation matching the parameter type included in the target expression associated with the computing node pointed to by the target variable can be performed.
[0053] According to different parameter types, different target operations are performed. The target operation can include at least one of constructing a sub-computing node matching the parameter type, controlling the dependency count corresponding to the computing node pointed to by the target variable to be reduced by 1, and adding a parameter corresponding to the parameter type to the parameter list. For example, the target operation can be to control the dependency count corresponding to the computing node pointed to by the target variable to be reduced by 1 and add a parameter corresponding to the parameter type to the parameter list. For another example, the target operation can be to construct a sub-computing node matching the parameter type and control the dependency count corresponding to the computing node pointed to by the target variable to be reduced by 1.
[0054] For example, for the target expression of "1, 2, +", the parameter type of the parameter "1" is a constant, and the parameter "1" can be added to the parameter list; the parameter type of the parameter "2" is a constant, and the parameter "2" can be added to the parameter list; and the parameter type of the parameter "+" is a function, and a function computing node corresponding to the function can be constructed based on the function.
[0055] It should be noted that when the target operation is to construct a sub-computing node matching the parameter type, a computing node matching the parameter type is constructed according to different parameter types, and the constructed computing node is a child node of the computing node pointed to by the target variable. For example, if the parameter type corresponding to the parameter of the target expression is a function, a function computing node corresponding to the function is constructed.
[0056] When the target operation is to build a sub-computing node matching the parameter type, the target variable can be controlled to point to the sub-computing node. That is, if a new sub-computing node is built, the target variable points to the newly built sub-computing node to give priority to the newly built sub-computing node.
[0057] When the target operation is to build a sub-computing node matching the parameter type, the target variable can be controlled to point to the sub-computing node. That is, if a new sub-computing node is built, the target variable points to the newly built sub-computing node to give priority to the newly built sub-computing node.
[0058] After step S204 is executed, step S202 is returned to enter a loop. Of course, if the target variable still points to the cell computing node corresponding to the target cell after step S204 is executed, at this time, it indicates that the computing node for calculating the target cell does not need to be built by a new computing node, the formula included in the target cell is a constant, and the dependency count corresponding to the cell computing node becomes 0. Accordingly, after step S202 is returned, step S205 is executed to execute the logical function corresponding to the cell computing node, obtain the calculation result of the formula from the parameter list, and write the calculation result into the target cell.
[0059] S205, in the case where the dependency count is 0, the logical function of the computing node pointed to by the target variable is executed according to the context information associated with the cell corresponding to the computing node pointed to by the target variable and the parameter list, the target variable is controlled to point to the target value, and step S202 is returned to be executed until the target variable points to a null value. When the logical function is executed, if a new computing node is generated, the target value is the new computing node, and if no new computing node is generated, the target value is the parent computing node corresponding to the computing node pointed to by the target variable, and the parent computing node corresponding to the cell computing node is a null value.
[0060] Here, the context information associated with the cell corresponding to the computing node pointed to by the target variable can be data on which the formula calculation depends, such as table information, workbook information, and the like. The logical function of the computing node pointed to by the target variable is executed according to the context information associated with the cell corresponding to the computing node pointed to by the target variable and the parameter list, which can mean that the data on which the logical function depends is the data in the context information and the parameter list.
[0061] Since the computing nodes of different node types correspond to different logical functions, the target value pointed to by the target variable is different when the target variable points to different computing nodes. Illustratively, when the logical function is executed, if a new computing node is generated, the target value is the new computing node, and if a new computing node is not generated, the target value is the parent computing node corresponding to the computing node pointed to by the target variable. The parent computing node corresponding to the cell computing node corresponding to the target cell is a null value.
[0062] If the computing node pointed to by the target variable is the cell computing node corresponding to the target cell, the logical function of the cell computing node is executed, the calculation result of the formula is obtained from the parameter list, and the calculation result is written into the target cell, and the target variable is controlled to point to a null value. At this time, step S202 is returned to be executed, and since the target variable points to a null value, the loop is ended, and the calculation of the formula for the target cell is completed.
[0063] If the computing node pointed to by the target variable is not the cell computing node corresponding to the target cell, after the logical function corresponding to the computing node pointed to by the target variable is executed, step S202 is returned to be executed until the logical function corresponding to the cell computing node corresponding to the target cell is executed, so that the target variable points to a null value. In the process of this loop, new computing nodes may be continuously generated to calculate the calculation result of the formula corresponding to the target cell, until the cell computing node corresponding to the target cell is executed, and the calculation result of the target cell is written into the target cell.
[0064] Therefore, through the above implementation, not only can the synchronous calculation of the formula be realized, so that the synchronous calculation performance of the formula is lossless, and the complexity of the formula calculation can be kept at O(n), where n is the length of the dependency and the number of formula function calls, but also the stack of the deep chain dependency can be prevented from overflowing. For example, for dependencies A1=A2+1, A2=A3+1, A3=A4+1, …, A100000=A100001+1, the length of the stack can always be less than 50. In addition, since the parameters are saved in the parameter list, when an exception occurs in a certain function, the information corresponding to the stack of the call can also be traced back through the parameter list to ensure that the exception is traceable.
[0065] In some implementable embodiments, a base class for constructing a computing node can be obtained, and based on a node type corresponding to the computing node to be constructed, data matching the node type is configured in a field included in the base class to obtain a constructed computing node.
[0066] In the embodiments of the present disclosure, a base class for constructing a computing node is provided, and the base class includes at least the following fields: A first field is configured to configure a parent computing node corresponding to the computing node to be constructed. a counter configured to configure a dependency count of the to-be-constructed calculation node; a second field configured to configure a constructor function of the to-be-constructed calculation node, the constructor function being configured to be executed when the calculation node is constructed to record a parent calculation node corresponding to the constructed calculation node; a third field configured to configure a logic function of the to-be-constructed calculation node; a fourth field configured to configure a loop function of the to-be-constructed calculation node, the loop function being configured to be executed when a circular reference is detected; a fifth field configured to configure a judgment function of the to-be-constructed calculation node, the judgment function being configured to judge whether to delay execution of a logic function corresponding to the to-be-constructed calculation node.
[0067] Here, by configuring the parent calculation node corresponding to the to-be-constructed calculation node in the first field of the base class, the order or chain call relationship between the calculation nodes can be described. The value configured in the first field can be the parent calculation node or null.
[0068] Figure 3 is a schematic diagram of the base class according to some embodiments. As shown in Figure 3 , the value configured in the first field 301 can be the parent calculation node (BaseCalcNode) or null. When the value in the first field is null, it indicates that the corresponding calculation node is the starting point of the entire call chain and has no parent calculation node. For example, the cell calculation node corresponding to the target cell is the first created calculation node, and the first field of the cell calculation node is null.
[0069] The counter (count) in the base class is configured to configure the dependency count of the to-be-constructed calculation node. As shown in Figure 3 , in the counter 302 of the base class, the dependency count can be configured by a number. It should be noted that for calculation nodes of different node types, the corresponding dependency count is different. For example, for a function calculation node, the dependency count can be the number of parameters of the corresponding function, and for calculation nodes of other node types, the corresponding dependency count can be 1 or 0. Of course, the specific value of the dependency count can be configured according to actual conditions.
[0070] The second field in the base class is configured to configure the constructor function. The constructor function configured in the second field is executed when the calculation node is constructed to record the parent calculation node corresponding to the constructed calculation node to complete the initialization of the calculation node. As shown in Figure 3 , the constructor function (constructor) corresponding to the second field 303 can be configured to receive the parent calculation node.
[0071] The third field in the base class is used to configure a logic function, and different logic functions can be configured for different types of computing nodes. As shown in Figure 3 , a logic function (do()) can be configured in the third field 304, where the dependencies of the logic function are context information (ctx) and a parameter list (params). After the logic function is executed, the parent computing node or null is returned.
[0072] It should be understood that the context information can include an index, a start position, and an end position corresponding to the target expression, and the logic function can be executed according to the index, the start position, and the end position corresponding to the target expression included in the context information.
[0073] The fourth field in the base class is used to configure a loop function (circle), and different loop functions can be configured for different types of computing nodes. As shown in Figure 3 , a loop function (circle) can be configured in the fourth field 305, and the dependencies of the loop function are context information (ctx) and a parameter list (params). It should be noted that the loop function is void, indicating that the loop function only performs the corresponding logic and does not return the computing node. When a loop reference is detected, the loop function can be called to break the loop reference and execute the next round.
[0074] The fifth field in the base class is used to configure a judgment function, and different judgment functions can be configured for different types of computing nodes. The judgment function is used to determine whether to delay the execution of the logic function corresponding to the to-be-constructed computing node before executing the logic function of the to-be-constructed computing node. As shown in Figure 3 , a judgment function (isLazy) can be configured in the fifth field 306.
[0075] It should be understood that the base class for constructing computing nodes described above is used to construct computing nodes, and the computing nodes constructed based on the base class all inherit from the base class.
[0076] Correspondingly, when a computing node needs to be constructed, the base class for constructing the computing node can be obtained, and based on the node type corresponding to the to-be-constructed computing node, data matching the node type is configured in the first field, the counter, the second field, the third field, the fourth field, and the fifth field of the base class, to obtain a constructed computing node.
[0077] In some implementable embodiments, when the node type is a cell computing node, the parent computing node corresponding to the cell computing node is configured in the field of the base class, the dependency count of the cell computing node is configured as 1, and the first constructor, the first logic function, the first loop function, and the preset data value corresponding to the cell computing node are configured in the corresponding field, to obtain a constructed cell computing node.
[0078] The first constructor function is configured to record the parent calculation node corresponding to the cell calculation node and whether the cell corresponding to the cell calculation node has been calculated. The first logic function is configured to obtain the calculation result of the formula corresponding to the cell calculation node from the parameter list and write the calculation result into the cell corresponding to the cell calculation node. The first loop function is configured to write the result of the loop reference into the cell corresponding to the cell calculation node. The preset data value is configured to represent that the first logic function corresponding to the cell calculation node is not executed in a deferred manner.
[0079] In some embodiments, when the node type is a cell calculation node, the parent calculation node corresponding to the cell calculation node is configured in the first field. The value of the counter is configured to be 1. The first constructor function is configured in the second field. The first constructor function is configured to record the parent calculation node corresponding to the cell calculation node and whether the cell corresponding to the cell calculation node has been calculated. The first logic function is configured in the third field. The first logic function is configured to obtain the calculation result of the formula corresponding to the cell calculation node from the parameter list and write the calculation result into the cell corresponding to the cell calculation node. The first loop function is configured in the fourth field. The first loop function is configured to write the result of the loop reference into the cell corresponding to the cell calculation node. The preset data value is configured in the fifth field. The preset data value is configured to represent that the first logic function corresponding to the cell calculation node is not executed in a deferred manner.
[0080] Here, the role of the cell calculation node is to write the calculation result into the corresponding cell. For the cell calculation node, the last of the cell calculation node can be the parent calculation node or null. If the cell calculation node is the first constructed cell calculation node, the last is null, that is, there is no parent calculation node. The dependency count of the cell calculation node is 1, so the value of the counter in the base class is configured to be 1. When the value of the counter of the cell calculation node is 0, the logic function of the cell calculation node is executed.
[0081] The constructor function corresponding to the cell calculation node is the first constructor function. The first constructor function is configured to record the parent calculation node corresponding to the cell calculation node and whether the cell corresponding to the cell calculation node has been calculated.
[0082] Exemplarily, the preset data value configured in the fifth field can be false, indicating that the first logic function corresponding to the cell calculation node is not executed in a deferred manner.
[0083] In some implementable embodiments, when the node type is a function computing node, a parent computing node corresponding to the function computing node is configured in a field corresponding to the base class, a dependency count of the function computing node is configured as the first number, and a second constructor function, a second logic function, a second loop function, and a target function corresponding to the function computing node are configured in the corresponding fields to obtain a built function computing node.
[0084] Here, the first number is the number of parameters included in the function corresponding to the function computing node; the second constructor function is used to record the parent computing node corresponding to the function computing node and record the first number; the second logic function is used to obtain the first number of parameters from a parameter list and calculate a calculation result of the function according to the obtained parameters and add the calculation result to the parameter list; the second loop function is used to delete the second number of parameters that have been added to the parameter list from the parameter list, the second number being the difference between the first number and the value of the counter; and the target function is used to determine whether to execute the second logic function later according to the value of the counter and the function type corresponding to the function.
[0085] According to the base class provided in the above embodiments, in some embodiments, when the node type is a function computing node, a parent computing node corresponding to the function computing node is configured in a first field; the value of the counter is configured as the first number, the first number being the number of parameters included in the function corresponding to the function computing node; a second constructor function is configured in a second field, the second constructor function being used to record the parent computing node corresponding to the function computing node and record the first number; a second logic function is configured in a third field, the second logic function being used to obtain the first number of parameters from a parameter list and calculate a calculation result of the function according to the obtained parameters and add the calculation result to the parameter list; a second loop function is configured in a fourth field, the second loop function being used to delete the second number of parameters that have been added to the parameter list from the parameter list, the second number being the difference between the first number and the value of the counter; a target function is configured in a fifth field, the target function being used to determine whether to execute the second logic function later according to the value of the counter and the function type corresponding to the function.
[0086] Here, the function computing node is used to process parameters of a function and calculate a calculation result of the function. For the function computing node, the value of the counter is configured as the first number, the first number being the number of parameters included in the function corresponding to the function computing node, that is, the second logic function corresponding to the function computing node is executed only after the parameters on which the function depends are prepared. The function corresponding to the function computing node can be a SUM function, an IF function, a LAMBDA function, etc.
[0087] The second constructor function of the function computing node is configured to record the parent computing node corresponding to the function computing node and record the first number to record the number of parameters of the function. Through the second constructor function, the running environment of the function computing node can be initialized.
[0088] It should be noted that the context information can include the index, the start position and the end position corresponding to the target expression, and the second logic function can obtain the first number of parameters from the parameter list according to the index, the start position and the end position corresponding to the target expression included in the context information. The first number of parameters are the function parameters on which the function depends.
[0089] The second loop function of the function computing node is executed when a loop reference is encountered, and the second loop function can be called and executed by the computing node of other node types.
[0090] The target function of the function computing node is configured to determine whether to delay the execution of the second logic function according to the value of the counter of the function computing node and the function type of the function. For example, when the value of the counter of the function computing node is not 0, the execution is delayed. When the function type is a preset type, the execution is delayed. For example, when the third parameter of the LAMBDA function is an expression, the execution needs to be delayed.
[0091] In some implementable embodiments, when the node type is an expression range computing node, the parent computing node corresponding to the expression range computing node is configured in the field corresponding to the base class, the dependency count of the expression range computing node is configured as 1, and the third constructor function, the third logic function and the preset data value corresponding to the expression range computing node are configured in the corresponding field, to obtain the built expression range computing node.
[0092] Here, the third constructor function is configured to record the parent computing node corresponding to the expression range computing node and record the historical context information when the expression range computing node is built, and update the current context information as the context information corresponding to the expression range computing node; the third logic function is configured to restore the current context information as the historical context information, and control the dependency count of the parent computing node corresponding to the expression range computing node to be reduced by 1; and the preset data value is configured to represent that the third logic function corresponding to the expression range computing node is not delayed.
[0093] Based on the base class provided in the above embodiments, in some embodiments, when the node type is an expression range computing node, the parent computing node corresponding to the expression range computing node is configured in the first field; The value of the counter is configured as 1; The third constructor function is configured in the second field, and is used for recording the parent calculation node corresponding to the expression range calculation node and the historical context information when the expression range calculation node is built, and updating the current context information as the context information corresponding to the expression range calculation node. The third logic function is configured in the third field, and is used for restoring the current context information as the historical context information, and controlling the dependency count of the parent calculation node corresponding to the expression range calculation node to be reduced by 1. The fourth field is configured as a null operation. The fifth field is configured as a preset data value, which is used to represent that the third logic function corresponding to the expression range calculation node is not executed in a deferred manner.
[0094] Here, the expression range calculation node is used for recording and updating the context information. The value of the counter of the expression range calculation node is configured as 1, i.e., the dependency count of the expression range calculation node is 1.
[0095] The third constructor function of the expression range calculation node is used for recording the context information in the previous running process, and updating the current context information as the context information corresponding to the expression range calculation node, which is a new reverse Polish expression and an index thereof.
[0096] The third logic function of the expression range calculation node is used for restoring the recorded historical context information to the current context, and controlling the dependency count of the parent calculation node corresponding to the expression range calculation node to be reduced by 1.
[0097] The fourth field of the expression range calculation node is configured as a null operation, i.e., the corresponding loop function does not perform any operation. The fourth field of the expression range calculation node is configured as a preset data value, which represents that the third logic function corresponding to the expression range calculation node is not executed in a deferred manner.
[0098] In some implementable embodiments, when the node type is a reference iteration calculation node, the parent calculation node corresponding to the reference iteration calculation node is configured in the field of the base class, the dependency count of the reference iteration calculation node is configured as 0, and the fourth constructor function, the fourth logic function and the preset data value corresponding to the reference iteration calculation node are configured in the corresponding fields, to obtain the built reference iteration calculation node.
[0099] Here, the fourth constructor function is configured to record the parent calculation node corresponding to the reference iteration calculation node and to record the cell reference area corresponding to the reference iteration calculation node; the fourth logic function is configured to traverse the cells in the cell reference area, in the case that the traversed cell has been calculated, add the parameters of the cell to the parameter list, in the case that the traversed cell has not been calculated, if the cell has not been traversed, build the cell calculation node corresponding to the cell, if the cell has been traversed, control the context information to execute the loop function corresponding to the calculation node of the cell; the preset data value is configured to represent that the fourth logic function corresponding to the reference iteration calculation node is not executed in a deferred manner.
[0100] In some embodiments, when the node type is a reference iteration calculation node, the parent calculation node corresponding to the reference iteration calculation node is configured in the first field based on the base class provided in the above embodiments; The value of the counter is configured to be 0; The fourth constructor function is configured in the second field, and the fourth constructor function is configured to record the parent calculation node corresponding to the reference iteration calculation node and to record the cell reference area corresponding to the reference iteration calculation node; The fourth logic function is configured in the third field, and the fourth logic function is configured to traverse the cells in the cell reference area, in the case that the traversed cell has been calculated, add the parameters of the cell to the parameter list, in the case that the traversed cell has not been calculated, if the cell has not been traversed, build the cell calculation node corresponding to the cell, if the cell has been traversed, control the context information to execute the loop function corresponding to the calculation node of the cell; The null operation is configured in the fourth field; The preset data value is configured in the fifth field, and the preset data value is configured to represent that the fourth logic function corresponding to the reference iteration calculation node is not executed in a deferred manner.
[0101] Here, the value of the counter of the reference iteration calculation node is 0, and when the target vector points to the reference iteration calculation node, the fourth logic function of the reference iteration calculation node is executed immediately.
[0102] The fourth constructor function of the reference iteration calculation node is configured to record the parent calculation node corresponding to the reference iteration calculation node and to record the cell reference area corresponding to the reference iteration calculation node. The cell reference area refers to the cells referenced by the formula in the calculation process, i.e., the calculation results of the cells referenced by the formula. For example, if the formula is written in cell A1, and the formula is B1, C2, D1, D2, …, D10 are cells referenced by A1.
[0103] The fourth logic function of the reference iteration calculation node, when executed, traverses all cells in the cell reference area, and when a traversed cell has been calculated, directly adds parameters of the cell to the parameter list. When a traversed cell has not been calculated, further detects whether the cell has been traversed. If the cell has not been traversed, a cell calculation node corresponding to the cell is constructed, wherein a parent calculation node of the constructed cell calculation node is the current reference iteration calculation node. If the cell has been traversed, control context information is used to execute a loop function corresponding to the calculation node of the cell.
[0104] It should be noted that the cell is traversed, which means that the cell calculation node corresponding to the cell has been constructed, and the cell calculation node will not be repeatedly created. By constructing the cell calculation node, the calculation result of the cell that has not been calculated in the cell reference area can be calculated through the cell calculation node.
[0105] The base class provided by the above embodiment can abstract interfaces that need to be implemented by calculation nodes of various node types, and provides the cell calculation node, the function calculation node, the expression range calculation node, and the reference iteration calculation node to ensure driving of the whole link. Of course, in specific implementation, calculation nodes other than the cell calculation node, the function calculation node, the expression range calculation node, and the reference iteration calculation node can be created according to specific requirements and the base class.
[0106] In the loop process of steps S201 to S205, the logic functions of various types of calculation nodes can implement calculation between cells that depend on each other, and can ensure correct calculation of each function and parameters thereof.
[0107] In the above embodiment, the calculation node provided by the embodiment of the present disclosure can include at least one of the following: The cell calculation node, whose logic function is used to obtain a calculation result of a formula corresponding to the cell calculation node from the parameter list, and write the calculation result into a cell corresponding to the cell calculation node; The function calculation node, whose corresponding logic function is used to obtain parameters corresponding to a function associated with the function calculation node from the parameter list, and calculate a calculation result of the function according to the parameters and add the calculation result to the parameter list; The expression range calculation node, whose logic function is used to restore current context information to historical context information, and control a dependency count of a parent calculation node corresponding to the expression range calculation node to be reduced by 1, wherein the historical context information is context information when the expression range calculation node is constructed; The reference iteration calculation node has a logic function for traversing cells in a cell reference area corresponding to the reference iteration calculation node, and when a traversed cell has not been calculated, constructing a cell calculation node corresponding to the traversed cell, and when a traversed cell does not need to be calculated, controlling a context information to execute a loop function corresponding to the cell calculation node.
[0108] Correspondingly, in step S204, when the parameter type corresponding to a parameter included in the target expression is a function, a function calculation node is constructed based on the function.
[0109] That is, for a parameter in the target expression whose parameter type is a function, the target operation is to construct a function calculation node based on the function. In the above embodiment, the function calculation node can be constructed by using the base class.
[0110] In step S204, when the parameter type corresponding to a parameter included in the target expression is a constant, the constant is added to the parameter list, and the dependency count corresponding to the calculation node pointed to by the target variable is controlled to be reduced by 1.
[0111] That is, for a parameter in the target expression whose parameter type is a constant, the target operation is to add the constant to the parameter list, and control the dependency count corresponding to the calculation node pointed to by the target variable to be reduced by 1. It should be understood that adding the constant to the parameter list can also be understood as a constant calculation node, and the role of the constant calculation node is to add the constant to the parameter list.
[0112] In step S204, when the parameter type corresponding to a parameter included in the target expression is an expression range, an expression range calculation node is constructed based on the expression range, and the dependency count corresponding to the calculation node pointed to by the target variable is controlled to be reduced by 1.
[0113] That is, for a parameter in the target expression whose parameter type is an expression range, the target operation is to construct an expression range calculation node based on the expression range, and control the dependency count corresponding to the calculation node pointed to by the target variable to be reduced by 1. It should be understood that through the expression range calculation node, the expression range can be added to the parameter list.
[0114] In step S204, when the parameter type corresponding to a parameter included in the target expression is a type representing data in a reference cell reference area, a reference iteration calculation node is constructed based on the cell reference area.
[0115] That is, for a parameter in the target expression whose parameter type is a type representing data in a reference cell reference area, the target operation is to construct a reference iteration calculation node based on the cell reference area. Through the construction of the reference iteration calculation node, the calculation result of each cell in the cell reference area can be calculated.
[0116] The above embodiments are illustrated by an example as follows.
[0117] Suppose the formula of the target cell is "1+2", and the corresponding target expression is "1, 2, +". Through the above steps S204 to S205, when the formula of the target cell is calculated, the cell calculation node x of the target cell is constructed, the target vector a points to the cell calculation node x, and since the dependency count of the cell calculation node x is 1, step S204 is executed, the function calculation node y is constructed based on "+" in the target expression, and then the target vector a points to the function calculation node y. When "1" and "2" in the target expression are calculated, it is the turn to execute the logical function of the function calculation node y. The logical function of the function calculation node y calculates the calculation result of "1+2", obtains the calculation result "3", and returns to the parent calculation node. Since the parent calculation node of the function calculation node y is the cell calculation node x, the target vector a points to the cell calculation node x. Since the dependency count of the cell calculation node x is reduced by 1 when the function calculation node y is executed, the logical function of the cell calculation node x can be executed. The calculation result "3" is taken out from the parameter list, and the calculation result "3" is written into the target cell. Since the parent calculation node corresponding to the cell calculation node x is a null value, the target vector points to the null value, and the calculation is ended.
[0118] Figure 4 is a structural schematic diagram of a data processing apparatus of a table according to some embodiments. As shown in Figure 4 The present disclosure provides a data processing apparatus 400 of a table, which comprises: A determination module 401 configured to determine a target expression corresponding to a formula included in a target cell; A calculation module 402 configured to encapsulate each parameter included in the target expression into a calculation node matching a parameter type corresponding to the parameter based on the target expression, and execute the calculation nodes based on an association relationship between the calculation nodes to obtain a calculation result of the target cell, wherein the calculation node is used to calculate the calculation result corresponding to the parameter through a logical function matching the parameter type.
[0119] Optionally, the calculation module 402 is specifically configured to: construct a cell calculation node based on the target expression of the target cell, the cell calculation node being used to obtain a calculation result of the formula from a parameter list and write into the target cell; traverse the constructed calculation nodes through a target variable until the target variable is a null value to obtain the calculation result of the target cell; When the dependency count of the computing node pointed to by the target variable is non-zero, a target operation matching the parameter type included in the target expression associated with the computing node is performed based on the parameter type, the target operation including at least one of constructing a sub-computing node matching the parameter type, controlling the dependency count of the pointed computing node to be reduced by 1, and adding a parameter corresponding to the parameter type to the parameter list, and when the target operation is to construct a sub-computing node matching the parameter type, controlling the target variable to point to the sub-computing node. When the dependency count of the computing node pointed to by the target variable is zero, a logic function of the computing node is executed according to context information corresponding to the computing node and the parameter list, and the target variable is controlled to point to a target value; wherein if the logic function generates a new computing node, the target value is the new computing node, and if the logic function does not generate a new computing node, the target value is a parent computing node corresponding to the computing node pointed to by the target variable, and the parent computing node corresponding to the cell computing node is a null value.
[0120] Optionally, the computing module 402 includes: an obtaining unit configured to obtain a base class for constructing a computing node; a constructing unit configured to, based on a node type corresponding to the computing node to be constructed, configure data matching the node type in a field included in the base class to obtain a constructed computing node.
[0121] Optionally, the base class includes at least the following fields: a first field configured to configure a parent computing node corresponding to the computing node to be constructed; a counter configured to configure a dependency count of the computing node to be constructed; a second field configured to configure a constructor function of the computing node to be constructed, the constructor function being used to record a parent computing node corresponding to the constructed computing node when the computing node is constructed; a third field configured to configure a logic function of the computing node to be constructed; a fourth field configured to configure a loop function of the computing node to be constructed, the loop function being used to be executed when a loop reference is detected; a fifth field configured to configure a judgment function of the computing node to be constructed, the judgment function being used to judge whether to delay execution of a logic function corresponding to the computing node to be constructed.
[0122] Optionally, the constructing unit is specifically configured to: when the node type is the cell calculation node, configuring the parent calculation node corresponding to the cell calculation node in the field corresponding to the base class, configuring the dependency count of the cell calculation node as 1, and configuring the first constructor function, the first logic function, the first loop function and the preset data value corresponding to the cell calculation node in the corresponding field to obtain the built cell calculation node; The first constructor function is configured to record the parent calculation node corresponding to the cell calculation node and record whether the cell corresponding to the cell calculation node is calculated. The first logic function is configured to obtain the calculation result of the formula corresponding to the cell calculation node from the parameter list, and write the calculation result into the cell corresponding to the cell calculation node. The first loop function is configured to write the result of the loop reference into the cell corresponding to the cell calculation node. The preset data value is configured to represent that the first logic function corresponding to the cell calculation node is not executed in a deferred manner.
[0123] Optionally, the construction unit is specifically configured to: when the node type is the function calculation node, configuring the parent calculation node corresponding to the function calculation node in the field corresponding to the base class, configuring the dependency count of the function calculation node as a first number, and configuring the second constructor function, the second logic function, the second loop function and the target function corresponding to the function calculation node in the corresponding field to obtain the built function calculation node; The first number is the number of parameters included in the function corresponding to the function calculation node. The second constructor function is configured to record the parent calculation node corresponding to the function calculation node and record the first number. The second logic function is configured to obtain the first number of parameters from the parameter list, and calculate the calculation result of the function according to the obtained parameters and add the calculation result to the parameter list. The second loop function is configured to delete the second number of parameters that have been added to the parameter list from the parameter list, the second number being the difference between the first number and the value of the counter. The target function is configured to determine whether to execute the second logic function in a deferred manner according to the value of the counter and the function type corresponding to the function.
[0124] Optionally, the construction unit is specifically configured to: when the node type is the expression range calculation node, configuring the parent calculation node corresponding to the expression range calculation node in the field corresponding to the base class, configuring the dependency count of the expression range calculation node as 1, and configuring the third constructor function, the third logic function and the preset data value corresponding to the expression range calculation node in the corresponding field to obtain the built expression range calculation node; The third constructor function is configured to record the parent calculation node corresponding to the expression range calculation node and record historical context information when the expression range calculation node is built, and update current context information as the context information corresponding to the expression range calculation node; the third logic function is configured to restore the current context information as the historical context information, and control the dependency count of the parent calculation node corresponding to the expression range calculation node to be reduced by 1; and the preset data value is configured to represent that the third logic function corresponding to the expression range calculation node is not executed in a deferred manner.
[0125] Optionally, the construction unit is specifically configured to: when the node type is the reference iteration calculation node, the parent calculation node corresponding to the reference iteration calculation node is configured in the field corresponding to the base class, the dependency count of the reference iteration calculation node is configured as zero, and the fourth constructor function, the fourth logic function and the preset data value corresponding to the reference iteration calculation node are configured in the corresponding field, so that the reference iteration calculation node is constructed. The fourth constructor function is configured to record the parent calculation node corresponding to the reference iteration calculation node and record the cell reference area corresponding to the reference iteration calculation node; the fourth logic function is configured to traverse the cells in the cell reference area, in the case that the traversed cell has been calculated, add the parameter of the cell to the parameter list, in the case that the traversed cell has not been calculated, if the cell has not been traversed, construct the cell calculation node corresponding to the cell, and if the cell has been traversed, control the context information to be the calculation node of the cell to execute the loop function corresponding to the calculation node; and the preset data value is configured to represent that the fourth logic function corresponding to the reference iteration calculation node is not executed in a deferred manner.
[0126] Optionally, the calculation node comprises at least one of the following: a cell calculation node, and the logic function of the cell calculation node is configured to obtain the calculation result of the formula corresponding to the cell calculation node from the parameter list, and write the calculation result into the cell corresponding to the cell calculation node; a function calculation node, and the logic function corresponding to the function calculation node is configured to obtain the parameter corresponding to the function associated with the function calculation node from the parameter list, and calculate the calculation result of the function according to the parameter and add the calculation result to the parameter list; an expression range calculation node, and the logic function of the expression range calculation node is configured to restore the current context information as the historical context information, and control the dependency count of the parent calculation node corresponding to the expression range calculation node to be reduced by 1, the historical context information being the context information when the expression range calculation node is built; The reference iteration computing node is configured to traverse cells in a cell reference area corresponding to the reference iteration computing node, and when a traversed cell is not calculated, construct a cell computing node corresponding to the traversed cell, and when a traversed cell does not need to be calculated, control context information to execute a loop function corresponding to the cell computing node of the traversed cell.
[0127] Optionally, the computing module 402 is specifically configured to: when the parameter type corresponding to a parameter included in the target expression is a function, construct the function computing node based on the function; when the parameter type corresponding to a parameter included in the target expression is a constant, add the constant to the parameter list, and control the dependency count of the computing node pointed to by the target variable to be reduced by 1; when the parameter type corresponding to a parameter included in the target expression is an expression range, construct the expression range computing node based on the expression range, and control the dependency count of the computing node pointed to by the target variable to be reduced by 1; when the parameter type corresponding to a parameter included in the target expression is a type representing data in a reference cell reference area, construct the reference iteration computing node based on the cell reference area.
[0128] The function logic executed by each function module in the data processing apparatus 400 described above has been described in detail in the method part, and will not be repeated here.
[0129] The following refers to Figure 5 which shows a structural schematic diagram of an electronic device (such as a terminal device or a server) 600 suitable for implementing the embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure can include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablet Personal Computers), PMPs (Portable Multimedia Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like. Figure 5 The electronic device shown is only an example, and should not bring any limitation to the functions and use range of the embodiments of the present disclosure.
[0130] As Figure 5As shown, the electronic device 600 can include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601 that can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 602 or loaded into a random access memory (RAM) 603 from a storage device 608. Various programs and data required for the operation of the electronic device 600 are also stored in the RAM 603. The processing device 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0131] Generally, the following devices can be connected to the I / O interface 605: input devices 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 608 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 609. The communication devices 609 can allow the electronic device 600 to communicate wirelessly or wired with other devices to exchange data. Although Figure 5 The electronic device 600 is shown with various devices, but it should be understood that all of the illustrated devices are not required, and fewer or different devices can alternatively be implemented.
[0132] In particular, the processes described above with reference to the flowcharts can be implemented as a computer software program according to embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods illustrated by the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network through the communication devices 609, or installed from the storage devices 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-described functions defined in the methods of embodiments of the present disclosure are performed.
[0133] It is noted that the aforementioned computer-readable medium of the present disclosure can be a computer-readable signal medium or a computer-readable storage medium or any combination thereof. The computer-readable storage medium can be, for example and without limitation, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the computer-readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program used by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, the computer-readable signal medium can include a computer-readable program code transmitted by a computer-readable medium or a carrier wave in a baseband or as part of a carrier wave. Such a propagated computer-readable signal medium can take many forms, including but not limited to, an electromagnetic signal, an optical signal, or any suitable combination of the foregoing. The computer-readable signal medium can also be any computer-readable medium that is not a computer-readable storage medium and that can be used to carry or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained in the computer-readable medium can be transmitted by any suitable medium, including but not limited to, wire, cable, RF (radio frequency), or the like, or any suitable combination of the foregoing.
[0134] In some embodiments, the client, server, or both can communicate using any current known or future developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include local area networks ("LAN"), wide area networks ("WAN"), the Internet, and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any current known or future developed networks.
[0135] The aforementioned computer-readable medium can be included in the aforementioned electronic device; or can exist separately from the electronic device and can be accessed via the electronic device.
[0136] The computer readable medium described above carries one or more programs, when the one or more programs are executed by the electronic device, cause the electronic device to: determine a target expression corresponding to a formula included by a target cell; encapsulate each parameter included by the target expression into a computing node matching a parameter type corresponding to the parameter based on the target expression, and execute the computing nodes based on an association relationship between the computing nodes to obtain a calculation result of the target cell, wherein the computing node is used to obtain a calculation result corresponding to the parameter by a logical function matching the parameter type.
[0137] Computer program code for carrying out operations of the present disclosure can be written in one or more programming languages or combinations of languages including object oriented programming languages such as Java, Smalltalk, C++ or conventional procedural programming languages such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).
[0138] The flow diagrams and the block diagrams in the drawings are illustrations of architectures, functionalities, and operations of possible implementations of systems, methods, and computer program products according to various embodiments of present disclosure. In this regard, each block in the flow diagrams or block diagrams can represent a module, a segment, or a portion of code, which comprises one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and / or flow diagrams, and combinations of blocks in the block diagrams and / or flow diagrams, can be implemented by special purpose hardware-based systems that perform the specified functions or operations, or combinations of special purpose hardware and computer instructions.
[0139] The modules involved in the embodiments of the present disclosure can be implemented in the manner of software or in the manner of hardware. In some cases, the name of the module does not constitute a limitation on the module itself.
[0140] The functionality described above in this document can be performed, at least in part, by one or more hardware logic components. For example, and without limitation, example types of hardware logic components that can be used include Field-programmable Gate Arrays (FPGAs), Application-specific Integrated Circuits (ASICs), Application-specific Standard Products (ASSPs), System-on-a-chip (SOCs), Complex Programmable Logic Devices (CPLDs), etc.
[0141] In the context of the present disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium will include one or more lines of electrical connections, portable computer disks, hard disk drives, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or Flash memory), optical fibers, portable compact disc read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0142] The above description is only preferred embodiments of the present disclosure and the explanation of the applied technical principles. It should be understood by those skilled in the art that the disclosure range involved in the present disclosure is not limited to the technical solutions formed by the specific combinations of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the technical solutions formed by replacing the above features with the technical features disclosed in the present disclosure (but not limited to) having similar functions.
[0143] Further, while operations are depicted in a particular order, this should not be understood as requiring the operations to be performed in the particular order shown or in sequential order, and that certain operations can be performed in parallel or in any suitably ordered order under certain circumstances. Also, while a number of specific implementation details have been discussed, these should not be construed as limiting the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable sub-combination.
[0144] Although the subject matter has been described in language specific to structural features and / or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims. With respect to the devices in the above-described embodiments, in which various modules perform operations, the specific manner in which the various modules perform the operations has been described in detail in the embodiments relating to the method, and will not be described in detail here.
Claims
1. A data processing method of a table, characterized by, The method comprises the following steps: determining a target expression corresponding to a formula included in a target cell; based on the target expression, encapsulating each parameter included in the target expression into a calculation node matching a parameter type corresponding to the parameter, and executing the calculation nodes based on the association relationship between the calculation nodes to obtain a calculation result of the target cell, wherein the calculation node is used to calculate the calculation result corresponding to the parameter through a logical function matching the parameter type.
2. The method of claim 1, wherein, The method based on the target expression, encapsulating each parameter included in the target expression into a calculation node matching a parameter type corresponding to the parameter, and executing the calculation nodes based on the association relationship between the calculation nodes to obtain a calculation result of the target cell, comprises: constructing a cell calculation node based on the target expression of the target cell, the cell calculation node being used to obtain the calculation result of the formula from a parameter list and write the calculation result into the target cell; traversing the constructed calculation nodes through a target variable until the target variable is empty to obtain the calculation result of the target cell; wherein, when the dependency count of the calculation node pointed to by the target variable is non-zero, based on the parameter type included in the target expression associated with the calculation node, performing a target operation matching the parameter type, the target operation including at least one of constructing a sub-calculation node matching the parameter type, controlling the dependency count of the pointed calculation node to be reduced by 1, and adding a parameter corresponding to the parameter type to the parameter list, and when the target operation is to construct a sub-calculation node matching the parameter type, controlling the target variable to point to the sub-calculation node; when the dependency count of the calculation node pointed to by the target variable is zero, executing a logical function of the calculation node according to context information corresponding to the calculation node and the parameter list, and controlling the target variable to point to a target value; wherein, if the execution of the logical function generates a new calculation node, the target value is the new calculation node, and if the execution of the logical function does not generate a new calculation node, the target value is a parent calculation node corresponding to the calculation node pointed to by the target variable, and the parent calculation node corresponding to the cell calculation node is empty.
3. The method of claim 2, wherein, The method for constructing a calculation node comprises the following steps: obtaining a base class for constructing a calculation node; based on a node type corresponding to the calculation node to be constructed, configuring data matching the node type in a field included in the base class to obtain a constructed calculation node.
4. The method of claim 3, wherein, The base class at least includes the following fields: a first field for configuring a parent calculation node corresponding to the calculation node to be constructed; a counter for configuring a dependency count of the calculation node to be constructed; a second field for configuring a constructor function of the calculation node to be constructed, the constructor function being used to execute when constructing the calculation node to record the parent calculation node corresponding to the constructed calculation node; a third field for configuring a logical function of the calculation node to be constructed; a fourth field for configuring a loop function of the calculation node to be constructed, the loop function being used to execute when a circular reference is detected. A fifth field is configured to configure a judgment function of the to-be-constructed computing node, and the judgment function is used to judge whether to delay execution of a logic function corresponding to the to-be-constructed computing node.
5. The method of claim 3, wherein, The base class includes fields, and the fields are used to configure data matched with the node type corresponding to the to-be-constructed computing node, so as to obtain the constructed computing node, including: When the node type is a cell computing node, the fields corresponding to the base class are configured to configure a parent computing node corresponding to the cell computing node, configure a dependency count of the cell computing node as 1, and configure a first constructor function, a first logic function, a first loop function and a preset data value corresponding to the cell computing node in the corresponding fields, so as to obtain the constructed cell computing node. The first constructor function is used to record the parent computing node corresponding to the cell computing node and record whether a cell corresponding to the cell computing node is calculated; the first logic function is used to obtain a calculation result of a formula corresponding to the cell computing node from the parameter list and write the calculation result into the cell corresponding to the cell computing node; the first loop function is used to write a result of a loop reference into the cell corresponding to the cell computing node; and the preset data value is used to represent that the first logic function corresponding to the cell computing node is not delayed to be executed.
6. The method of claim 3, wherein, The base class includes fields, and the fields are used to configure data matched with the node type corresponding to the to-be-constructed computing node, so as to obtain the constructed computing node, including: When the node type is a function computing node, the fields corresponding to the base class are configured to configure a parent computing node corresponding to the function computing node, configure a dependency count of the function computing node as a first number, and configure a second constructor function, a second logic function, a second loop function and a target function corresponding to the function computing node in the corresponding fields, so as to obtain the constructed function computing node. The first number is a number of parameters included in a function corresponding to the function computing node; the second constructor function is used to record the parent computing node corresponding to the function computing node and record the first number; the second logic function is used to obtain the first number of parameters from the parameter list, calculate a calculation result of the function according to the obtained parameters, and add the calculation result to the parameter list; the second loop function is used to delete a second number of parameters that have been added to the parameter list from the parameter list, and the second number is a difference between the first number and a value of the counter; and the target function is used to judge whether to delay execution of the second logic function according to the value of the counter and a function type corresponding to the function.
7. The method of claim 3, wherein, The base class includes fields, and the fields are used to configure data matched with the node type corresponding to the to-be-constructed computing node, so as to obtain the constructed computing node, including: When the node type is the expression range calculation node, a parent calculation node corresponding to the expression range calculation node is configured in a field corresponding to the base class, a dependency count of the expression range calculation node is configured as 1, and a third constructor function, a third logic function and a preset data value corresponding to the expression range calculation node are configured in corresponding fields, so that the expression range calculation node is built. The third constructor function is configured to record the parent calculation node corresponding to the expression range calculation node and record historical context information when the expression range calculation node is built, and update current context information as the context information corresponding to the expression range calculation node; the third logic function is configured to restore the current context information as the historical context information, and control the dependency count of the parent calculation node corresponding to the expression range calculation node to be reduced by 1; and the preset data value is configured to represent that the third logic function corresponding to the expression range calculation node is not executed in a deferred manner.
8. The method of claim 3, wherein, The method comprises the following steps: When the node type is the reference iteration calculation node, a parent calculation node corresponding to the reference iteration calculation node is configured in a field corresponding to the base class, a dependency count of the reference iteration calculation node is configured as 0, and a fourth constructor function, a fourth logic function and a preset data value corresponding to the reference iteration calculation node are configured in corresponding fields, so that the reference iteration calculation node is built. The fourth constructor function is configured to record the parent calculation node corresponding to the reference iteration calculation node and record a cell reference area corresponding to the reference iteration calculation node; the fourth logic function is configured to traverse cells in the cell reference area, in a case where a traversed cell has been calculated, add a parameter of the cell to the parameter list, in a case where the traversed cell has not been calculated, if the cell has not been traversed, build a cell calculation node corresponding to the cell, and if the cell has been traversed, control context information to be the cell calculation node to execute a loop function corresponding to the cell calculation node; and the preset data value is configured to represent that the fourth logic function corresponding to the reference iteration calculation node is not executed in a deferred manner.
9. The method according to any one of claims 2-8, characterized in that, The calculation node comprises at least one of the following: A cell calculation node, a logic function of which is configured to obtain a calculation result of a formula corresponding to the cell calculation node from the parameter list, and write the calculation result into a cell corresponding to the cell calculation node; A function calculation node, a logic function of which is configured to obtain a parameter corresponding to a function associated with the function calculation node from the parameter list, and calculate a calculation result of the function according to the parameter and add the calculation result to the parameter list; and A loop calculation node, a logic function of which is configured to obtain a parameter corresponding to a loop function associated with the loop calculation node from the parameter list, and calculate a calculation result of the loop function according to the parameter and add the calculation result to the parameter list. an expression range calculation node, a logic function of which is configured to restore current context information into historical context information, and control a dependency count of a parent calculation node corresponding to the expression range calculation node to be reduced by 1, the historical context information being context information at a time when the expression range calculation node is built; a reference iteration calculation node, a logic function of which is configured to traverse cells in a cell reference area corresponding to the reference iteration calculation node, and when a traversed cell is not calculated, build a cell calculation node corresponding to the traversed cell, and when the traversed cell is not needed to be calculated, control context information of the calculation node of the traversed cell to execute a loop function corresponding to the calculation node.
10. The method of claim 9, wherein, the target operation matching the parameter type, comprising: when the parameter type corresponding to the parameter included in the target expression is a function, building the function calculation node based on the function; when the parameter type corresponding to the parameter included in the target expression is a constant, adding the constant to the parameter list, and controlling a dependency count of the calculation node pointed to by the target variable to be reduced by 1; when the parameter type corresponding to the parameter included in the target expression is an expression range, building the expression range calculation node based on the expression range, and controlling a dependency count of the calculation node pointed to by the target variable to be reduced by 1; when the parameter type corresponding to the parameter included in the target expression is a type representing data in a cell reference area, building the reference iteration calculation node based on the cell reference area.
11. A data processing apparatus of a table, characterized by, comprising: a determining module configured to determine a target expression corresponding to a formula included in a target cell; a calculating module configured to encapsulate each parameter included in the target expression into a calculation node matching a parameter type corresponding to the parameter based on the target expression, and execute the calculation nodes based on an association relationship between the calculation nodes to obtain a calculation result of the target cell, wherein the calculation node is used to calculate a calculation result corresponding to the parameter through a logic function matching the parameter type.
12. A computer readable medium having stored thereon a computer program, characterized in that, The computer program is executed by the processing device to implement the steps of the method of any one of claims 1-10.
13. An electronic device, comprising: comprising: a storage device having a computer program stored thereon; a processing device configured to execute the computer program in the storage device to implement the steps of the method of any one of claims 1-10.
14. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processing device to implement the steps of the method of any one of claims 1-10. The computer program is executed by the processing device to implement the steps of the method of any one of claims 1-10.