Method for calculating data expression and related device

By extracting and concurrently calculating the results of data expressions in multiple documents, the problems of slow report generation speed and high system performance burden in the prior art are solved, and more efficient data expression calculation and report generation are achieved.

CN119807911APending Publication Date: 2025-04-11KINGDEE SOFTWARE(CHINA) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411877318.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-17
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

When processing data expressions in reports, the prior art adopts a one-by-one processing method, resulting in limited report generation speed and a significant burden on system performance.

Method used

By obtaining the full text content tree of the document, extracting and extracting multiple data expressions, calculating the results of these data expressions using multi-task concurrency, and replacing the results with the original data expressions to improve computing efficiency.

Benefits of technology

It significantly improves the computing efficiency of data expressions in multiple documents, reduces report generation time, and reduces the burden on system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119807911A_ABST
    Figure CN119807911A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a method for calculating data expressions and a related device, which are used for improving the operation efficiency of the data expressions in a plurality of documents. The method comprises the steps that a full-text content tree of a preset document is obtained, the full-text content tree comprises a plurality of nodes, and each node takes a minimum storage format as a unit and correspondingly stores document content and a document format; the bottommost node of the full-text content tree serves as a starting point, the full-text content tree is traversed to extract a plurality of data expressions in the full-text content tree, and the data expressions are used for executing calculation on data in a function mode; performing concurrent calculation on the plurality of data expressions by utilizing multiple tasks to obtain operation results of the plurality of data expressions; and correspondingly replacing the plurality of data expressions in the full-text content tree with the operation results of the plurality of data expressions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a method for calculating a data expression and a related device. Background Art

[0002] In modern enterprise management and data analysis, batch report generation is a very important task. Especially when faced with large amounts of data, generating reports quickly and efficiently can help companies make timely decisions and improve work efficiency.

[0003] In the process of generating reports, in addition to having to deal with thousands of data records, which prolongs the generation time, the number of data expressions in the report will directly increase the performance burden of the system. When processing data expressions in reports, the existing technology generally reads data directly in the current document, parses and calculates expressions, and then replaces the results in the document. This method of processing each data expression one by one obviously affects the speed of report generation. Summary of the invention

[0004] An embodiment of the present invention provides a method and related device for calculating data expressions, which are used to synchronously calculate data expressions in multiple documents and use the calculation results of multiple data expressions to replace multiple data expressions in the documents, thereby improving the calculation efficiency of data expressions in multiple documents.

[0005] A first aspect of an embodiment of the present application provides a method for calculating a data expression, including:

[0006] Obtaining a full-text content tree of a preset document, wherein the full-text content tree includes a plurality of nodes, each of which stores document content and document format in a minimum storage format;

[0007] Taking the bottommost node of the full-text content tree as a starting point, traversing the full-text content tree to extract a plurality of data expressions in the full-text content tree, wherein the data expressions are used to perform calculations on data in the form of functions;

[0008] Performing concurrent calculations on the multiple data expressions using multiple tasks to obtain calculation results of the multiple data expressions;

[0009] The operation results of the multiple data expressions are used to correspondingly replace the multiple data expressions in the full-text content tree.

[0010] Preferably, the document content includes a graphic component, a table component or a text content, and the graphic component, the table component or the text content all contain the data expression;

[0011] After extracting a plurality of data expressions in the full-text content tree, the method further includes:

[0012] simplifying the plurality of data expressions into a plurality of formatted data expressions;

[0013] Performing a deduplication operation on the multiple formatted data expressions to obtain multiple formatted data expressions after deduplication;

[0014] The correspondence between the graphic component, the table component, the text content and the multiple formatted data expressions after deduplication is stored in a first dictionary.

[0015] Preferably, the method further comprises:

[0016] The plurality of formatted data expressions after deduplication are stored in corresponding input data objects respectively to obtain a plurality of input data objects;

[0017] Determine identical input data objects among the multiple input data objects that have different data expressions but the same input data objects;

[0018] performing a deduplication operation on the identical input data objects among the multiple input data objects to obtain multiple deduplicated input data objects;

[0019] The correspondence between the multiple formatted data expressions after deduplication and the multiple input data objects after deduplication is stored in the second dictionary.

[0020] Preferably, the concurrently calculating the multiple data expressions using multiple tasks to obtain the operation results of the multiple data expressions includes:

[0021] Performing concurrent calculations on the multiple deduplicated input data objects using multiple tasks to obtain multiple output data objects corresponding to the multiple deduplicated input data objects, wherein the output data objects are used to store calculation results of the input data objects;

[0022] The correspondence between the multiple input data objects after deduplication and the multiple output data objects is stored in a third dictionary.

[0023] Preferably, the using the operation results of the multiple data expressions to replace the multiple data expressions in the full-text content tree includes:

[0024] Determine the input data object corresponding to each output data result according to the correspondence between the multiple output data objects and the multiple input data objects;

[0025] Determine the formatted data expression corresponding to each input data object according to the correspondence between the input data object and the plurality of formatted data expressions;

[0026] According to the correspondence between the formatted data expression and the graphic component, the table component or the text content, the multiple output data objects are correspondingly filled into the graphic component, the table component or the text content.

