Report generation method, report generation device, and readable storage medium
Patent Information
- Application Number
- CN202211191936.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-28
- Publication Date
- 2026-08-18
- Estimated Expiration
- 2042-09-28
AI Technical Summary
[0004]对于多维数据库采用的MDX(Multi-Dimensional Expressions,多维表达式)查询语音,对于高频更新的数据处理并不能及时处理,不能满足企业合并报表的使用需求
[0031] Additional aspects and advantages of the invention will become apparent in the following description or may be learned by practice of the invention.
Smart Images

Figure CN115577692B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of consolidated financial statement technology, and more specifically, to a report generation method, a report generation device, and a readable storage medium. Background Technology
[0002] Currently, enterprises often need to manage large amounts of data in a unified manner, and the relevant technologies often cannot quickly merge the reports required by users to meet the needs of different categories of enterprises and the need for regular updates.
[0003] In related technologies, it is often necessary to store all data in a database and use SQL (Structured Query Language) to query the required data for secondary calculations. When the data exceeds one million rows, merging reports can take tens of minutes or even several hours to complete.
[0004] For MDX (Multi-Dimensional Expressions) query language used in multidimensional databases, it cannot process frequently updated data in a timely manner, and cannot meet the needs of enterprises for consolidated financial statements. Summary of the Invention
[0005] The present invention aims to solve at least one of the technical problems existing in the prior art or related art.
[0006] In view of this, the first aspect of the present invention provides a report generation method.
[0007] A second aspect of the present invention provides a report generation apparatus.
[0008] A third aspect of the present invention provides a report generation apparatus.
[0009] A fourth aspect of the present invention provides a readable storage medium.
[0010] To achieve at least one of the above objectives, the first aspect of the present invention proposes a report generation method, comprising: constructing a preset data template, the preset data template including multiple sub-templates and corresponding template categories, the multiple sub-templates respectively corresponding to different data categories; upon receiving multiple first data, configuring the multiple first data into the corresponding sub-templates respectively to generate a target data set; obtaining a first expression corresponding to the preset template, the first expression being associated with the data category and the template category; and processing the target data set according to the first expression to obtain a target report.
[0011] In this technical solution, a preset data template is constructed, which includes multiple sub-templates and corresponding template categories. Each sub-template corresponds to a different data category. Multiple sub-templates can be pre-set according to the different data categories and data types, with a one-to-one correspondence between sub-templates and data types. Upon receiving multiple sets of first data, each set is configured into its corresponding sub-template, generating the target data set. Compared to the data merging and reporting methods in related technologies that involve querying data, this approach eliminates the need for data querying. Therefore, for large datasets, such as tens of millions to billions of rows, it significantly reduces query time, thereby improving overall efficiency. The processing speed of the consolidated report process is improved by obtaining the first expression corresponding to the preset template. The first expression is associated with the data category and the template category, which can determine the expression corresponding to the category. This ensures that when a consolidated report request is received, the data can be mapped to different templates according to the category, and calculations are performed according to the expression corresponding to the template. The target data set is processed according to the first expression to obtain the target report. Data can be processed in batches without calculating the data results of intermediate processes. This allows for batch calculation of frequently updated data, improving the data calculation speed and the speed of consolidated reports. This meets the needs of high-frequency and high-volume consolidated reports and enhances the user experience.
[0012] In addition, the report generation method in the above-mentioned technical solution provided by the present invention may also have the following additional technical features:
[0013] In the above technical solution, when multiple first data are received, the multiple first data are configured into corresponding sub-templates to generate a target data set, including: when multiple first data are received, determining the dimension data and detailed data of each first data; and configuring each first data into the corresponding sub-template according to the dimension data and detailed data corresponding to each first data to generate a target data set.
[0014] In this technical solution, dimensional data and detailed data are configured into corresponding sub-templates. This makes it easy to configure multiple primary data into corresponding sub-templates according to dimensional data and detailed data. Compared with related technologies, it is not necessary to query the data corresponding to a certain business in the database, which reduces the query time of consolidated report data, thereby reducing the time required for the entire consolidated report process, improving the efficiency of consolidated reports, meeting the requirements of consolidated reports of different data types, ensuring the speed of consolidated report generation, and improving the user experience.
[0015] In any of the above technical solutions, each sub-template is provided with a corresponding transmission channel; based on the dimension data and detailed data corresponding to each first data, each first data is configured to the corresponding sub-template to generate a target data set, including: determining the corresponding transmission channel for each first data based on the dimension data corresponding to each first data; configuring the detailed data of each first data to the corresponding sub-template through the corresponding transmission channel to generate a target data set.
[0016] In this technical solution, the detailed data of each first data is configured into the corresponding sub-template through the corresponding transmission channel, realizing independent thread processing of the detailed data. When multiple first data are received, the detailed data in the multiple first data can be processed by independent threads, thereby realizing multi-threaded processing of detailed data, improving the speed of data configuration, thereby improving the generation speed of the target data set, improving the processing speed of the consolidated report process, meeting the usage requirements of consolidated reports with large data volumes, and improving the user experience.
[0017] In any of the above technical solutions, obtaining the first expression corresponding to the preset template includes: obtaining the association relationship between multiple sub-templates in the preset template, and the second expression corresponding to each sub-template, wherein the association relationship is the relationship between the data categories and template categories corresponding to the multiple sub-templates; establishing multiple third expressions based on the association relationship and the multiple second expressions; and determining the first expression based on the multiple third expressions and the multiple second expressions.
[0018] In this technical solution, the application obtains the second expression corresponding to each sub-template through the association relationship between multiple sub-templates in the preset template, and establishes multiple third expressions based on the association relationship and multiple second expressions to determine the first expression. Compared with related technologies, this can reduce the calculation process of intermediate expression results, thereby reducing the calculation steps of consolidated reports, improving the speed of consolidated reports, meeting the usage needs of consolidated reports with large amounts of data, and enhancing the user experience.
[0019] In any of the above technical solutions, processing the target data set according to the first expression to obtain the target report includes: processing the corresponding first data in the target data set simultaneously through multiple second expressions to obtain multiple first target data; processing the multiple first target data according to multiple third expressions to obtain second target data; and generating the target report based on the second target data.
[0020] In this technical solution, multiple second expressions are used to process the corresponding first data in the target data set simultaneously, which can make full use of server resources and improve data processing speed. Multiple third expressions are used to process multiple first target data to obtain second target data, which can realize batch processing of large amounts of data, thereby improving the processing speed of the first target data. Then, based on the second target data obtained from the first target data, the target report is generated, which can improve the report generation speed and meet the user's needs for large amounts of data.
[0021] In any of the above technical solutions, the second expression corresponds one-to-one with the sub-template, and the third expression corresponds to the first category information corresponding to multiple sub-templates. The first category information includes multi-level second category information, and each second category information corresponds to a third expression.
[0022] In this technical solution, the first category of information includes multiple levels of second category information, and each first category of information corresponds to a third expression. The second expression corresponds one-to-one with the sub-template. Thus, the relationship between the third expression and the second expression is determined based on the different sub-template category relationships. Compared with related technologies, it is not necessary to search and judge the relationship between expressions, thereby eliminating the search steps in the report merging process, shortening the report merging time, improving the speed of report merging, and meeting the user's needs.
[0023] In any of the above technical solutions, each sub-template in the preset data template corresponds to a storage unit.
[0024] In this technical solution, each sub-template corresponds to a storage unit. Compared with storing all data in one unit, this reduces the storage pressure on the storage unit. At the same time, the storage unit corresponds to the message queue, which ensures that each processing process is independent and there are no overlapping processing flows, thereby reducing the probability of errors during data processing.
[0025] A second aspect of the present invention provides a report generation apparatus, comprising: a construction unit for constructing a preset data template, the preset data template including multiple sub-templates and corresponding template categories, the multiple sub-templates respectively corresponding to different data categories; a generation unit for configuring the multiple first data into the corresponding sub-templates respectively upon receiving multiple first data to generate a target data set; an acquisition unit for acquiring a first expression corresponding to the preset template, the first expression being associated with the data category and the template category; and a processing unit for processing the target data set according to the first expression to obtain a target report.
[0026] In this technical solution, the construction unit can pre-set data templates and set multiple sub-templates according to different data categories, so that subsequent data can be loaded into the corresponding sub-templates according to the category. The generation unit can configure multiple first data into the sub-templates corresponding to the categories to generate the target data set, avoiding data query operations during report generation and improving data processing efficiency. The acquisition unit obtains the expression corresponding to the template and can map the data to different expressions according to different categories, improving data processing speed. After processing the target set, the processing unit obtains the target report to meet the user's needs.
[0027] A third aspect of the present invention provides a report generation apparatus, comprising: a memory and a processor, wherein the memory stores a program or instructions running on the processor, and the program or instructions, when executed by the processor, implement the steps of the report generation method of the first aspect.
[0028] In this technical solution, the report generation device includes a memory and a processor. The memory stores programs or instructions that run on the processor. When the program or instructions are executed by the processor, they implement the steps of the report generation method of the first aspect, thereby having all the beneficial technical effects of any of the above technical solutions, which will not be elaborated here.
[0029] A fourth aspect of the present invention provides a readable storage medium having a program or instructions stored thereon, which, when executed by a processor, implement the steps of the report generation method of the first aspect.
[0030] In this technical solution, a readable storage medium stores a program or instructions. When the program or instructions are executed by a processor, they implement the steps of the report generation method of the first aspect, thereby having all the beneficial technical effects of any of the above technical solutions, which will not be elaborated here.
[0031] Additional aspects and advantages of the invention will become apparent in the following description or may be learned by practice of the invention. Attached Figure Description
[0032] Figure 1 One of the flowcharts of a report generation method according to an embodiment of the present invention is shown;
[0033] Figure 2 A second flowchart illustrating a report generation method according to an embodiment of the present invention is shown;
[0034] Figure 3 One of the processing schematic diagrams of a report generation method according to an embodiment of the present invention is shown;
[0035] Figure 4A third flowchart illustrating a report generation method according to an embodiment of the present invention is shown;
[0036] Figure 5 A fourth flowchart illustrating a report generation method according to an embodiment of the present invention is shown;
[0037] Figure 6 A second schematic diagram of a report generation method according to an embodiment of the present invention is shown;
[0038] Figure 7 The fifth flowchart illustrates a report generation method according to an embodiment of the present invention;
[0039] Figure 8 The third schematic diagram illustrates a report generation method according to an embodiment of the present invention;
[0040] Figure 9 The fourth schematic diagram illustrates a report generation method according to an embodiment of the present invention;
[0041] Figure 10 The fifth schematic diagram illustrates a report generation method according to an embodiment of the present invention;
[0042] Figure 11 One of the structural schematic diagrams of a report generation apparatus according to an embodiment of the present invention is shown;
[0043] Figure 12 A second schematic diagram of a report generation apparatus according to an embodiment of the present invention is shown. Detailed Implementation
[0044] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.
[0045] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and therefore the scope of protection of the invention is not limited to the specific embodiments disclosed below.
[0046] The following reference Figures 1 to 12 This invention describes a report generation method, a report generation apparatus, and a readable storage medium according to some embodiments of the present invention.
[0047] Example 1
[0048] like Figure 1 As shown, some embodiments of the report generation method in this application include:
[0049] Step 102: Construct a preset data template. The preset data template includes multiple sub-templates and corresponding template categories. The multiple sub-templates correspond to different data categories.
[0050] Each sub-template corresponds to a specific type. For example, when a user needs to merge the financial statements of a certain business in region A and region B, the financial data corresponding to that business in region A forms a sub-template A, and the financial data corresponding to that business in region B forms a sub-template B. It can be understood that region A includes more than one business; different sub-templates are stored for different businesses, and each sub-template stores the relevant data corresponding to that business.
[0051] Step 104: If multiple first data are received, configure the multiple first data into the corresponding sub-templates to generate the target data set;
[0052] Multiple primary data sets are assigned to corresponding sub-templates to generate target data sets. This makes it easier to retrieve data from business-related sub-templates for different business needs without having to query the database for data corresponding to a specific business. This reduces the query time for consolidated report data, thereby reducing the overall time required for the consolidated report process, improving the efficiency of consolidated reports, meeting the requirements of consolidated reports for different data types, ensuring the speed of consolidated report generation, and improving the user experience.
[0053] Step 106: Obtain the first expression corresponding to the preset template. The first expression is associated with the data category and the template category.
[0054] The first expression can be a data operation formula in a sub-template for a certain business. For example, the financial data corresponding to a certain business in region A forms a sub-template A, and sub-template A corresponds to the operation formula that adds data a and data b.
[0055] Step 108: Process the target data set according to the first expression to obtain the target report.
[0056] The target dataset includes multiple data sets assigned to corresponding sub-templates. When processing the target dataset, the sub-template data corresponding to a specific business function can be processed in batches using the first expression corresponding to the template. In contrast, multi-dimensional expression calculations in related technologies require processing expressions layer by layer based on their hierarchical relationships. This application eliminates the need to calculate intermediate expression results, thereby reducing the calculation steps in consolidated reports, increasing the speed of consolidated reports, meeting the needs of high-frequency, high-volume consolidated reports, and improving the user experience.
[0057] This application constructs a preset data template, which includes multiple sub-templates and corresponding template categories. Each template corresponds to a category, enabling pre-classification of data. When multiple data sets are received, they are configured into the corresponding templates for each category, generating a data set. Compared to related technologies that involve querying data and then processing it to create a consolidated report, this approach eliminates the need for data querying. For large datasets, such as tens of millions to billions of rows, this application significantly reduces query time, thereby improving the overall processing speed of the consolidated report process. It obtains expressions corresponding to the templates and processes the data sets based on these expressions, enabling batch processing of data without the need to calculate intermediate results. This allows for batch calculation of frequently updated data, saving the time spent calculating sequentially according to expression levels, thus increasing the speed of data processing and consolidation. This meets the needs of consolidating reports with high frequency and large data volumes, enhancing the user experience.
[0058] like Figure 2 As shown, in one embodiment of this application, when multiple first data are received, the multiple first data are respectively configured into corresponding sub-templates to generate a target data set, including:
[0059] Step 202: In the case of receiving multiple first data, determine the dimension data and detailed data of each first data;
[0060] Dimensional data can be the type of data, while detailed data can be the specific value of data under a certain data type. For example, dimensional data can be the electricity consumption of region A, while detailed data can be the specific electricity consumption of region A as 200 kWh.
[0061] Step 204: Based on the dimension data and detailed data corresponding to each first data point, configure each first data point to the corresponding sub-template to generate the target data set.
[0062] Configuring dimensional and detailed data into corresponding sub-templates facilitates the allocation of multiple primary data points according to their respective dimensions and details. This implies a correlation between dimensional and detailed data. During subsequent report consolidation, the primary data can be configured into the corresponding sub-template based on the dimensional information, simplifying subsequent report data processing. In contrast, related technologies require querying data corresponding to a specific business transaction in the database. This application reduces the query time for consolidated report data, thereby reducing the overall consolidation process time, improving efficiency, meeting the requirements of consolidation reports with different data types, ensuring rapid report generation, and enhancing the user experience.
[0063] In one embodiment of this application, each sub-template is provided with a corresponding transmission channel.
[0064] like Figure 3 As shown, when the data source sends multiple first data points, each first data point is assigned a corresponding thread loader, and each thread loader is assigned a corresponding transmission channel. When multiple first data points are received, the corresponding transmission channel can be found based on the thread loader corresponding to the first data point, thus ensuring that each first data point has an independent processing thread. Compared with related technologies, it is not necessary to lock the data by setting identifiers when multiple first data points are received.
[0065] In related technologies, no thread loader is set up for the data, nor is a separate processing channel set up for the thread loader. Therefore, to ensure the correctness of data transmission in a multi-threaded environment, it is necessary to add identifiers to the data. Data with identifiers is processed, while data without identifiers is not processed. On the one hand, when the amount of data in multi-threaded environments is large, and there is a lot of data without identifiers, it will put a lot of storage pressure on the server and affect server performance. On the other hand, for processing large amounts of data, considering the server's processing performance, it is not possible to add identifiers to all data at the same time, so locks must be added sequentially, which slows down the data processing speed. This application does not require locking the first data, eliminating the locking operation, and does not affect server performance. It can increase the data processing speed of consolidated reports, meet the needs of using consolidated reports with large amounts of data, and improve the user experience.
[0066] like Figure 4 As shown, in one embodiment of this application, each first data point is configured into a corresponding sub-template based on the dimensional data and detailed data corresponding to each first data point, generating a target data set, including:
[0067] Step 402: Determine the corresponding transmission channel for each first data based on the dimension data corresponding to each first data.
[0068] The transmission channel can be a queue, which can be a concurrent queue that processes data simultaneously. The length of the concurrent queue or the receiving period of the concurrent queue can be set according to user needs, so that the concurrent queue receives relevant data within a specified period. This application does not limit the specific form of the concurrent queue.
[0069] Step 404: Configure the detailed data of each first data into the corresponding sub-template through the corresponding transmission channel to generate the target data set.
[0070] The detailed data of each first data point is configured into the corresponding sub-template through the corresponding transmission channel, realizing independent thread processing of the detailed data. When multiple first data points are received, the detailed data in each first data point can be processed by independent threads, thereby realizing multi-threaded processing of detailed data, improving the speed of data configuration, thereby improving the speed of generating the target data set, improving the processing speed of the consolidated report process, meeting the needs of consolidated reports with large data volumes, and improving the user experience.
[0071] like Figure 5 As shown, in one embodiment of this application, obtaining the first expression corresponding to the preset template includes:
[0072] Step 502: Obtain the association relationship between multiple sub-templates in the preset template, and the second expression corresponding to each sub-template. The association relationship is the relationship between the data categories and template categories corresponding to multiple sub-templates.
[0073] There may be hierarchical relationships between different sub-templates, and these relationships are related to the relationship between the data categories corresponding to the sub-templates and the template categories. For example, region A includes cities B and C. Correspondingly, the water consumption A1 of region A includes the water consumption B1 of city B and the water consumption C1 of city C. Water consumption A1 corresponds to sub-template A2, water consumption B1 corresponds to sub-template B2, and water consumption C1 corresponds to sub-template C2. Sub-template A2 has an inclusion relationship with sub-templates B2 and C2, which is related to the relationship between the data types of cities B and C included in region A. Region A not only has sub-template A2 for water consumption A1, but also sub-template a2 for wind power generation a1. The association between region A and sub-template A2 is related to the water consumption type of region A and sub-template A2. The second expression of sub-template B2 can be the sum of water consumption from one month to another.
[0074] Step 504: Based on the association relationship and multiple second expressions, create multiple third expressions;
[0075] The second expression of subtemplate B2 can be used to sum the water consumption between a certain month and a certain month, the second expression of subtemplate C2 can be used to sum the water consumption between a certain month and a certain month, and the third expression of subtemplate A2 is the sum of the second expressions of subtemplate B2 and subtemplate C2.
[0076] Step 506: Determine the first expression based on the multiple third expressions and the multiple second expressions.
[0077] When the data volume is large, there are multiple third expressions and multiple second expressions, and the first expression is related to multiple third expressions and multiple second expressions, and there are parallel relationships among multiple expressions.
[0078] For example, such as Figure 6 As shown, slicing can be understood as filtering data. For example, when calculating a company's procurement costs from the 10th to the 20th day, it is necessary to filter the data for the entire month to extract the procurement costs from the 10th to the 20th day.
[0079] This application does not restrict the relationship between expressions. It is understood that an expression can be calculated by one or more expressions that are related to it, or by one or more slices that are related to it, or by both the expression and the slice that are related to it.
[0080] This application does not require a limit on the number of expressions between the first expression and the slice, nor does it require calculating the results of the expressions between the first expression and the slice. It is understood that the second and third expressions are intermediate expressions between the first expression and the slice, and these intermediate expressions must not have duplicate dependencies. For example, third expression 1 can be composed of second expression 1 and slice 3, but third expression 1 cannot be composed of third expression 1 and slice 3. Duplicate dependencies will not yield results and will loop indefinitely, leading to computational anomalies.
[0081] This application obtains the second expression corresponding to each sub-template by means of the association relationship between multiple sub-templates in the preset template, and establishes multiple third expressions based on the association relationship and multiple second expressions to determine the first expression. Compared with related technologies, it can reduce the calculation process of intermediate expression results, thereby reducing the calculation steps of consolidated reports, improving the speed of consolidated reports, meeting the usage needs of consolidated reports with large amounts of data, and improving the user experience.
[0082] like Figure 7 As shown, in one embodiment of this application, the target data set is processed according to a first expression to obtain a target report, including:
[0083] Step 702: Through multiple second expressions, the corresponding first data in the target data set is processed simultaneously to obtain multiple first target data;
[0084] Multiple second expressions process the first data synchronously. Compared with asynchronous processing in related technologies, this allows for simultaneous data processing, improving data processing speed. Furthermore, compared with asynchronous processing, synchronous processing can make full use of server resources.
[0085] Step 704: Process multiple first target data according to multiple third expressions to obtain second target data;
[0086] By processing the first target data based on multiple third expressions, batch processing of large amounts of data can be achieved, thereby improving the processing speed of the first target data, increasing the processing speed of the consolidated report process, meeting the needs of consolidated reports with large amounts of data, and improving the user experience.
[0087] Step 706: Generate a target report based on the second target data.
[0088] This application processes the corresponding first data in the target data set simultaneously through multiple second expressions, which can make full use of server resources and improve data processing speed. It processes multiple first target data according to multiple third expressions to obtain second target data, which can realize batch processing of large amounts of data, thereby improving the processing speed of the first target data. Then, based on the second target data obtained from the first target data, the target report is generated, which can improve the report generation speed and meet the user's needs for large data volume usage.
[0089] In one embodiment of this application, the second expression corresponds one-to-one with the sub-template, and the third expression corresponds to the first category information corresponding to multiple sub-templates. The first category information includes multi-level second category information, and each second category information corresponds to a third expression.
[0090] The first category of information includes multiple levels of second category information, and each first category of information corresponds to a third expression. The second expression corresponds one-to-one with the sub-template. Therefore, the relationship between the third expression and the second expression is determined based on the different sub-template category relationships. Compared with related technologies, it is not necessary to search and judge the relationship between expressions, thus eliminating the search steps in the report merging process, thereby shortening the report merging time, improving the speed of report merging, and meeting the user's needs.
[0091] In one embodiment of this application, each sub-template in the preset data template corresponds to a storage unit.
[0092] Each sub-template corresponds to a storage unit. Compared with storing all data in one unit, this can reduce the storage pressure on the storage unit. At the same time, the storage unit corresponds to the message queue, which can ensure that each processing process is carried out independently and there are no overlapping processing flows, thereby reducing the probability of errors during data processing.
[0093] like Figure 8As shown in one embodiment of this application, the server includes a data cube, a data management module, and a multidimensional computing engine module. Dimensional data and detailed data are stored in the data cube. The dimensional data form a directed acyclic graph (DAG) within the data cube, which displays the relationships between the dimensional data.
[0094] like Figure 9 As shown, detailed data is stored in different blocks according to certain rules.
[0095] A data cube consists of blocks and shards. Each shard is stored within a JVM (Java Virtual Machine), and each shard contains multiple blocks. Data can be divided into several blocks according to user settings. For example, if the user sets each block to store 10 numbers, and 1000 data items are received, 100 blocks will be generated. These 100 blocks can be numbered using a cardinality setting, for example:
[0096] The block base can be set to 10;
[0097] The base of each block is represented by the cards array, and its calculation method is as follows:
[0098] cards[0] = 1;
[0099] cards[1] = cards[0] × 10;
[0100] cards[2] = cards[1] × 10;
[0101] Here, [0], [1], and [2] represent different dimensions. The dimension of [0] is greater than that of [1], and the dimension of [1] is greater than that of [2]. It can be understood that the cards[0] array contains 100 numbers, while the cards[1] array contains 10 numbers. One cards[0] array is composed of 10 cards[1] arrays, while the cards[2] array contains 1 number. One cards[1] array is composed of 10 cards[2] arrays.
[0102] The values of dimensions [0], [1], and [2] can be represented by hash numbers. Specifically, the block index is calculated as follows:
[0103] blockIndex=d0×cards[0]+d1×cards[1]+d2×cards[2]+...;
[0104] The hash number is di (0≤i<N), where i can be 0, 1, or 2, di can be d1, d2, or d3, and blockIndex represents the block index.
[0105] like Figure 9 As shown, different dimensions have different index numbers. Based on the different index numbers, data related to the dimension can be stored into blocks and stored in different areas.
[0106] like Figure 3 and Figure 8 As shown, the thread loader is located in the data management module, while the block loader and queue are located in the multidimensional computing engine. The data management module consists of three parts: full loading of detailed data, incremental loading of detailed data, and dimension management. Dimension management allows manipulation of dimensional data on the server through an interface, including adding, searching, and deleting. It can load all the data required for the consolidated report at once, or load additional data needed for the consolidated report as required by the user. The loaded and processed data can be updated in the server's memory. Essentially, after loading data, the data management module stores the loaded data into blocks of the data cube.
[0107] The multidimensional computation engine module comprises three parts: multidimensional expression parsing, detailed data filtering, and multidimensional convolution computation. The multidimensional expression parsing function can parse custom multidimensional expressions, determine their correctness, and, if correct, invoke the relevant multidimensional computation interface. The detailed data filtering function can quickly filter out the detailed data for computation from the data cube's detailed data based on the implicit filtering conditions in the multidimensional expression. The multidimensional convolution computation function provides a multi-threaded multidimensional convolution algorithm, thereby utilizing the computer's multi-core processor to quickly calculate the results of the consolidated report. Understandably, after receiving the loaded data, the data cube sends it to the multidimensional computation engine. The multidimensional computation engine may modify the data and then transfer the modified data to blocks within the data cube.
[0108] The data that changes in memory needs to be persisted to the database. In order not to affect the efficiency of the multidimensional computing engine module, the data is persisted through a message queue and the message queue is transmitted to the data source.
[0109] Each block loader can correspond to multiple blocks, thereby reducing the number of block loaders and improving server resource utilization and configuration.
[0110] like Figure 10As shown, in one embodiment of this application, the data cube stores multiple dimensional data and other data. The other data can be definition data or related information data, which does not affect the merging of reports. Format conversion is required between the data cube and the in-memory concurrent queue. The in-memory concurrent queue has a different format than the message processor, also requiring format conversion. After processing the message, the message processor adjusts the format, writes the data back to the database, and performs master-slave synchronization.
[0111] By writing data back to the database and synchronizing with the master-slave node through the message processor, data synchronization can achieve consistency and high efficiency. On the one hand, the order of synchronized data is consistent with the order of modification operations (add, delete, update) on the nodes; on the other hand, the data synchronization mechanism does not consume too many computing resources, thus avoiding affecting the computing speed.
[0112] Specifically, the memory queue is an MPSC (Multiple Producers, Single Consumer) queue that supports concurrent writes by multiple threads. Different data cubes use different memory queues, which avoids synchronization order between different data cubes. Modified data is entered into the data queue in the required row order.
[0113] The message processor is a separate thread, and only one thread can be used at a time, thus ensuring fast data processing. Users can pre-configure the data structures for QueueItem and DataEvent in the system. QueueItem is the data structure used for in-memory queues, while DataEvent is the data structure sent to Kafka, an independent message queue service. This application converts QueueItem formatted messages into DataEvents to enable synchronous sending to different Kafka topics. These different Kafka topics can include database write-back and master-slave synchronization.
[0114] Example 2
[0115] like Figure 11 As shown, one embodiment of this application proposes a report generation device 1100, including: a construction unit 1102, used to construct a preset data template, the preset data template including multiple sub-templates and corresponding template categories, the multiple sub-templates corresponding to different data categories; a generation unit 1104, used to, upon receiving multiple first data, configure the multiple first data into the corresponding sub-templates to generate a target data set; an acquisition unit 1106, used to acquire a first expression corresponding to the preset template, the first expression being associated with the data category and the template category; and a processing unit 1108, used to process the target data set according to the first expression to obtain a target report.
[0116] In this embodiment, the construction unit 1102 can pre-set a data template and set multiple sub-templates according to different data categories, so that subsequent data can be loaded into the corresponding sub-templates according to the category. The generation unit 1104 can configure multiple first data into the sub-templates corresponding to the category to generate a target data set, avoiding data query operations during report generation and improving data processing efficiency. The acquisition unit 1106 acquires the expression corresponding to the template and can map the data to different expressions according to different categories, thereby improving data processing speed. After processing the target set, the processing unit 1108 obtains the target report to meet the user's needs.
[0117] Example 3
[0118] like Figure 12 As shown, one embodiment of the present invention provides a report generation device 1200, including: a memory 1202 and a processor 1204. The memory 1202 stores programs or instructions that run on the processor 1204. When the program or instructions are executed by the processor 1204, they implement the steps of the report generation method of any of the above embodiments.
[0119] In this technical solution, the report generation device 1200 includes a memory 1202 and a processor 1204. The memory 1202 stores programs or instructions that run on the processor 1204. When the program or instructions are executed by the processor 1204, they implement the steps of the report generation method of any of the above embodiments, thereby having all the beneficial technical effects of any of the above embodiments, which will not be repeated here.
[0120] Example 4
[0121] In one embodiment of this application, a readable storage medium is provided, on which a program or instructions are stored, which, when executed by a processor, implement the steps of the report generation method of any of the above embodiments.
[0122] In this technical solution, a readable storage medium stores a program or instructions thereon. When the program or instructions are executed by a processor, they implement the steps of the report generation method as described in any of the above embodiments, thereby having all the beneficial technical effects of any of the above embodiments, which will not be repeated here.
[0123] Furthermore, it is understood that any process or method description in the flowchart or otherwise described herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of the invention includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order according to the functions involved, as should be understood by those skilled in the art to which embodiments of the invention pertain.
[0124] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which programs can be printed, because programs can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0125] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0126] Those skilled in the art will understand that all or part of the steps of the methods described in the above embodiments can be implemented by a program instructing related hardware, and the program can be stored in a computer-readable storage medium. When executed, the program includes one or a combination of the steps of the method embodiments.
[0127] Furthermore, the functional units in the various embodiments of the present invention can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
[0128] The storage media mentioned above can be read-only memory, disk, or optical disk, etc.
[0129] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A report generation method characterized by, include: Construct a preset data template, which includes multiple sub-templates and corresponding template categories, with each sub-template corresponding to a different data category; When multiple first data points are received, each first data point is configured into a corresponding sub-template to generate a target data set. Obtain the first expression corresponding to the preset template, wherein the first expression is associated with the data category and the template category; The target data set is processed according to the first expression to obtain the target report; The step of obtaining the first expression corresponding to the preset template includes: Obtain the association relationship between the multiple sub-templates in the preset template, and the second expression corresponding to each sub-template, wherein the association relationship is the relationship between the data category and the template category corresponding to the multiple sub-templates; Based on the aforementioned association and multiple second expressions, multiple third expressions are established; The first expression is determined based on the plurality of third expressions and the plurality of second expressions.
2. The report generation method according to claim 1, characterized in that, When multiple first data points are received, each first data point is configured into its corresponding sub-template to generate a target data set, including: Upon receiving the plurality of first data, determine the dimension data and detail data for each of the first data. Based on the dimension data and detail data corresponding to each first data point, each first data point is configured into the corresponding sub-template to generate the target data set.
3. The report generation method according to claim 2, characterized in that, Each of the sub-templates is equipped with a corresponding transmission channel; The step of configuring each first data point to a corresponding sub-template based on the dimension data and detail data corresponding to each first data point, and generating the target data set, includes: Based on the dimension data corresponding to each of the first data, determine the corresponding transmission channel for each of the first data. The detailed data of each first data is configured into the corresponding sub-template through the corresponding transmission channel to generate the target data set.
4. The report generation method according to claim 1, characterized in that, The step of processing the target data set according to the first expression to obtain the target report includes: Through the multiple second expressions, the corresponding first data in the target data set are processed synchronously to obtain multiple first target data; The multiple first target data are processed according to the multiple third expressions to obtain the second target data; The target report is generated based on the second target data.
5. The report generation method according to claim 1, characterized in that, The second expression corresponds one-to-one with the sub-template, and the third expression corresponds to the first category information corresponding to the multiple sub-templates. The first category information includes multiple levels of second category information, and each second category information corresponds to a third expression.
6. The report generation method according to any one of claims 1 to 3, characterized in that, Each of the sub-templates in the preset data template corresponds to a storage unit.
7. A report generation device, characterized in that, include: A construction unit is used to construct a preset data template, which includes multiple sub-templates and corresponding template categories, with the multiple sub-templates corresponding to different data categories; The generation unit is used to configure the multiple first data into corresponding sub-templates respectively when multiple first data are received, and to generate a target data set; The acquisition unit is used to acquire a first expression corresponding to the preset template, wherein the first expression is associated with the data category and the template category; The processing unit is configured to process the target data set according to the first expression to obtain a target report; The acquisition unit is specifically used for: Obtain the association relationship between the multiple sub-templates in the preset template, and the second expression corresponding to each sub-template, wherein the association relationship is the relationship between the data category and the template category corresponding to the multiple sub-templates; Based on the aforementioned association and multiple second expressions, multiple third expressions are established; The first expression is determined based on the plurality of third expressions and the plurality of second expressions.
8. A report generation device, characterized in that, include: A memory and a processor, the memory storing a program or instructions executable on the processor, the program or instructions, when executed by the processor, implementing the steps of the report generation method as described in any one of claims 1 to 6.
9. A readable storage medium having a program or instructions stored thereon, characterized in that, When the program or instructions are executed by the processor, they implement the steps of the report generation method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Method for generating a Chinese style report
CN110347758A
Report generation method, device and equipment and computer readable storage medium
CN111797604A