Method and device for generating summary data

By introducing the summary result data storage model and field modeling, the flexibility and real-time problems of data summary in the existing technology are solved, the efficient execution and structured output of complex summary tasks are achieved, and the stability and processing efficiency of summary tasks are improved.

CN120371841BActive Publication Date: 2025-09-09BEIJING JOIN CHEER SOFTWARE
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510874624.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-27
Publication Date
2025-09-09
Estimated Expiration
2045-06-27

AI Technical Summary

Technical Problem

Existing technologies cannot simultaneously take into account the flexibility, configurability, real-time performance and ease of use of data aggregation, and are unable to meet the complex needs of hierarchical aggregation and result reuse. They rely on professional and technical personnel, have poor business adaptability and insufficient real-time performance.

Method used

By introducing the summary result data storage model, field modeling and publishing operations are performed based on the pre-configured summary table basic information table to generate summary data result sets. This supports data modeling and processing under multiple summary types, and achieves efficient execution and structured output of complex summary tasks.

Benefits of technology

Improves the stability and processing efficiency of summary tasks, ensures that the summary data has a unified and traceable data structure in the underlying storage table, facilitates data reading, maintenance and reuse, and improves the maintainability and execution efficiency of the summary table engine.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120371841B_ABST
    Figure CN120371841B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for generating summary data, wherein the method comprises: based on a pre-established summary result data storage model, performing summary processing on a summary area in the summary result data storage model to generate summary data; the summary result data storage model corresponds one-to-one with a pre-configured summary table basic information table, the summary table basic information table storing summary basic information, the summary basic information including a first identification code, a table name, a summary type, and a summary condition; the summary result data storage model is obtained by performing field modeling on each caliber item and each cell item in the summary area based on the first identification code, and performing a publishing operation; and performing summary result construction processing on the summary area based on the summary result data storage model and the summary data to generate a summary data result set. The present invention supports data modeling and summary processing under multiple summary types, achieving efficient execution of complex summary tasks and structured output of summary data result sets.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data statistics and data processing, and in particular to a method and device for generating summary data. Background Art

[0002] With the continuous development of information technology, data has experienced explosive growth in various government administration and business operations, gradually becoming a key production factor driving the development of the digital economy. However, data itself is often fragmented, complex, and has diverse business dimensions. To effectively transform it into high-quality information with decision-making value, it must be organized and refined through systematic statistical processing, in-depth processing, and structured aggregation. As the core product of data statistics and processing, the flexibility of its generation and processing capabilities directly determine the efficiency and quality of data-driven applications.

[0003] Currently, mainstream data aggregation technologies fall into two main implementation approaches: one is a real-time query method based on detailed data. This method temporarily groups raw data, generates aggregated results in system memory, and returns them to users. The other is a data warehouse modeling-based approach. This relies on data stratification and preprocessing mechanisms, periodically generating target data results using pre-built aggregated data models and data layer structures. Both approaches have limitations in practical applications. Real-time query methods cannot persistently store aggregated results; each access requires recalculation from detailed data, resulting in reduced system performance and significantly increased database pressure. Furthermore, they only support relatively simple aggregation and processing, making them incapable of meeting complex hierarchical aggregation and result reuse requirements. While data warehouse modeling methods offer certain data preprocessing and storage capabilities, their construction and maintenance rely on specialized technical personnel, resulting in poor business adaptability and insufficient flexibility. This makes it difficult to meet frequently changing statistical requirements, and their real-time performance is limited, resulting in low application efficiency.

[0004] To sum up, existing technologies are unable to simultaneously take into account the flexibility, configurability, real-time performance and ease of use of data aggregation. There is an urgent need for a data aggregation generation method that supports multiple scenarios, dynamic parameter control and sustainable scalability to meet the growing business data processing needs.

[0005] This section is intended to provide a background or context to the embodiments of the invention that are recited in the claims. No statement herein is admitted to be prior art by virtue of its inclusion in this section. Summary of the Invention

[0006] The embodiment of the present invention provides a summary data generation method to support data modeling and summary processing under various summary types, thereby achieving efficient execution of complex summary tasks and structured output of summary data result sets.

[0007] The summary data generation method includes:

[0008] Based on a pre-established summary result data storage model, a summary area in the summary result data storage model is summarized and processed to generate summary data; the summary result data storage model corresponds one-to-one to a pre-configured summary table basic information table, the summary table basic information table storing summary basic information, the summary basic information including a first identification code, a table name, a summary type, and a summary condition; the summary result data storage model is obtained by performing field modeling on each caliber item and each cell item in the summary area based on the first identification code, and performing a publishing operation;

[0009] A summary result construction process is performed on the summary area according to the summary result data storage model and the summary data to generate a summary data result set.

[0010] In one embodiment, pre-establishing the summary result data storage model includes:

[0011] According to the first identification code of the basic information table of the summary table, a corresponding summary area is obtained;

[0012] Initializing the summary result data storage model corresponding to the summary table basic information table according to the first identification code;

[0013] Perform field modeling on each caliber item in the summary area, and generate a caliber column field corresponding to the caliber item in the summary result data storage model;

[0014] Perform field modeling on each cell item in the summary area, and generate a cell column field corresponding to the cell item in the summary result data storage model;

[0015] A publishing operation is performed according to the caliber column field and the cell column field to generate the summary result data storage model.

[0016] In one embodiment, the step of performing aggregating processing on a summary area in a pre-established summary result data storage model to generate summary data includes:

[0017] Obtain configuration information of all summary areas in the summary result data storage model;

[0018] Initialize the context object and query executor object corresponding to each summary area based on the configuration information;

[0019] Parsing the caliber column field, cell column field and summary condition in the summary area respectively, and writing the generated parsing results into the query executor object;

[0020] Performing data aggregation processing on the query executor object that writes the parsing result to generate a corresponding SQL query object;

[0021] Generate summary data based on SQL query objects and store it in the summary result data storage model.

[0022] In one embodiment, the step of constructing a summary result for the summary area based on the summary result data storage model and the summary data to generate a summary data result set includes:

[0023] Performing a field organization operation on the summary area according to the summary result data storage model and the summary data to generate an SQL structure object;

[0024] Perform a query operation in the database through the SQL structure object to obtain the corresponding database query result;

[0025] Performing a structural organization operation on the database query results to obtain a summary data result set structure;

[0026] According to the database query result and the structure of the summary data result set, a data content organization operation is performed to obtain a summary data result set.

[0027] In one embodiment, initializing the summary result data storage model corresponding to the summary table basic information table according to the first identification code includes:

[0028] Determine whether a summary result data storage model corresponding to the summary table basic information table already exists in the database;

[0029] If the summary result data storage model corresponding to the summary table basic information table does not exist in the database, generating a table name of the corresponding summary result data storage model according to the first identification code;

[0030] Initialize the summary result data storage model corresponding to the table name, and set the table name and predefined field information in the summary result data storage model.

[0031] In one embodiment, performing field modeling on each caliber item in the summary area and generating a caliber column field corresponding to the caliber item in the summary result data storage model includes:

[0032] Traversing each caliber item in the summary area to determine whether the caliber item is a published caliber item;

[0033] If the caliber item is an unpublished caliber item, generate a field name of the caliber column field according to the second identification code of the caliber item;

[0034] Marking the caliber column field as an update state so that the field name is written into the summary result data storage model when publishing the operation;

[0035] The above steps are iterated until all the caliber items in the summary area are modeled.

[0036] In one embodiment, performing field modeling on each cell item in the summary area and generating a cell column field corresponding to the cell item in the summary result data storage model includes:

[0037] Traversing each cell item in the summary area to determine whether the cell item is a published cell item;

[0038] If the cell item is an unpublished cell item, generating a corresponding cell column field according to the configuration type of the cell item;

[0039] Marking the cell column field as an update state so as to write the cell column field into the summary result data storage model during a publishing operation;

[0040] The above steps are iterated until all cell items in the summary area are modeled.

[0041] In one embodiment, the publishing operation is performed according to the caliber column field and the cell column field to generate the summary result data storage model, including:

[0042] In the summary result data storage model, updating the caliber column field and the cell column field marked as being in an update state;

[0043] Update the field mapping information in the pre-created summary table caliber configuration table and summary table indicator configuration table according to the caliber column field and the cell column field marked as updated;

[0044] Performing a database physicalization operation on the summary result data storage model.

[0045] In one embodiment, the step of performing data aggregation processing on the query executor object that writes the parsing result to generate a corresponding SQL query object includes:

[0046] Determine the summary type based on the summary type field in the pre-created summary table basic information table;

[0047] Generate corresponding aggregate structure information according to the summary type;

[0048] Based on the above aggregate structure information, subtotal and aggregate data processing is performed on single-type caliber dimensions and cross-caliber dimensions respectively to generate corresponding SQL query objects.

[0049] In one embodiment, generating summary data based on the SQL query object and storing it in the summary result data storage model specifically includes:

[0050] Based on the initialized context object and the summary table caliber configuration table corresponding to the summary area, the SQL query object is summarized and processed to generate summary data and store it in the summary result data storage model.

[0051] In one embodiment, performing a field organization operation on the summary area to generate an SQL structure object based on the summary result data storage model and the summary data includes:

[0052] Get the configuration information of all summary areas in the summary result data storage model;

[0053] According to the configuration information, field organization operations are performed on the caliber column fields and the cell column fields of the summary area respectively to construct an SQL structure object.

[0054] In one embodiment, the structural organization operation performed on the database query results to obtain a summary data result set structure includes:

[0055] Determine the summary type based on the summary type field in the pre-created summary table basic information table;

[0056] If the summary type is a row-column caliber summary table, recursively expand the column caliber fields to obtain expanded columns;

[0057] Insert the expanded columns into the summary data result set structure according to a preset order.

[0058] In one embodiment, performing a data content organization operation based on the database query result and the structure of the summary data result set to obtain the summary data result set includes:

[0059] Determine the summary type based on the summary type field in the pre-created summary table basic information table;

[0060] If the summary type is a row-based summary table or a column-based summary table, filling the summary data result set structure according to the database query result;

[0061] If the summary type is a row-column summary table, the database query result rows are merged and added to the summary data result set structure;

[0062] Subtotal and total filling operations are performed on the summary data result set structure to obtain the summary data result set.

[0063] An embodiment of the present invention also provides a summary data generation device to support data modeling and summary processing under various summary types, thereby achieving efficient execution of complex summary tasks and structured output of summary data result sets.

[0064] The summary data generating device comprises:

[0065] A summary processing module is configured to, based on a pre-established summary result data storage model, perform summary processing on a summary area in the summary result data storage model to generate summary data; the summary result data storage model corresponds one-to-one with a pre-configured summary table basic information table, the summary table basic information table storing summary basic information, the summary basic information including a first identification code, a table name, a summary type, and a summary condition; the summary result data storage model is obtained by performing field modeling on each caliber item and each cell item in the summary area based on the first identification code, and performing a publishing operation;

[0066] A result construction module is used to perform summary result construction processing on the summary area according to the summary result data storage model and the summary data to generate a summary data result set.

[0067] An embodiment of the present invention further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned summary data generation method when executing the computer program.

[0068] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned summary data generating method is implemented.

[0069] An embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the computer program implements the above-mentioned summary data generation method.