[0027] Preferably, the data expression includes a data set and a data set access function; or, the data expression includes: the data set and the data set access function, and at least one of a dimension and a dimension member;

[0028] The method further comprises:

[0029] The data set and the data set access function, or the data set and the data set access function, and at least one of the dimension and the dimension member in the data expression are stored in a cache;

[0030] storing the output data object in the cache;

[0031] The concurrently calculating the multiple data expressions by using multiple tasks to obtain the operation results of the multiple data expressions includes:

[0032] If the cache includes the data sets, the data set retrieval functions, the dimensions and / or the dimension members in the multiple data expressions, and the output data objects corresponding to the multiple data expressions, then the data sets, the data set retrieval functions, the dimensions and / or the dimension members, and the output data objects corresponding to the multiple data expressions are obtained from the cache.

[0033] Preferably, when the multiple data expressions are concurrently calculated using multiple tasks to obtain the operation results of the multiple data expressions, the method further includes:

[0034] When executing each task, each task is locked using a task lock until the execution of each task is completed.

[0035] Preferably, when obtaining the full-text content tree of the preset document, the method further includes:

[0036] Generate a batch number for the preset document, where the batch number is used to identify the quantity range of the preset document;

[0037] After the operation results of the multiple data expressions are used to replace the multiple data expressions in the full-text content tree, the method further includes:

[0038] The batch number is used to clear the cache and task lock information occupied by the preset documents of the batch number.

[0039] A second aspect of an embodiment of the present application provides a computer device, including:

[0040] An acquisition unit, used for acquiring a full-text content tree of a preset document, wherein the full-text content tree includes a plurality of nodes, each of which stores document content and document format in a minimum storage format;

[0041] An extraction unit, used to traverse the full-text content tree starting from the bottom node of the full-text content tree to extract multiple data expressions in the full-text content tree, wherein the data expressions are used to perform calculations on data in the form of functions;

[0042] A computing unit, used for concurrently computing the multiple data expressions using multiple tasks to obtain computing results of the multiple data expressions;

[0043] A replacement unit is used to replace the multiple data expressions in the full-text content tree with the operation results of the multiple data expressions.

[0044] A third aspect of an embodiment of the present application provides a computer device, including a processor and a memory, wherein the processor, when executing a computer program stored in the memory, is used to implement the method for calculating a data expression provided in the first aspect of an embodiment of the present application.

[0045] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it is used to implement the method for calculating data expressions provided in the first aspect of an embodiment of the present application.

[0046] A fifth aspect of an embodiment of the present application provides a computer program product on which a computer program is stored. When the computer program is executed by a processor, it is used to implement the method for calculating data expressions provided in the first aspect of an embodiment of the present application.

[0047] It can be seen from the above technical solutions that the embodiments of the present invention have the following advantages:

[0048] The method for calculating a data expression in an embodiment of the present application includes: obtaining a full-text content tree of a preset document, wherein the full-text content tree includes multiple nodes, each node correspondingly stores document content and document format in a minimum storage format; starting from the bottommost node of the full-text content tree, traversing the full-text content tree to extract multiple data expressions in the full-text content tree, wherein the data expressions are used to perform calculations on data in the form of functions; using multiple tasks to concurrently calculate the multiple data expressions to obtain operation results of the multiple data expressions; and using the operation results of the multiple data expressions to correspondingly replace the multiple data expressions in the full-text content tree.

[0049] The embodiments of the present application, on the one hand, extract data expressions in a preset document by means of a full-text content tree, thereby improving the efficiency of obtaining data expressions. Furthermore, after extracting the data expressions, multiple data expressions are concurrently calculated using multi-tasking, thereby further improving the calculation efficiency of multiple data expressions. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 This is a schematic diagram of the architecture of the computing system in the embodiment of the present application;

[0051] Figure 2 A schematic diagram of an embodiment of a method for calculating a data expression in an embodiment of the present application;

[0052] Figure 3 A schematic diagram of a storage tree structure of text content including data expressions in an embodiment of the present application;

[0053] Figure 4 A schematic diagram of another embodiment of the method for calculating a data expression in an embodiment of the present application;

[0054] Figure 5 It is a detailed step of step 204 in the embodiment of the present application;

[0055] Figure 6 A schematic diagram of another embodiment of the method for calculating a data expression in an embodiment of the present application;

[0056] Figure 7 It is a schematic diagram of an embodiment of a computer device in an embodiment of the present application. DETAILED DESCRIPTION

[0057] An embodiment of the present invention provides a method and related device for calculating data expressions, which are used to synchronously calculate data expressions in multiple documents and use the calculation results of multiple data expressions to replace multiple data expressions in the documents, thereby improving the calculation efficiency of data expressions in the documents.

