Method and device for generating summarized data

By introducing a summary result data storage model and a unified summary table engine execution context mechanism, the flexibility and real-time problems of data aggregation in the existing technology are solved, efficient execution of complex summary tasks and structured output of result sets are realized, and the stability and processing efficiency of the system are improved.

CN120371841AActive Publication Date: 2025-07-25BEIJING JOIN CHEER SOFTWARE
View PDF 6 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The prior art cannot take into account the flexibility, configurability, real-time and ease of use of data aggregation, and it is difficult to meet the complex hierarchical aggregation and result reuse requirements.

Method used

By introducing a summary result data storage model and a unified summary table engine execution context mechanism, a complete technical path from the summary table logical configuration definition to the summary task organization execution and result structured output is established, and a variety of summary types of data modeling and processing are supported.

Benefits of technology

It realizes efficient execution of complex summary tasks and structured output of summary data result sets, improves the stability and processing efficiency of summary tasks, reduces dependence on temporary analysis and dynamic structure changes, and improves the maintainability and execution efficiency of the summary table engine.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120371841A_ABST
    Figure CN120371841A_ABST
Patent Text Reader

Abstract

The invention discloses a summarized data generation method and device, and the method comprises the steps: carrying out the summarized processing of a summarized region in a summarized result data storage model based on a pre-established summarized result data storage model, and generating summarized data; the summarizing result data storage models are in one-to-one correspondence with preconfigured summarizing table basic information tables, the summarizing table basic information tables store summarizing basic information, and the summarizing basic information comprises first identification codes, table names, summarizing types and summarizing conditions; the summarizing result data storage model is obtained by performing field modeling on each aperture item and each cell item in the summarizing area based on the first identification code and performing publishing operation; according to the summarized result data storage model and the summarized data, summarized result construction processing is conducted on the summarized area, and a summarized data result set is generated. According to the method, data modeling and summarization processing under various summarization types are supported, and efficient execution of complex summarization tasks and structured output of a summarized data result set are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the continuous development of information technology, data has shown explosive growth in various government affairs management and enterprise operation activities, and has gradually become a key production factor driving the development of the digital economy. However, data itself usually has characteristics such as fragmentation, complex structure, and diverse business dimensions. If it is to be effectively transformed into high-quality information with decision-making support value, it needs to be sorted out and refined through systematic statistical processing, in-depth processing, and structured summarization. As the core result of data statistics and processing, the flexibility of the generation method and the processing ability of summary data directly determine the efficiency and quality of data-driven applications.

[0003] At present, the mainstream data summarization technologies mainly include two implementation methods: one is the real-time query method based on detailed data, which generates summary results in the system memory and returns them to users by temporarily grouping the original data. The other is the method based on data warehouse modeling, which relies on data stratification and preprocessing mechanisms to regularly generate target data results through pre-constructed summary data models and data layer structures. Both of the above methods have certain limitations in practical applications. The real-time query method cannot persistently store the summary results, and each access requires recalculation from the detailed data, resulting in a decline in system performance and a significant increase in database pressure. Moreover, it only supports relatively simple summarization and processing, and it is difficult to meet the requirements of complex hierarchical summarization and result reuse. Although the data warehouse modeling method has certain data preprocessing and storage capabilities, its construction and maintenance rely on professional technical personnel, with poor business adaptability, insufficient flexibility, difficult to meet the frequently changing statistical requirements, and limited real-time performance and low application efficiency.

[0004] In summary, the existing technologies cannot simultaneously balance the flexibility, configurability, real-time performance, and ease of use of data summarization. There is an urgent need for a data summarization generation method that supports multiple scenarios, dynamic parameter control, and has sustainable expansion capabilities to meet the growing business data processing requirements.

[0005] This section aims to provide background or context for the embodiments of the present invention described in the claims. The description herein is not admitted to be prior art merely by including it in this section. Summary of the Invention

[0006] The embodiments of the present invention provide a method for generating summary data, which is used to support data modeling and summarization processing under various summary types, and realizes the efficient execution of complex summarization tasks and the structured output of summary data result sets.

[0007] The method for generating summary data includes:

[0008] 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 corresponds one-to-one with a pre-configured summary table basic information table, the summary table basic information table stores summary basic information, and the summary basic information includes a first identification code, a table name, a summary type, and summary conditions; the summary result data storage model is obtained by respectively 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] According to the summary result data storage model and the summary data, performing summary result construction processing on the summary area to generate a summary data result set.

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

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

[0012] According to the first identification code, initializing the summary result data storage model corresponding to the summary table basic information table;

[0013] 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;

[0014] 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;

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

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

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

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

[0019] Respectively performing parsing processing on the caliber column field, the cell column field, and the summary conditions in the summary area, and writing the generated parsing results into the query executor object.

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

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

[0022] In one embodiment, the generating a summary data result set by performing summary result construction processing on the summary area according to the summary result data storage model and the summary data includes:

[0023] Perform field organization operations 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 a corresponding database query result;

[0025] Perform structure organization operations on the database query result to obtain a summary data result set structure;

[0026] Perform data content organization operations according to the database query result and the summary data result set structure to obtain a summary data result set.

[0027] In one embodiment, the 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 the 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, generate the 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, the 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] Traverse each caliber item in the summary area and determine whether the caliber item is a published caliber item;

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

[0034] Mark the caliber column field as the updated status to write the field name into the summary result data storage model during the publishing operation;

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

[0036] In one embodiment, the field modeling of each cell item in the summary area to generate the corresponding cell column field in the summary result data storage model includes:

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

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

[0039] Mark the cell column field as the updated status to write the cell column field into the summary result data storage model during the publishing operation;

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

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

[0042] In the summary result data storage model, perform update processing on the caliber column field and the cell column field marked as the updated status;

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

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

[0045] In one embodiment, the data aggregation processing of the query executor object writing the parsing result to generate the corresponding SQL query object includes:

[0046] Determine the aggregation type according to the aggregation type field in the pre-created summary table basic information table;

[0047] Generate the corresponding total structure information according to the aggregation type;

[0048] Based on the above combined structure information, perform subtotaling and totaling data processing on the single - type caliber dimension and the cross - caliber dimension 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, perform summary processing on the SQL query object to generate summary data and store it in the summary result data storage model.

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

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

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

[0054] In one embodiment, performing structure organization operations on the database query result to obtain a summary data result set structure includes:

[0055] Determine the summary type according to 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, perform recursive expansion processing on the column caliber fields to obtain expanded columns;

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

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

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

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

[0061] If the summary type is a row - column caliber summary table, perform row merging processing on the database query result and add it to the summary data result set structure;

[0062] Perform a subtotal and total filling operation on the summarized data result set structure to obtain the summarized data result set.

[0063] An embodiment of the present invention further provides a summarized data generation device, which is used to support data modeling and summarization processing under multiple summarization types, and realizes the efficient execution of complex summarization tasks and the structured output of the summarized data result set.

[0064] The summarized data generation device includes:

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

[0066] A result construction module, configured to perform a summarized result construction process on the summarization area according to the summarized result data storage model and the summarized data to generate a summarized data result set.

[0067] An embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the above-mentioned summarized data generation method is implemented.

[0068] An embodiment of the present invention further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned summarized data generation 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 above-mentioned summarized data generation method is implemented.

[0070] The summary data generation method and device provided by the embodiments of the present invention perform structured modeling on the configuration information of the summary area and the summary result data storage model, and complete field modeling and publishing operations before the summary task is executed, so that the summary processing process no longer depends on temporary parsing and dynamic structure changes, which helps to improve the stability and processing efficiency of the summary task in the execution stage. According to the unique identification code stored in the basic information table of the summary table, field modeling is performed on the caliber items and cell items in the summary area, and a clear physical field mapping relationship is established, so as to ensure 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. This summary data result set can be directly used for front-end data display, report export or downstream business analysis, without having to perform additional format conversion or field alignment processing on the result data, effectively improving the automated processing ability of the summary table engine and the structural consistency of the summary result. 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 technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings. In the drawings:

[0072] Figure 1 It is a schematic flow chart of the summary data generation method in an embodiment of the present invention;

[0073] Figure 2 It is a schematic structural diagram of the summary table in the embodiment of the present invention;

[0074] Figure 3 It is a schematic flow chart of the summary data generation method in another embodiment of the present invention;

[0075] Figure 4 It is a schematic flow chart of the summary data generation method in another embodiment of the present invention;

[0076] Figure 5 It is a schematic flow chart of the summary data generation method in another embodiment of the present invention;

[0077] Figure 6 It is a schematic flow chart of the summary data generation method in another embodiment of the present invention;

[0078] Figure 7Schematic flowchart of the method for generating summary data in another embodiment of the present invention;

[0079] Figure 8 Schematic flowchart of the method for generating summary data in another embodiment of the present invention;

[0080] Figure 9 Schematic flowchart of the method for generating summary data in another embodiment of the present invention;

[0081] Figure 10 Schematic flowchart of the method for generating summary data in another embodiment of the present invention;

[0082] Figure 11 Schematic flowchart of the method for generating summary data in another embodiment of the present invention;

[0083] Figure 12 Schematic flowchart of the method for generating summary data in another embodiment of the present invention;

[0084] Figure 13 Schematic flowchart of the method for generating summary data in another embodiment of the present invention;

[0085] Figure 14 Schematic flowchart of the method for generating summary data in another embodiment of the present invention;

[0086] Figure 15 Schematic flowchart of the method for generating summary data in another embodiment of the present invention;

[0087] Figure 16 Schematic flowchart of the method for generating summary data in another embodiment of the present invention;

[0088] Figure 17 Schematic structural diagram of the device for generating summary data in an embodiment of the present invention;

[0089] Figure 18 Schematic structural diagram of the physical entity of the electronic device provided in an embodiment of the present invention. Detailed implementation manners

[0090] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer and more understandable, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. Herein, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but not 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. For the processing of relevant data such as collection, storage, use, processing, transmission, provision, disclosure, and application, it complies with relevant laws, regulations, and standards of relevant countries and regions, takes necessary confidentiality measures, does not violate public order and good customs, and provides corresponding operation entrances for users to choose to authorize or reject.

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

[0093] In order to solve the problems existing in the existing summary table engine, such as redundant model configuration, high coupling degree of execution logic, 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 the definition of summary table logic configuration, organization and execution of summary tasks, generation of summary data to structured output of summary results. This method can adapt to various 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 as needed during the summary processing stage, supporting various data processing logics such as caliber field expansion, subtotal and total generation, and expression calculation, so as to achieve consistent organization and automated execution of complex summary scenarios such as multiple summary areas, multiple versions, multiple periods, and multiple indicators.

[0094] As Figure 1 shown, the method for generating summary data includes step 101 to step 102.

[0095] Step 101: Based on the pre-established summary result data storage model, perform summary processing on the summary areas in the summary result data storage model to generate summary data. Among them, the summary result data storage model corresponds one-to-one with the pre-configured summary table basic information table, and the summary table basic information table stores summary basic information, and the summary basic information includes the first identification code, table name, summary type, summary conditions, etc. The summary result data storage model is obtained by respectively performing field modeling on each caliber item and each cell item in the summary area based on the first identification code and performing a release operation.

[0096] Step 102: According to 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.

[0097] In the implementation mode 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 summary task is executed, the summary processing process no longer relies on temporary analysis and dynamic structure changes, which helps to improve the stability and processing efficiency of the summary task in 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, so as to ensure 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. In 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, which effectively improves 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 FIG. 1 , 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 summary task is executed, the caliber items involved in each summary area need to be pre-configured to support the construction and execution of multi-dimensional summary logic.

[0100] The above-mentioned caliber items are used to define the structured configuration parameters of the data aggregation 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., but 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 configuration object of the source subject caliber is the organization or basic data subject, and the corresponding caliber entry is the organization entry or basic data entry. The summary table engine automatically identifies the data range of the source subject node and its subordinate level 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 of the summary dimension, and constructs a grouping dimension based on the organization or subject structure. This source subject caliber is suitable for statistical scenarios that summarize the superiors and subordinates according to the organizational hierarchy.

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

[0104] Specifically, the configuration object of the caliber of the subject attribute field is the subject attribute field, and its corresponding caliber entry is the enumerated dictionary entry bound to the subject attribute field. During the caliber configuration process, the summary table engine extracts the enumerated values and constructs grouping dimensions based on a certain enumerated field defined in the subject object (such as "enterprise nature", "industry", "scale level", etc.). When performing summarization, the summary table engine classifies and counts the data according to the enumerated values of the enumerated field, which is applicable to business scenarios that require grouping based on subject attribute characteristics.

[0105] The above-mentioned time period caliber is used to construct a data summarization model based on the time dimension.

[0106] Specifically, the configuration object of the time period caliber is the time field, and its corresponding caliber entry is the time period entry. The summary table engine groups the data according to a predefined time granularity (such as annual, quarterly, monthly, etc.) to construct a summary dimension of the time series type. The time period caliber is applicable to typical scenarios such as cross-period comparison, year-on-year analysis, or time trend display. It can be used alone or in combination with other calibers to construct a composite dimension structure.

[0107] The above-mentioned enumerated index caliber is used to group data according to the enumerated fields on which the statistical index depends.

[0108] Specifically, the configuration object of the enumerated index caliber is the enumerated dictionary field bound to the index field, and its corresponding caliber entry is the entry value in the enumerated dictionary. In the summarization task, if an index field (such as "project type", "personnel type", etc.) is bound to an enumerated field (such as "project type", "personnel category", etc.), the summary table engine can use this enumerated field as a grouping dimension and group and count according to the enumerated values. The above method is similar to the caliber of the subject attribute field, but the difference is that its grouping basis comes from the subsidiary attributes of the index field itself, which is applicable to statistical requirements classified by index attributes.

[0109] The above-mentioned standard caliber is used to construct a custom grouping and summarization dimension defined manually.

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

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

[0112] Specifically, the placeholder caliber only exists as a variable placeholder during the configuration phase and is not bound to actual fields. During the execution phase of the summary task, the summary table engine dynamically replaces the placeholder caliber with one of the source subject caliber, subject attribute field caliber, period caliber, enumeration index caliber, or standard caliber according to the actual parameters passed in by the caller, and completes the corresponding field parsing and summary processing according to its field type. The placeholder caliber is applicable to the reuse scenario of templated summary tables in multiple business dimensions, which can significantly improve the generality and flexibility of summary configuration.

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

[0114] In one embodiment, as Figure 2 shown, after configuring multiple types of caliber items, it is necessary to perform preset configuration on the summary table. This summary table is a summary definition object at the logical level, which is jointly composed of multiple configuration units, including: summary table basic information configuration, summary area configuration, summary caliber configuration, indicator item configuration, and table sample display structure, etc. 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 caliber 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 entry table, manual grouping entry detail 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 index items to achieve aggregation calculation and expression evaluation of the specified data source, and generate a structured summary data result set that can be used for front-end rendering display or downstream report analysis during the summary processing stage.

[0117] In the embodiments of the present invention, the configuration and definition information of various summary tables are respectively stored in multiple structured database tables. The functions and roles of various summary tables 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, the summary data filtering conditions, etc., as the basic configuration source for the entire summary modeling and task execution.

[0119] The summary table and grouping association table is used to manage the logical grouping of multiple summary tables when there are multiple summary tables, so as to store the association relationship between the summary table and the grouping identifier. The summary table and grouping association table can classify and schedule summary tasks according to the business dimension and control permissions.

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