[0070] The summary data generation method and device provided by the embodiment of the present invention, by structurally modeling the configuration information of the summary area and the summary result data storage model, and completing the field modeling and publishing operations before the execution of the summary task, so that the summary processing process no longer relies on temporary parsing and dynamic structure changes, helps to improve the stability and processing efficiency of the summary task during the execution phase. According to the unique identification code stored in the basic information table of the summary table, the caliber items and cell items in the summary area are field modeled, and a clear physical field mapping relationship is established, thereby ensuring that the summary data has a unified and traceable data structure in the underlying storage table, which is convenient for subsequent data reading, maintenance and reuse. During the summary processing process, the final summary data result set is organized and generated based on the published summary result data storage model. The summary data result set can be directly used for front-end data display, report export or downstream business analysis, without the need to perform additional format conversion or field alignment processing on the result data, effectively improving the automatic processing capability of the summary table engine and the structural consistency of the summary results. The above method realizes the decoupling of the summary logic configuration and the summary processing operation, and improves the maintainability and execution efficiency of the summary table engine. BRIEF DESCRIPTION OF THE DRAWINGS

[0071] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0072] Figure 1 Schematic diagram of a flow chart of a method for generating summary data in one embodiment of the present invention;

[0073] Figure 2 A schematic diagram of the structure of a summary table in an embodiment of the present invention;

[0074] Figure 3 Schematic diagram of a flow chart of a method for generating summary data in another embodiment of the present invention;

[0075] Figure 4 Schematic diagram of a flow chart of a method for generating summary data in another embodiment of the present invention;

[0076] Figure 5 Schematic diagram of a flow chart of a method for generating summary data in another embodiment of the present invention;

[0077] Figure 6 Schematic diagram of a flow chart of a method for generating summary data in another embodiment of the present invention;

[0078] Figure 7Schematic diagram of a flow chart of a method for generating summary data in another embodiment of the present invention;

[0079] Figure 8 Schematic diagram of a flow chart of a method for generating summary data in another embodiment of the present invention;

[0080] Figure 9 Schematic diagram of a flow chart of a method for generating summary data in another embodiment of the present invention;

[0081] Figure 10 Schematic diagram of a flow chart of a method for generating summary data in another embodiment of the present invention;

[0082] Figure 11 Schematic diagram of a flow chart of a method for generating summary data in another embodiment of the present invention;

[0083] Figure 12 Schematic diagram of a flow chart of a method for generating summary data in another embodiment of the present invention;

[0084] Figure 13 Schematic diagram of a flow chart of a method for generating summary data in another embodiment of the present invention;

[0085] Figure 14 Schematic diagram of a flow chart of a method for generating summary data in another embodiment of the present invention;

[0086] Figure 15 Schematic diagram of a flow chart of a method for generating summary data in another embodiment of the present invention;

[0087] Figure 16 Schematic diagram of a flow chart of a method for generating summary data in another embodiment of the present invention;

[0088] Figure 17 Schematic diagram of the structure of a summary data generating device according to an embodiment of the present invention;

[0089] Figure 18 A schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0090] To make the purpose, technical solutions and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings. Here, the exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.

[0091] The information collected in the technical solution of this application is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of relevant data comply with the relevant laws, regulations and standards of relevant countries and regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0092] Provide users with corresponding operation entrances for them to choose to agree or reject the automated decision-making results; if the user chooses to reject, they will enter the expert decision-making process.

[0093] In order to solve the problems existing in the existing summary table engine, such as model configuration redundancy, high degree of execution logic coupling, and lack of structured modeling and unified scheduling mechanism, the present invention proposes a method for generating summary data. By introducing a summary result data storage model, a unified summary table engine execution context mechanism, and an SQL constructor, this method establishes a complete technical path from summary table logic configuration definition, summary task organization and execution, summary data generation to structured output of summary results. This method can adapt to a variety of summary table structure types, including fixed summary tables, row-caliber summary tables, column-caliber summary tables, and row-column composite-caliber summary tables, and generates corresponding SQL query statements on demand during the summary processing stage. It supports multiple types of data processing logic, such as caliber field expansion, subtotal generation, and expression calculation, thereby achieving consistent organization and automated execution of complex summary scenarios such as multiple summary areas, multiple versions, multiple periods, and multiple indicators.

[0094] like Figure 1 As shown, the summary data generating method includes steps 101 and 102.

[0095] Step 101: Based on a pre-established summary result data storage model, the summary area in the summary result data storage model is aggregated to generate summary data. The summary result data storage model corresponds one-to-one with a pre-configured summary table basic information table, which stores basic summary information, including a first identification code, table name, aggregation type, and aggregation conditions. The summary result data storage model is generated by performing field modeling on each caliber item and each cell item in the summary area based on the first identification code, and then publishing the model.

[0096] Step 102: Perform summary result construction processing on the summary area according to the summary result data storage model and the summary data to generate a summary data result set.

[0097] In the embodiment of the present invention, by structurally modeling the configuration information of the summary area and the summary result data storage model, and completing the field modeling and publishing operations before the execution of the summary task, the summary processing process no longer relies on temporary parsing and dynamic structural changes, which helps to improve the stability and processing efficiency of the summary task during the execution stage. According to the unique identification code stored in the basic information table of the summary table, the caliber items and cell items in the summary area are field modeled, and a clear physical field mapping relationship is established, thereby ensuring that the summary data has a unified and traceable data structure in the underlying storage table, which is convenient for subsequent data reading, maintenance and reuse. During the summary processing process, the final summary data result set is organized and generated based on the published summary result data storage model. The summary data result set can be directly used for front-end data display, report export or downstream business analysis, without the need to perform additional format conversion or field alignment processing on the result data, effectively improving the automatic processing capability of the summary table engine and the structural consistency of the summary results. The above method realizes the decoupling of the summary logic configuration and the summary processing operation, and improves the maintainability and execution efficiency of the summary table engine.

[0098] As shown in FIG1 , each step is explained in detail below. The execution subject of the present invention is the summary table engine.

[0099] In one embodiment, if Figure 2 As shown, before the aggregation task is executed, the scope items involved in each aggregation area need to be pre-configured to support the construction and execution of multi-dimensional aggregation logic.

[0100] The above-mentioned caliber items are used to define the structured configuration parameters of the data summary dimension. The summary table engine supports multiple types of caliber configurations, including source subject caliber, subject attribute field caliber, period caliber, enumeration indicator caliber, standard caliber and placeholder caliber, etc. The present invention is not limited to this.

[0101] The above-mentioned source subject caliber is used for grouping and aggregation according to the hierarchical relationship of the organizational structure or basic data subject.

[0102] Specifically, the source subject scope is configured for an organization or basic data subject, and its corresponding scope entry is an organizational structure entry or basic data entry. The summary table engine automatically identifies the data scope at the current and lower levels of the source subject node by specifying a source subject node (such as "province" or "municipality" in the administrative hierarchy, or "group company" or "subsidiary" in the business system) as the starting point for the summary dimension. This automatically identifies the data scope at the current and lower levels of the source subject node, and constructs a grouping dimension based on the organizational or subject structure. This source subject scope is suitable for statistical scenarios where summarization is performed across organizational hierarchies.

[0103] The above subject attribute field caliber is used to group and summarize according to the enumerated attribute fields associated with the source subject.

[0104] Specifically, the scope of a subject attribute field is configured for the subject attribute field, and its corresponding scope entry is the enumeration dictionary entry bound to the subject attribute field. During scope configuration, the summary table engine extracts enumeration values ​​from a specific enumeration field defined in the subject object (such as "Enterprise Nature," "Industry," or "Scale Level") and constructs a grouping dimension. During aggregation, the summary table engine categorizes and counts data based on the enumeration value of this enumeration field. This approach is suitable for business scenarios where grouping is based on subject attribute characteristics.

[0105] The above period scope is used to construct a data aggregation model based on the time dimension.

[0106] Specifically, the period caliber is configured for the time field, and its corresponding caliber entry is the period entry. The summary table engine groups data according to predefined time granularities (such as year, quarter, and month) to construct time series summary dimensions. The period caliber is suitable for typical scenarios such as cross-period comparisons, year-on-year analysis, and time trend display. It can be used alone or in conjunction with other calibers to build a composite dimension structure.

[0107] The above enumeration indicator caliber is used to group data according to the enumeration fields on which the statistical indicators depend.

[0108] Specifically, the configuration object for the enumeration indicator scope is the enumeration dictionary field bound to the indicator field, and its corresponding scope entry is the entry value in the enumeration dictionary. In a summary task, if an indicator field (such as "project type" or "personnel type") is bound to an enumeration field (such as "project type" or "personnel category"), the summary table engine can use the enumeration field as a grouping dimension and perform group statistics according to the enumeration value. The above method is similar to the main attribute field scope, except that its grouping basis is derived from the subsidiary attributes of the indicator field itself, which is suitable for statistical needs classified by indicator attributes.

[0109] The above standard caliber is used to construct manually defined custom grouping summary dimensions.

[0110] Specifically, the configuration objects of standard caliber include manual grouping and interval grouping, where the caliber items corresponding to manual grouping are manual grouping items and their item details, and the caliber items corresponding to interval grouping are interval definition fields and their division conditions. Through manual grouping, users can merge multiple values ​​of the original field into logical categories (such as classifying "Beijing", "Shanghai", and "Guangzhou" as the "Eastern Region"); through interval grouping, users can set threshold conditions for numerical fields and construct segmentation dimensions such as "more than 5,000 yuan" or "18-40 years old". The summary table engine can realize the configuration of manually defined logic through the caliber item table and the manual grouping item detail table, which is suitable for scenarios where the original fields cannot meet statistical requirements.

[0111] The above placeholder caliber is used to support the summary scenario of dynamic parameterized configuration.

[0112] Specifically, the placeholder scope exists only as a variable placeholder during the configuration phase and is not bound to an actual field. During the summary task execution phase, the summary table engine dynamically replaces the placeholder scope with one of the source subject scope, subject attribute field scope, period scope, enumeration indicator scope, or standard scope based on the actual parameters passed in by the caller, and completes the corresponding field parsing and aggregation processing according to its field type. The placeholder scope is suitable for reuse scenarios of templated summary tables in multiple business dimensions, and can significantly improve the versatility and flexibility of summary configuration.

[0113] Through the combined configuration of the above-mentioned multiple scope items, the summary table engine can support flexible and diverse summary grouping strategies to meet the complex modeling requirements of different business structures, statistical calibers, and analysis dimensions, providing a basic guarantee for the efficient execution and unified output of summary tasks.

[0114] In one embodiment, if Figure 2 As shown, after configuring various types of scope items, you need to pre-configure the summary table. The summary table is a summary definition object at the logical level and is composed of multiple configuration units, including: summary table basic information configuration, summary area configuration, summary scope configuration, indicator item configuration, and table display structure. Among them, the summary table basic information configuration is stored in the "Summary Table Basic Information Table", the summary area configuration is stored in the "Summary Table Area Configuration Table", the summary scope configuration is stored in the "Summary Table Caliber Configuration Table", and the indicator item configuration is stored in the "Summary Table Indicator Configuration Table".

[0115] In addition, the complete structure of the summary table also includes multiple database structure tables related to the summary processing logic and summary data storage, including: summary result data storage table, caliber basic information table, caliber item table, manual grouping item details table, summary result basic information main table, summary result sub-table, summary table and grouping association table and summary table structure configuration object table, etc.

[0116] Each summary table can correspond to one or more summary areas, and each summary area can be independently configured with caliber items and indicator items to implement aggregate calculations and expression evaluations for specified data sources. During the summary processing phase, a structured summary data result set is generated that can be used for front-end rendering display or downstream report analysis.

[0117] In the embodiment of the present invention, the configuration and definition information of each summary table is stored in multiple structured database tables. The functions and effects of each summary table are described in detail below:

[0118] The summary table basic information table is used to store the core definition information of each summary table, including the unique identification code of the summary table, the summary table name, the summary type, and the summary data filtering conditions, etc., which serves as the basic configuration source for the entire summary modeling and task execution.

[0119] The summary table and group association table are used to logically group multiple summary tables and store the association between summary tables and group identifiers. The summary table and group association table can be used to classify and schedule summary tasks based on business dimensions and control permissions.

[0120] The summary table structure configuration object table is used to store binary structured configuration information of the summary table style, including cell style attributes, font settings, font size configuration, border style and other display parameters, to facilitate front-end rendering and unified display.

[0121] The summary table region configuration table defines the spatial boundaries and control parameters for each summary region in the summary table, including information such as the region's start and end positions, whether to enable summary rows, whether to display detailed data, and sort field settings. The summary table region configuration table also drives the execution of subsequent summary logic.

[0122] The summary table caliber configuration table is used to configure the summary caliber items used in a certain summary area. The caliber items can come from the source subject caliber, subject attribute field caliber, period caliber, enumeration indicator caliber, standard caliber and placeholder caliber. The summary table engine stores metadata information such as caliber fields, field types and associated logic through the summary table caliber configuration table.

[0123] The Summary Table Indicator Configuration Table is used to configure the data items for each cell in each summary area, including cell coordinates, data source fields, applied statistical methods, whether it is an expression field and its expression structure, and cell data filtering conditions. The Summary Table Indicator Configuration Table also provides basic data for query SQL construction and summary result output.

[0124] The caliber basic information table is used to define the basic attributes of various standard calibers. It is applicable to standard caliber configurations of manual grouping and interval grouping types, including metadata information such as caliber identifier, caliber name, binding subject type, and related business attributes.

[0125] The caliber entry table is used to store the definition information of each caliber entry in the standard caliber, including the code, name and sorting rules of the grouped entries. It is also used to provide structured entry information for the caliber field grouping logic in the summary processing stage.

[0126] The manual grouping item details table is used to store the correspondence between the manual grouping items and the detailed data in the standard caliber. For example, the specific entities corresponding to the "A region" group include "A1, A2, A3,..., A4", etc. The summary table engine stores the above correspondence in a structured manner in the manual grouping item details table.

[0127] The master table for basic summary results information stores the execution metadata for each summary operation, including information such as the processing time, call parameters, and externally specified additional scope conditions. In scenarios where a single summary task generates multiple sets of summary data, the master table will uniquely record a single piece of execution information corresponding to that task, clearly identifying these multiple sets of summary data as originating from the same execution process. This allows for unified archiving and traceability of summary results from the same batch. Furthermore, the master table also provides a detailed description of the execution process of each summary task.

[0128] The summary table result subtable stores information describing subsets of summary results. When a summary task generates multiple data results (for example, two results for the "North China" region and the "Central China" region), the summary table engine stores the summary conditions and data range for each sub-result in its own subtable, enabling versioning and traceability of summary results.

[0129] The summary result data storage table is used to store structured summary data after summary calculations. After the basic information table for each summary table is configured, a corresponding physical data table is generated through a publish operation. The summary result data storage table is also used to store summary data generated by aggregation based on caliber items and cell items. The structure of the summary result data storage table is derived from the field registration results of caliber items and cell items during the field modeling process. It is the physical carrier for data writing and querying during the summary processing phase.

[0130] In one embodiment, if Figure 3 and Figure 8 As shown, pre-establishing the summary result data storage model includes steps 301 to 305.

[0131] Step 301: Obtain the corresponding summary area according to the first identification code of the basic information table of the summary table.

[0132] Specifically, the summary table engine queries and obtains the summary area associated with the unique identifier of the summary table recorded in the summary table basic information table. Subsequently, it calls the pre-configured summary table caliber configuration table to obtain all caliber items configured in the current summary area and performs a validity check on each caliber item.

[0133] The summary table basic information table also includes a summary type field, which indicates the structure type of the current summary table, including but not limited to: fixed summary table, simplified table, row-based summary table, column-based summary table, and row-column-based summary table. If the summary type is fixed or simplified, the scope item can be empty. If the summary type is row-based, column-based, or row-column-based, at least one valid scope item must be configured, and the number of scope items in all summary areas must be consistent.

[0134] Furthermore, the summary table engine obtains all cell items configured in the current summary area from the summary table indicator configuration table, and performs validity check operations on each cell item. If there is at least one cell item in the current summary area that is not a serial number column or a caliber column, that is, the cell item type belongs to a data indicator field or an expression field that can perform statistical fields, summary operations, then the cell configuration of the summary area is considered legal. On the contrary, if the summary area only contains cell items of the serial number column or caliber column type, and lacks fields that can participate in the actual summary processing, then the summary area is marked as incompletely configured and does not have the ability to perform summary calculations.

[0135] Step 302: Initialize the summary result data storage model corresponding to the summary table basic information table according to the first identification code.

[0136] In one embodiment, if Figure 4 As shown, step 302 includes steps 401 to 403.

[0137] Step 401: Determine whether a summary result data storage model corresponding to the summary table basic information table already exists in the database.

[0138] Specifically, the summary table engine queries the database based on the unique identification code in the summary table basic information table to see whether a summary result data storage model corresponding to the unique identification code already exists.

[0139] Step 402: If the summary result data storage model corresponding to the summary table basic information table does not exist in the database, generate a table name of the corresponding summary result data storage model according to the first identification code.

[0140] Specifically, the summary table engine generates a default table name (TableCode) based on the unique identifier (Code) recorded in the summary table basic information table. During the table name generation process, the summary table engine verifies the uniqueness of the table name according to preset naming rules. If the generated table name conflicts with an existing table name in the database, an auto-incrementing suffix is ​​appended to the original table name to construct a new unique table name, for example: HZB, HZB_1, HZB_2, etc.

[0141] Step 403: Initialize the summary result data storage model corresponding to the table name, and set the table name and predefined field information in the summary result data storage model.

[0142] Specifically, the summary table engine creates a new summary result data storage model, sets the generated table name (TableCode) and table attribute information in the model, and initializes the basic field information in the summary result data storage model. This field information includes but is not limited to: primary key field, summary result sub-table ID field, period field, summary region ID field, and other management fields.

[0143] In one embodiment, if Figure 8 As shown, step 302 also includes step 404.

[0144] Step 404: If it is determined that the corresponding summary result data storage model already exists in the database, directly read the historical storage table model associated with the current summary table basic information table.

[0145] Specifically, the summary table engine does not need to regenerate the table name and summary result data storage model, but reads and loads it based on the table model information that has been generated and registered historically.

[0146] Step 303: Perform field modeling on each caliber item in the summary area, and generate a caliber column field corresponding to the caliber item in the summary result data storage model.

[0147] Specifically, various caliber items configured in the current summary area are converted into caliber column fields in the summary result data storage model.

[0148] In one embodiment, if Figure 5 As shown, step 303 includes steps 501 to 504.

[0149] Step 501: Traverse each caliber item in the summary area to determine whether the caliber item is a published caliber item.

[0150] Specifically, the summary table engine first retrieves all configured caliber items for the current summary area from the summary table caliber configuration table. Each caliber item includes a caliber type (such as source entity caliber, entity attribute field caliber, and period caliber), a caliber identification code, and caliber publication status. The summary table engine then iterates over each caliber item, determining whether a corresponding caliber column field has been generated for that caliber item in the previous round of summary publication.

[0151] Step 502: If the caliber item is an unpublished caliber item, generate a field name of the caliber column field according to the second identification code of the caliber item, wherein the second identification code is a caliber identification code.

[0152] Specifically, for caliber items that have not yet been modeled, the summary table engine generates corresponding field names based on their caliber identification codes as physical table fields. If the generated field name is already in use in the current summary result data storage model, an underscore and a numerical sequence number are appended to the name until a unique field name is generated. This field name is then added to the summary result data storage model and to the joint index field set to support complex queries based on multiple caliber items.

[0153] Step 503: Mark the caliber column field as updated so that the field name is written into the summary result data storage model when publishing the operation.

[0154] Specifically, after the field name generation is completed, the corresponding caliber column field is marked as a pending update configuration state to ensure that the summary result data storage model is written during the summary publishing operation.

[0155] Step 504: Iterate the above steps until all caliber items in the summary area are modeled.

[0156] Specifically, the summary table engine sequentially executes steps 501 to 503 for each caliber item in the summary area until all caliber items are modeled to form a complete caliber column field structure.

[0157] In one embodiment, if Figure 8 As shown, step 302 also includes step 505.

[0158] Step 505: If the caliber item is a published caliber item, determine whether the caliber item is still used in the current configuration. If the caliber item has been deleted in the current configuration, mark the corresponding caliber column field in the summary result data storage model as deleted.

[0159] Specifically, when it is detected that a caliber item has generated a corresponding caliber column field in a previous summary publishing operation, and the caliber column field has been added to the current summary result data storage model, the summary table engine will further determine whether the caliber item is still enabled in the current summary table configuration. If the caliber item has been removed from the summary table caliber configuration table, it is deemed that the caliber item no longer participates in the current summary task. The summary table engine will automatically mark the corresponding caliber column field in the summary result data storage model as deleted to clean up the field structure during subsequent publishing operations.

[0160] Step 304: Perform field modeling on each cell item in the summary area, and generate a cell column field corresponding to the cell item in the summary result data storage model.

[0161] In one embodiment, if Figure 6 As shown, step 304 includes steps 601 to 604.

[0162] Step 601: Traverse each cell item in the summary area to determine whether the cell item is a published cell item.

[0163] Specifically, the system first reads all cell items in the current summary area from the pre-configured summary table indicator configuration table. Each cell item contains multiple properties, such as cell type, data source field, summary method, and expression. The summary table engine then iterates over these cell items one by one, identifying whether any of them have already been modeled for field columns in a previous summary publishing operation.

[0164] Step 602: If the cell item is an unpublished cell item, a corresponding cell column field is generated according to the configuration type of the cell item.

[0165] Specifically, for cell items with a configuration type of serial number column, they are only used for front-end display purposes and do not participate in data storage modeling, so no cell column fields are generated.

[0166] For cell items with the configuration type of expression column, the summary table engine automatically generates the field name of the cell column field for it. The naming rule of the field name adopts the "fml_numeric serial number" format, and creates the corresponding cell column field accordingly to store the expression calculation results.

[0167] For cell items configured as display caliber fields or subject attribute fields, the summary table engine determines the field type based on its original data type and whether it participates in numerical calculations: If the field type is non-numeric and is not used in statistical operations such as count or sum, it is modeled as a string field. If the field type is numeric or is used in numeric statistical operations, it is modeled as a numeric field.

[0168] Step 603: Mark the cell column field as an update state, so that the cell column field is written into the summary result data storage model when the operation is published.

[0169] Specifically, the summary table engine marks each newly created or changed cell column field as pending configuration update, records information such as the field name, field type, and field order, and establishes a mapping relationship between the cell column field and its corresponding cell item. These mapping relationships are stored in the summary result data storage model during the summary publishing operation.

[0170] Step 604: Iterate the above steps until all cell items in the summary area are modeled.

[0171] In one embodiment, if Figure 8 As shown, step 304 also includes steps 605 and 606.

[0172] Step 605: If the cell item is a published item, determine whether the cell item is still used in the current configuration. If the cell item has been deleted in the current configuration, mark the corresponding cell column field in the summary result data storage model as deleted.