[0058] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0059] The terms "first", "second", "third", "fourth", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0060] The embodiment of the present application provides a method for calculating data expressions. The general principle of the method for calculating data expressions is as follows: when it is necessary to operate on the data expressions in the document, the embodiment of the present application obtains the full-text content tree of the preset document, wherein the full-text content tree includes multiple nodes, each node is in the minimum storage format, and the document content and document format are stored correspondingly; starting from the bottom node of the full-text content tree, traverse the full-text content tree to extract multiple data expressions in the full-text content tree, wherein the data expression is used to perform calculations on the data in the form of functions; concurrently calculate the multiple data expressions using multiple tasks to obtain the calculation results of the multiple data expressions; and replace the multiple data expressions in the full-text content tree with the calculation results of the multiple data expressions. The method for calculating data expressions provided by the embodiment of the present application can, on the one hand, quickly extract the data expressions in the preset document, and on the other hand, can also quickly calculate the calculation results of multiple data expressions using multiple tasks, thereby improving the calculation efficiency of the data expressions in the document content.

[0061] In order to better implement the above-mentioned image detection solution, the present application embodiment provides a computing system, see Figure 1 , Figure 1A schematic diagram of the architecture of a computing system provided for an embodiment of the present application. The computing system may include at least one terminal device 101 and a server 102; different types of applications may be installed on the terminal device 101, for example, document applications such as Office, Excel, WPS, PDF, etc. may be installed on the terminal device 101; the terminal device 101 may be a smart phone, tablet computer, laptop computer, desktop computer, smart car, etc. The server 102 may be used to store document data and image data generated by different types of applications of the terminal device 101. The server 102 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and basic cloud computing services such as big data and artificial intelligence platforms, etc.

[0062] Among them, the above-mentioned method for calculating data expressions is executed by the terminal device 101 or the server 102. When the method for calculating data expressions is executed by the terminal device 101; the preset document content that the terminal device 101 needs to obtain can be included in the server, and then when the terminal device 101 needs to calculate the data expression in the preset document, the terminal device 101 can obtain the preset document from the server 102, and then after the terminal device 101 obtains the preset document from the server 102, it further obtains the full-text content tree of the preset document, takes the bottom node of the full-text content tree as the starting point, traverses the full-text content tree to extract multiple data expressions in the full-text content tree, wherein the data expression is used to perform calculations on data in the form of functions; then multiple data expressions are concurrently calculated using multiple tasks to obtain the calculation results of multiple data expressions; finally, the calculation results of multiple data expressions are used to replace multiple data expressions in the full-text content tree.

[0063] For ease of understanding, the method for calculating the data expression in the embodiment of the present application is described in detail below. Figure 2 , an embodiment of the method for calculating a data expression in the embodiment of the present application includes:

[0064] 201. Obtain a full-text content tree of a preset document, wherein the full-text content tree includes a plurality of nodes, each of which stores document content and document format in a minimum storage format;

[0065] When storing Word documents, a storage model based on OLE (Object Linking and Embedding) technology is adopted. In Microsoft Word content, the document content is also organized into a tree-like structure. Although it is not as public as DOM, it can be regarded as an implicit "content tree".

[0066] This tree structure includes elements such as titles, paragraphs, lists, images, and tables, which have a hierarchical relationship between them. Each element has its corresponding attributes, such as font, size, color and other information. When you edit a Word document, every change you make will be reflected in this content tree. Although users will not directly operate this content tree, the underlying engine of the software will maintain it to quickly render and save documents.

[0067] In order to quickly obtain data expressions in Word documents, the embodiment of the present application can obtain the content tree of a preset document and quickly extract data expressions from the content tree. Specifically, the full-text content tree is stored in the form of multiple hierarchical nodes, and each node is stored in the minimum storage format, corresponding to the document content and document format. For example, when a data expression is displayed in a bold font, the data expression will be stored in a certain node during storage, or the data expression will be stored in the form of multiple nodes, and the font format of the data expression will be stored in other related nodes. For easy understanding, Figure 3 A tree structure is given that stores the text content of a data expression.

[0068] It should be noted that the number of preset documents here can be single or multiple, and there is no specific restriction on the number of preset documents here.

[0069] 202. Starting from the bottommost node of the full-text content tree, traverse the full-text content tree to extract multiple data expressions in the full-text content tree, wherein the data expressions are used to perform calculations on data in the form of functions;

[0070] After obtaining the full-text content tree of the preset document, the full-text content tree is traversed starting from the bottom node of the full-text content tree to extract multiple data expressions in the full-text content tree, wherein the data expressions are used to perform calculations on data in the form of functions.

[0071] For ease of understanding, we use Figure 3 Taking the tree structure in as an example, the process of extracting data expressions is described:

[0072] As in Figure 3In the tree structure, starting from the bottom node, merge and traverse upward layer by layer to extract the data expression. Generally, in the process of extraction, each time a layer is merged, the merged content is judged to determine whether the content is a complete data expression. When judging, it can be judged according to the format followed by the data expression. For example, in the embodiment of the present application, generally a complete data expression will have braces set in its outer layer. Therefore, after merging the content in each layer of nodes, it can be determined whether the merged content contains complete braces, and then it can be determined whether the content in the brackets is a complete data expression. For example, in Figure 3 In the example, after merging the asset and {{Round(, the content obtained is the asset {{Round(. According to the preset data expression format, we can know that this content is not a complete data expression. Then we continue to traverse and merge upward until we get the following content: merged asset {{Round(bind("rsMulti","FMONEY","A.{R1005.children},PM-M03")+200,2}} million.

[0073] Specifically, the data expression in the embodiment of the present application may be contained in a graphic component, a table component or text content, such as Figure 3 The data expressions in are contained in the text content, while some data expressions are contained in graphic components, such as bar charts and pie charts, and some data expressions are contained in table components, such as calculation formulas in Excel. There is no specific restriction on the storage form and format of data expressions in the document.

[0074] 203. Perform concurrent calculations on the multiple data expressions using multiple tasks to obtain calculation results of the multiple data expressions;

[0075] In order to improve the calculation efficiency of data expressions, different from the method of using a single thread to calculate multiple data expressions in batches in the prior art, the embodiment of the present application uses multi-tasking to perform concurrent calculations on multiple data expressions to improve the calculation efficiency of multiple data expressions.

[0076] Specifically, the multi-tasking concurrency method can be multi-threaded processing, asynchronous I / O processing, or microservice architecture processing, etc., and no specific limitation is made to the multi-tasking concurrency method here.

[0077] 204. Use the operation results of the multiple data expressions to correspondingly replace the multiple data expressions in the full-text content tree.

[0078] After obtaining the calculation results of multiple data expressions, the calculation results of the multiple data expressions can be used to replace the multiple data expressions in the full-text content tree, and then the interface of the content in the Word document is rendered according to the full-text content tree.

[0079] The embodiments of the present application, on the one hand, extract data expressions in a preset document by means of a full-text content tree, thereby improving the efficiency of obtaining data expressions. Furthermore, after extracting the data expressions, multiple data expressions are concurrently calculated using multi-tasking, thereby further improving the calculation efficiency of multiple data expressions.

[0080] based on Figure 2 In the embodiment described above, after extracting multiple data expressions in the full-text content tree, the following steps may be performed. Figure 4 :

[0081] 401. Simplify multiple data expressions into multiple formatted data expressions;

[0082] Because data expressions may exist in the form of graphic components, table components or text content in a document, after the data expressions are extracted through the full-text content tree, there may be some problems with spaces and irregular capitalization in these data expressions. Therefore, in order to improve the computational efficiency of data expressions, an embodiment of the present application may be to simplify multiple data expressions into multiple formatted data expressions after the data expressions are extracted, wherein the formatted data expressions here only refer to data expressions that comply with the specifications, that is, spaces in the data expressions are deleted, and / or the case in the data expressions is normalized.

[0083] 402. Perform a deduplication operation on the multiple formatted data expressions to obtain multiple formatted data expressions after deduplication;

[0084] Furthermore, after extracting multiple data expressions from the graphic component, table component or text content and simplifying the multiple data expressions into formatted data expressions, because there may be repeated data expressions in these formatted data expressions, in order to avoid the waste of processing resources caused by repeated calculations, the embodiment of the present application can perform a deduplication operation on the multiple formatted data expressions after obtaining the multiple formatted data expressions to obtain multiple formatted data expressions after deduplication.

[0085] 403. Store the correspondence between the graphic component, the table component, the text content, and the multiple formatted data expressions after deduplication in a first dictionary.

[0086] It is considered that the embodiment of the present application performs formatting and deduplication processing on multiple data expressions, which leads to the problem that the final expression is not one-to-one corresponding to the original graphic components, table components or text content. Therefore, in order to realize the use of the calculation results of the data expression to replace the graphic components, table components and data expressions in the text content in the document content in the later stage, it is also necessary to pre-record the correspondence between the graphic components, table components and text content and the multiple formatted data expressions after deduplication.

[0087] 404. Store the multiple formatted data expressions after deduplication into corresponding input data objects respectively to obtain multiple input data objects;

[0088] Specifically, when performing operations on formatted data expressions, because business scenarios and user permissions are involved, the embodiment of the present application, after obtaining multiple deduplicated formatted data expressions, stores the multiple deduplicated formatted data expressions in corresponding input data objects respectively to obtain multiple input data objects. The input data objects here include not only the formatted data expressions but also data related to the business data, such as the user permissions of the user for the business data, and / or the business scenarios of the business data, etc.

[0089] 405. Determine identical input data objects among a plurality of input data objects, which have different data expressions but the same input data objects;

[0090] After obtaining multiple input data objects, because there may be long-coded or short-coded expression strings (such as some data expression strings are identified by A, while some data expressions are represented by Acode, but the two are the same), the multiple input data objects appear to have different data expression forms but the essence of the input data objects is the same. Therefore, in order to avoid waste of processing resources caused by repeated calculations, the embodiment of the present application also needs to determine the identical input data objects among the multiple input data objects that have different data expressions but the same input data objects, and perform deduplication operations on the identical input data objects.

[0091] 406. Perform a deduplication operation on identical input data objects among the multiple input data objects to obtain multiple deduplicated input data objects;

[0092] After obtaining the identical input data objects among the multiple input data objects, a deduplication operation is further performed on the analogical data structures among the multiple input data objects to obtain multiple deduplicated input data objects, thereby avoiding repeated calculation of identical input data objects.

[0093] 407. Store the correspondence between the multiple formatted data expressions after deduplication and the multiple input data objects after deduplication in a second dictionary.

[0094] Among the multiple formatted data expressions after deduplication, because there is a problem that multiple formatted data expressions correspond to the same input data object, the embodiment of the present application also needs to record the correspondence between the multiple formatted data expressions after deduplication and the multiple input data objects after deduplication, so that after obtaining the calculation results of the multiple data expressions, the calculation results can be used to correspond to replace the data expressions in the graphic components, table components and text content in the document content.

[0095] 408. Perform concurrent calculations on the multiple deduplicated input data objects using multiple tasks to obtain multiple output data objects corresponding to the multiple deduplicated input data objects, where the output data objects are used to store calculation results of the input data objects;

[0096] Multiple input data objects after deduplication are obtained. Since data expressions are stored in the input data objects, the embodiment of the present application can use multi-tasking to perform concurrent calculations on the multiple input data objects after deduplication to obtain multiple output data objects corresponding to the multiple input data objects after deduplication, wherein the output data objects are used to store the calculation results of the input data objects.

[0097] It should be noted here that each input data object corresponds to an output data object, that is, there is a one-to-one correspondence between the input data objects and the output data objects in the embodiment of the present application.

[0098] 409 . Store the correspondence between the multiple input data objects and the multiple output data objects after deduplication in a third dictionary.

[0099] After obtaining multiple output data objects, in order to use the calculation results to replace the data expressions in the graphic components, table components and text content in the document content in the later stage, the embodiment of the present application also needs to record the correspondence between the multiple input data objects and the multiple output data objects after deduplication, and based on the correspondence, reversely search for the input data object corresponding to the output data object.

[0100] In order to improve the calculation efficiency of data expressions, the embodiment of the present application stores multiple data expressions into an input data object, and uses multi-tasking to operate on the input data object, thereby further improving the calculation efficiency of the data expressions. After obtaining multiple input data objects, deduplication operations are performed on similar input data objects, which further avoids repeated operations on similar input data objects, and correspondingly avoids the waste of processing resources.

[0101] based on Figure 4In the embodiment described above, the process of using the operation results of multiple data expressions to replace the multiple data expressions in the full-text content tree is described below. Figure 5 :

[0102] 501. Determine the input data object corresponding to each output data result according to the correspondence between the plurality of output data objects and the plurality of input data objects;

[0103] Because the output data object in the embodiment of the present application stores the operation results of the data expression, in order to realize the use of the operation results of the data expression to replace the data expression in the document, the embodiment of the present application first determines the input data object corresponding to each output data result based on the correspondence between multiple output data objects and multiple input data objects.

[0104] It should be noted that there is a one-to-one correspondence between the input data objects and the output data objects in the embodiments of the present application. Therefore, after obtaining the output data objects, the input data objects corresponding to each output data result can be determined based on the correspondence.

[0105] 502. Determine a formatted data expression corresponding to each input data object according to a correspondence between the input data object and a plurality of formatted data expressions;

[0106] according to Figure 4 It can be seen from step 406 of the embodiment that because there are identical input data objects in the input data objects, it is necessary to deduplicate the input data objects. Therefore, the correspondence between the multiple formatted data expressions and the input data objects in the embodiment of the present application is many-to-one, that is, multiple formatted data expressions correspond to one input data object. Therefore, after each input data object is obtained, one or more formatted data expressions corresponding to the input data object can be determined based on the correspondence between the input data object and the multiple formatted data expressions.

[0107] 503. According to the correspondence between the formatted data expression and the graphic component, the table component or the text content, the plurality of output data objects are correspondingly filled into the graphic component, the table component or the text content.

[0108] Further, according to Figure 4It can be seen from step 402 of the embodiment that because there may be a scenario where a graphic component, table component or text content corresponds to the same formatted data expression, the embodiment of the present application can, after obtaining the formatted data expression, fill the data operation result in the final output data object into the graphic component, table component or text content in the preset document according to the correspondence between the formatted data expression and the graphic component, table component or text content, so as to realize fast operation of the data expression in the preset file.

[0109] In an embodiment of the present application, a detailed description is given of the process of filling the graphic components, table components and text content in the preset document according to the data calculation results in the output data object after obtaining the output data object, thereby improving the convenience and efficiency of calculating the data expressions in the preset document.

[0110] based on Figure 2 In the embodiment described above, because data expressions are generally composed of some functions, general data expressions include: data sets, data set access functions, and dimensions or dimension members, wherein the data set is used to indicate the object of the function, and the data set access function is the corresponding calculation function, the dimension can be a row or column in the data set, and the dimension member can be a filter condition for filtering the dimension, such as in Figure 3 In the data expression shown: {{Round(bind("rsMulti", "FMONEY", "A.{R1005.children}, PM-M03")+200,2}}, Round is the function for filtering decimals, bind means binding function, "rsMulti" is the table code in the data set, "FMONEY" is the column name in the "rsMulti" data set, that is, the dimension member, and "A.{R1005.children}, PM-M03"+200,2} is the condition for filtering the data in the column named "FMONEY".

[0111] In order to further improve the calculation efficiency of the data expression, the embodiment of the present application can also perform the following steps when calculating the data expression using multiple tasks, see Figure 6 :

[0112] 601. Store the data set and the data set access function, or the data set and the data set access function, and at least one of the dimension and the dimension member in the data expression into a cache;

[0113] Specifically, because the process of calculating each data expression involves the data set and data set retrieval function in each data expression, and sometimes may also involve the dimension and dimension member in the data expression, in order to avoid the problem of low data retrieval efficiency caused by reading the data set from the database every time, the embodiment of the present application can also store the data set and the data set retrieval function, or the data set and the data set retrieval function, and at least one of the dimension and the dimension member in the cache, so that when different data expressions involve the same data set, the same data set retrieval function, the same dimension and the same dimension member, the above information can be extracted from the cache, thereby improving the efficiency of calculating the data expression.

[0114] 602. Store the output data object in the cache;

[0115] Furthermore, in order to avoid repeated operations, the embodiments of the present application can also store the output data object in the cache, so that if the cache contains the same output data object, the output data object can be obtained from the cache, thereby avoiding repeated operations on the same data expression, and correspondingly avoiding the waste of processing resources due to repeated operations.

[0116] 603. If the cache includes data sets, data set retrieval functions, dimensions and / or dimension members in multiple data expressions, and output data objects corresponding to the multiple data expressions, then the data sets, data set retrieval functions, dimensions and / or dimension members, and output data objects corresponding to the multiple data expressions are obtained from the cache.

[0117] Because the cache is part of the memory, when reading data content from the memory, the speed is faster than reading content from the hard disk or database. Therefore, in order to improve the calculation efficiency of data expressions, the embodiment of the present application can obtain the corresponding data set, data set retrieval function, dimension and / or dimension member, and output data object from the cache when the same data set, the same data set retrieval function, the same dimension and / or dimension member, and the same output data object exist in the cache, thereby improving the data extraction speed relative to extracting the data set, data set retrieval function, dimension and / or dimension member from the database, and correspondingly improving the calculation efficiency of the data expression.

[0118] In order to further improve the computational efficiency of data expressions in the embodiments of the present application, data sets, data set retrieval functions, dimensions and / or dimension members in multiple data expressions, and output data objects corresponding to the multiple data expressions are stored in a cache, so that when the same data set, the same data set retrieval function, the same dimension and / or dimension member, and the same output data object exist in the cache, the corresponding data set, data set retrieval function, dimension and / or dimension member, and output data object can be obtained from the cache, thereby improving the data extraction speed relative to extracting the data set, data set retrieval function, dimension and / or dimension member from the database, and correspondingly improving the computational efficiency of the data expressions.

[0119] based on Figure 6 In the described embodiment, when multiple tasks are used to perform concurrent calculations on multiple data expressions, in order to ensure that each task can obtain the latest data set, data set retrieval function, dimension and / or dimension member from the cache, the embodiment of the present application can also use a task lock to lock each task when executing each task until each task is completed. In this way, after each task is executed, the latest data set, data set retrieval function, dimension and / or dimension member can be stored in the cache, so that the next task can obtain the latest data set, data set retrieval function, dimension and / or dimension member from the cache, and correspondingly reduce the probability of the next task obtaining the data set, data set retrieval function, dimension and / or dimension member from the hard disk or database, further improving the computing efficiency of the data expression.

[0120] Furthermore, in order to ensure the isolation of the preset document contents of different batches during the processing process, the embodiment of the present application can also generate a batch number for the preset document when obtaining the full-text content tree of the preset document, wherein the batch number is used to represent the data range of the preset document being processed, so that the preset document contents processed by each batch can be isolated from each other, and after the processing of the preset document of the current batch number is completed, the batch number can be used to clear the cache and task lock information occupied by the preset document of the batch number to release the occupied cache information.

[0121] It is understandable that, in various embodiments of the present invention, the sequence numbers of the above steps do not mean the order of execution. The order of execution of the steps should be determined by their functions and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0122] The above describes in detail the method for calculating the data expression in the embodiment of the present application. Next, the computer device in the embodiment of the present application is described. Figure 7 , an embodiment of the computer device in the embodiment of the present application includes:

[0123] The acquisition unit 701 is used to acquire a full-text content tree of a preset document, wherein the full-text content tree includes a plurality of nodes, each of which stores document content and document format in a minimum storage format;

[0124] An extraction unit 702 is used to traverse the full-text content tree starting from the bottom node of the full-text content tree to extract multiple data expressions in the full-text content tree, wherein the data expressions are used to perform calculations on data in the form of functions;

[0125] A calculation unit 703, configured to perform concurrent calculations on the multiple data expressions using multiple tasks to obtain calculation results of the multiple data expressions;

[0126] The replacement unit 704 is used to replace the multiple data expressions in the full-text content tree with the operation results of the multiple data expressions.

[0127] As an optional embodiment, the document content includes a graphic component, a table component or a text content, and the graphic component, the table component or the text content all include a data expression;

[0128] The computer device also includes:

[0129] A simplification unit 705, used to simplify multiple data expressions into multiple formatted data expressions;

[0130] A deduplication unit 706, configured to perform a deduplication operation on the plurality of formatted data expressions to obtain a plurality of formatted data expressions after deduplication;

[0131] The storage unit 707 is used to store the correspondence between the graphic components, table components and text content and the multiple formatted data expressions after deduplication in the first dictionary.

[0132] As an optional embodiment, the storage unit 707 is further configured to:

[0133] The multiple formatted data expressions after deduplication are stored in corresponding input data objects respectively to obtain multiple input data objects;

[0134] The deduplication unit 706 is further used to determine identical input data objects having different data expressions but the same input data objects among the multiple input data objects;

[0135] Performing a deduplication operation on identical input data objects among the multiple input data objects to obtain multiple deduplicated input data objects;

[0136] The storage unit 707 is further used to store the correspondence between the multiple formatted data expressions after deduplication and the multiple input data objects after deduplication in the second dictionary.

[0137] As an optional embodiment, the calculating unit 703 is specifically configured to:

[0138] Performing concurrent calculations on the multiple deduplicated input data objects using multiple tasks to obtain multiple output data objects corresponding to the multiple deduplicated input data objects, wherein the output data objects are used to store calculation results of the input data objects;

[0139] The storage unit 707 is further used for:

[0140] The correspondence between the multiple input data objects after deduplication and the multiple output data objects is stored in a third dictionary.

[0141] The replacement unit 704 is specifically configured to:

[0142] Determine the input data object corresponding to each output data result according to the correspondence between the multiple output data objects and the multiple input data objects;

[0143] Determine the formatted data expression corresponding to each input data object according to the correspondence between the input data object and the plurality of formatted data expressions;

[0144] According to the correspondence between the formatted data expression and the graphic component, the table component or the text content, the multiple output data objects are correspondingly filled into the graphic component, the table component or the text content.

[0145] As an optional embodiment, the data expression includes a data set and a data set access function; or, the data expression includes: the data set and the data set access function, and at least one of a dimension and a dimension member;

[0146] The storage unit 707 is further used for:

[0147] The data set and the data set access function, or the data set and the data set access function, and at least one of the dimension and the dimension member in the data expression are stored in a cache;

[0148] storing the output data object in the cache;

[0149] The calculation unit 703 is specifically used for:

[0150] If the cache includes the data sets, the data set retrieval functions, the dimensions and / or the dimension members in the multiple data expressions, and the output data objects corresponding to the multiple data expressions, then the data sets, the data set retrieval functions, the dimensions and / or the dimension members, and the output data objects corresponding to the multiple data expressions are obtained from the cache.

[0151] As an optional embodiment, the computer device further includes:

[0152] The locking unit 708 is used to lock each task using a task lock when executing each task until the execution of each task is completed.

[0153] As an optional embodiment, the computer device further includes:

[0154] A generating unit 709, configured to generate a batch number for the preset document, wherein the batch number is used to identify a quantity range of the preset document;

[0155] The clearing unit 710 is used to use the batch number to clear the cache and task lock information occupied by the preset documents of the batch number.

[0156] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0157] In the embodiment of the present application, on the one hand, the extraction unit 702 is used to extract data expressions in a preset document by means of a full-text content tree, thereby improving the efficiency of obtaining data expressions. Furthermore, after the data expressions are extracted, the calculation unit 703 is used to concurrently calculate multiple data expressions through multi-tasking, thereby further improving the calculation efficiency of multiple data expressions.

[0158] The computer device in the embodiment of the present invention is described above from the perspective of modular functional entities. The computer device in the embodiment of the present invention is described below from the perspective of hardware processing:

[0159] An embodiment of the computer device in the embodiment of the present invention includes:

[0160] Processor and memory;

[0161] When the memory is used to store a computer program and the processor is used to execute the computer program stored in the memory, each step in the above method embodiment can be implemented.

[0162] It is understandable that when the processor in the computer device described above executes the computer program, it can also implement the functions of the various units in the above-mentioned corresponding device embodiments, which will not be repeated here. Exemplarily, the computer program can be divided into one or more modules / units, and the one or more modules / units are stored in the memory and executed by the processor to complete the present invention. The one or more modules / units can be a series of computer program instruction segments that can perform specific functions, and the instruction segments are used to describe the execution process of the computer program in the computer device. For example, the computer program can be divided into the various units in the above-mentioned computer device, and each unit can implement the specific functions described in the above-mentioned corresponding computer device.

[0163] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, and a cloud server. The computer device may include, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that a processor and a memory are merely examples of computer devices and do not constitute a limitation of the computer device. The computer device may include more or fewer components, or a combination of certain components, or different components. For example, the computer device may also include input and output devices, network access devices, buses, and the like.

[0164] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the computer device, and uses various interfaces and lines to connect various parts of the entire computer device.

[0165] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the computer device by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function, etc.; the data storage area can store data created according to the use of the terminal, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0166] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the processor can be used to execute each step in the above-mentioned method embodiments.

[0167] It is understandable that if 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 corresponding computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned corresponding embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0168] In the 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 only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as 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 mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0169] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0170] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0171] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for calculating a data expression, characterized in that: include: Obtaining a full-text content tree of a preset document, wherein the full-text content tree includes a plurality of nodes, each of which stores document content and document format in a minimum storage format; Taking the bottommost node of the full-text content tree as a starting point, traversing the full-text content tree to extract a plurality of data expressions in the full-text content tree, wherein the data expressions are used to perform calculations on data in the form of functions; Performing concurrent calculations on the multiple data expressions using multiple tasks to obtain calculation results of the multiple data expressions; The operation results of the multiple data expressions are used to correspondingly replace the multiple data expressions in the full-text content tree.

