Table statistical method and system capable of realizing hierarchical summarization
Through hierarchical summary tabular statistical methods and systems, the problem of low data aggregation efficiency is solved, efficient and safe data analysis is realized, customization and expansion are supported, and it is suitable for the data analysis needs of government or enterprise users.
Patent Information
- Application Number
- CN202410791692.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-19
- Publication Date
- 2024-08-30
AI Technical Summary
Enterprises or users lack simple, easy-to-use and efficient data aggregation tools when statistical data, resulting in low efficiency of data analysis and aggregation and requiring a lot of manual participation.
Provides a hierarchical summary table statistics method and system. By reading the configuration file in JSON format, using JDBC to connect to the remote database, executing SQL scripts, and summarizing the results according to the preset hierarchical structure, it supports re-statistics and summarization when the data changes. , using encrypted transmission protocol and batch processing technology, providing RESTful interface and open API.
It improves the efficiency of data analysis and summary, ensures the security of data transmission and system stability, supports custom SQL scripts and result table structures, and facilitates user expansion and integration.
Smart Images

Figure CN118568152A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer application technology, in particular to a table statistics method and system capable of realizing hierarchical aggregation. Background Art
[0002] When collecting statistics, enterprises or other user entities sometimes need to summarize data from various levels to form statistical tables for each level and total statistical tables at the top level to analyze and summarize the data. Currently, there is a lack of easy-to-use and efficient data aggregation tools, which leads to the fact that in actual applications, data analysis and aggregation still requires a lot of manual participation and is inefficient. Summary of the invention
[0003] The technical task of the present invention is to address the above shortcomings and provide a table statistics method and system that can realize hierarchical aggregation, which can meet the data analysis needs of government or corporate users and improve the efficiency of data analysis and aggregation.
[0004] The technical solution adopted by the present invention to solve its technical problem is:
[0005] A table statistics method that can achieve hierarchical aggregation, completes data hierarchical statistics and aggregation according to user-defined policies, and when business data changes, re-counts the changed nodes through values, and summarizes the changes to achieve statistics on data changes;
[0006] By reading the configuration file in JSON format, connecting to the remote database through JDBC, executing the specified SQL script, and summarizing the execution results hierarchically into the result table; when the data changes, re-execution and summary are performed by calling the interface.
[0007] Furthermore, the implementation of this method includes:
[0008] 1) Configuration file reading: read the configuration file in JSON format; after parsing the configuration file, automatically establish a connection with the remote database;
[0009] 2) SQL execution: locate and execute specific SQL scripts placed in a remote fixed path based on the parameters passed in; during the execution process, record the execution log for subsequent tracking and troubleshooting;
[0010] 3) Result summary: The execution results are summarized according to the preset hierarchical structure; the execution results of the next level are summarized and queried through the program, and are summarized to the previous level step by step according to the organizational relationship tree, and finally a complete summary result is formed at the top level; the summary results are stored in the result table for subsequent query and analysis;
[0011] 4) Interface call: Provide a calling interface. When the data changes, the user triggers re-execution and summary operations by calling the provided interface.
[0012] Furthermore, the configuration file in JSON format includes database connection information, SQL script path, and result table structure.
[0013] Furthermore, the interface is designed in RESTful style, supports GET and POST request methods, and is easy to integrate with other systems.
[0014] Furthermore, an encrypted transmission protocol (such as SSL) is used when connecting to the database to ensure the security of data transmission; at the same time, sensitive information in the configuration file is encrypted and stored to prevent leakage.
[0015] Furthermore, for the execution and aggregation operations of large amounts of data, batch processing and cache optimization techniques are used to improve execution efficiency; at the same time, the execution process is monitored and optimized to ensure the stability and reliability of the system.
[0016] Furthermore, it supports custom SQL scripts and result table structures, allowing users to expand according to actual needs; at the same time, it provides an open API interface to support integration and expansion with other systems.
[0017] The present invention also claims a table statistical system capable of realizing hierarchical aggregation, comprising:
[0018] The file reading module is used to read the configuration file in JSON format; after parsing the configuration file, it automatically establishes a connection with the remote database;
[0019] The SQL execution module is used to locate and execute a specific SQL script placed in a remote fixed path according to the passed parameters; during the execution process, the execution log is recorded for subsequent tracking and troubleshooting;
[0020] The result summary module is used to summarize the execution results according to the preset hierarchical structure; the execution results of the next level are summarized and queried through the program, and are summarized to the previous level step by step according to the organizational relationship tree, and finally a complete summary result is formed at the top level; the summary results are stored in the result table for subsequent query and analysis;
[0021] The interface calling module provides a calling interface. When the data changes, the user triggers the re-execution and summary operations by calling the interface provided by the tool.
[0022] The present invention also claims a table statistics device capable of realizing hierarchical aggregation, comprising at least one memory and at least one processor;
[0023] The at least one memory is used to store a machine-readable program;
[0024] The at least one processor is used to call the machine-readable program to implement the above method.
[0025] The present invention also claims protection for a computer-readable medium having computer instructions stored thereon, which, when executed by a processor, enable the processor to implement the above method.
[0026] Compared with the prior art, the table statistics method and system capable of realizing hierarchical aggregation of the present invention have the following beneficial effects:
[0027] This method is simple and easy to operate, can improve the efficiency of data analysis and aggregation, and meet the data analysis needs of government or corporate users.
[0028] When connecting to the database, an encrypted transmission protocol is used to ensure the security of data transmission. At the same time, sensitive information in the configuration file is encrypted and stored to prevent leakage.
[0029] For the execution and aggregation operations of large amounts of data, batch processing and cache optimization techniques are used to improve execution efficiency; at the same time, the execution process is monitored and optimized to ensure the stability and reliability of the system.
[0030] It supports customized SQL scripts and result table structures, allowing users to expand according to actual needs; at the same time, it provides an open API interface to support integration and expansion with other systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 It is a flowchart of a table statistics method for implementing hierarchical aggregation provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0032] The present invention will be further described below in conjunction with specific embodiments.
[0033] The embodiment of the present invention provides a table statistics method capable of realizing hierarchical aggregation, which completes data hierarchical statistics and aggregation according to a user-defined strategy. When business data changes, the changed nodes are re-counted by value, and the changes are summarized to realize statistics of data changes.
[0034] Design a remote SQL execution tool written in Java, which reads the configuration file in JSON format, connects to the remote database through JDBC, executes the specified SQL script, and summarizes the execution results hierarchically into the result table; when the data changes, re-execute and summarize by calling the interface.
[0035] The specific implementation of this method includes:
[0036] 1. Configuration file reading: Supports reading configuration files in JSON format, which contain database connection information, SQL script path, result table structure, etc. After parsing the configuration file, it automatically establishes a connection with the remote database.
[0037] 2. SQL execution: Locate and execute a specific SQL script placed in a remote fixed path based on the passed parameters; during the execution process, record the execution log for subsequent tracking and troubleshooting.
[0038] 3. Result summary: The execution results are summarized according to the preset hierarchical structure. The execution results of the next level will be summarized and queried through the program, and summarized to the previous level step by step according to the organizational relationship tree, and finally form a complete summary result at the top level. The summary results are stored in the result table for subsequent query and analysis.
[0039] 4. Interface call: Provide a call interface. When data changes, users can trigger re-execution and aggregation operations by calling the provided interface. The interface is designed in RESTful style and supports GET and POST request methods, which is convenient for integration with other systems.
[0040] In terms of security, an encrypted transmission protocol (such as SSL) is used when connecting to the database to ensure the security of data transmission. At the same time, sensitive information in the configuration file is encrypted and stored to prevent leakage.
[0041] In terms of performance optimization, batch processing and cache optimization techniques are used to improve execution efficiency for the execution and aggregation operations of large amounts of data; at the same time, the execution process is monitored and optimized to ensure the stability and reliability of the system.
[0042] In terms of scalability, it supports custom SQL scripts and result table structures, allowing users to expand according to actual needs; at the same time, it provides an open API interface to support integration and expansion with other systems.
[0043] The embodiment of the present invention also provides a table statistics system that can realize hierarchical aggregation, completes data hierarchical statistics and aggregation according to user-defined strategies, and when business data changes, re-counts the changed nodes through values, and summarizes the changes to achieve statistics on data changes.
[0044] The system has a remote SQL execution tool written in Java, which can read configuration files in JSON format, connect to the remote database through JDBC, execute the specified SQL script, and summarize the execution results hierarchically into the result table; when the data changes, it is re-executed and summarized by calling the interface.
[0045] The system specifically includes:
[0046] 1. File reading module, supports reading configuration files in JSON format, which contain database connection information, SQL script path, result table structure, etc. After parsing the configuration file, it automatically establishes a connection with the remote database;
[0047] 2. SQL execution module, which is used to locate and execute specific SQL scripts placed in a remote fixed path according to the passed parameters; during the execution process, the execution log is recorded for subsequent tracking and troubleshooting.
[0048] 3. The result summary module is used to summarize the execution results according to the preset hierarchical structure. The execution results of the next level will be summarized and queried through the program, and summarized to the previous level step by step according to the organizational relationship tree, and finally form a complete summary result at the top level. The summary results are stored in the result table for subsequent query and analysis.
[0049] 4. Interface calling module: the tool provides a calling interface. When data changes, users can trigger re-execution and aggregation operations by calling the interface provided by the tool. The interface is designed in RESTful style and supports GET and POST request methods, which is convenient for integration with other systems.
[0050] In terms of security, this system uses encrypted transmission protocols (such as SSL) when connecting to the database to ensure the security of data transmission. At the same time, sensitive information in the configuration file is encrypted and stored to prevent leakage.
[0051] In terms of performance optimization, this system uses batch processing and cache optimization techniques to improve execution efficiency for the execution and aggregation operations of large amounts of data; at the same time, the execution process is monitored and optimized to ensure the stability and reliability of the system.
[0052] In terms of scalability, this system supports custom SQL scripts and result table structures, allowing users to expand according to actual needs; at the same time, it provides an open API interface to support integration and expansion with other systems.
[0053] The embodiment of the present invention also provides a table statistics device capable of realizing hierarchical aggregation, comprising at least one memory and at least one processor;
[0054] The at least one memory is used to store a machine-readable program;
[0055] The at least one processor is used to call the machine-readable program to implement the table statistics method capable of achieving hierarchical aggregation as described in the above embodiment.
[0056] The embodiment of the present invention further provides a computer-readable medium, on which computer instructions are stored, and when the computer instructions are executed by a processor, the processor executes the table statistical method for hierarchical aggregation described in the above embodiment. Specifically, a system or device equipped with a storage medium can be provided, on which a software program code for implementing the functions of any of the above embodiments is stored, and a computer (or CPU or MPU) of the system or device reads and executes the program code stored in the storage medium.
[0057] In this case, the program code itself read from the storage medium can realize the function of any one of the above-mentioned embodiments, and thus the program code and the storage medium storing the program code constitute a part of the present invention.
[0058] The storage medium embodiments for providing the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), a magnetic tape, a non-volatile memory card, and a ROM. Alternatively, the program code can be downloaded from a server computer by a communication network.
[0059] In addition, it should be clear that the functions of any of the above embodiments can be implemented not only by executing the program code read by the computer, but also by enabling an operating system operating on the computer to complete part or all of the actual operations based on instructions from the program code.
[0060] In addition, it can be understood that the program code read from the storage medium is written to a memory provided in an expansion board inserted into the computer or written to a memory provided in an expansion unit connected to the computer, and then based on the instructions of the program code, a CPU installed on the expansion board or the expansion unit is enabled to perform part or all of the actual operations, thereby realizing the functions of any of the above-mentioned embodiments.
[0061] The present invention is shown and described in detail above through the accompanying drawings and preferred embodiments. However, the present invention is not limited to these disclosed embodiments. Based on the above multiple embodiments, those skilled in the art can know that the code review methods in the above different embodiments can be combined to obtain more embodiments of the present invention, and these embodiments are also within the protection scope of the present invention.
Claims
1. A table statistical method that can achieve hierarchical aggregation, It is characterized in that Complete data hierarchical statistics and aggregation according to user-defined policies. When business data changes, re-count the changed nodes through values and summarize the changes to achieve statistics on data changes. By reading the configuration file in JSON format, connecting to the remote database through JDBC, executing the specified SQL script, and summarizing the execution results hierarchically into the result table; when the data changes, re-execution and summary are performed by calling the interface.
2. A table statistical method capable of realizing hierarchical aggregation according to claim 1, It is characterized in that The implementation of this method includes: 1) Configuration file reading: read the configuration file in JSON format; after parsing the configuration file, automatically establish a connection with the remote database; 2) SQL execution: locate and execute specific SQL scripts placed in a remote fixed path based on the parameters passed in; during the execution process, record the execution log for subsequent tracking and troubleshooting; 3) Result summary: The execution results are summarized according to the preset hierarchical structure; the execution results of the next level are summarized and queried through the program, and are summarized to the previous level step by step according to the organizational relationship tree, and finally a complete summary result is formed at the top level; the summary result is stored in the result table; 4) Interface call: Provide a calling interface. When the data changes, the user triggers re-execution and summary operations by calling the interface.
3. A table statistical method capable of realizing hierarchical aggregation according to claim 2, It is characterized in that The configuration file in JSON format includes database connection information, SQL script path, and result table structure.
4. A table statistical method capable of realizing hierarchical aggregation according to claim 2, It is characterized in that The interface is designed in RESTful style and supports GET and POST request methods.
5. A table statistical method capable of realizing hierarchical aggregation according to claim 1 or 2, It is characterized in that When connecting to the database, an encrypted transmission protocol is used to ensure the security of data transmission; at the same time, sensitive information in the configuration file is encrypted and stored.
6. A table statistical method capable of realizing hierarchical aggregation according to claim 1 or 2, It is characterized in that Batch processing and cache optimization techniques are used for the execution and aggregation of large amounts of data. At the same time, the execution process is monitored and optimized to ensure the stability and reliability of the system.
7. A table statistical method capable of realizing hierarchical aggregation according to claim 1 or 2, It is characterized in that It supports customized SQL scripts and result table structures, allowing users to expand according to actual needs; at the same time, it provides an open API interface to support integration and expansion with other systems.
8. A table statistics system that can achieve hierarchical aggregation, It is characterized in that include: The file reading module is used to read the configuration file in JSON format; after parsing the configuration file, it automatically establishes a connection with the remote database; The SQL execution module is used to locate and execute a specific SQL script placed in a remote fixed path according to the passed parameters; during the execution process, the execution log is recorded for subsequent tracking and troubleshooting; The result summary module is used to summarize the execution results according to the preset hierarchical structure; The execution results of the next level are summarized and queried through the program, and are summarized to the previous level step by step according to the organizational relationship tree, and finally a complete summary result is formed at the top level; The summary results are stored in the result table; The interface calling module provides a calling interface. When the data changes, the user triggers the re-execution and summary operations by calling the interface.
9. A table statistics device capable of realizing hierarchical aggregation, It is characterized in that comprising at least one memory and at least one processor; The at least one memory is used to store a machine-readable program; The at least one processor is used to call the machine-readable program to implement the method described in any one of claims 1 to 7.
10. A computer readable medium, It is characterized in that The computer readable medium stores computer instructions, which, when executed by a processor, enable the processor to implement the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Data query system based on ApacheKylin, and method thereof
CN106599052A
Statistic data summarizing method and device
CN107832267A
Tree structure data summarizing method and system
CN111522819A
Method and terminal for hierarchically summarizing reports
CN113486066A
Hadoop OLAP engine
US20150310082A1