[0173] Specifically, if it is detected that a cell item has generated a cell column field during the historical publishing process and is no longer used in the current configuration, the corresponding cell column field will be marked as deleted so that the field structure can be cleaned up during subsequent publishing operations.

[0174] Step 606: If it is detected that the number of decimal places in the field definition of a cell item has changed, the cell column field of the cell item in the summary result data storage model is synchronously updated to ensure that the cell column field is consistent with the configuration information of the actual cell item.

[0175] Step 305: Perform publishing operations based on the caliber column fields and the cell column fields to generate a summary result data storage model.

[0176] Specifically, after completing the modeling of all caliber columns and cell columns in the summary area, the summary table engine enters the publishing phase of the summary result data storage model. This publishing process solidifies the previously constructed logical field structure into a physical table structure in the database, forming a summary result data storage table that can be used by the summary task.

[0177] In one embodiment, if Figure 7 As shown, step 305 includes: steps 701 to 703.

[0178] Step 701: In the summary result data storage model, update the caliber column field and the cell column field marked as updated.

[0179] Specifically, for fields marked as being in the configuration state to be updated, the summary table engine will add them to the summary result data storage model and define their attributes such as field name, data type, field length, decimal places, and whether they participate in the index. For fields marked as being in the state to be changed, the summary table engine will correct the definition information of the existing fields according to the change items. For fields marked as being deleted, they will be removed from the summary result data storage model or set to a logically invalid state. During this process, if any field change affects its corresponding original index structure, the summary table engine will automatically clear the invalid index and rebuild the joint index or ordinary index based on the latest field definition.

[0180] Step 702: updating the field mapping information in the pre-created summary table caliber configuration table and summary table indicator configuration table according to the caliber column field and the cell column field marked as updated.

[0181] Specifically, the summary table engine writes the field name, field type, arrangement order, index attributes and other information of each caliber column field and cell column field into the corresponding summary table caliber configuration table and summary table indicator configuration table, establishes a binding relationship between the field column and the original configuration item, and ensures the consistency and traceability between the summary table configuration logic and the physical table structure.

[0182] Step 703: Perform database physicalization operations on the summary result data storage model.

[0183] Specifically, the summary table engine generates standard database table creation statements (CREATE TABLE) or field change statements (ALTER TABLE) based on the current summary result data storage model, completes the physical registration of field column definitions and index structures in the database, and formally converts the logical model into the target result table structure in the database where summary data can be written, that is, converts the summary result data storage model into a summary result data storage table.

[0184] In one embodiment, if Figure 8 As shown, step 305 also includes step 704.

[0185] Step 704: After completing the above-mentioned database physical table creation operation, the table structure information of the current summary result data storage model is registered in the model management object, and its status is marked as table creation completion status or available status, so that subsequent summary tasks can be directly called and used for data writing operations during execution.

[0186] In an embodiment of the present invention, by structured modeling and publishing of each component of a summary table, a complete mapping path from logical configuration to physical table structure is constructed, achieving a high degree of consistency and an automatic linkage mechanism between the summary table execution model and the database structure. Through the unique identifier of the summary table basic information table, the summary table engine can quickly locate and load the corresponding summary area and its configured caliber items and cell items, and then perform validity verification, field modeling and publishing operations to ensure that each configuration content is correctly mapped to a field column in the database. Through automatic naming, field conflict avoidance, index reconstruction and field status identification during the systematic modeling process, the summary table engine's adaptability to multi-version configurations and dynamic field changes is significantly improved. Ultimately, the summary table engine converts the logical field structure into a physical table structure that can be executed in the database, completing the registration of the summary result data storage table. The above mechanism not only reduces the complexity of manual table creation and structure maintenance, but also avoids problems such as data write anomalies, query errors or version conflicts caused by structural inconsistencies in traditional summary systems, improving the stability of the summary task, the degree of automation and the consistency of subsequent data analysis.

[0187] Step 101: Based on a pre-established summary result data storage model, perform summary processing on the summary area in the summary result data storage model to generate summary data.

[0188] In one embodiment, if Figure 9 and Figure 11 As shown, step 101 includes steps 901 to 905.

[0189] Step 901: Obtain configuration information of all summary areas in the summary result data storage model.

[0190] Specifically, the summary table engine reads and parses the structure of the summary result data storage table associated with the current summary task, extracting the configuration information for all summary regions. This configuration information includes the unique identifier of the summary region (Region ID), the definition of the summary unit range, whether to include total rows, whether to display detail rows, and sort field settings, etc., which is used to independently perform logical organization on each summary region.

[0191] Step 902: Initialize the context object and query executor object corresponding to each summary area based on the configuration information.

[0192] Specifically, the summary table engine initializes a corresponding summary execution context object (Context) for each summary area. This context object is used to record the global and local environment parameters required during the summary task execution, including but not limited to the current summary area ID, summary task identification code, data source master table name, summary result data storage table name, field column definitions, and other auxiliary configuration items. Subsequently, based on the established context object, the bound query executor object (QueryExecutor) is instantiated and the required field information is automatically added to the SQL structure maintained by the query executor object. This field information includes the summary area ID field, period field, summary result subtable ID field, primary key field, and management field.

[0193] During the addition process, the aforementioned field information will be automatically written to the corresponding clause structure in the SQL builder. The Summary Region ID field, as an attribution identifier, is added to the SELECT and INSERT clauses to indicate the region to which the summary results belong. The Period field, as a multi-period summary support field, can be written to SELECT, WHERE, and INSERT clauses to support periodic data segmentation logic. The Summary Result Subtable ID field is used to identify the specific result version generated by the current task. Primary key fields and other management fields are added to the INSERT clause and table creation structure to ensure the uniqueness and integrity of the summary result data storage table structure.

[0194] Step 903: parse the caliber column fields, cell column fields, and summary conditions in the summary area respectively, and write the generated parsing results into the query executor object.

[0195] In one embodiment, if Figure 11 As shown, parsing the caliber column field in the summary area and writing the generated parsing result into the query executor object includes: steps 1101 to 1104.

[0196] Step 1101: Sequentially traverse all scope column fields configured in the current summary area and obtain the type identifier, scope identification code, and corresponding field identifier for each scope item. The scope item type identifiers include: source subject scope, subject attribute field scope, period scope, enumeration indicator scope, standard scope, and placeholder scope.

[0197] Step 1102: Based on the type identifier of the caliber item, call the field parsing logic module corresponding to the type identifier to perform standardized parsing processing on each caliber column field.

[0198] Specifically, the standardized parsing process includes generating field expressions required for executing SQL statements, and adding the parsed field contents to the SQL constructor maintained by the query executor object. The query clauses include the SELECT clause, the GROUP BY clause, and the INSERT clause.

[0199] Step 1103: Perform standardized parsing on the caliber column fields corresponding to the source subject caliber.

[0200] Specifically, when parsing source entity scopes, the summary table engine automatically associates predefined source entity dimension tables and builds filtering logic to include subordinate node data based on the current configuration. Furthermore, a subject version control field is added to ensure that matching subject structure data is obtained across different summary cycles.

[0201] The summary table engine retrieves the mapped field name (i.e., the coded field in the source table, such as org_code) from the summary table caliber configuration table based on the caliber identifier of the source entity caliber item. This field name is used as the actual field reference for the source entity caliber and is written into the SELECT clause, GROUP BY clause, and INSERT clause maintained in the SQL builder.

[0202] Step 1104: Perform standardized parsing processing on the caliber column fields corresponding to the subject attribute caliber.

[0203] Specifically, since the relevant attribute fields of the subject attribute caliber have been connected to the basic query table structure through the source subject dimension table, the subject attribute field name can be directly extracted and written into the corresponding Query clause without performing other association operations.

[0204] Step 1105: Perform standardization and parsing processing on the caliber column fields corresponding to the period caliber.

[0205] Specifically, the summary table engine adds the period field in the form of the "@@Period" placeholder in each Query clause to support subsequent batch replacement and generation of corresponding SQL query statements according to specific time granularity (year, quarter, month, etc.) during the summary task execution phase.

[0206] Step 1106: Perform standardized parsing processing on the caliber column fields corresponding to the enumeration indicator caliber.

[0207] Specifically, when processing an enumerated indicator caliber, the summary table engine first adds the corresponding enumeration dictionary table to the FROM clause of the SQL builder. Based on pre-set field association rules, it establishes a field join relationship with the master data table to achieve a logical mapping between the enumerated fields and the original indicator data. Subsequently, the summary table engine retrieves the corresponding enumeration field name based on the caliber identification code of the enumerated indicator caliber and writes this field name into the SELECT clause, GROUP BY clause, and INSERT clause maintained by the SQL builder.

[0208] Step 1107: Perform standardized parsing processing on the caliber column fields corresponding to the standard caliber.

[0209] Specifically, the summary table engine analyzes the two types of processing logic: manual grouping and interval grouping, based on the configuration of the standard caliber in the caliber basic information table, caliber entry table, and manual grouping details table. Manual grouping uses static mapping to establish a mapping relationship between the summary caliber and the original field value, while interval grouping generates the corresponding SQL conditional expression based on a predefined interval formula (for example, "age is between 20 and 50"). If the current summary mode is a dual-subject structure, the summary table engine will also add the necessary subject fields and indicator fields to the SQL clause to ensure consistency across subject groupings.

[0210] Step 1108: Perform standardized parsing on the caliber column fields corresponding to the placeholder caliber.

[0211] Specifically, the placeholder caliber does not specify a specific field during the configuration phase and only exists in a placeholder form. During the summary execution phase, the summary table engine receives the actual field parameters passed in by the external caller and replaces the placeholder field with the corresponding field code. Subsequently, the summary table engine performs one of the above-mentioned steps 1103 to 1107 based on the replaced field type to ensure that the dynamic configuration of the caliber field remains consistent with the standard field logic. Among them, the actual field parameter type must be one of the source subject caliber, subject attribute field, period caliber, enumeration indicator or standard caliber.

[0212] In one embodiment, if Figure 11 As shown, parsing the cell column fields in the summary area and writing the generated parsing results into the query executor object includes: steps 1109 to 1116.

[0213] Step 1109: Sequentially traverse all modeled cell column fields in the current summary area, read the configuration information of the cell item corresponding to each field, and obtain the type identifier and data source information of the cell column field. Cell types include, but are not limited to, subject attribute field cells, caliber information cells, indicator field cells, general expression cells, summary-first-then-calculate expression cells, and placeholder cells.

[0214] Step 1110: According to the type identifier of the cell column field, the corresponding field parsing processing logic is called to generate standardized field information and write it into the SQL constructor of the query executor object.

[0215] Step 1111: Perform standardized parsing processing on the cell column fields corresponding to the subject attribute cells.

[0216] Specifically, the summary table engine adds the main attribute fields (such as company type and region code) directly to the SELECT and INSERT clauses in the SQL builder. If a statistical function type (such as sum, count, and average) is configured for the field, the SQL aggregate function expression corresponding to the statistical function type, such as SUM(field) or AVG(field), is wrapped around the main attribute field to implement statistical aggregation processing of the data.

[0217] Step 1112: Perform standardized parsing processing on the cell fields corresponding to the caliber information cells.

[0218] Specifically, the caliber information field is used to display the subsidiary attribute information of the caliber item, such as the caliber code, caliber name or caliber group title. After identifying the statistical type of the caliber information field, the summary table engine constructs it into the corresponding statistical function expression and adds it to the SELECT clause and INSERT clause. If the caliber information field is a placeholder type, the actual caliber item is passed in by the caller during the summary execution phase, and the corresponding field attributes are parsed accordingly. If the caliber information field corresponds to the interval grouping field in the standard caliber (such as "age group"), it is identified as a field that needs to be processed twice through the UPDATE statement during the summary result write-back phase. The summary table engine parses it into an internal code field, and then converts it into a display name after the summary is completed.