2. The method according to claim 1, characterized in that The content of the preset document includes a graphic component, a table component or a text content, and the graphic component, the table component or the text content all contain the data expression; After extracting a plurality of data expressions in the full-text content tree, the method further includes: simplifying the plurality of data expressions into a plurality of formatted data expressions; Performing a deduplication operation on the multiple formatted data expressions to obtain multiple formatted data expressions after deduplication; The correspondence between the graphic component, the table component, the text content and the multiple formatted data expressions after deduplication is stored in a first dictionary.

3. The content according to claim 2, characterized in that: The method further comprises: The multiple formatted data expressions after deduplication are stored in corresponding input data objects respectively to obtain multiple input data objects; Determine identical input data objects among the multiple input data objects that have different data expressions but the same input data objects; performing a deduplication operation on the identical input data objects among the multiple input data objects to obtain multiple deduplicated input data objects; The correspondence between the multiple formatted data expressions after deduplication and the multiple input data objects after deduplication is stored in the second dictionary.

4. The method according to claim 3, characterized in that The concurrently calculating the multiple data expressions by using multiple tasks to obtain the operation results of the multiple data expressions includes: Performing concurrent calculations on the multiple deduplicated input data objects using multiple tasks to obtain multiple output data objects corresponding to the multiple deduplicated input data objects, wherein the output data objects are used to store calculation results of the input data objects; The correspondence between the multiple input data objects after deduplication and the multiple output data objects is stored in a third dictionary.