[0121] The summary table area configuration table is used to define the spatial boundary and control parameters of each summary area in the summary table, including information such as the start and end positions of the area, whether to enable the total row, whether to display detailed data, and sorting field settings. In addition, the summary table area configuration table is also used to drive the subsequent summary logic execution.

[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 be sourced from the source subject caliber, the subject attribute field caliber, the period caliber, the enumerated index caliber, the standard caliber, and the placeholder caliber. The summary table engine stores metadata information such as caliber fields, field types, and association logics through this summary table caliber configuration table.

[0123] The summary table index configuration table is used to configure the data items of 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, cell data filtering conditions, etc. The summary table index configuration table is also used to provide 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, and is applicable to the configuration of standard calibers of manual grouping and interval grouping types, including metadata information such as caliber identification, caliber name, bound subject type, and related business attributes.

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

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

[0127] The main table of summary result basic information is used to store the execution metadata of each summary operation, including information such as summary processing time, call parameters, and externally specified additional caliber conditions. In the scenario where a single summary task generates multiple pieces of summary data, the main table of summary result basic information will uniquely record an execution information corresponding to this summary task, so as to clearly identify that these multiple pieces of summary data all originate from the execution process of the same summary task, thereby realizing the unified archiving and traceability management of the summary results of the same batch. In addition, this main table of summary result basic information is also used for archiving and describing the execution process of each summary task.

[0128] The sub-table of summary table result is used to store the subset description information of the summary result. When a single summary task generates multiple pieces of data results (for example, divided into two results of "North China Region" and "Central China Region" according to regions), the summary table engine stores the summary conditions and data ranges of each sub-result in this sub-table of summary table result respectively, in order to realize the versioning and traceability management of the summary results.

[0129] The summary result data storage table is used to store the structured summary data after summary calculation. After each summary table basic information table is configured, a corresponding physical data table is generated through the release operation. The summary result data storage table is also used to store the summary data aggregated according to the caliber item and cell item dimensions. The structure of the summary result data storage table comes from the field registration results of the caliber item and cell item in the field modeling process, and is the physical carrier for data writing and query in the summary processing stage.

[0130] In one embodiment, as Figure 3 and Figure 8 shown, the establishment of the summary result data storage model in advance includes steps 301 to 305.

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

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

[0133] Among them, the summary table basic information table also contains a summary type field, which is used to indicate the structural type of the current summary table, including but not limited to: fixed summary table, simple table, row caliber summary table, column caliber summary table, and row-column caliber summary table. If the summary type is a fixed summary table or a simple table, the caliber item is allowed to be empty. If the summary type is a row caliber summary table, a column caliber summary table, or a row-column caliber summary table, at least one valid caliber item must be configured, and the number of caliber items in all summary areas is required to be the same.

[0134] Furthermore, the summary table engine obtains all the cell items configured in the current summary area from the summary table index configuration table, and performs a validity check operation on each cell item. If there is at least one cell item in the current summary area whose type is not a serial number column or a caliber column, that is, the cell item type belongs to a statistical field that can be executed, a data index field for summary operations, or an expression field, then the cell configuration of this 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 actual summary processing, then this summary area is marked as incompletely configured and does not have the ability to perform executable 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, as Figure 4 shown, Step 302 includes Step 401 to Step 403.

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

[0138] Specifically, the summary table engine queries the database according to the unique identification code in the summary table basic information table to determine whether there is already a summary result data storage model corresponding to this unique identification code.

[0139] Step 402: If there is no summary result data storage model corresponding to the summary table basic information table in the database, generate the 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 identification code (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 with reference to the preset naming rules. If the generated table name conflicts with the table names in the existing database, an incrementing serial number suffix is appended to the original table name to construct a new unique table name, such as: 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 this model, and simultaneously 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 area ID field, and other management fields.

[0143] In one embodiment, as Figure 8 shown, step 302 further includes step 404.

[0144] Step 404: If it is determined that there is a corresponding summary result data storage model 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 the summary result data storage model, but reads and loads it based on the historical generated and registered table model information.

[0146] Step 303: Perform field modeling for 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, convert various caliber items configured in the current summary area into caliber column fields in the summary result data storage model.

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

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

[0150] Specifically, first, all configured caliber items in the current summary area are retrieved 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, etc.), a caliber identification code, and a caliber release status. Then, the summary table engine traverses each caliber item in turn to determine whether a corresponding caliber column field has been generated in the previous round of summary release operations.

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

[0152] Specifically, for the caliber items that have not been modeled yet, the summary table engine generates the corresponding field name as a physical table field according to their caliber identification codes. If the generated field name has been occupied in the current summary result data storage model, an underscore and a digital serial number are appended after the name until a unique field name is generated. Subsequently, the field name is added to the summary result data storage model, and the field name is added to the combined index field set to support compound queries based on multiple caliber items.

[0153] Step 503: Mark the caliber column field as the update status to write the field name into the summary result data storage model during the release operation.

[0154] Specifically, after the field name is generated, the corresponding caliber column field is marked as the to-be-updated configuration status to ensure that it is written into the summary result data storage model during the summary release operation.

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

[0156] Specifically, the summary table engine sequentially executes Step 501 to Step 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 an embodiment, as Figure 8 shown, Step 302 further 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 the deletion status.

[0159] Specifically, when it is detected that a certain caliber item has generated a corresponding caliber column field in previous summary release operations and this caliber column field has been added to the current summary result data storage model, the summary table engine will further determine whether this caliber item is still enabled in the current summary table configuration. If this caliber item has been removed from the summary table caliber configuration table, it is considered that this 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 release operations.

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

[0161] In one embodiment, as Figure 6 shown, Step 304 includes Step 601 to Step 604.

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

[0163] Specifically, first, read all cell items in the current summary area from the pre-configured summary table metric configuration table. Each cell item contains multiple attributes such as cell type, data source field, summary method, and expression. Then, the summary table engine traverses these cell items one by one to identify whether it has completed field column modeling in previous summary release operations.

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

[0165] Specifically, for a cell item with a configuration type of serial number column, it is only used for front-end display purposes and does not participate in data storage modeling, so no cell column field is generated.

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

[0167] For a cell item with a configuration type of display caliber field or main body attribute field, the summary table engine determines the field type according to its original data type and whether it participates in numerical calculation operations: if the field type is non-numerical and not used for statistical operations such as counting or summing, it is modeled as a string field. If the field type is numerical or used for participating in numerical statistical operations, it is modeled as a numerical field.

[0168] Step 603: Mark the cell column fields as the updated status to write the cell column fields into the summary result data storage model during the publishing operation.

[0169] Specifically, the summary table engine marks each newly created or changed cell column field as the to-be-updated configuration status, 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. The above mapping relationship is stored in the summary result data storage model during the summary publishing operation.

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

[0171] In one embodiment, as Figure 8 shown, step 304 further includes step 605 and step 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 the deleted status.

[0173] Specifically, if it is detected that a certain cell item has generated a cell column field during the historical publishing process and the cell item is no longer used in the current configuration, mark its corresponding cell column field as the deleted status for field structure cleaning during subsequent publishing operations.

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

[0175] Step 305: Perform a publishing operation 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 process of all caliber column fields and cell column fields in the summary area, the summary table engine enters the publishing stage of the summary result data storage model. This publishing process aims to solidify the previously constructed logical field structure into the physical table structure in the database to form a summary result data storage table that can be called by the summary task.

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

[0178] Step 701: In the summary result data storage model, perform an update process on the caliber column fields and the cell column fields marked as the updated status.

[0179] Specifically, for the fields marked with the status of the configuration to be updated, the summary table engine adds them to the summary result data storage model, and defines their attribute information such as field name, data type, field length, decimal places, and whether to participate in indexing. For the fields marked with the status of change, the summary table engine corrects the definition information of the existing fields according to the change items. For the fields marked with the deletion status, they are removed from the summary result data storage model or set to the logical invalid status. 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 composite index or ordinary index according to the latest field definition.

[0180] Step 702: Update the field mapping information in the pre-created summary table caliber configuration table and summary table index configuration table according to the caliber column fields and cell column fields marked with the update status.

[0181] Specifically, the summary table engine writes the information such as the field name, field type, arrangement order, and index attribute of each caliber column field and cell column field into the corresponding summary table caliber configuration table and summary table index configuration table, establishes the binding relationship between the field columns and the original configuration items, 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) according to the current summary result data storage model, completes the physical registration of the field column definition and index structure in the database, and formally converts the logical model into the target result table structure that can write summary data in the database, that is, converts the summary result data storage model into the summary result data storage table.