[0219] Step 1113: Perform standardized parsing processing on the cell fields corresponding to the indicator data cells.

[0220] Specifically, the summary table engine converts the indicator data field into the corresponding SQL aggregate function expression (such as SUM(sales_amount)) based on the binding relationship of the indicator data field and its configured statistical method, and writes it into the SELECT clause and INSERT clause. At the same time, it ensures that the data source table on which the indicator data field depends is added to the FROM clause to support the reference of the indicator data field.

[0221] Step 1114: perform standardized parsing processing on the cell fields corresponding to the common expression cells (ie, the expression cells that are calculated first and then summarized).

[0222] Specifically, a common expression is typically represented as an A * B structure. The summary table engine expands this expression structure during parsing and adds statistical functions (such as SUM(fieldA * fieldB)) to the common expression. During this process, all fields involved in the expression, depending on the data source table, are added to the FROM clause, and the generated common expression cell column fields are added to the SELECT and INSERT clauses.

[0223] Step 1115: Perform standardized parsing processing on the cell fields corresponding to the cells that first summarize and then calculate the expression.

[0224] Specifically, the aggregation-first, then-calculation expression is typically of the form SUM(A) * SUM(B). During the parsing phase, the summary table engine generates independent aggregate function expressions for A and B, each written into the SELECT and INSERT clauses. These fields are then marked as intermediate fields, allowing for post-processing calculations (such as product operations) in SQL UPDATE statements after the aggregation is complete to populate the expression with the summary result.

[0225] Step 1116: Perform standardized parsing processing on the cell fields corresponding to the placeholder cells.

[0226] Specifically, during the aggregation configuration phase, placeholder fields exist only as field location information and are not bound to actual fields. During the aggregation execution phase, the aggregation engine receives the actual field parameters passed in by the caller, determines their specific type (such as subject attribute field, caliber field, indicator field, or expression field), and performs standardized parsing processing in one of the above steps 1111 to 1116, thereby achieving semantic replacement and dynamic binding of the field structure.

[0227] In an embodiment of the present invention, through the above-mentioned cell column field parsing processing, the summary table engine can uniformly convert the definition information of all cell column fields into an SQL execution structure, and inject it into the SQL constructor of the query executor as the key field basis for subsequent generation of SQL query statements.

[0228] In one embodiment, if Figure 11 As shown, parsing the summary conditions in the summary area and writing the generated parsing results into the query executor object includes: steps 1117 to 1123.

[0229] Step 1117: traverse various aggregation conditions configured in the current aggregation area, call the corresponding field parsing logic, generate SQL conditional expressions and write them into the SQL constructor maintained by the query executor object.

[0230] Specifically, these aggregation conditions include, but are not limited to, subject version control conditions, static filter conditions, unit range filter conditions, interface dynamic parameter conditions, and multi-period conditions. The aggregation table engine converts these aggregation conditions into standardized SQL expressions through structured extraction, type determination, and semantic conversion, and then writes them into the WHERE clause.

[0231] Step 1118: Perform standardized parsing of the main body table version control conditions.

[0232] Specifically, based on the aggregation period (such as month and quarter) configured for the current aggregation task, determine the corresponding time interval and construct a filter expression indicating that the subject data is valid within the time interval (such as valid_time <= '2024-03-31' AND invalid_time > '2024-03-31'). This expression is written into the WHERE clause of the SQL builder to limit the referenced subject information to valid data within the current period.

[0233] Step 1119: Perform standardized parsing on the static filter conditions.

[0234] Specifically, the preset filter formula condition is read from the summary result data storage model, converted into an SQL expression (for example, audit_status = 'approved'), and added to the WHERE clause of the SQL builder.

[0235] Step 1120: Perform standardized parsing processing on the unit range filtering conditions.

[0236] Specifically, if the summary task passes in a unit code parameter (such as unit_code = 'ORG001'), the summary table engine converts it into a field matching condition bound to the master data table, such as unit_code = '10' OR parents LIKE '10 / %', and writes it into the WHERE clause of the SQL builder to limit the summary scope to the organization or business unit.

[0237] Step 1121: Perform standardized parsing processing on the interface dynamic parameter conditions.

[0238] Specifically, the dynamic parameter conditions of this interface include: general screening conditions (such as fixed field values, single selection, multiple selection, fuzzy matching, etc.), and logical condition groups, or logical condition groups and custom formula expressions, etc.

[0239] The summary table engine parses the dynamic parameter conditions in the above interface into SQL expressions. It combines AND logical condition groups into Boolean AND expressions. It concatenates OR logical condition groups into Boolean OR expressions. It also converts custom formulas (such as Field A > Field B × 1.2) into valid SQL expressions after syntax parsing and variable substitution. These parsed SQL expressions are then written into the WHERE clause of the SQL builder.

[0240] Step 1122: Perform standardized parsing on the period conditions of the data source table.

[0241] Specifically, if the summary task is configured with a data period field (such as report_month), the summary table engine automatically generates a filter expression (such as report_month = '2024-03') based on the time parameter of the current task and writes it into the WHERE clause to limit the data range.

[0242] Step 1123: Perform standardized analysis on the period conditions in the multi-period comparison scenario.

[0243] Specifically, the summary table engine traverses the configured period caliber value list and builds an independent SQL query environment for each period value, including the WHERE clause, FROM clause and related parameters.

[0244] If there are placeholders like "@@Period" in the SQL builder, they are dynamically replaced with the current period value. If different periods correspond to different data tables (e.g., data_202403 and data_202404), the table name or alias in the query statement is replaced to ensure that each period's data is read from the correct data source. Ultimately, each generated SQL query structure is stored in the query executor object, including the corresponding fields, parameters, and table structure information, for subsequent period-by-period aggregate execution.

[0245] Step 904: Summarize and process the query executor object that contains the parsing result to generate a corresponding SQL query object.

[0246] In one embodiment, if Figure 10 and Figure 11 As shown, step 904 includes steps 1001 to 1003.

[0247] Step 1001: Determine the summary type according to the summary type field in the pre-created summary table basic information table.

[0248] Specifically, the Summary Type field indicates the structure of the current summary table. Summary types include, but are not limited to, fixed summary tables, simplified tables, row-based summary tables, column-based summary tables, and row-column-based summary tables. The summary engine uses this Summary Type field to determine whether to generate summary structure information and subsequent summary data processing logic.

[0249] Step 1002: Generate corresponding aggregate structure information according to the aggregation type.

[0250] Specifically, when the summary type is a row-scope summary table, a column-scope summary table, or a row-column-scope summary table, the summary engine will construct the corresponding summary structure, including subtotal rows, summary rows, subtotal columns, summary columns, and cross-total cells.

[0251] If the summary type is a row-based summary table, the subtotal and total structures corresponding to each level of the caliber items are generated sequentially according to the row dimension. If the summary type is a column-based summary table, the subtotal and total columns for each caliber item are generated according to the column dimension. If the summary type is a row-column summary table, a cross-subtotal structure is constructed according to the row dimension and the column dimension, and then a total cell for the entire table is generated.

[0252] Step 1003: Based on the above-mentioned aggregate structure information, subtotal and aggregate data processing is performed on the single-type caliber dimension and the cross-caliber dimension respectively, and the corresponding SQL query object is generated.

[0253] like Figure 11 As shown, step 1003 includes step 1124 and step 1125.

[0254] Step 1124: Perform subtotal and total data processing on the single-caliber dimension to generate the corresponding SQL query object.

[0255] Specifically, the summary engine retrieves the summary attribute configuration for each scope item from the summary table scope configuration table and determines which scope items have subtotals or totals enabled. For each scope item with subtotals enabled, a mapping relationship is established between the scope item and the target summary field, and an SQL query object is generated based on the scope item. The query statement uses the GROUP BY clause to group by scope, and combines the aggregate functions (such as SUM, COUNT, and AVG) in the SELECT clause to perform statistical aggregation on the indicator field or expression field, generating a subtotal result corresponding to the scope value.

[0256] Step 1125: Perform subtotal and total data processing on the intersection dimension to generate a corresponding SQL query object.

[0257] Specifically, the aggregation engine identifies multiple scope items with subtotals enabled within the current aggregation range and constructs a cross-dimensional structure consisting of two or more combinations. For each cross-dimensional combination, a corresponding SQL query object is constructed. Aggregation is performed using a GROUP BY clause that combines multiple fields. Aggregation functions are then applied to the relevant indicator fields to perform statistical calculations, generating a result set of subtotal data for the cross-dimensional structure. The resulting SQL query object contains all summary statistical fields for that cross-combination and their corresponding summary results.

[0258] In one embodiment, if Figure 11 As shown, the query executor object in which the parsing result is written is aggregated and further includes steps 1126 and 1127 .

[0259] Step 1126: Perform SQL optimization processing on the aggregate data according to the aggregation method fields corresponding to the cell items in the aggregation area.

[0260] Specifically, when parsing a summary range configuration, the summary engine reads the summary method properties (e.g., sum, count, average, and percentage) for all cell items within the summary range and automatically determines whether any field types require calculations based on detail data. If it detects relative value calculations (e.g., percentage fields) or average statistics, the summary engine constructs an SQL aggregate query object based on the detail data, based on the master data source table corresponding to the summary range, to directly generate the required subtotals or totals.

[0261] If all cell items in the current summary area are summarized using common summary functions (such as SUM and COUNT) and do not rely on detail-level fields, the recursive aggregation method based on the subtotal data of the next level is preferred. The subtotal or total result of the previous level is generated through the step-by-step accumulation logic of multi-level summary data, effectively reducing the data table scanning overhead and improving the execution efficiency of the overall summary task.

[0262] Step 1127: For the summary area with dependent cell items, generate an SQL object for secondary update processing.

[0263] Specifically, when there is an expression type cell item in the summary area, and the field value of the cell item depends on the output results of other completed statistical calculation fields in the same summary area (for example, the expression form is: fd1= v1 +v2, or fd2 = v3 / v4, where v1 to v4 are the summary results of other indicator fields in the current summary area), the dependent cell item cannot be directly calculated in the main summary SQL query stage (i.e., step 903), and the result must be backfilled through the UPDATE clause after the main summary query result is generated.

[0264] The summary table engine first parses the calculation formula configured in each expression-type cell item, identifies the set of fields on which the calculation formula depends, and then constructs the corresponding SQL UPDATE object. This SQL UPDATE object is triggered and executed uniformly after the main query statement in the summary area completes. Based on the completed field calculation results in the current record, it generates the final calculated value of the target cell field, thereby achieving delayed replenishment and complete backfill of dependent fields.

[0265] Step 905: Generate summary data based on the SQL query object and store it in the summary result data storage model.

[0266] In one embodiment, step 905 specifically includes: performing summary processing on the SQL query object based on the initialized context object and the summary table caliber configuration table corresponding to the summary area, generating summary data and storing it in the summary result data storage model.

[0267] Specifically, the summary table engine extracts summary parameters and sets period parameter values ​​based on the initialized context object and the summary table scope configuration table configured for the current summary region. Subsequently, depending on the presence of the period scope field, different strategies are used to generate summary data, and the generated summary data is stored in the summary result data storage table.

[0268] like Figure 11 As shown, step 905 includes steps 1128 to 1131.

