A method and apparatus for computing data and providing a query interface service
By designing a data query interface service method, the problems of data redundancy and obsolescence in urban operation status monitoring were solved, enabling flexible acquisition and real-time updated data display, and improving decision support capabilities.
Patent Information
- Application Number
- CN202210925311.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-03
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2042-08-03
AI Technical Summary
In urban operation status monitoring, the problems of redundant business data, outdated results data, and inflexible acquisition make it impossible for large-screen visualization to effectively assist decision-making.
Design a method for computing data and providing query interface services, including defining computing logic, generating database tables, providing query interfaces and scheduled tasks, supporting filtering conditions and data synchronization, and ensuring data freshness and flexibility.
It enables flexible acquisition of business data and real-time updates of result data, solves the problems of data redundancy and obsolescence, and enhances the decision support capabilities of large-screen visualization.
Smart Images

Figure CN115328984B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of smart city, and particularly provides a method and device for calculating data and providing query interface services. BACKGROUND
[0002] Informationization is a major trend in today's world, and building city operation situation monitoring is an important step in informationization. Through informationization big data means, using large screen visualization display technology, the business data and event data of the city are analyzed and displayed in multiple dimensions to assist leaders, technical personnel, executive personnel and other post personnel in comprehensively and correctly understanding the city operation state and making correct judgments and decisions. In this process, the following problems exist:
[0003] Business data and event data are redundant. Most of the data of the city is large and complex business data, which cannot be directly applied to the large screen to assist decision makers in making correct judgments.
[0004] The result data is outdated. The data displayed by the large screen visualization sometimes is outdated and cannot be used as the basis for current decision making.
[0005] It is difficult to obtain result data. The large screen visualization is not flexible in obtaining data, and often all the data in a table is obtained, and the data cannot be obtained flexibly by setting filtering conditions. SUMMARY
[0006] The present application is aimed at the deficiencies of the prior art, and provides a method for calculating data and providing query interface services with strong practicality.
[0007] The further technical task of the present application is to provide a device for calculating data and providing query interface services, which is safe and suitable.
[0008] The technical solution adopted by the present application to solve the technical problems is:
[0009] A method for calculating data and providing query interface services, comprising the following steps:
[0010] S1. Formulate a calculation logic for obtaining result data according to business needs;
[0011] S2. Generate a database table according to the result data field in the calculation logic;
[0012] S3. Provide a result data query interface to a data visualization application;
[0013] S4. Formulate a timing task to obtain data from a data source and obtain result data through logical calculation, and then store the result data in the created database table.
[0014] Further, in step S1,
[0015] Further comprising:
[0016] S101, according to the needs of the business to select the field of data operation;
[0017] S102, according to the needs of the business to set the dimension of the aggregate operation, the dimension is the basis parameter of the data logical operation;
[0018] S103, according to the needs of the business aggregation mode including average, total, maximum, minimum and sum.
[0019] Further, in step S2,
[0020] Further comprising:
[0021] S201, according to the actual use of the business to name the database table to be generated for generating the library table;
[0022] S202, then select the dimension of the aggregate calculation, according to the dimension and the actual business needs to select the calculation result field under the same dimension for generating the table structure field of the library table.
[0023] Further, in step S3,
[0024] Further comprising:
[0025] S301, the filling method of the interface name has two kinds, respectively system default and custom, the system default interface name does not need to be manually inputted, the default interface name is automatically generated and consistent with the database table name;
[0026] The custom interface name needs to be manually inputted;
[0027] S302, select the creation method of the interface, the creation method of the interface has two kinds, one is through the data table creation, one is through the SQL creation.
[0028] Further, in step S4,
[0029] Further comprising:
[0030] S401, set the task name and fill in the task description to give a task content an identification;
[0031] S402, select the task type and the execution time;
[0032] S403, set the number of retries and the retry interval time of the task execution failure;
[0033] S404, set the data synchronization mode.
[0034] Further, in step S402, the task type is selected as single or repetitive, if single is selected, the task will only be executed once according to the execution time;
[0035] If the task is repetitive, the task will be executed according to the set execution time.
[0036] Further, in step S404, the full synchronization and incremental synchronization are included, the full synchronization is to update the result data in the database every time;
[0037] The incremental synchronization updates the result data in the database according to the set condition.
[0038] A device for calculating data and providing a query interface service, characterized in that it comprises at least one memory and at least one processor.
[0039] The at least one memory is used to store machine readable programs.
[0040] The at least one processor is used to call the machine readable programs and execute a method for calculating data and providing a query interface service.
[0041] Compared with the prior art, the method and device for calculating data and providing a query interface service have the following outstanding advantages:
[0042] The application can solve the problems of complex business data that cannot be directly used as result data for data visualization system display, inflexible data acquisition of data visualization system and outdated result data acquired by data visualization system. BRIEF DESCRIPTION OF DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are some embodiments of the application, and other drawings can also be obtained by those skilled in the art without creative labor on the basis of these drawings.
[0044] Figure Figure 1 It is a flowchart of a method for calculating data and providing a query interface service. DETAILED DESCRIPTION
[0045] For the person in the art to better understand the scheme of the present application, the present application will be further described in detail below in combination with specific embodiments. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without making creative efforts fall within the scope of protection of the present application.
[0046] A preferred embodiment is given below:
[0047] As shown in the figure, the method for calculating data and providing a query interface service in the embodiment has the following steps: Figure 1
[0048] S1, the calculation logic of the result data is formulated according to the business needs;
[0049] Further including:
[0050] S101, the fields for data operation are selected according to the business needs;
[0051] S102, the dimensions for aggregation operation are set according to the business needs, and the dimension is the basis parameter for data logical operation;
[0052] S103, the aggregation mode according to the business needs includes average, total, maximum, minimum, summation, etc.
[0053] Such a complete operation logic includes the operation field, the dimension field for operation basis, and the aggregation mode, and is generated. The generated data calculation logic is the conversion rule for converting the original data into the result data for the analyst to use, and the data displayed on the subsequent visualization interface will be generated according to this rule.
[0054] S2, the database table is generated according to the result data field in the calculation logic;
[0055] Further including:
[0056] S201, the database table to be generated is named for generating the library table according to the actual use of the business.
[0057] S202, then the dimension for aggregation calculation is selected, and the result field under the same dimension is selected according to the dimension and the actual business needs to generate the table structure field of the library table.
[0058] The database table is generated according to the result data field in the calculation logic, in order to store the result data generated by using the original data through logical operation into the database table.
[0059] S3, the result data query interface with flexible filter conditions is provided to the data visualization application;
[0060] Further comprising:
[0061] S301, the filling method of interface name has two kinds, respectively system default and custom, the interface name of system default does not need manual input, the default interface name is automatically generated and consistent with database table name;
[0062] The custom interface name needs manual input;
[0063] S302, select the creation method of interface, the creation method of interface has two kinds, one is through data table creation, one is through SQL creation.
[0064] This step is to provide a data query interface, the user can obtain the result data stored in the database table through the interface.
[0065] S4, make timing task, get data from data source and get result data through logical calculation, then store to the created database table.
[0066] Further comprising:
[0067] S401, set task name and fill in task description for giving a task content identification.
[0068] S402, select task type and execution time, task type can be single or repetitive. If it is single, the task will only be executed once according to the execution time. If the task is repetitive, the task will be executed according to the set execution time.
[0069] This step is to give the task execution mode more selectivity, and the repeated task can ensure the result data to be refreshed constantly.
[0070] S403, set the number of retries and retry interval time of task execution failure, if the task execution fails due to external reasons such as network problem, the task will be executed repeatedly according to the setting, until the set retry number is met, if the intermediate retry is successful, it will not be retried.
[0071] This step is to avoid the task missing the execution time because of network or device external failure.
[0072] S404, set the way of data synchronization, including full synchronization, incremental synchronization and other ways, full synchronization is to update the result data in the database every time. Incremental synchronization can be updated in the database according to the set conditions, which can ensure the freshness of the data and reduce the memory resources occupied by the task execution when the data volume is large.
[0073] This step is to combine the aggregation calculation logic created in the previous steps and the storage process of the result data to generate a round-robin executable task to complete the continuous update of the result data.
[0074] Based on the above method, the device for calculating data and providing query interface service in the embodiment is characterized in that it comprises at least one memory and at least one processor.
[0075] The at least one memory is used to store machine readable programs.
[0076] The at least one processor is used to call the machine readable programs and execute the method for calculating data and providing query interface service.
[0077] The above specific embodiments are only specific cases of the present application, and the patent protection scope of the present application includes but is not limited to the above specific embodiments. Any appropriate changes or replacements made by any person skilled in the art to the method and device for calculating data and providing query interface service shall fall within the patent protection scope of the present application.
[0078] Although the embodiments of the present application have been shown and described, it can be understood by those skilled in the art that various changes, modifications, replacements and variations can be made to these embodiments without departing from the principles and spirits of the present application, and the scope of the present application is defined by the appended claims and their equivalents.
Claims
1. A method for calculating data and providing a query interface service, characterized in that, It has the following steps: S1. The calculation logic for obtaining the result data should be formulated according to business needs; Further includes: S101. Select the fields for data calculation based on business needs; S102. Set the dimensions for aggregation operations according to business needs. Dimensions are the parameters used to perform logical operations on data. S103. Aggregation methods based on business needs include average, total, maximum value, minimum value, and summation; S2. Generate a database table based on the result data fields in the calculation logic; S3. Provides a result data query interface for data visualization applications; S4. Define a scheduled task to periodically retrieve data from the data source, perform logical calculations to obtain the result data, and then store it in the created database table. Further includes: S401. Set the task name and fill in the task description to assign an identifier to the task content; S402. Select the task type and execution time; If you select the task type as single or repetitive, the task will only be executed once according to the execution time if you select single. If the task is repetitive, it will be executed in a round-robin fashion according to the set execution time. S403. Set the number of retries and the retry interval for task execution failures; S404, Configure the data synchronization method; This includes full synchronization and incremental synchronization methods. Full synchronization means updating the result data in the database in a comprehensive manner each time. Incremental synchronization updates the result data in the database based on the set conditions.
2. The method for calculating data and providing a query interface service according to claim 1, characterized in that, In step S2, Further includes: S201. Name the database tables to be generated according to their actual business use for generating database tables; S202. Then select the dimension for aggregation calculation. Based on the dimension and actual business needs, select the calculation result field under the same dimension to generate the table structure field of the database table.
3. The method for calculating data and providing a query interface service according to claim 2, characterized in that, In step S3, Further includes: S301. There are two ways to fill in the interface name: system default and custom. The system default interface name does not need to be entered manually. The default interface name is automatically generated and is consistent with the database table name. The custom interface name needs to be entered manually; S302. Select the interface creation method. There are two ways to create an interface: one is to create it through a data table, and the other is to create it through SQL.
4. An apparatus for calculating data and providing a query interface service, characterized in that, include: 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 configured to invoke the machine-readable program to perform the method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Dynamic compilation-based business scenario automated test method
CN108446223A
Data processing method and device, storage medium and electronic equipment
CN114817389A