[0184] In one embodiment, as Figure 8 shown, step 305 further includes step 704.

[0185] Step 704: After completing the above database physical table creation operation, register the table structure information of the current summary result data storage model into the model management object, and mark its status as the table creation completed status or available status for subsequent summary tasks to directly call and use for data writing operations during the execution process.

[0186] In the embodiments of the present invention, through the structured modeling and publishing process of each component of the summary table, a complete mapping path from the logical configuration to the physical table structure is constructed, realizing 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 the configured caliber items and cell items therein, and then perform validity verification, field modeling, and publishing operations to ensure that each configured content can be correctly mapped to the field columns in the database. Through automatic naming, field conflict avoidance, index reconstruction, and field status identification in the systematic modeling process, the adaptability of the summary table engine to multi-version configurations and dynamic field changes is significantly improved. Finally, the summary table engine converts the logical field structure into a physical table structure that can be executed in the database, and completes the on-the-ground 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 writing exceptions, query errors, or version conflicts caused by inconsistent structures in traditional summary systems, improving the stability, automation level of summary tasks, and the consistency of subsequent data analysis.

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

[0188] In one embodiment, as Figure 9 and Figure 11 shown, Step 101 includes Step 901 to Step 905.

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

[0190] Specifically, the summary table engine reads and parses the structure information according to the summary result data storage table associated with the current summary task, and extracts the configuration information of all summary areas therefrom. The configuration information includes: summary area unique identifier (Region ID), summary unit range definition, whether to include the total row configuration, whether to display the detail row configuration, and sorting field setting, etc., for independently performing logical organization on each summary area.