[0269] Step 1128: Summarize the parameter values ​​according to different periods.

[0270] Specifically, the summary table engine determines whether a period scope field exists based on the period parameter settings in the context object corresponding to the current summary task. If a configured period scope field is detected in the summary table scope configuration table, the current summary task is considered to involve time-based amortization logic. If no period scope field is detected, the current summary task is considered a standard summary task without time constraints.

[0271] Step 1129: If the period scope field does not exist, perform non-period parameter aggregation processing.

[0272] Specifically, when it is detected that the current summary area is not configured with a period caliber field, the summary table engine will default to using the period parameter value preset in the context object to execute the summary task.

[0273] The summary table engine converts pre-built SQL query objects into standardized SQL query statements and executes the primary summary SQL query statement to generate basic summary data. Subsequently, for expression fields marked as dependent during the modeling phase (such as expression cells involving inter-field calculation relationships), the corresponding secondary UPDATE-type SQL query statement is executed to perform supplementary update calculations on these fields. Finally, based on the constructed aggregate structure information, the summary table engine executes the corresponding aggregate row and aggregate column SQL queries to generate summary data for the current summary area.

[0274] Step 1130: If the period scope field exists, perform period parameter aggregation processing.

[0275] Specifically, when it is detected that the current summary area has been configured with a period caliber field and all period variables correspond to the same data source table structure, the summary table engine will extract the period caliber field from the summary table caliber configuration table and obtain the period variable list passed in by the caller when the task is executed.

[0276] For each period variable, the summary table engine searches for a preset period placeholder (such as "@@Period") in the SQL query object and replaces it with the current specific period value, dynamically generating an SQL query statement with time filtering constraints. The replaced SQL query statements are then executed sequentially to generate summary data results for each period and write them to the summary result data storage table. This replacement, execution, and storage process loops through the list of period variables until all period variables have been summarized, thereby generating multiple sets of summary data based on the period dimension.

[0277] Step 1131: When variables in different periods correspond to different source data tables, perform aggregation processing on multiple source data tables.

[0278] Specifically, if the current summary area is configured with a period-scope field, and each period variable corresponds to a different data source table structure, the summary table engine, when executing the summary process, not only replaces the period placeholder (e.g., "@@Period") in the SQL query object, but also replaces the pre-set data table name placeholder in the SQL query object with the actual data source table name corresponding to the current period variable (e.g., data_202403 and data_202404). For each period variable, the summary table engine generates a complete SQL query structure based on the replaced field values, including a SELECT clause, an INSERT clause, and any necessary UPDATE clauses. During execution, this query structure adapts to each data source table, enabling period-by-period aggregation within a multi-table structure. The summary table engine loops through all period variables until all SQL query structures are generated and executed, and then writes the summary data for each period to the corresponding summary result data storage table.

[0279] In one embodiment, if Figure 11 As shown, step 905 also includes step 1132.

[0280] Step 1132: Summarize the summary area with dependent cell items, generate summary data and store it in the summary result data storage model.

[0281] Specifically, if there are dependent cell items in the current summary area, that is, their field values ​​depend on the expression calculation of other field values ​​that have completed summary calculations in the same summary area (such as fd1 = v1 + v2, or fd2 = v3 ÷ v4, etc.), then the summary table engine needs to perform secondary processing on such cell items based on the dependency relationship between fields after the main summary query is completed.

[0282] This secondary processing is accomplished through SQL UPDATE objects generated and marked during the modeling phase. These SQL UPDATE objects contain expression logic based on dependent fields. The summary table engine loops through all expression fields marked as dependent within the summary range and executes the corresponding SQL UPDATE operations in sequence to calculate the final field value based on the generated intermediate summary results.

[0283] In an embodiment of the present invention, a summary data generation mechanism covering the entire process of scope analysis, field modeling, SQL query object construction, aggregate data processing and summary data generation is established by structurally modeling the summary table execution process in steps. The summary data generation mechanism automatically initializes the query executor object based on the structural configuration and context object of the summary area, and uniformly converts various fields in the summary area into executable SQL construction objects to achieve flexible adaptation and unified processing of multiple summary types, multi-dimensional fields and multi-period parameters. By dynamically replacing the period and data source table name placeholders in the SQL query object, the summary table engine can automatically complete the phased summary processing across periods and multiple data tables. For dependent expression fields, the delayed calculation of dependent fields and the supplementary backfilling of result accuracy can be achieved through secondary SQL UPDATE statements to ensure the integrity and correctness of the summary results. The above method not only improves the versatility, scalability and execution efficiency of the summary table engine, but also significantly reduces the cost of manual intervention and manual configuration.

[0284] Step 102: Based on the summary result data storage model and the summary data, perform summary result construction processing on the summary area to generate a summary data result set.

[0285] In one embodiment, if Figure 12 As shown, step 102 includes steps 1201 to 1204.

[0286] Step 1201: Based on the summary result data storage model and the summary data, perform field organization operations on the summary area to generate an SQL structure object.

[0287] In one embodiment, if Figure 13 and Figure 16 As shown, step 1201 includes steps 1301 to 1302.

[0288] Step 1301: Obtain configuration information of all summary areas in the summary result data storage model.

[0289] Specifically, the summary table engine determines the name of the summary result data storage table used by the current summary task based on the summary result data storage model generated during the publish operation, and reads the configuration information for each summary area recorded in the summary result data storage table. This configuration information includes: caliber column field definition, cell column field definition, summary area range, total item enablement status, detail row display configuration, and sort field settings. At the same time, it also loads the common field definition information required by the summary table engine, such as the summary area ID field, summary result subtable ID field, data period field, and primary key field.

[0290] Step 1302: Based on the configuration information of the summary area, perform field organization operations on the caliber column fields and cell column fields of the summary area respectively to construct an SQL structure object.

[0291] In one embodiment, if Figure 16 As shown, step 1302 includes steps 1601 to 1606.

[0292] Step 1601: traverse each caliber column field in the current summary area and add the caliber column field to the SELECT clause of the SQL structure object.

[0293] Specifically, the configuration information of all caliber column fields is read in sequence, and the field names and attributes corresponding to the caliber column fields are written into the SELECT clause of the SQL structure object.

[0294] Step 1602: Perform dimension identification processing on the scope column field according to the summary type and generate an SQL structure object.

[0295] Specifically, the summary table engine automatically identifies whether the summary area belongs to row-based summary, column-based summary, or row-column-based summary based on the summary type configured for the summary area, and organizes the query field structure and its tag attributes accordingly.

[0296] Step 1603: Processing of row caliber summary table.

[0297] Specifically, all scope columns are identified as row dimension fields, and the current summary area is marked as a "group by row" structure. At the same time, these row dimension fields are written to the group control field set for subsequent generation of the GROUP BY clause.

[0298] Step 1604: Processing of column caliber summary table.

[0299] Specifically, all caliber column fields are identified as column dimension fields, and the current summary area is marked as an "expand by column" structure, providing a structural definition basis for subsequent column transposition operations.

[0300] Step 1605: Processing of row and column caliber summary table.

[0301] Specifically, multiple caliber column fields are divided into row dimension fields and column dimension fields according to dimension attributes, and the current summary area is marked as a "cross structure" type.

[0302] After completing the processing of each caliber column field, iterate the above steps until all caliber column fields in the current summary area are processed.

[0303] Step 1606: Traverse each cell column field in the current summary area and add it to the SELECT clause of the SQL structure object.

[0304] Specifically, the summary table engine reads all the cell column field information configured for the current summary area from the summary result data storage table. Based on the recognition results, the summary table engine constructs the field expression for each cell column field in the SELECT clause and writes it into an SQL structure object.

[0305] Among them, if the cell column field is a serial number column type, because it is only used for front-end sequence display and does not participate in data aggregation or storage processing, the summary table engine will exclude this type of field from the field organization process by default.

[0306] In one embodiment, if Figure 16 As shown, step 1201 also includes step 1607 and step 1608.

[0307] Step 1607: Use the summary result sub-table ID as the query condition to construct the WHERE clause in the SQL structure object.

[0308] Specifically, the WHERE clause is constructed to retain only the summary result sub-table ID field as the filtering condition to distinguish the ownership of the result data generated by different tasks.

[0309] Step 1608: Traverse the sort fields configured in the current summary area and build the ORDER BY clause in the SQL structure object.

[0310] Specifically, if a sort field is set in the summary area configuration, the ORDER BY clause is constructed using that sort field. If no sort field is set, the summary area ID field is used as the primary sort field by default, and all caliber columns are appended to ensure consistent row and column order and predictability in the summary results.

[0311] In an embodiment of the present invention, through the above processing, the summary table engine can construct an SQL structure object including clauses such as SELECT, WHERE and ORDER BY based on the structure definition in the published summary result data storage model, as the basis for subsequent summary data result set query and structural organization.

[0312] Step 1202: Perform a query operation in the database through the SQL structure object to obtain the corresponding database query result.

[0313] In one embodiment, if Figure 16 As shown, step 1202 includes steps 1609 to 1610.

[0314] Step 1609: Construct a database result set object based on the SQL structure object.

[0315] Specifically, the summary table engine extracts the SELECT clause field list defined in the generated SQL structure object and, combined with the scope column and cell column fields and common fields (such as the summary area ID field, period field, and summary result sub-table ID field) included in the summary area configuration, constructs the field structure definition information for the database result set object. This database result set object is used to store the summary data returned by subsequent database query operations and provides functions such as field index mapping, field type description, and field value management.

[0316] Step 1610: Perform a query operation based on the database result set object to obtain the database query result corresponding to the summary area.

[0317] Specifically, the summary table engine generates a standardized SQL query statement based on the field structure definition of the database result set object and submits the query request to the target database. After the query operation is completed, the query results returned by the database are populated into the database result set object field by field according to the field structure information preset in step 1609. The field population process uses a mapping strategy based on field names or field aliases to ensure consistency in field order and field type, avoiding data anomalies caused by structure mismatches.

[0318] Step 1203: Perform a structural organization operation on the database query result to obtain a summary data result set structure.

[0319] In one embodiment, if Figure 14 As shown, step 1203 includes steps 1401 to 1403.

[0320] Step 1401: Determine the summary type according to the summary type field in the pre-created summary table basic information table.

[0321] Specifically, the summary table engine performs summary data result set structure organization operations based on the summary data in the database result set object obtained by querying the aforementioned steps. The summary type field stored in the summary table basic information table is queried to determine the summary type. The summary type field is used to indicate the structure of the summary area, including but not limited to: fixed summary table, simplified table, row-based summary table, column-based summary table, and row-column-based summary table.

[0322] Step 1402: If the summary type is a row-column caliber summary table, recursively expand the column caliber fields to obtain expanded columns.

[0323] Specifically, if the summary type field indicates that the current summary area is configured with both row-caliber fields and column-caliber fields, that is, a row-column-caliber summary table structure, the summary table engine performs a column expansion processing operation on the column-caliber fields.

[0324] Extracts all configured column-caliber fields from the current summary area and recursively expands the column-caliber field structure hierarchically based on the caliber entries associated with the column-caliber fields (such as enumerated dictionary fields, standard caliber entries, and manual groupings). In the database result set, the entry value corresponding to each column-caliber field is matched. Successful matching entry values ​​are converted into column fields in the summary results (i.e., expanded columns).

[0325] For multi-level column caliber structures, the summary table engine uses a recursive method to expand each level step by step to build the column field structure. If a column caliber entry is not found in the current database result set, the summary table engine will automatically fill in the empty column structure to ensure the integrity of the expanded column structure.

