Data processing method and related equipment
By automatically building directed acyclic graphs and generating linear queues, the cumbersome operation problems when updating document calculation formulas are solved, processing efficiency and flexibility is improved, and time and resources are saved.
Patent Information
- Application Number
- CN202510470581.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2025-08-01
AI Technical Summary
The prior art requires manual repetition of cumbersome listing and arrangement of calculation formulas when updating document calculation formulas, resulting in low processing efficiency and waste of resources.
By automatically building a directed acyclic graph and generating a linear queue, update the formula information and the initial formula information of the target document based on the formula, determine the target input field, output field and input and output relationship, and generate the target linear queue to avoid cumbersome manual operations.
It improves the efficiency and accuracy of document processing, saves time and resources, and flexibly responds to various dynamic update needs.
Smart Images

Figure CN120409715A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of data processing. More specifically, they are data processing methods, data processing devices, data processing equipment, computer-readable storage media, and computer program products containing instructions. Background Art
[0002] There are multiple corresponding calculation formulas among the fields of documents in different fields. For example, amount = unit price × quantity, etc. Amount, unit price, and quantity are all fields of the document. Any update to the calculation formula (such as adding, modifying, or removing an input / output factor of a certain calculation formula) will cause other calculation formulas of the document to change, and thus the order of calculation among the fields of the document will also change. The existing data processing method is that when there is a formula update requirement, it is necessary to manually list all the multiple calculation formulas among the fields on the document again, and manually exhaust and arrange the order of calculation among the fields in the multiple calculation formulas again, resulting in very low processing efficiency of the document.
[0003] Moreover, every time there is a formula update requirement, it is necessary to manually repeat the above operations, and the operation steps are relatively cumbersome, resulting in a large waste of time and resources. Summary of the Invention
[0004] The embodiments of the present application provide a data processing method, a data processing device, data processing equipment, a computer-readable storage media, and a computer program product containing instructions, which can perform data processing while improving the processing efficiency of documents.
[0005] In a first aspect, the embodiments of the present application provide a data processing method, including:
[0006] Obtain formula update information according to a formula update request. The formula update information is used to represent an update of the calculation logic of multiple calculation formulas corresponding to the fields of a target document. The calculation logic includes input fields and / or output fields of the multiple calculation formulas;
[0007] Based on the formula update information and the initial formula information of the target document, determine a target input field, a target output field, and a target input-output relationship associated with the formula update information, and obtain a target local directed acyclic graph based on the target input field, the target output field, and the target input-output relationship;
[0008] Generate a target linear queue corresponding to the formula update information based on the target local directed acyclic graph. The target linear queue is used to represent the order of calculation before and after among the respective target fields associated with the formula update information. The respective target fields include the target input field and / or the target output field.
[0009] In a second aspect, an embodiment of the present application provides a data processing device, including:
[0010] An acquisition unit, configured to acquire formula update information according to a formula update request, where the formula update information is used to represent an update of the calculation logic of multiple calculation formulas corresponding to each field of a target document, and the calculation logic includes input fields and / or output fields of the multiple calculation formulas;
[0011] The acquisition unit is further configured to determine a target input field, a target output field, and a target input-output relationship associated with the formula update information based on the formula update information and the initial formula information of the target document, and obtain a target locally directed acyclic graph based on the target input field, the target output field, and the target input-output relationship;
[0012] A generation unit, configured to generate a target linear queue corresponding to the formula update information based on the target locally directed acyclic graph, where the target linear queue is used to represent the sequential calculation order between each target field associated with the formula update information, and each target field includes the target input field and / or the target output field.
[0013] In a third aspect, an embodiment of the present application provides a data processing device, including:
[0014] A central processing unit, a memory, an input / output interface, a wired or wireless network interface, and a power supply;
[0015] The memory is a transient storage memory or a persistent storage memory;
[0016] The central processing unit is configured to communicate with the memory and execute instruction operations in the memory to execute the foregoing data processing method.
[0017] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium includes instructions, and when the instructions run on a computer, the computer is caused to execute the foregoing data processing method.
[0018] In a fifth aspect, an embodiment of the present application provides a computer program product including instructions, and when the computer program product runs on a computer, the computer is caused to execute the foregoing data processing method.
[0019] As can be seen from the above technical solutions, the embodiments of the present application have the following advantages: It can automatically update information and the initial formula information of the target document based on a formula, determine the complete target input fields, target output fields, and target input-output relationships linked to the formula update information, and obtain a target local directed acyclic graph based on the complete target input fields, target output fields, and target input-output relationships. A target linear queue corresponding to the formula update information is generated based on the target local directed acyclic graph. By automatically constructing a directed acyclic graph and generating a linear queue, the cumbersome steps of manually listing and arranging calculation formulas are eliminated, and the processing efficiency of the document is relatively high. Moreover, it avoids the cumbersome operations of manually repeating the listing and arranging of calculation formulas every time there is a formula update requirement in the prior art, thereby saving time and resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 FIG. is a schematic structural diagram of a data processing system disclosed in an embodiment of the present application;
[0021] Figure 2 FIG. is a schematic flowchart of a data processing method disclosed in an embodiment of the present application;
[0022] Figure 2-1 FIG. is a schematic diagram of multiple calculation formulas corresponding to each field on a purchase receipt form disclosed in an embodiment of the present application;
[0023] Figure 2-2 FIG. is a schematic diagram of a target local directed acyclic graph disclosed in an embodiment of the present application;
[0024] Figure 3 FIG. is a schematic flowchart of another data processing method disclosed in an embodiment of the present application;
[0025] Figure 3-1 FIG. is a schematic diagram of a target global directed acyclic graph disclosed in an embodiment of the present application;
[0026] Figure 4 FIG. is a schematic structural diagram of a data processing device disclosed in an embodiment of the present application;
[0027] Figure 5 FIG. is a schematic structural diagram of a data processing device disclosed in an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0028] Embodiments of the present application provide a data processing method, a data processing device, a data processing device, a computer-readable storage medium, and a computer program product including instructions, which can perform data processing while improving the processing efficiency of documents.
[0029] Please refer to Figure 1 , the architecture of the data processing system in the embodiments of the present application includes:
[0030] A data processing device 101 and a client 102. When data processing is performed, the data processing device 101 can be connected to the client 102. The data processing device 101 can obtain a formula update request sent by the client 102, obtain formula update information according to the formula update request, and then, based on the formula update information and the initial formula information of the target document, determine a target input field, a target output field, and a target input-output relationship associated with the formula update information to obtain a target local directed acyclic graph. Finally, a target linear queue corresponding to the formula update information is generated based on the target local directed acyclic graph, the saved target linear queue corresponding to the field value update request can be determined and executed, and the execution result is returned to the client 102.
[0031] Based on Figure 1 the data processing system shown, please refer to Figure 2 , Figure 2 which is a schematic flowchart of a data processing method disclosed in an embodiment of the present application. The method includes:
[0032] 201. Obtain formula update information according to a formula update request. The formula update information is used to represent update information on the calculation logic of multiple calculation formulas corresponding to each field of the target document. The calculation logic includes input fields and / or output fields of multiple calculation formulas.
[0033] In this embodiment, when data processing is performed, formula update information can be obtained according to a formula update request. The formula update information is used to represent an update of the calculation logic of multiple calculation formulas corresponding to each field of the target document. The update of the calculation logic includes, but is not limited to, addition, modification, and / or removal of the calculation logic. The calculation logic includes input fields and / or output fields of multiple calculation formulas.
[0034] Specifically, the target document includes, but is not limited to, documents such as purchase receipt notes in inventory management. For example, assume that the target document is a purchase receipt note in inventory management. The multiple calculation formulas between the fields on the purchase receipt note can be referred to Figure 2-1 , Figure 2-1 which is a schematic diagram of multiple calculation formulas corresponding to each field on a purchase receipt note disclosed in an embodiment of the present application. From Figure 2-1It can be known that, for example, calculation formula 1 is "tax amount = total tax-inclusive price ÷ (1 + tax rate) × tax rate", then "tax amount" is the output field (output factor) of calculation formula 1, "total tax-inclusive price" and "tax rate" are the input fields (input factors) of calculation formula 1, and "÷", "+", and "×" are the operation symbols of calculation formula 1. For example, calculation formula 2 is "amount = total tax-inclusive price - tax amount", then "amount" is the output field (output factor) of calculation formula 2, "total tax-inclusive price" and "tax amount" are the input fields (input factors) of calculation formula 2. For example, calculation formula 3 is "tax amount in local currency (if the conversion method = direct exchange rate) = tax amount × exchange rate", then "tax amount in local currency" is the output field (output factor) of calculation formula 3, "tax amount" and "exchange rate" are the input fields (input factors) of calculation formula 3. For example, the formula update information is used to represent that the "tax rate" field in multiple calculation formulas (including calculation formulas 1, 2, and 3) among the fields on the purchase receipt is modified, and the "tax rate" is modified to "tax rate - A".
[0035] 202. Based on the formula update information and the initial formula information of the target document, determine the target input fields, target output fields, and target input-output relationships associated with the formula update information, and obtain a target local directed acyclic graph based on the target input fields, target output fields, and target input-output relationships.
[0036] After obtaining the formula update information according to the formula update request, based on the formula update information and the initial formula information of the target document, the target input fields, target output fields, and target input-output relationships associated with the formula update information can be determined, and a target local directed acyclic graph can be obtained based on the target input fields, target output fields, and target input-output relationships.
[0037] It should be understood that the target input fields, target output fields, and target input-output relationships associated with the formula update information refer to the input fields, output fields, and input-output relationships that will be affected by the formula update information. Secondly, by combining the formula update information (including the modified information) and the initial formula information of the target document (including the unmodified information) to determine the target input fields, target output fields, and target input-output relationships associated with the formula update information, the accuracy of determining the target input fields, target output fields, and target input-output relationships can be improved, thereby improving the accuracy of generating the target linear queue corresponding to the formula update information.
[0038] Specifically, if the "tax rate" is modified to "tax rate - A", the information based on the formula and the initial formula information of the target document can be used to determine the target input fields (such as "total price including tax", "tax rate", "tax amount", and "exchange rate") linked to the formula update information, the target output fields (such as "tax amount", "amount", and "tax amount in local currency", etc.), and the target input-output relationships (such as the "tax amount" being the output field corresponding to the two input fields of "total price including tax" and "tax rate", the "amount" being the output field corresponding to the two input fields of "total price including tax" and "tax amount", and the "tax amount in local currency" being the output field corresponding to the two input fields of "tax amount" and "exchange rate", etc.). Then, the links between each field can be made based on the target input fields, target output fields, and target input-output relationships. Such links include, but are not limited to, linking the input-output characteristics of the same field (such as the characteristic that the "tax amount" is "both the output field of calculation formula 1 and the input field of calculation formula 2"), thereby constructing and generating a target local directed acyclic graph.
[0039] More specifically, please refer to Figure 2-2 , Figure 2-2 which is a schematic diagram of a target local directed acyclic graph disclosed in an embodiment of the present application. As can be seen from Figure 2-2 , Figure 2-2 is the target local directed acyclic graph (a data structure) corresponding to the formula update information for modifying the "tax rate" to "tax rate - A". As can be seen from the target local directed acyclic graph in the figure, since the "tax amount" is the output field of calculation formula 1 and also the input field of calculation formula 2, modifying the "tax rate" will cause the "tax amount" to be modified, and further cause the "amount" to be changed. Similarly, modifying the "tax amount" will also cause the "tax amount in local currency" to be modified.
[0040] It can be understood that the method for obtaining the target local directed acyclic graph can be to first generate a target global directed acyclic graph based on the formula update information for the initial formula information, and then generate a target local directed acyclic graph based on the target global directed acyclic graph; it can also be to first determine the target input fields, target output fields, and target input-output relationships linked to the formula update information based on the formula update information and the initial formula information of the target document, and then determine the "both output field and input field" characteristics of the same field through the target algorithm for linking, directly constructing and generating the target local directed acyclic graph. It can also be other reasonable methods, which are not specifically limited here.
[0041] 203. Generate a target linear queue corresponding to the formula update information based on the target local directed acyclic graph. The target linear queue is used to represent the sequential calculation order between each target field linked to the formula update information. Each target field includes a target input field and / or a target output field.
[0042] After obtaining the target local directed acyclic graph, a target linear queue corresponding to the formula update information can be generated based on the target local directed acyclic graph. The target linear queue is used to represent the sequential calculation order among the respective target fields linked to the formula update information. Each target field includes a target input field and / or a target output field.
[0043] Specifically, continuing with the above example, the target linear queue could be, for instance, "Unit Price → Tax Amount → Amount → Actual Unit Price → Tax Amount in Local Currency → Amount in Local Currency". This target linear queue describes the calculation order of the field values of "Unit Price", "Tax Amount", "Amount", "Actual Unit Price", "Tax Amount in Local Currency", and "Amount in Local Currency" respectively.
[0044] It can be understood that the target linear queue is called and executed after the field value update corresponding to the target field is obtained to return the calculation result.
[0045] It is worth mentioning that this method of generating a target local directed acyclic graph based on the formula update information and generating a target linear queue corresponding to the formula update information based on the target local directed acyclic graph can generate the target local directed acyclic graph only based on the fields and input-output relationships linked to the formula update information, thereby generating only the target linear queue linked to the formula update information, avoiding the generation of linear queues for other fields and other input-output relationships that are not affected by the formula update information, thus improving the efficiency of generating the target linear queue corresponding to the formula update information.
[0046] In the embodiments of the present application, the complete target input fields, target output fields, and target input-output relationships linked to the formula update information can be automatically determined based on the formula update information and the initial formula information of the target document, and the target local directed acyclic graph can be obtained based on the complete target input fields, target output fields, and target input-output relationships. The target linear queue corresponding to the formula update information is generated based on the target local directed acyclic graph. By automatically constructing the directed acyclic graph and generating the linear queue, the cumbersome steps of manually listing and arranging calculation formulas are eliminated, the efficiency of generating the target linear queue corresponding to the formula update information is improved, and thus the processing efficiency of the document is improved. And it avoids the cumbersome operations of manually repeating the listing and arranging of calculation formulas every time there is a formula update requirement in the prior art, thereby saving time and resources. Further, the formula update information can be used to represent various dynamic update information of the calculation logic, and the target linear queue corresponding to the formula update information can be generated for various dynamic update requirements. Therefore, the flexibility of generating the target linear queue corresponding to the formula update information is relatively high.
[0047] Based on Figure 2In the described embodiments, during data processing, in order to further improve the efficiency and accuracy of generating the target local directed acyclic graph, thereby further improving the efficiency and accuracy of generating the target linear queue of documents when updating the formula, and thus improving the processing efficiency and accuracy of documents. The following provides a detailed embodiment that can be optionally executed during the implementation of this solution. Please refer to Figure 3 , Figure 3 is a schematic flowchart of another data processing method disclosed in the embodiments of the present application. The method of another embodiment of the data processing method of the present application includes:
[0048] 301. Obtain formula update information according to a formula update request. The formula update information is used to represent the update of the calculation logic of multiple calculation formulas corresponding to each field of the target document. The calculation logic includes input fields and / or output fields of multiple calculation formulas.
[0049] Step 301 in this embodiment is similar to step 201 in the embodiment Figure 2 shown above, and will not be elaborated here.
[0050] 302. Update the initial formula information based on the formula update information to obtain the target formula information of the target document.
[0051] After obtaining the formula update information, the initial formula information can be updated based on the formula update information to obtain the target formula information of the target document.
[0052] Specifically, for example, the initial formula information includes each initial calculation formula (including but not limited to initial calculation formulas 1, 2, 3, and 4). The initial calculation formula 1 is "Tax amount = Total amount including tax ÷ (1 + Tax rate) × Tax rate", the initial calculation formula 2 is "Amount = Total amount including tax - Tax amount", the initial calculation formula 3 is "Tax amount in local currency (if the conversion method = direct exchange rate) = Tax amount × Exchange rate", and the initial calculation formula 4 is "Basic quantity = Quantity × (Conversion rate between measurement unit and basic unit)". If "Tax rate" is modified to "Tax rate - A", the target formula information includes each target calculation formula obtained after the update (including but not limited to target calculation formulas 1, 2, 3, and 4). The target calculation formula 1 is "Tax amount' = Total amount including tax ÷ [1 + (Tax rate - A)] × (Tax rate - A)", the target calculation formula 2 is "Amount = Total amount including tax - Tax amount'", the target calculation formula 3 is "Tax amount in local currency' (if the conversion method = direct exchange rate) = Tax amount' × Exchange rate", and the target calculation formula 4 is the same as the initial calculation formula 4.
[0053] 303. Take the input field, output field, and input-output relationship of the target formula information as the input node, output node, and input-output node relationship corresponding to the target formula information, and generate a target global directed acyclic graph based on the input node, output node, and input-output node relationship corresponding to the target formula information.
[0054] After obtaining the target formula information of the target document, the input field, output field, and input-output relationship of the target formula information can be taken as the input node, output node, and input-output node relationship corresponding to the target formula information, and a target global directed acyclic graph can be generated based on the input node, output node, and input-output node relationship corresponding to the target formula information.
[0055] Specifically, the target calculation formula obtained after comprehensive update and the target calculation formula that is consistent with the initial calculation formula without update are combined to generate a target global directed acyclic graph, which can be referred to Figure 3-1 , Figure 3-1 is a schematic diagram of a target global directed acyclic graph disclosed in an embodiment of the present application. As can be seen from Figure 3-1 it can be seen that Figure 3-1 the target global directed acyclic graph includes the input-output relationship between the input / output fields linked to the formula update information and the input-output relationship between the input / output fields not linked to the formula update information.
[0056] Among them, before taking the input field, output field, and input-output relationship of the target formula information as the input node, output node, and input-output node relationship corresponding to the target formula information, the input field, output field, and input-output relationship of the target formula information can be determined based on the input and / or output identifiers of each field in the target formula information.
[0057] It is worth mentioning that determining the input field, output field, and input-output relationship of the target formula information based on the input and / or output identifiers of each field in the target formula information can improve the feasibility and accuracy of determining the input field, output field, and input-output relationship of the target formula information.
[0058] Among them, the method of generating a target global directed acyclic graph based on the input node, output node, and input-output node relationship corresponding to the target formula information can be to generate an initial global directed acyclic graph based on the input node, output node, and input-output node relationship corresponding to the target formula information. If it is determined that there is no node in the initial global directed acyclic graph that is both the input node and the output node corresponding to the target calculation formula, then the initial global directed acyclic graph is taken as the target global directed acyclic graph, and the target global directed acyclic graph includes the input node and the output node corresponding to each calculation formula.
[0059] Specifically, determining whether there is a node in the initial global directed acyclic graph that is both an input node and an output node corresponding to the target calculation formula means verifying whether there is a cycle structure in the directed acyclic graph. The cycle structure is used to represent that there is a cyclic calculation between calculation formulas. For example, from the current directed acyclic graph, it can be seen that modifying field A triggers an update of field B, and the update of field B in turn triggers an update of field A. Then, this situation has a cyclic calculation, and it can be determined that the directed acyclic graph has a cycle structure. This situation belongs to a logical error in business. When such an error is detected, a calculation logic error can be prompted, and the corresponding modification can be made to the directed acyclic graph to ensure that the obtained directed acyclic graph has no cycle structure, thereby improving the accuracy of the target linear queue corresponding to the generated formula update information.
[0060] 304. Determine the target input field, target output field, and the target input node, target output node, and target input-output node relationship corresponding to the target input-output relationship in the target global directed acyclic graph, and obtain the target local directed acyclic graph based on the target input node, target output node, and target input-output node relationship.
[0061] After generating the target global directed acyclic graph, the target input field, target output field, and the target input node, target output node, and target input-output node relationship corresponding to the target input-output relationship can be determined in the target global directed acyclic graph, and the target local directed acyclic graph can be obtained based on the target input node, target output node, and target input-output node relationship.
[0062] Among them, the method for determining the target input field, target output field, and the target input node, target output node, and target input-output node relationship corresponding to the target input-output relationship in the target global directed acyclic graph can be as follows: First, in the target global directed acyclic graph, use the node corresponding to the formula update information as the starting node, and determine at least one target reachable node corresponding to the starting node. The starting node is the target input node, and the target reachable node is the target input node and / or target output node. Then, use the relationship between each node among the starting node and the at least one target reachable node as the target input-output node relationship.
[0063] It can be understood that using the node corresponding to the formula update information as the starting node means the node directly corresponding to the formula update information, and at least one target reachable node corresponding to the starting node means at least one target reachable node determined by the reachability analysis algorithm that will be directly or indirectly affected by the starting node.
[0064] Specifically, for example, if the formula update information is used to represent the modification of "tax rate" to "tax rate - A", the node directly corresponding to the formula update information is the "tax rate" node. If the formula update information is used to represent the modification of the operation symbol "×" in the calculation formula 1 "tax amount = total tax-inclusive price ÷ (1 + tax rate) × tax rate" to "÷", the node directly corresponding to the formula update information is the node corresponding to the input field of the calculation formula where the operation symbol is modified. That is, the "tax rate" node is the starting node. At this time, at least one target reachable node corresponding to the "tax rate" starting node can include "tax amount", "amount", "tax amount in local currency", etc.
[0065] It is worth mentioning that first, in the target global directed acyclic graph, taking the node corresponding to the formula update information as the starting node, and then determining at least one target reachable node corresponding to the starting node can improve the accuracy and efficiency of determining the target input node, target output node, and the relationship between the target input and output nodes.
[0066] 305. Generate a target linear queue corresponding to the formula update information based on the target local directed acyclic graph. The target linear queue is used to represent the sequential calculation order among the respective target fields associated with the formula update information. The respective target fields include target input fields and / or target output fields.
[0067] Step 301 in this embodiment is similar to step 201 in the Figure 2 illustrated embodiment described above, and will not be elaborated here.
[0068] In this embodiment, the initial formula information of the information and the target document can be automatically updated based on the formula, and the complete target input fields, target output fields, and target input-output relationships linked to the formula update information can be determined. Then, based on the complete target input fields, target output fields, and target input-output relationships, a target local directed acyclic graph can be obtained. Based on the target local directed acyclic graph, a target linear queue corresponding to the formula update information can be generated. By automatically constructing a directed acyclic graph and generating a linear queue, the cumbersome steps of manually listing and arranging calculation formulas are eliminated, the efficiency of generating the target linear queue corresponding to the formula update information is improved, and thus the processing efficiency of the document is improved. Moreover, it avoids the cumbersome operations of manually repeating the listing and arranging of calculation formulas every time there is a formula update requirement in the prior art, thereby saving time and resources. Further, the formula update information can be used to represent information on various dynamic updates of the calculation logic, and a target linear queue corresponding to the formula update information can be generated for various dynamic update requirements. Therefore, the flexibility of generating the target linear queue corresponding to the formula update information is relatively high. Secondly, in the target global directed acyclic graph, the node corresponding to the formula update information can be used as the starting node first, and then at least one target reachable node corresponding to the starting node can be determined, which can improve the accuracy and efficiency of determining the target input node, target output node, and the relationship between the target input-output nodes, further improve the efficiency and accuracy of generating the target local directed acyclic graph, and thus further improve the efficiency and accuracy of generating the target linear queue of the document when updating the formula.
[0069] Based on Figure 2 and Figure 3 the embodiments, in order to further improve the generation efficiency and accuracy of the target linear queue, the following improvements in the implementation manner can also be made:
[0070] Among them, the method of generating a target linear queue corresponding to the formula update information based on the target local directed acyclic graph can be to sort the nodes of the target local directed acyclic graph based on the topological sorting algorithm to obtain a target linear task queue.
[0071] It is worth mentioning that by performing topological sorting on the target local directed acyclic graph, it can be ensured that the target field is processed only after the dependent fields preceding the target field are processed, which improves the accuracy of subsequent calculations based on the target linear task queue.
[0072] Among them, after generating a target linear queue corresponding to the formula update information based on the target local directed acyclic graph, the target linear queue corresponding to the formula update information can be saved, a field value update request can be obtained, and the field value update request is used to represent a request for updating the field value of the target input field and / or target output field. Then, the saved target linear queue corresponding to the field value update request is determined and executed.
[0073] It is worth mentioning that usually, in the absence of formula updates, the constructed directed acyclic graph is fixed. If the directed acyclic graph does not change, the target linear queue corresponding to the field value update request is also fixed. Therefore, saving the target linear queue to the storage resource and directly determining and executing the saved target linear queue based on the field value update request can improve the efficiency of determining and executing the target linear queue and enhance the performance of executing the target linear queue. Secondly, the target global directed acyclic graph and the target local directed acyclic graph can also be saved, and then the directed acyclic graph can be updated based on the formula update information to obtain the accurate updated target local directed acyclic graph, thereby obtaining the accurate updated target linear queue, avoiding duplicate content in the repeated construction of the directed acyclic graph, improving the efficiency of obtaining the target local directed acyclic graph, improving the efficiency of determining and executing the target linear queue, and enhancing the performance of executing the target linear queue.
[0074] It is also worth mentioning that in addition to the method of automatically generating the target linear queue corresponding to the formula update information based on the directed acyclic graph structure described above, a listening mode can also be used to generate the target linear queue corresponding to the formula update information.
[0075] Specifically, the formula update information of multiple current calculation formulas of the target document in the target document page can be listened to (for example, the input field, output field, and / or arithmetic symbol have been updated). The current node directly corresponding to the formula update information can be added to the linear queue, and the formula update information can be used as a signal to be transmitted to the target input field, target output field, and target input-output relationship of other calculation formulas in linkage, so as to obtain the target linear queue corresponding to the formula update information.
[0076] The data processing method in the embodiments of the present application has been described above. Next, the data processing device in the embodiments of the present application will be described. Please refer to Figure 4 , an embodiment of the data processing device in the embodiments of the present application includes:
[0077] An acquisition unit, configured to acquire formula update information according to a formula update request, where the formula update information is used to represent an update of the calculation logic of multiple calculation formulas corresponding to each field of a target document, and the calculation logic includes the input field and / or output field of the multiple calculation formulas;
[0078] The acquisition unit is further configured to determine a target input field, a target output field, and a target input-output relationship linked to the formula update information based on the formula update information and the initial formula information of the target document, and obtain a target local directed acyclic graph based on the target input field, the target output field, and the target input-output relationship;
[0079] A generating unit, configured to generate a target linear queue corresponding to the formula update information based on the target local directed acyclic graph, where the target linear queue is used to represent the sequential calculation order between each target field linked to the formula update information, and each target field includes the target input field and / or the target output field.
[0080] The obtaining unit is specifically configured to update the initial formula information based on the formula update information to obtain the target formula information of the target document, use the input field, output field, and input-output relationship of the target formula information as the input node, output node, and input-output node relationship corresponding to the target formula information, generate a target global directed acyclic graph based on the input node, output node, and input-output node relationship corresponding to the target formula information, determine the target input node, target output node, and target input-output node relationship corresponding to the target input field, target output field, and target input-output relationship in the target global directed acyclic graph, and obtain the target local directed acyclic graph based on the target input node, target output node, and target input-output node relationship.
[0081] The data processing device further includes:
[0082] A determining unit, configured to determine the input field, output field, and input-output relationship of the target formula information based on the input and / or output identifiers of each field in the target formula information.
[0083] The obtaining unit is specifically configured to generate an initial global directed acyclic graph based on the input node, output node, and input-output node relationship corresponding to the target formula information. If it is determined that there is no node in the initial global directed acyclic graph that is both an input node and an output node corresponding to the target calculation formula, then use the initial global directed acyclic graph as the target global directed acyclic graph, and the target global directed acyclic graph includes the input node and output node corresponding to each calculation formula.
[0084] The obtaining unit is specifically configured to use the node corresponding to the formula update information as a starting node in the target global directed acyclic graph, and determine at least one target reachable node corresponding to the starting node. The starting node is the target input node, and the target reachable node is the target input node and / or the target output node. Use the relationship between each node among the starting node and the at least one target reachable node as the target input-output node relationship.
[0085] The generating unit is specifically configured to sort the nodes of the target local directed acyclic graph based on a topological sorting algorithm to obtain the target linear task queue.
[0086] The data processing device further includes:
[0087] a storage unit, configured to store a target linear queue corresponding to the formula update information;
[0088] The obtaining unit is further configured to obtain a field value update request, where the field value update request is used to represent a request for updating the field value of the target input field and / or the target output field;
[0089] The determining unit is further configured to determine and execute the stored target linear queue corresponding to the field value update request.
[0090] In the embodiments of the present application, it is possible to automatically determine, based on the formula update information and the initial formula information of the target document, a complete set of target input fields, target output fields, and target input-output relationships that are linked to the formula update information, and obtain a target partial directed acyclic graph based on the complete set of target input fields, target output fields, and target input-output relationships. Then, generate a target linear queue corresponding to the formula update information based on the target partial directed acyclic graph. By automatically constructing a directed acyclic graph and generating a linear queue, the cumbersome steps of manually listing and arranging calculation formulas are eliminated, the efficiency of generating the target linear queue corresponding to the formula update information is improved, and thus the processing efficiency of the document is improved. Moreover, it avoids the cumbersome operations of manually repeating the listing and arranging of calculation formulas every time there is a formula update requirement in the prior art, thereby saving time and resources.
[0091] Please refer to Figure 5 for an embodiment of a data processing device 500 in the embodiments of the present application, which includes:
[0092] a central processing unit 501, a memory 505, an input / output interface 504, a wired or wireless network interface 503, and a power supply 502;
[0093] The memory 505 is a transient storage memory or a persistent storage memory;
[0094] The central processing unit 501 is configured to communicate with the memory 505 and execute the instruction operations in the memory 505 to execute the methods in the foregoing Figure 2 and Figure 3 illustrated embodiments.
[0095] The embodiments of the present application further provide a computer-readable storage medium, where the computer-readable storage medium includes instructions that, when running on a computer, cause the computer to execute the methods in the foregoing Figure 2 and Figure 3 illustrated embodiments.
[0096] The embodiments of the present application also provide a computer program product containing instructions. When the computer program product runs on a computer, it causes the computer to execute the methods in the foregoing Figure 2 and Figure 3 illustrated embodiments.
[0097] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are shown in sequence according to the arrows, these steps do not necessarily have to be executed in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps has no strict order restriction, and these steps can be executed in other orders. Moreover, at least some of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages do not necessarily have to be executed at the same moment, but can be executed at different moments. The execution order of these steps or stages does not necessarily have to be sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.
[0098] Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated here.
[0099] In several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling, direct coupling, or communication connection can be through some interfaces, and the indirect coupling or communication connection of devices or units can be in electrical, mechanical, or other forms.
[0100] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they can be located in one place, or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0101] In addition, the functional units in each embodiment of the present application can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-integrated units can be implemented in the form of hardware or in the form of software functional units.
[0102] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The foregoing storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs.
Claims
1. A data processing method, characterized in that, Including: Obtain formula update information according to a formula update request, where the formula update information is used to represent an update to the calculation logic of multiple calculation formulas corresponding to each field of a target document, and the calculation logic includes input fields and / or output fields of the multiple calculation formulas; Based on the formula update information and the initial formula information of the target document, determine a target input field, a target output field, and a target input-output relationship associated with the formula update information, and obtain a target local directed acyclic graph based on the target input field, the target output field, and the target input-output relationship; Generate a target linear queue corresponding to the formula update information based on the target local directed acyclic graph, where the target linear queue is used to represent the order of calculation precedence among each target field associated with the formula update information, and each target field includes the target input field and / or the target output field.
2. The method according to claim 1, wherein The step of based on the formula update information and the initial formula information of the target document, determining a target input field, a target output field, and a target input-output relationship associated with the formula update information, and obtaining a target local directed acyclic graph based on the target input field, the target output field, and the target input-output relationship includes: Update the initial formula information based on the formula update information to obtain the target formula information of the target document; Use the input field, output field, and input-output relationship of the target formula information as the input node, output node, and input-output node relationship corresponding to the target formula information, and generate a target global directed acyclic graph based on the input node, output node, and input-output node relationship corresponding to the target formula information; Determine the target input node, target output node, and target input-output node relationship corresponding to the target input field, target output field, and target input-output relationship in the target global directed acyclic graph, and obtain the target local directed acyclic graph based on the target input node, target output node, and target input-output node relationship.
3. The method according to claim 2, characterized in that, Before using the input field, output field, and input-output relationship of the target formula information as the input node, output node, and input-output node relationship corresponding to the target formula information, the method further includes: Determine the input field, output field, and input-output relationship of the target formula information based on the input and / or output identifiers of each field in the target formula information.
4. The method according to claim 2, wherein The target global directed acyclic graph includes an input node and an output node corresponding to each calculation formula; The step of generating a target global directed acyclic graph based on the input node, output node, and input-output node relationship corresponding to the target formula information includes: Generate an initial global directed acyclic graph based on the input node, output node, and input-output node relationship corresponding to the target formula information; If it is determined that there is no node in the initial global directed acyclic graph that is both an input node and an output node corresponding to a target calculation formula, then use the initial global directed acyclic graph as the target global directed acyclic graph.
5. The method according to claim 2, characterized in that, Determining the target input node, target output node, and target input-output node relationship corresponding to the target input field, target output field, and target input-output relationship in the target global directed acyclic graph includes: In the target global directed acyclic graph, using the node corresponding to the formula update information as the starting node, and determining at least one target reachable node corresponding to the starting node, where the starting node is the target input node, and the target reachable node is the target input node and / or the target output node; Taking the relationship between each node among the starting node and the at least one target reachable node as the target input-output node relationship.
6. The method according to claim 1, wherein Generating a target linear queue corresponding to the formula update information based on the target local directed acyclic graph includes: Sorting the nodes of the target local directed acyclic graph based on a topological sorting algorithm to obtain the target linear task queue.
7. The method according to any one of claims 1 to 6, characterized in that, After generating the target linear queue corresponding to the formula update information based on the target local directed acyclic graph, the method further includes: Saving the target linear queue corresponding to the formula update information; Obtaining a field value update request, where the field value update request is used to represent a request for updating the field value of the target input field and / or the target output field; Determining and executing the saved target linear queue corresponding to the field value update request.
8. A data processing device, characterized in that, Includes: An obtaining unit configured to obtain formula update information according to a formula update request, where the formula update information is used to represent an update to the calculation logic of multiple calculation formulas corresponding to each field of a target document, and the calculation logic includes the input field and / or output field of the multiple calculation formulas; The obtaining unit is further configured to determine, based on the formula update information and the initial formula information of the target document, a target input field, a target output field, and a target input-output relationship associated with the formula update information, and obtain a target local directed acyclic graph based on the target input field, the target output field, and the target input-output relationship; A generating unit configured to generate a target linear queue corresponding to the formula update information based on the target local directed acyclic graph, where the target linear queue is used to represent the sequential calculation order between each target field associated with the formula update information, and each target field includes the target input field and / or the target output field.
9. A data processing device, characterized in that, Includes: A central processing unit and a memory; The memory is a transient storage memory or a persistent storage memory; The central processing unit is configured to communicate with the memory and execute the instruction operations in the memory to execute the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes instructions that, when run on a computer, cause the computer to execute the method according to any one of claims 1 to 7.
11. A computer program product containing instructions, characterized in that, When the computer program product runs on a computer, it causes the computer to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method for extracting formula from table, electronic equipment and computer readable medium
CN113515920A
Method for supporting mass formula parallel computing
CN117291738A
Expression execution judgment method and device, equipment and storage medium
CN117827353A