5. The method according to claim 4, characterized in that The using the operation results of the multiple data expressions to correspondingly replace the multiple data expressions in the full-text content tree includes: Determine the input data object corresponding to each output data result according to the correspondence between the multiple output data objects and the multiple input data objects; Determine the formatted data expression corresponding to each input data object according to the correspondence between the input data object and the plurality of formatted data expressions; According to the correspondence between the formatted data expression and the graphic component, the table component or the text content, the multiple output data objects are correspondingly filled into the graphic component, the table component or the text content.

6. The method according to claim 4, characterized in that The data expression includes a data set and a data set access function; or, the data expression includes: the data set and the data set access function, and at least one of a dimension and a dimension member; The method further comprises: The data set and the data set access function, or the data set and the data set access function, and at least one of the dimension and the dimension member in the data expression are stored in a cache; storing the output data object in the cache; The concurrently calculating the multiple data expressions by using multiple tasks to obtain the operation results of the multiple data expressions includes: If the cache includes the data sets, the data set retrieval functions, the dimensions and / or the dimension members in the multiple data expressions, and the output data objects corresponding to the multiple data expressions, then the data sets, the data set retrieval functions, the dimensions and / or the dimension members, and the output data objects corresponding to the multiple data expressions are obtained from the cache.

7. The method according to claim 6, characterized in that When the multiple data expressions are concurrently calculated by using multiple tasks to obtain operation results of the multiple data expressions, the method further includes: When executing each task, each task is locked using a task lock until the execution of each task is completed.