[0326] Step 1403: Insert the expanded columns into the summary data result set structure according to a preset order.

[0327] Specifically, the summary table engine inserts the column caliber expansion column constructed in step 1402 into the summary data result set structure according to the preset caliber sorting rule.

[0328] During the insertion process, the summary table engine records metadata for each newly added column field, including the field name, its position number within the summary data result set, the column hierarchy path to which it belongs, and the corresponding entry identifier. Simultaneously, the summary table engine updates the column statistics of the summary data result set structure to facilitate subsequent operations such as field length allocation and table layout rendering at the business call layer.

[0329] Step 1204: Perform data content organization operations based on the database query results and the structure of the summary data result set to obtain a summary data result set.

[0330] Specifically, based on the constructed summary data result set structure and the query results obtained from the database, the corresponding data content organization operation is performed. This process maps the field data in the database query results to the summary data result set structure according to the defined field location information, completing the structured data population.

[0331] In one embodiment, if Figure 15 As shown, step 1204 includes steps 1501 to 1504.

[0332] Step 1501: Determine the summary type according to the summary type field in the pre-created summary table basic information table.

[0333] Step 1502: If the summary type is a row-based summary table or a column-based summary table, fill the summary data result set structure according to the database query result.

[0334] Specifically, the summary table engine reads the summary type field recorded in the summary table basic information table to determine whether the current summary type is a row-based summary table or a column-based summary table. Since these two summary types only involve aggregation and expansion along a single dimension (row or column), data can be directly populated based on database query results without performing column expansion or cross-structure operations.

[0335] The summary table engine traverses each record in the database query results, following the order of the scope columns defined in the summary area, and maps each field value to the corresponding field position in the summary data result set structure. During the field value writing process, the system accurately locates and populates the data in the result set based on the field name or model field name.

[0336] For column-based summary tables, although column-based fields are used for column expansion at the business display level, the underlying data is still organized in rows. Therefore, the fill operation in the summary data result set structure can still be completed in row order. The horizontal expansion logic of column fields can be implemented in the front-end display stage through column transposition or column mapping, without explicit processing at the engine level.

[0337] To ensure the consistency and identifiability of the summary data structure, the summary table engine synchronously processes the sort fields and various identification fields (such as the summary area ID, summary result sub-table ID, etc.) during the filling process to ensure that the final constructed summary data result set is consistent with the summary configuration in both structure and content.

[0338] Step 1503: If the summary type is a row-column summary table, the database query result rows are merged and added to the summary data result set structure.

[0339] Specifically, when the summary type of the current summary area is a row-column caliber summary table, the summary table engine needs to convert the multiple records stored in the database query results in the "row caliber and column caliber" combined dimension into a single-row structure of the "row caliber" main dimension, that is, perform intra-row column expansion and merging operations.

[0340] The summary table engine first extracts the row- and column-scoped field values ​​for each record, using the row-scoped value as the key to construct the primary row structure. It then extracts the summary result values ​​of the corresponding indicator fields or expression fields for all column-scoped combinations within the row-scoped value, and constructs the target column field names using the "column-scoped value and field identifier" as the concatenation rule.

[0341] The summary table engine writes the above values ​​into the corresponding "dynamic column" field position of the main row structure, and continues to process the remaining column values ​​under the row caliber until the column fields of the row are merged to form a complete horizontal structure.

[0342] Step 1504: Perform subtotal and total filling operations on the summary data result set structure to obtain the summary data result set.

[0343] Specifically, based on the filled data content, the summary table engine completes the business data and generates summary rows for the summary data result set according to the subtotal and total attributes set for each caliber item in the summary table caliber configuration table.

[0344] When there is a caliber entry in the summary area but no matching data is returned in the database, the summary table engine generates a business record with a complete structure but empty value for the caliber item based on the configuration of "whether to display rows with no data", and marks it as a "no detailed value" row through a Boolean field for identification and processing by the front-end display layer.

[0345] For scope items with subtotal or total attributes enabled, the summary table engine generates corresponding total rows based on the scope item's structural rules. Structural rules include hierarchical subtotals, group totals, and full table totals.

[0346] Hierarchical subtotal: The summary table engine aggregates the subordinate items at each level according to the hierarchical relationship of the caliber items and generates a subtotal record.

[0347] Group total: If the scope item is set to logical grouping, the summary table engine generates corresponding total rows according to the grouping dimension.

[0348] Table-wide totals: If the total attribute is enabled, a total row is generated across all entries. Each total row contains a total identifier field, a scope level field, and a total type field to distinguish between subtotals and totals.

[0349] The summary table engine can also automatically supplement display fields (such as summary titles or empty dimension fields, etc.) to meet the requirements of result set visualization and business presentation.

[0350] The summary table engine returns the organized summary data result set to the business call layer and provides standardized output data containing information such as column structure definition, row data content, column caliber expansion structure and identification tags.

[0351] In this embodiment of the present invention, the generation of summary data result sets is driven by a summary result data storage model. Structured SQL object construction and a dynamic result organization process are employed to achieve an efficient execution mechanism for the entire summary data process, from structure definition, data query, to result filling. Through the structural organization of summary area fields, SQL structure objects that meet the requirements of various summary types (such as row-level, column-level, and row-column intersection structures) can be dynamically constructed, enabling accurate queries of summary results within the database. By constructing database result set objects, query results are ensured to have a unified field structure and clearly defined data types, ensuring the accuracy of subsequent processing. During the structure organization process, the summary table engine supports dynamic expansion of multi-level column fields based on column-level entries and automatically completes missing structures based on business configuration, further enhancing the integrity and display adaptability of the column-level structure. During the data filling phase, the summary table engine intelligently differentiates filling logic based on summary type, enabling data aggregation and row merging for single-type and cross-dimensional dimensions. It also supports automatic completion of configuration-dependent subtotals, totals, and empty data rows, enhancing the business integrity and display effectiveness of the summary data result set. The final output summary data result set not only maintains the structural logic consistent with the summary result data storage model, but also supports precise marking of aggregate levels and data existence, significantly improving the scalability and versatility of summary tasks in multidimensional data display and complex structure rendering.

[0352] The present invention also provides a summary data generation device, as described in the following embodiments. Since the principle of the device to solve the problem is similar to that of the summary data generation method, the implementation of the device can refer to the implementation of the summary data generation method, and the repeated parts will not be repeated.

[0353] like Figure 17 As shown, the summary data generating device 1700 includes: a summary processing module 1701 and a result construction module 1702.

[0354] The summary processing module 1701 is used to perform summary processing on the summary area in the summary result data storage model based on a pre-established summary result data storage model to generate summary data; the summary result data storage model has a one-to-one correspondence with a pre-configured summary table basic information table, which stores summary basic information, including a first identification code, table name, summary type, and summary conditions; the summary result data storage model is obtained by performing field modeling on each caliber item and each cell item in the summary area based on the first identification code, and performing a publishing operation;

[0355] The result construction module 1702 is used to perform summary result construction processing on the summary area according to the summary result data storage model and the summary data, and generate a summary data result set.

[0356] In one embodiment, the summary result data storage model is pre-established, including a region determination module, a model initialization module, a caliber modeling module, a cell modeling module and a release processing module.

[0357] The area determination module is used to obtain the corresponding summary area according to the first identification code of the basic information table of the summary table;

[0358] The model initialization module is used to initialize the summary result data storage model corresponding to the summary table basic information table according to the first identification code;

[0359] The caliber modeling module is used to perform field modeling on each caliber item in the summary area, and generate a caliber column field corresponding to the caliber item in the summary result data storage model;

[0360] The cell modeling module is used to perform field modeling on each cell item in the summary area, and generate a cell column field corresponding to the cell item in the summary result data storage model;

[0361] The publishing processing module is used to perform a publishing operation according to the caliber column field and the cell column field to generate the summary result data storage model.

[0362] In one embodiment, the summary processing module 1701 includes a configuration information acquisition unit, an executor initialization unit, a condition parsing unit, a query generation unit, and a data storage unit.

[0363] The configuration information acquisition unit is used to acquire the configuration information of all summary areas in the summary result data storage model;

[0364] The executor initialization unit is used to initialize the context object and query executor object corresponding to each summary area based on the configuration information;

[0365] The condition parsing unit is used to parse the caliber column field, cell column field and summary condition in the summary area respectively, and write the generated parsing results into the query executor object;

[0366] The query generation unit is used to perform data aggregation processing on the query executor object in which the parsing result is written, and generate a corresponding SQL query object;

[0367] The data storage unit is used to generate summary data based on the SQL query object and store it in the summary result data storage model.

[0368] In one embodiment, the result construction module 1702 includes a field organization unit, a database query unit, a structure organization unit, and a content organization unit.

[0369] The field organization unit is used to perform field organization operation on the summary area to generate an SQL structure object according to the summary result data storage model and the summary data;

[0370] The database query unit is used to perform a query operation in the database through the SQL structure object to obtain a corresponding database query result;

[0371] The structural organization unit is used to perform structural organization operations on the database query results to obtain a summary data result set structure;

[0372] The content organization unit is used to perform a data content organization operation according to the database query result and the structure of the summary data result set to obtain a summary data result set.

[0373] In one embodiment, the model initialization module includes an existence determination unit, a table name generation unit, and a field setting unit.

[0374] The existence judgment unit is used to judge whether the summary result data storage model corresponding to the summary table basic information table already exists in the database;

[0375] The table name generating unit is configured to generate a table name of the corresponding summary result data storage model according to the first identification code if the summary result data storage model corresponding to the summary table basic information table does not exist in the database;

[0376] The field setting unit is used to initialize the summary result data storage model corresponding to the table name, and set the table name and predefined field information in the summary result data storage model.

[0377] In one embodiment, the caliber modeling module includes a traversal judgment unit, a field name generation unit, a field marking unit, and an iterative execution unit.

[0378] The traversal judgment unit is used to traverse each of the caliber items in the summary area to determine whether the caliber item is a published caliber item;

[0379] The field name generating unit is used for generating a field name of the caliber column field according to the second identification code of the caliber item if the caliber item is an unpublished caliber item;

[0380] The field marking unit is used to mark the caliber column field as an update state, so as to write the field name into the summary result data storage model during the publishing operation;

[0381] The iterative execution unit is used to iteratively execute the above steps until all the caliber items in the summary area are modeled.

[0382] In one embodiment, the cell modeling module includes a cell traversal unit, a column field generation unit, a column field marking unit, and a cell modeling unit.

[0383] The cell traversal unit is used to traverse each cell item in the summary area to determine whether the cell item is a published cell item;

[0384] The column field generating unit is configured to generate a corresponding cell column field according to a configuration type of the cell item if the cell item is an unpublished cell item;

[0385] The column field marking unit is used to mark the cell column field as an updated state, so as to write the cell column field into the summary result data storage model during the publishing operation;

[0386] The cell modeling unit is used to iteratively execute the above steps until all cell items in the summary area are modeled.

[0387] In one embodiment, the publishing processing module includes a field updating unit, a mapping updating unit, and a physicalization unit.

[0388] The field updating unit is used for updating the caliber column field and the cell column field marked as being in an update state in the summary result data storage model;

[0389] The mapping update unit is used to update the field mapping information in the pre-created summary table caliber configuration table and the summary table indicator configuration table according to the caliber column field and the cell column field marked as the update state;

[0390] The physicalization unit is used to perform a database physicalization operation on the summary result data storage model.

[0391] In one embodiment, the query generation unit includes a summary type determination subunit, a summary structure generation subunit, and a summary processing subunit.