[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 independently 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 execution of the summary task, including but not limited to: the current summary area ID, the summary task identification code, the name of the main data source table, the name of the table for storing the summary result data, the field column definition information, and other auxiliary configuration items. Subsequently, based on the established context object, a bound query executor object (QueryExecutor) is instantiated, and the required field information is automatically added to the SQL construction structure maintained by this query executor object. The field information includes: the summary area ID field, the period field, the summary result sub-table ID field, the primary key field, and the management field, etc.

[0193] During the addition process, the above field information will be automatically written into the corresponding clause structure of the SQL constructor. Among them, the summary area ID field, as the attribution identification field, is added to the SELECT clause and the INSERT clause to indicate the area to which the summary result belongs. The period field, as a multi-period summary support field, can be written into clauses such as SELECT, WHERE, and INSERT to support the periodic data segmentation logic. The summary result sub-table ID field is used to identify the specific result version generated by the current task. The primary key field and other management fields will be added to the INSERT clause and the table creation structure to ensure the uniqueness and integrity of the summary result data storage table structure.

[0194] Step 903: Parse and process 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, as Figure 11 shown, parsing and processing the caliber column fields in the summary area and writing the generated parsing results into the query executor object includes: Step 1101 to Step 1104.

[0196] Step 1101: Traverse all the caliber column fields configured in the current summary area in sequence to obtain the type identifier, caliber identification code, and the corresponding field identifier of each caliber item. Among them, the type identifier of the caliber item includes: source entity caliber, entity attribute field caliber, period caliber, enumeration index caliber, standard caliber, and placeholder caliber, etc.

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

[0198] Specifically, the above standardized parsing process includes: generating field expressions required for executable SQL statements, and adding the parsed field contents to the SQL constructor maintained by the query executor object respectively. The Query clause includes 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 the summary table engine parses the source subject caliber, it automatically associates with the predefined source subject dimension table, and constructs a filtering logic of "including data of subordinate nodes" according to the current configuration. At the same time, add a subject version control field to ensure that matching subject structure data can be obtained during different summary periods.

[0201] The summary table engine obtains the field name it maps (i.e., the coding field in the source subject table, such as org_code) from the summary table caliber configuration table according to the caliber identification code of the source subject caliber item. This field name will be used as the actual field reference of the source subject caliber and written into the SELECT clause, GROUP BY clause, and INSERT clause maintained in the SQL constructor in sequence.

[0202] Step 1104: Perform standardized parsing 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 names can be directly extracted and written into the corresponding Query clause without other association operations.

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

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

[0206] Step 1106: Perform standardized parsing on the caliber column fields corresponding to the enumerated metric caliber.

[0207] Specifically, when the summary table engine processes the enumerated metric caliber, it first adds the corresponding enumerated dictionary table to the FROM clause of the SQL constructor, and based on the preset field association rules, establishes a field connection relationship with the main data table to achieve the logical mapping between the enumerated field and the original metric data. Subsequently, the summary table engine obtains the corresponding enumerated field name according to the caliber identification code of the enumerated metric caliber, and writes this field name into the SELECT clause, GROUP BY clause, and INSERT clause maintained by the SQL constructor respectively.

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

[0209] Specifically, the summary table engine parses the processing logics of both manual grouping and interval grouping respectively according to the configuration contents of the standard caliber in the caliber basic information table, caliber entry table, and manual grouping detail table. Among them, the manual grouping establishes the mapping relationship between the summary caliber and the original field value through the static mapping method, and the interval grouping generates the corresponding SQL conditional expression according to the predefined interval formula (such as "the 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 metric fields to the SQL clause to ensure the consistency of cross-subject grouping.

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

[0211] Specifically, the placeholder caliber does not specify specific fields during the configuration stage and only exists in the form of placeholders. During the summary execution stage, the summary table engine receives the actual field parameters passed in by the external caller and replaces the placeholder fields with the corresponding field codes. Subsequently, the summary table engine performs the standard parsing processing of one of the above steps 1103 to 1107 according to the replaced field type to ensure the consistency between the dynamic configuration of the caliber field and the standard field logic. Among them, the type of the actual field parameter must be one of the source subject caliber, subject attribute field, period caliber, enumerated metric, or standard caliber.

[0212] In one embodiment, as Figure 11 shown, the parsing processing of 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: Traverse all the modeled cell column fields in the current summary area in sequence, read the configuration information of the cell items corresponding to each field, and obtain the type identifier and data source information of the cell column field. Among them, cell types include but are not limited to main attribute field cells, caliber information cells, index field cells, ordinary expression cells, expression cells with pre-summary and post-calculation, and placeholder cells, etc.

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

[0215] Step 1111: Perform standardized parsing and processing on the cell column field corresponding to the main attribute cell.

[0216] Specifically, the summary table engine directly adds the main attribute fields (such as enterprise type, regional code, etc.) to the SELECT clause and INSERT clause in the SQL constructor. If this field is configured with a statistical function type (such as sum, count, average, etc.), wrap the SQL aggregation function expression corresponding to the statistical function type outside the main attribute field, such as SUM(field) or AVG(field), etc., to achieve data statistical aggregation processing.

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

[0218] Specifically, the caliber information field is used to display the subsidiary attribute information of the caliber item, such as caliber code, caliber name, or caliber grouping title, etc. After the summary table engine identifies the statistical type of the caliber information field, it constructs it into the corresponding statistical function expression and adds it to the SELECT clause and INSERT clause. If this caliber information field is of the placeholder type, the actual caliber item is passed in by the caller during the summary execution stage, and the corresponding field attributes are parsed accordingly. If this caliber information field corresponds to an 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 stage. The summary table engine parses it into an internal code field and then uniformly converts it to the display name after the summary is completed.

[0219] Step 1113: Perform standardized parsing and processing on the cell field corresponding to the index data cell.

[0220] Specifically, according to the binding relationship of the metric data fields and their configured statistical methods, the summary table engine converts the metric data fields into corresponding SQL aggregate function expressions (such as SUM(sales_amount)), and writes them into the SELECT clause and the INSERT clause. At the same time, it ensures that the data source tables relied on by the metric data fields are added to the FROM clause to support the reference of the metric data fields.

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

[0222] Specifically, an ordinary expression is usually expressed in the structure of A * B. When parsing, the summary table engine expands its expression structure and adds a statistical function (such as SUM(fieldA * fieldB)) outside the ordinary expression. During this process, all the data source tables relied on by the fields involved in the expression are added to the FROM clause, and the generated column fields of the general expression cells are added to the SELECT clause and the INSERT clause.

[0223] Step 1115: Perform standardized parsing processing on the cell fields corresponding to cells that are summarized first and then calculated.

[0224] Specifically, an expression that is summarized first and then calculated is usually in the form of SUM(A) * SUM(B). During the parsing stage, the summary table engine generates independent aggregate function expressions for A and B respectively and writes them into the SELECT clause and the INSERT clause. Subsequently, the above fields are marked as intermediate fields to perform post-processing calculations (such as multiplication operations) by the SQL UPDATE statement after summarization to achieve the filling of the expression of the summary result.

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

[0226] Specifically, during the summary configuration stage, the placeholder fields only exist as field position information and are not bound to actual fields. During the summary execution stage, the summary engine receives the actual field parameters passed in by the caller, determines their specific types (such as main attribute fields, caliber fields, metric fields, or expression fields), and performs standardized parsing processing in one of the above steps 1111 to 1116, so as to achieve semantic replacement and dynamic binding of the field structure.

[0227] In the embodiments of the present invention, through the above-mentioned parsing processing of the cell column fields, 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 generating subsequent SQL query statements.

[0228] In one embodiment, as Figure 11 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 summary conditions configured in the current summary 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, the summary conditions include but are not limited to main body version control conditions, static filter conditions, unit range filtering conditions, interface dynamic parameter conditions, and multi-period conditions, etc. The summary table engine converts the above summary conditions into standardized SQL expressions through methods such as structured extraction, type judgment, and semantic conversion, and writes them into the WHERE clause.

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

[0232] Specifically, according to the summary period configured for the current summary task (such as months and quarters, etc.), determine the corresponding time interval, and construct a screening expression indicating that the main body data is valid within this time interval (such as valid_time<='2024-03-31' AND invalid_time>'2024-03-31'), and write it into the WHERE clause of the SQL constructor to limit that the referenced main body information is valid data within the current period.

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

[0234] Specifically, read the preset filter formula conditions from the summary result data storage model, convert them into SQL expressions (such as audit_status = 'approved'), and add them to the WHERE clause of the SQL constructor.

[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 main data table, such as unit_code ='10' OR parents LIKE '10 / %', and writes it into the WHERE clause of the SQL constructor to implement the summary range limitation of the organization or business unit.

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

[0238] Specifically, the interface dynamic parameter conditions include: general screening conditions (such as field fixed values, radio buttons, checkboxes, fuzzy matching, etc.), AND logic condition groups, OR logic condition groups, and custom formula expressions, etc.

[0239] The summary table engine parses the above interface dynamic parameter conditions into SQL expressions respectively. The AND logic condition groups are combined into Boolean AND expressions. The OR logic condition groups are concatenated into Boolean OR expressions. After syntax parsing and variable substitution, the custom formula (such as field A > field B × 1.2) is converted into a legal SQL expression. The above parsed SQL expressions are all written into the WHERE clause of the SQL constructor.

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

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

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

[0243] Specifically, the summary table engine traverses the configured list of period caliber values. For each period value, it constructs an independent SQL query environment, including the WHERE clause, FROM clause, and their related parameters.

[0244] If there are placeholders of the type “@@Period” in the SQL constructor, they are dynamically replaced with the current period value. If different periods correspond to different data tables (such as data_202403 and data_202404), the table names or aliases in the query statement are replaced to ensure that the data for each period is read from the correct data source. Finally, each generated group of SQL query structures will be stored in the query executor object, including the corresponding fields, parameters, and table structure information, for subsequent per-period summary execution calls.

[0245] Step 904: Perform summary processing on the query executor object written with the parsing results to generate a corresponding SQL query object.

[0246] In one embodiment, as Figure 10 and Figure 11 shown, Step 904 includes Step 1001 to Step 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 is used to indicate the structural organization method of the current summary table. The summary types include, but are not limited to: fixed summary table, simple table, row-caliber summary table, column-caliber summary table, and row-column caliber summary table. The summary engine determines whether to generate total structure information and subsequent total data processing logic based on this summary type field.

[0249] Step 1002: Generate corresponding total structure information according to the summary type.

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

[0251] If the summary type is a row-caliber summary table, generate the subtotals and total structures corresponding to each level of caliber items in sequence according to the row dimension. If the summary type is a column-caliber summary table, generate the subtotal columns and total columns for each caliber item according to the column dimension. If the summary type is a row-column caliber summary table, construct cross-subtotal structures respectively according to the row dimension and column dimension, and further generate the total cells for the whole table.

[0252] Step 1003: Based on the above total structure information, perform subtotal and total data processing on the single-type caliber dimension and cross-caliber dimension respectively to generate corresponding SQL query objects.

[0253] As Figure 11 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 corresponding SQL query objects.

[0255] Specifically, the summary engine obtains the total attribute configurations of each caliber item from the summary table caliber configuration table, and determines which caliber items have enabled the subtotal or total function. For each caliber item that enables the subtotal function, construct the mapping relationship between this caliber item and the target summary field, and generate an SQL query object based on this caliber item. In the query statement, the GROUP BY clause is used to group by caliber, and the aggregate functions (such as SUM, COUNT, AVG, etc.) in the SELECT clause are combined to perform statistical summarization on the indicator fields or expression fields to generate the subtotal results corresponding to the caliber values.

[0256] Step 1125: Perform subtotal and total data processing on the cross-caliber dimension to generate corresponding SQL query objects.

[0257] Specifically, the summarization engine identifies multiple caliber items with the subtotal function enabled within the current summarization area and constructs a cross-dimensional structure formed by pairwise or multiple combinations. For each group of cross-caliber combinations, a corresponding SQL query object is constructed, aggregated through the GROUP BY clause of multi-field combination, and the aggregate function is called to perform statistical calculations on relevant metric fields to generate a result set of subtotal data for the cross-dimension. The finally output SQL query object contains all the summary statistical fields under this cross-combination and their corresponding summary results.

[0258] In one embodiment, as Figure 11 shown, the summarization process for the query executor object writing the parsing result further includes step 1126 and step 1127.

[0259] Step 1126: Perform SQL optimization processing operations on the total data according to the summarization method fields corresponding to each cell item in the summarization area.

[0260] Specifically, when parsing the summarization area configuration, the summarization engine reads the summarization method attributes of all cell items in the summarization area (for example: sum, count, average, percentage, etc.) and automatically determines whether there are field types that need to rely on detailed data for calculation. If it is detected that there are cases such as relative value calculations (such as percentage fields) or average statistical fields, the summarization engine constructs an SQL aggregation query object based on the detailed data based on the main data source table corresponding to the summarization area to directly generate the required subtotal or total data.

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

[0262] Step 1127: Generate an SQL object for secondary update processing for the summarization area with dependent cell items.

[0263] Specifically, when there are cell items of expression type in the summary area, and the field value of the cell item depends on the output results of other fields that have completed statistical calculations 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 metric fields in the current summary area), this dependent cell item cannot be directly calculated in the main summary SQL query stage (i.e., step 903). After the main summary query result is generated, the result needs to be filled back separately through the UPDATE clause.

[0264] The summary table engine first parses the calculation formula configured in each cell item of expression type, identifies the set of fields on which the calculation formula depends, and then constructs the corresponding SQL UPDATE object. The above SQL UPDATE object will be triggered and executed uniformly after the main query statement of the summary area is executed. According to the field calculation results that have been completed in the current record, the final calculated value of the target cell field is generated to achieve the delayed supplementation and integrity filling of the 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 the period parameter values based on the initialized context object and the summary table caliber configuration table configured for the current summary area. Subsequently, according to whether there are period caliber fields, different strategies are adopted to perform the summary data generation operation, and the generated summary data is stored in the summary result data storage table.

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

[0269] Step 1128: Perform summary processing according to different period parameter values.

[0270] Specifically, the summary table engine determines whether there are period caliber fields according to the period parameter setting in the context object corresponding to the current summary task. If a configured period caliber field is detected in the summary table caliber configuration table, it is considered that the current summary task involves the phased processing logic of the time dimension. If no period caliber field is detected, it is considered that the current summary task is an ordinary summary situation without time dimension constraints.

[0271] Step 1129: In the case where there is no period caliber field, perform summary processing without period parameters.

[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 values preset in the context object to execute the summary task.

[0273] The summary table engine converts the pre-built SQL query object into a standardized SQL query statement and executes the main summary SQL query statement to generate basic summary data. Subsequently, for the expression fields marked as dependent during the modeling phase (such as expression cells involving calculation relationships between fields), execute the corresponding secondary UPDATE type SQL query statement to perform supplementary update calculations on such fields. Finally, the summary table engine executes the corresponding total row and total column SQL query statements according to the built total structure information to generate the summary data corresponding to the current summary area.

[0274] Step 1130: In the case where there is a period caliber field, perform summary processing with period parameters.

[0275] Specifically, when it is detected that the current summary area is 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 list of period variables passed in by the caller during task execution.

[0276] For each period variable, the summary table engine searches for the preset period placeholder (such as "@Period") in the SQL query object and replaces it with the current specific period value to dynamically generate a SQL query statement with time filtering constraints. Subsequently, execute the replaced SQL query statements in sequence to generate the summary data results corresponding to each period and write them into the summary result data storage table respectively. The above replacement, execution, and storage processes will be looped according to the list of period variables until all period variables have completed the summary task, thus realizing the generation of multiple groups of summary data based on the period dimension.

[0277] Step 1131: In the case where different period variables correspond to different source data tables, perform summary processing of multiple source data tables.

[0278] Specifically, if the current summary area is configured with a period-caliber field and the period variables correspond to different data source table structures, when the summary table engine performs the summary process, in addition to replacing the period placeholder (such as “@@Period”) in the SQL query object, it also needs to replace the preset data table name placeholder in the SQL query object with the actual data source table name corresponding to the current period variable (such as data_202403 and data_202404, etc.). For each period variable, the summary table engine generates a complete set of SQL query structures based on the replaced field values, including the SELECT clause, the INSERT clause, and the necessary UPDATE clause. The above query structures can adapt to their respective data source tables during the execution process to achieve the phased summary process for multi-table structures. The summary table engine will sequentially loop through all period variables until all SQL query structures are generated and executed, and write the summary data for each period into the corresponding summary result data storage table.

[0279] In one embodiment, as Figure 11 shown, step 905 further includes step 1132.

[0280] Step 1132: Perform a summary process on 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 field values of other fields that have completed summary calculations in the same summary area for expression calculations (such as fd1 = v1 + v2, or fd2 = v3 ÷ v4, etc.), then after the main summary query is executed, the summary table engine needs to perform secondary processing on such cell items based on the dependency relationship between the fields.

[0282] This secondary processing process is implemented through the SQL UPDATE object generated and marked during the modeling phase. The SQL UPDATE object contains the expression logic composed of dependent fields. The summary table engine will loop through all the expression fields marked as dependent in the summary area and sequentially execute the corresponding SQL UPDATE operations to calculate the final field values based on the generated intermediate summary results.

[0283] In the embodiments of the present invention, through step-by-step structured modeling of the summary table execution process, a summary data generation mechanism covering the entire process of caliber parsing, field modeling, SQL query object construction, aggregate data processing, and summary data generation is established. Based on the structure configuration of the summary area and the context object, this summary data generation mechanism automatically initializes the query executor object and uniformly converts various types of 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 cycles and multiple data tables. For dependent expression fields, through a secondary SQL UPDATE statement, the delayed calculation of the dependent fields and the supplementary backfill of the result accuracy can be achieved to ensure the integrity and correctness of the summary results. The above method not only improves the generality, scalability, and execution efficiency of the summary table engine but also significantly reduces the manual intervention and manual configuration costs.

[0284] Step 102: According to 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, as Figure 12 shown, step 102 includes steps 1201 to 1204.

[0286] Step 1201: According to 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, as Figure 13 and Figure 16 shown, step 1201 includes steps 1301 to 1302.

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

[0289] Specifically, based on the summary result data storage model generated during the publishing operation, the summary table engine determines the name of the summary result data storage table used for the current summary task and reads the configuration information of each summary area recorded in this summary result data storage table. This configuration information includes: caliber column field definition, cell column field definition, summary area range, enabling status of aggregate items, detailed row display configuration, and sorting field setting, etc. At the same time, load the general field definition information required by the summary table engine, such as summary area ID field, summary result sub-table ID field, data period field, and primary key field, etc.

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

[0291] In one embodiment, as Figure 16 shown, Step 1302 includes Step 1601 to Step 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, sequentially read the configuration information of all caliber column fields, and write the field names and attributes corresponding to the caliber column fields into the SELECT clause of the SQL structure object.

[0294] Step 1602: Perform dimension recognition processing on the caliber column fields according to the summary type to generate an SQL structure object.

[0295] Specifically, the summary table engine automatically identifies whether the summary area belongs to row caliber summary, column caliber summary, or row-column caliber summary according to the summary type configured in the summary area, and organizes the query field structure and its marking attributes accordingly.

[0296] Step 1603: Process the row caliber summary table.

[0297] Specifically, identify all caliber column fields as row dimension fields, and mark the current summary area as a "grouped by row" structure. At the same time, write the row dimension fields into the grouped control field set for subsequent generation of the GROUP BY clause.

[0298] Step 1604: Process the column caliber summary table.

[0299] Specifically, identify all caliber column fields as column dimension fields, and mark the current summary area as a "expanded by column" structure, providing a structural definition basis for subsequent column transposition operations.

[0300] Step 1605: Process the row-column caliber summary table.

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

[0302] After processing each caliber column field, iterate and execute 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 in the current summary area from the summary result data storage table. According to the recognition result, the summary table engine constructs the field expression of each cell column field in the SELECT clause and writes it into the SQL structure object.

[0305] Among them, if the cell column field is of the serial number column type, since it is only used for front-end sequence display and does not participate in data summary or storage processing, the summary table engine defaults to excluding such fields from the field organization process.

[0306] In one embodiment, as Figure 16 shown, step 1201 further 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, when constructing the WHERE clause, only the summary result sub-table ID field is retained as the filtering condition to distinguish the attribution of the result data generated by different tasks.

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

[0310] Specifically, if the sorting field is set in the summary area configuration, use this sorting field to construct the ORDER BY clause. If the sorting field is not set, by default, the summary area ID field is used as the primary sorting field, and all caliber column fields are appended to ensure that the summary result has a consistent row and column order and predictability.

[0311] In the 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 structure 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, as Figure 16 shown, step 1202 includes step 1609 to step 1610.

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

[0315] Specifically, the summary table engine extracts the list of fields in the SELECT clause defined therein based on the previously generated SQL structure object, and combines the caliber column fields, cell column fields, and general fields (such as the summary area ID field, period field, summary result sub-table ID field, etc.) included in the summary area configuration to construct the field structure definition information of 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 according to the field structure definition of the database result set object and submits a query request to the target database. After the query operation is completed, the query result returned by the database is filled into the database result set object field by field according to the preset field structure information in Step 1609. The field filling process adopts a mapping strategy based on the field name or field alias to ensure the consistency of the field order and field type, avoiding data anomalies caused by structural mismatches.

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

[0319] In one embodiment, as Figure 14 shown, Step 1203 includes Step 1401 to Step 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 a summary data result set structure organization operation based on the summary data in the database result set object queried in the previous steps. Query the summary type field stored in the summary table basic information table to determine the summary type. The summary type field is used to indicate the structural form of the summary area, including but not limited to: fixed summary table, simple table, row caliber summary table, column caliber summary table, and row-column caliber summary table, etc.

[0322] Step 1402: If the summary type is a row-column caliber summary table, perform a recursive expansion process on the column caliber fields to obtain the 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, the row-column caliber summary table structure, the summary table engine performs a column expansion process on the column caliber fields.

[0324] Extract all column caliber fields configured from the current summary area, and recursively expand 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, manual grouping, etc.). In the database result set, match the entry values corresponding to each column caliber field, and the successfully matched entry values will be converted into column fields (i.e., expanded columns) in the summary result.

[0325] For a multi-level column caliber structure, the summary table engine recursively expands it level by level to construct the column field structure. If a column caliber entry is not found in the current database result set, the summary table engine will automatically complete 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 in a preset order.

[0327] Specifically, the summary table engine inserts the column caliber expanded columns 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 the metadata information of each newly added column field, including the field name, the position number of the field in the summary data result set, the hierarchical path of the column caliber to which it belongs, the entry identifier corresponding to the field, etc. At the same time, the summary table engine will update the column statistical information of the summary data result set structure for subsequent operations such as field length allocation and table layout rendering in the business call layer.

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

[0330] Specifically, based on the constructed summary data result set structure and the query result obtained from the database, perform the corresponding data content organization operations. In this process, map the field data in the database query result to the summary data result set structure according to the defined field position information to complete the structured data filling.

[0331] In one embodiment, as Figure 15 shown, Step 1204 includes Step 1501 to Step 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 caliber summary table or a column caliber summary table, perform a filling operation on 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-caliber summary table or a column-caliber summary table. Since the above two types of summary types only involve summarization and expansion along a single type dimension (row or column), data filling can be directly based on the database query results, and there is no need to perform column field expansion or cross-structure combination operations.

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

[0336] For the column-caliber summary table, although the column-caliber fields are used for column expansion at the business display level, its underlying data is still organized based on rows as the basic unit. Therefore, the filling operation in the summary data result set structure can still be completed according to the record row order. The horizontal expansion logic of the column fields can be implemented through column transposition or column mapping in the front-end display link, without explicit processing at the engine layer.

[0337] To ensure the consistency and recognizability of the summary data structure, the summary table engine synchronously processes the sorting fields and various identification fields (such as summary area ID, summary result sub-table ID, etc.) during the filling process to ensure that the finally 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 caliber summary table, perform row merging on the database query results and add them 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 multiple records stored in the "row caliber and column caliber" combination dimension in the database query results into a single-row structure with the "row caliber" as the main dimension, that is, perform in-row column expansion and merging operations.

[0340] The summary table engine first extracts the row caliber field values and column caliber field values of each record, and constructs the main row structure with the row caliber value as the key. Subsequently, for all column caliber combinations under this row caliber, it extracts the summary result values of their corresponding index fields or expression fields, and constructs the target column field names according to the "column caliber value and field identifier" concatenation rule.

[0341] The summary table engine writes the above values to the corresponding "dynamic column" field positions in the main row structure, and continues to process the remaining column values under this row caliber until the column fields of this 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 performs business data completion and total row generation on 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 are caliber entries 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 values for this caliber item according to the configuration of "whether to display rows without data", and marks it as a "row without detailed values" through a boolean field for the front-end display layer to identify and process.

[0345] For caliber items with subtotal or total attributes enabled, the summary table engine generates corresponding total rows according to the structure rules of the caliber items. Among them, the structure rules include hierarchical subtotals, grouped totals, and overall table totals.

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

[0347] Grouped total: If the caliber item is set in a logical grouping form, the summary table engine generates corresponding total rows according to the grouping dimension.

[0348] Overall table total: If the total attribute is enabled, a total row spanning all entries is generated. Among them, each total row contains a total identification field, a caliber 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 total titles or vacant dimension fields, etc.) to meet the requirements of result set visualization and business display.

[0350] The summary table engine returns the organized summary data result set to the business call layer and provides standardized output data including column structure definitions, row data content, column caliber expansion structures, and identification marks, etc.

[0351] In the embodiments of the present invention, by driving the generation of the summary data result set through the summary result data storage model, and adopting the structured SQL object construction and dynamic result organization process, an efficient execution mechanism for the entire process from structure definition, data query to result filling of the summary data is realized. Through the structural organization of the summary area fields, an SQL structure object that meets the requirements of various summary types (such as row caliber, column caliber, and row-column cross structure) can be dynamically constructed, and on this basis, an accurate query of the summary result in the database is completed. By constructing the database result set object, it is ensured that the query result has the resolvable characteristics of unified field structure and clear data type, guaranteeing the accuracy of subsequent processing. During the structure organization process, the summary table engine supports the dynamic expansion of multi-level column fields based on the column caliber entries, and automatically completes the missing structure in combination with the service configuration, further improving the integrity and display adaptability of the column-level structure. In the data filling link, the summary table engine intelligently distinguishes the filling logic according to the summary type, realizes data aggregation and row merging under a single type dimension and cross dimension, and at the same time supports the automatic completion of subtotals, totals, and empty data rows depending on the configuration, enhancing the business integrity and display effect of the summary data result set. The finally output summary data result set not only maintains the same structural logic as the summary result data storage model, but also supports accurate marking of the total level and data existence, significantly improving the scalability and generality of the summary task in multi-dimensional data display and complex structure rendering.

[0352] In the embodiments of the present invention, a summary data generation device is also provided, as described in the following embodiments. Since the principle of the device for solving problems 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 described again.

[0353] As Figure 17 shown, the summary data generation 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 the pre-established summary result data storage model to generate summary data; the summary result data storage model corresponds one-to-one with the pre-configured summary table basic information table, the summary table basic information table stores summary basic information, and the summary basic information includes a first identification code, a table name, a summary type, and a summary condition; the summary result data storage model is obtained by respectively performing field modeling on each caliber item and each cell item in the summary area based on the first identification code and performing a release 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 to generate a summary data result set.

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

[0357] The region determination module is used to obtain the corresponding summary region according to the first identification code of the summary table basic information 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 region 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 region and generate a cell column field corresponding to the cell item in the summary result data storage model;

[0361] The release processing module is used to perform a release 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 regions 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 region based on the configuration information;

[0365] The condition parsing unit is used to respectively perform parsing processing on the caliber column field, cell column field, and summary condition in the summary region, and write the generated parsing result into the query executor object;

[0366] The query generation unit is used to perform data summarization processing on the query executor object written with the parsing result to 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 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;

[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 structure organization unit is used to perform a structure organization operation on the database query result 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 summary data result set structure to obtain a summary data result set.

[0373] In one embodiment, the model initialization module includes an existence judgment 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 generation unit is used to generate the 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 caliber item in the summary area and judge whether the caliber item is a published caliber item;

[0379] The field name generation unit is used to generate the 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 status 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 and determine whether the cell item is a published cell item;

[0384] The column field generation unit is used to generate corresponding cell column fields according to the 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 fields as updated status so as to write the cell column fields 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 update unit, a mapping update unit, and a physicalization unit.

[0388] The field update unit is used to perform update processing on the caliber column fields and the cell column fields marked as updated status 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 summary table index configuration table according to the caliber column fields and the cell column fields marked as updated status;

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

[0391] In one embodiment, the query generation unit includes a summary type determination subunit, a total structure generation subunit, and a total 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 total structure generation subunit is used to generate corresponding total structure information according to the summary type;

[0394] The total processing subunit is used to perform subtotal and total data processing on the single-type caliber dimension and the cross-caliber dimension respectively based on the above total 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 perform 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, 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 acquire 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 fields and cell column fields of the summary area respectively according to the configuration information, and 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 to perform recursive expansion processing on the column caliber fields if the summary type is a row-column caliber summary table to obtain expanded columns;

[0403] The structure insertion subunit is used to insert the expanded columns into the summary data result set structure in 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 total 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 to perform a filling operation on the summary data result set structure according to the database query result if the summary type is a row caliber summary table or a column caliber summary table;

[0407] The result merging subunit is used to perform row merging processing on the database query result and add it 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 18Schematic diagram of the physical structure of the electronic device provided by the embodiment of the present invention, as Figure 18 shown, the electronic device 1800 includes: a processor 1801, a memory 1802, and a bus 1803.

[0410] Among them, the processor 1801 and the memory 1802 communicate with each other through the 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] The embodiment of the present invention also provides a computer-readable storage medium, and the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above method for generating summary data is implemented.

[0413] The embodiment of the present invention also provides a computer program product, and the computer program product includes a computer program, and when the computer program is executed by a processor, the above method for generating summary data is implemented.

[0414] Those skilled in the art should understand that the embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

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

[0416] These computer program instructions can 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 generate a manufactured article including an instruction device, and the instruction device implements the process inFigure 1 one process or multiple processes and / or blocks Figure 1 the functions specified in one block or multiple blocks.

[0417] These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process. Thus, the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.

[0418] The specific embodiments described above further elaborate on the purpose, technical solutions, and beneficial effects of the present invention. It should be understood that the above are only specific embodiments of the present invention and are not used to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.

Claims

1. A method for generating summary data, characterized in that, Including: Based on a pre-established summary result data storage model, performing summary processing on the summary areas 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 stores summary basic information, and the summary basic information includes a first identification code, a table name, a 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 respectively based on the first identification code and performing a publishing operation; 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.

2. The method according to claim 1, characterized in that, Pre-establishing the summary result data storage model includes: Obtaining the corresponding summary area according to the 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 to generate 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 to generate 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.

3. The method according to claim 2, wherein The performing summary processing on the summary area in the summary result data storage model based on the pre-established summary result data storage model to generate summary data includes: Obtaining the configuration information of all summary areas in the summary result data storage model; Initializing a context object and a query executor object corresponding to each summary area based on the configuration information; Respectively performing parsing processing on the caliber column field, the cell column field, and the summary conditions in the summary area, and writing the generated parsing results into the query executor object; Performing data summary processing on the query executor object written with the parsing results to generate a corresponding SQL query object; Generating summary data based on the SQL query object and storing it in the summary result data storage model.

4. 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 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; Performing a query operation in the database through the SQL structure object to obtain a corresponding database query result; Performing a structure organization operation on the database query result to obtain a summary data result set structure; Performing a data content organization operation according to the database query result and the summary data result set structure to obtain a summary data result set.

5. The method according to claim 2, characterized in that, The initializing the summary result data storage model corresponding to the summary table basic information table according to the first identification code includes: Determine whether there is already a summary result data storage model corresponding to the summary table basic information table in the database; If there is no summary result data storage model corresponding to the summary table basic information table in the database, generate the 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.

6. The method according to claim 2, wherein The field modeling for each caliber item in the summary area, and generating the caliber column field corresponding to the caliber item in the summary result data storage model includes: Traverse each caliber item in the summary area, and determine whether the caliber item is a published caliber item; If the caliber item is an unpublished caliber item, generate the field name of the caliber column field according to the second identification code of the caliber item; Mark the caliber column field as the update status, so as to write the field name into the summary result data storage model during the publishing operation; Iteratively execute the above steps until all caliber items in the summary area are modeled.

7. The method according to claim 6, wherein The field modeling for each cell item in the summary area, and generating the cell column field corresponding to the cell item in the summary result data storage model includes: Traverse each cell item in the summary area, and determine whether the cell item is a published cell item; If the cell item is an unpublished cell item, generate the corresponding cell column field according to the configuration type of the cell item; Mark the cell column field as the update status, so as to write the cell column field into the summary result data storage model during the publishing operation; Iteratively execute the above steps until all cell items in the summary area are modeled.

8. The method according to claim 7, wherein 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, perform update processing on the caliber column field and the cell column field marked as the update status; Update the field mapping information in the pre-created summary table caliber configuration table and summary table index configuration table according to the caliber column field and the cell column field marked as the update status; Perform database physicalization operation on the summary result data storage model.

9. The method according to claim 3, characterized in that The data summarization process is performed on the query executor object written with the parsing result to generate the corresponding SQL query object, including: Determine the summary type according to the summary type field in the pre-created summary table basic information table; Generate the corresponding total structure information according to the summary type; Based on the above total structure information, perform subtotal and total data processing on the single-type caliber dimension and the cross-caliber dimension respectively to generate the corresponding SQL query object.

10. The method according to claim 3, characterized in that, The generation of 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, perform summary processing on the SQL query object, generate summary data and store it in the summary result data storage model.

11. The method according to claim 4, characterized in that, Performing a field organization operation on the summarized area according to the summarized result data storage model and the summarized data to generate an SQL structure object, including: Obtaining configuration information of all summarized areas in the summarized result data storage model; Performing field organization operations on the caliber column fields and cell column fields of the summarized area respectively according to the configuration information to construct an SQL structure object.

12. The method according to claim 4, characterized in that, Performing a structure organization operation on the database query result to obtain a summarized data result set structure, including: Determining the summarization type according to the summarization type field in the pre-created basic information table of the summarized table; If the summarization type is a row-column caliber summarized table, performing recursive expansion processing on the column caliber fields to obtain expanded columns; Inserting the expanded columns into the summarized data result set structure in a preset order.

13. The method according to claim 4, wherein Performing a data content organization operation according to the database query result and the summarized data result set structure to obtain a summarized data result set, including: Determining the summarization type according to the summarization type field in the pre-created basic information table of the summarized table; If the summarization type is a row caliber summarized table or a column caliber summarized table, performing a filling operation on the summarized data result set structure according to the database query result; If the summarization type is a row-column caliber summarized table, performing row merging processing on the database query result and adding it to the summarized data result set structure; Performing a subtotal and total filling operation on the summarized data result set structure to obtain the summarized data result set.

14. A summary data generation device, characterized in that, Including: A summarization processing module for performing summarization processing on the summarized areas in the summarized result data storage model based on a pre-established summarized result data storage model to generate summarized data; The summarized result data storage model corresponds one-to-one to a pre-configured basic information table of the summarized table. The basic information table of the summarized table stores summarized basic information, and the summarized basic information includes a first identification code, a table name, a summarization type, and summarization conditions. The summarized result data storage model is obtained by respectively performing field modeling on each caliber item and each cell item in the summarized area based on the first identification code and performing a publishing operation; A result construction module for performing a summarized result construction process on the summarized area according to the summarized result data storage model and the summarized data to generate a summarized data result set.

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

16. 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 13 is implemented.

17. A computer program product, characterized in that, The computer program product includes a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 13 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

  • Data summarization method and device, electronic equipment and storage medium

    CN118171025A

  • Database multi-level grouping method, device and system and medium

    CN119719169A

  • Automatically executing graphql queries on databases

    US20210248143A1