8. The method according to claim 7, characterized in that When obtaining the full-text content tree of the preset document, the method further includes: Generate a batch number for the preset document, where the batch number is used to identify the quantity range of the preset document; After the operation results of the multiple data expressions are used to replace the multiple data expressions in the full-text content tree, the method further includes: The batch number is used to clear the cache and task lock information occupied by the preset documents of the batch number.

9. A computer device, characterized in that: include: An acquisition unit, used for acquiring a full-text content tree of a preset document, wherein the full-text content tree includes a plurality of nodes, each of which stores document content and document format in a minimum storage format; An extraction unit, used to traverse the full-text content tree starting from the bottom node of the full-text content tree to extract multiple data expressions in the full-text content tree, wherein the data expressions are used to perform calculations on data in the form of functions; A computing unit, used for concurrently computing the multiple data expressions using multiple tasks to obtain computing results of the multiple data expressions; A replacement unit is used to replace the multiple data expressions in the full-text content tree with the operation results of the multiple data expressions.

10. A computer device comprising a processor and a memory, characterized in that: When executing a computer program stored in the memory, the processor is used to implement the method for calculating a data expression according to any one of claims 1 to 8.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it is used to implement the method for calculating a data expression as described in any one of claims 1 to 8.

12. A computer program product having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it is used to implement the method for calculating a data expression as described in any one of claims 1 to 8.