[0392] The summary type determination subunit is used to determine the summary type according to the summary type field in the pre-created summary table basic information table;

[0393] The aggregate structure generating subunit is used to generate corresponding aggregate structure information according to the summary type;

[0394] The aggregate processing subunit is used to perform subtotal and aggregate data processing on single-type caliber dimensions and cross-caliber dimensions based on the above-mentioned aggregate structure information, and generate corresponding SQL query objects.

[0395] In one embodiment, the data storage unit specifically includes a summary execution subunit.

[0396] The summary execution subunit is used to summarize the SQL query object based on the initialized context object and the summary table caliber configuration table corresponding to the summary area, generate summary data and store it in the summary result data storage model.

[0397] In one embodiment, the field organization unit includes a configuration information acquisition subunit and a structure object construction subunit.

[0398] The configuration information acquisition subunit is used to obtain the configuration information of all summary areas in the summary result data storage model;

[0399] The structure object construction subunit is used to perform field organization operations on the caliber column field and the cell column field of the summary area according to the configuration information to construct an SQL structure object.

[0400] In one embodiment, the structure organization unit includes a type determination subunit, an expansion processing subunit, and a structure insertion subunit.

[0401] The type determination subunit is used to determine the summary type according to the summary type field in the pre-created summary table basic information table;

[0402] The expansion processing subunit is used for recursively expanding the column-caliber fields to obtain expanded columns if the summary type is a row-column caliber summary table;

[0403] The structure inserting subunit is used to insert the expanded columns into the summary data result set structure according to a preset order.

[0404] In one embodiment, the content organization unit includes a type determination subunit, a data filling subunit, a result merging subunit, and a summary filling subunit.

[0405] The type determination subunit is used to determine the summary type according to the summary type field in the pre-created summary table basic information table;

[0406] The data filling subunit is used for filling the summary data result set structure according to the database query result if the summary type is a row-based summary table or a column-based summary table;

[0407] The result merging subunit is used for merging the database query result rows and adding them to the summary data result set structure if the summary type is a row-column caliber summary table;

[0408] The total filling subunit is used to perform subtotal and total filling operations on the summary data result set structure to obtain the summary data result set.

[0409] Figure 18A schematic diagram of the physical structure of an electronic device provided in an embodiment of the present invention, such as Figure 18 As shown, the electronic device 1800 includes a processor 1801 , a memory 1802 and a bus 1803 .

[0410] The processor 1801 and the memory 1802 communicate with each other via a bus 1803 .

[0411] The processor 1801 is used to call the program instructions in the memory 1802 to execute the methods provided by the above method embodiments.

[0412] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned summary data generating method is implemented.

[0413] An embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the computer program implements the above-mentioned summary data generation method.

[0414] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0415] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0416] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0417] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 The steps for the function specified in one or more boxes.

[0418] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for generating summary data, characterized in that: include: Based on a pre-established summary result data storage model, performing summary processing on the summary area in the summary result data storage model to generate summary data; The summary result data storage model has a one-to-one correspondence with a pre-configured summary table basic information table, wherein the summary table basic information stores summary basic information, and the summary basic information includes a first identification code, a table name, a summary type, and a summary condition; Performing summary result construction processing on the summary area according to the summary result data storage model and the summary data to generate a summary data result set; Pre-establishing the summary result data storage model includes: obtaining a corresponding summary area according to a first identification code of the summary table basic information table; initializing the summary result data storage model corresponding to the summary table basic information table according to the first identification code; performing field modeling on each caliber item in the summary area, and generating a caliber column field corresponding to the caliber item in the summary result data storage model; performing field modeling on each cell item in the summary area, and generating a cell column field corresponding to the cell item in the summary result data storage model; performing a publishing operation according to the caliber column field and the cell column field to generate the summary result data storage model; The method of generating summary data by summarizing the summary areas in the summary result data storage model based on the pre-established summary result data storage model includes: obtaining configuration information of all summary areas in the summary result data storage model; initializing the context object and query executor object corresponding to each summary area based on the configuration information; performing parsing on the caliber column field, cell column field and summary condition in the summary area respectively, and writing the generated parsing results into the query executor object; performing data summarization on the query executor object with the parsing results written therein to generate a corresponding SQL query object; generating summary data based on the SQL query object and storing the summary data into the summary result data storage model; The scope types include: source subject scope, subject attribute field scope, period scope, enumeration indicator scope, standard scope, and placeholder scope. The placeholder scope is used to support dynamic parameterized configuration aggregation scenarios. During the configuration phase, the placeholder caliber only exists as a variable placeholder and is not bound to an actual field. During the summary task execution phase, the placeholder caliber is dynamically replaced with one of the source subject caliber, subject attribute field caliber, period caliber, enumeration indicator caliber, or standard caliber based on the actual parameters passed in by the caller, and the corresponding field parsing and summary processing are completed according to its field type.

2. The method according to claim 1, characterized in that The performing summary result construction processing on the summary area according to the summary result data storage model and the summary data to generate a summary data result set includes: Performing field organization operation on the summary area according to the summary result data storage model and the summary data to generate an SQL structure object; Perform a query operation in the database through the SQL structure object to obtain the corresponding database query result; Performing a structural organization operation on the database query results to obtain a summary data result set structure; According to the database query result and the structure of the summary data result set, a data content organization operation is performed to obtain a summary data result set.

3. The method according to claim 1, characterized in that Initializing the summary result data storage model corresponding to the summary table basic information table according to the first identification code includes: Determine whether a summary result data storage model corresponding to the summary table basic information table already exists in the database; If the summary result data storage model corresponding to the summary table basic information table does not exist in the database, generating a table name of the corresponding summary result data storage model according to the first identification code; Initialize the summary result data storage model corresponding to the table name, and set the table name and predefined field information in the summary result data storage model.

4. The method according to claim 1, wherein The performing of field modeling on each caliber item in the summary area and generating a caliber column field corresponding to the caliber item in the summary result data storage model includes: Traversing each caliber item in the summary area to determine whether the caliber item is a published caliber item; If the caliber item is an unpublished caliber item, generate a field name of the caliber column field according to the second identification code of the caliber item; Marking the caliber column field as an update state so that the field name is written into the summary result data storage model when publishing the operation; The above steps are iterated until all the caliber items in the summary area are modeled.

5. The method according to claim 4, characterized in that The performing field modeling on each cell item in the summary area and generating a cell column field corresponding to the cell item in the summary result data storage model includes: Traversing each cell item in the summary area to determine whether the cell item is a published cell item; If the cell item is an unpublished cell item, generating a corresponding cell column field according to the configuration type of the cell item; Marking the cell column field as an update state so as to write the cell column field into the summary result data storage model during a publishing operation; The above steps are iterated until all cell items in the summary area are modeled.

6. The method according to claim 5, characterized in that The publishing operation is performed according to the caliber column field and the cell column field to generate the summary result data storage model, including: In the summary result data storage model, updating the caliber column field and the cell column field marked as being in an update state; Update the field mapping information in the pre-created summary table caliber configuration table and summary table indicator configuration table according to the caliber column field and the cell column field marked as updated; Performing a database physicalization operation on the summary result data storage model.

7. The method according to claim 1, characterized in that The step of performing data aggregation processing on the query executor object that writes the parsing result to generate a corresponding SQL query object includes: Determine the summary type based on the summary type field in the pre-created summary table basic information table; Generate corresponding aggregate structure information according to the summary type; Based on the above aggregate structure information, subtotal and aggregate data processing is performed on single-type caliber dimensions and cross-caliber dimensions respectively to generate corresponding SQL query objects.

8. The method according to claim 1, characterized in that Generating summary data based on the SQL query object and storing it in the summary result data storage model specifically includes: Based on the initialized context object and the summary table caliber configuration table corresponding to the summary area, the SQL query object is summarized and processed to generate summary data and store it in the summary result data storage model.

9. The method according to claim 2, characterized in that The generating of an SQL structure object by performing a field organization operation on the summary area according to the summary result data storage model and the summary data includes: Get the configuration information of all summary areas in the summary result data storage model; According to the configuration information, field organization operations are performed on the caliber column fields and the cell column fields of the summary area respectively to construct an SQL structure object.

10. The method according to claim 2, characterized in that The structural organization operation is performed on the database query result to obtain a summary data result set structure, including: Determine the summary type based on the summary type field in the pre-created summary table basic information table; If the summary type is a row-column caliber summary table, recursively expand the column caliber fields to obtain expanded columns; Insert the expanded columns into the summary data result set structure according to a preset order.

11. The method according to claim 2, characterized in that The data content organization operation is performed according to the database query result and the structure of the summary data result set to obtain the summary data result set, including: Determine the summary type based on the summary type field in the pre-created summary table basic information table; If the summary type is a row-based summary table or a column-based summary table, filling the summary data result set structure according to the database query result; If the summary type is a row-column summary table, the database query result rows are merged and added to the summary data result set structure; Subtotal and total filling operations are performed on the summary data result set structure to obtain the summary data result set.

12. A summary data generating device, characterized in that: include: A summary processing module, configured to perform summary processing on the summary area in the summary result data storage model based on a pre-established summary result data storage model to generate summary data; The summary result data storage model corresponds one-to-one to a pre-configured summary table basic information table, the summary table basic information table storing summary basic information, the summary basic information including a first identification code, a table name, a summary type, and a summary condition; the summary result data storage model is obtained by performing field modeling on each caliber item and each cell item in the summary area based on the first identification code and performing a publishing operation; A result construction module, configured to perform summary result construction processing on the summary area according to the summary result data storage model and the summary data, and generate a summary data result set; The model building module includes: An area determination module, configured to obtain a corresponding summary area according to the first identification code of the basic information table of the summary table; A model initialization module, configured to initialize a summary result data storage model corresponding to the summary table basic information table according to the first identification code; A caliber modeling module, configured to perform field modeling on each caliber item in the summary area, and generate a caliber column field corresponding to the caliber item in the summary result data storage model; A cell modeling module, configured to perform field modeling on each cell item in the summary area, and generate a cell column field corresponding to the cell item in the summary result data storage model; A publishing processing module, configured to perform a publishing operation according to the caliber column field and the cell column field, and generate the summary result data storage model; The summary processing module includes: A configuration information acquisition unit, configured to acquire configuration information of all summary areas in the summary result data storage model; an executor initialization unit, configured to initialize a context object and a query executor object corresponding to each summary area based on the configuration information; A condition parsing unit, configured to parse the caliber column field, the cell column field, and the summary condition in the summary area, and write the generated parsing results into the query executor object; A query generation unit, configured to perform data aggregation processing on the query executor object in which the parsing result is written, and generate a corresponding SQL query object; A data storage unit, used for generating summary data based on the SQL query object and storing the summary data in a summary result data storage model; The scope types include: source subject scope, subject attribute field scope, period scope, enumeration indicator scope, standard scope, and placeholder scope. The placeholder scope is used to support dynamic parameterized configuration aggregation scenarios. During the configuration phase, the placeholder caliber only exists as a variable placeholder and is not bound to an actual field. During the summary task execution phase, the placeholder caliber is dynamically replaced with one of the source subject caliber, subject attribute field caliber, period caliber, enumeration indicator caliber, or standard caliber based on the actual parameters passed in by the caller, and the corresponding field parsing and summary processing are completed according to its field type.

13. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 11 is implemented.

14. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 11 is implemented.

15. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 11 is implemented.

Citation Information

Patent Citations

  • Data editing method and device, equipment, medium and program product

    CN115983214A

  • General data summarization configuration method, device and equipment

    CN117708119A