Management method for data query based on common interface
Through the data query management method based on public interface, the data format diversity and interface complexity problems are solved, the efficiency and standardization of data query are realized, the flexibility and accuracy of data processing are improved, the development costs are reduced, and the development costs are supported. Data sharing and decision analysis.
Patent Information
- Application Number
- CN202410955376.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2024-11-15
AI Technical Summary
In the prior art, the public interface management of standard format data query faces problems such as data format diversity, interface design complexity and performance stability, resulting in difficulty in data exchange and sharing, making it difficult for users to query data efficiently, and it is costly or lacks flexibility.
Provide a data query management method based on public interfaces, which is implemented through multiple library table sources and query interfaces, adapt to standardized data formats, manage database connections, data tables and public interfaces, supports import of multiple file formats, and simplifies data query Process, improve data availability and application, and reduce customized development modules.
Improves the flexibility and efficiency of data processing, optimizes data accuracy and reliability, reduces development and maintenance costs, promotes data standardization and sharing, and supports decision analysis and business optimization.
Smart Images

Figure CN118964377A_ABST
Abstract
Description
Technical Field
[0001] The invention discloses a method, and relates to the technical field of databases, in particular to a management method for data query based on a public interface. Background Art
[0002] With the acceleration of digital transformation, data has become a key factor in driving business innovation and improving competitiveness. In the existing technology, the management of public interfaces for standard format data query faces multiple challenges. First, the diversity of data formats between different systems and platforms makes data exchange and sharing difficult. Second, the complexity and non-standardization of interface design make it difficult for users to query data efficiently. In addition, with the continuous increase in data volume, the performance and stability of interfaces are also facing tremendous pressure. Although methods such as formulating unified data standards to standardize data formats and simplifying interface calls by designing standardized interface protocols can be used to improve interface performance and security. However, these solutions often have problems such as complex implementation, high cost or lack of flexibility. Summary of the invention
[0003] In response to the problems of the prior art, the present invention provides a management method for data query based on a public interface, provides multiple library and table source methods, and multiple query interface implementation methods, adapts to data query requirements in standardized data format scenarios, improves data availability and applicability, improves service reusability, reduces customized development modules, and reduces the amount of code, providing important technical support for urban brain platforms, data visualization, low-code configuration, standardized products and other fields.
[0004] The specific scheme proposed by the present invention is:
[0005] The present invention provides a management method for data query based on a public interface, comprising:
[0006] Step 1: Manage database connection: configure data source code, data source name, database type, driver class, data source address, database name, user name, password and remarks, and use JDBC to connect to the database to obtain data tables;
[0007] Step 2: Manage data tables for data query:
[0008] Create data tables through web visual management, define table name, table description, status, field name, field notes, field length, default value, field type, whether it is primary key and whether null value is allowed,
[0009] And / or select to connect to the data source, import the existing data table according to the requirements, and obtain the library table information based on the imported data table.
[0010] And / or import the files to be uploaded according to the file data source and create a data table based on the uploaded files,
[0011] Step 3: Manage the public interface and query data through the public interface: Select the public interface creation method. The public interface creation methods include creating an interface based on a data table and creating an interface based on a SQL query.
[0012] Create an interface based on the data table: select the data source, configure the data table attributes, select the interface code generation method, configure the interface code, and complete the interface creation.
[0013] Create an interface based on SQL query: configure SQL statements and verify SQL statements, automatically generate interface codes, and complete interface creation.
[0014] According to the public interface creation method, select the calling method to obtain the data table information for data query.
[0015] Furthermore, in the management method for data query based on a public interface, in step 2, the file to be uploaded is imported according to the file data source and a data table is created according to the uploaded file, including: if the file to be uploaded is an Excel file, when creating the data table, the sheet page, field row, data row, whether to create a new table and select the data source are configured. If a new table is to be created, the table name is entered; otherwise, the data table is selected, and the mapping between the library table fields and the file fields is configured.
[0016] Furthermore, in the management method for data query based on a public interface, in step 2, the file to be uploaded is imported according to the file data source and a data table is created according to the uploaded file, including: if the file to be uploaded is a txt file, when creating the data table, the record delimiter, field delimiter, text identifier, field row, data row, whether to create a new table and select the data source are configured. If a new table is to be created, the table name is entered; otherwise, the data table is selected, and the mapping between the library table field and the file field is configured.
[0017] Furthermore, in the management method for data query based on a public interface, step 2 imports the file to be uploaded according to the file data source and creates a data table according to the uploaded file, including: if the file to be uploaded is a csv file, when creating the data table, configure the record delimiter, field delimiter, field row, data row, whether to create a new table and select the data source. If a new table is to be created, enter the table name, otherwise select the data table, and configure the mapping between the library table field and the file field.
[0018] Furthermore, in the management method for performing data query based on a public interface, in step 3, according to the public interface creation mode, a calling method is selected to obtain the information of the data table for data query, including:
[0019] For the interface created based on the data table, use POST call, set the interface call path and parameters, perform paging query, and pass the query conditions and sorting method in JSON format;
[0020] For the interface created based on SQL query, use GET call, set the interface call path and parameters, query by page, and splice query conditions in the path.
[0021] The present invention also provides a management device for data query based on a public interface, including a management database module, a management data table module, and a management public interface module.
[0022] The management database module manages database connections: configures data source code, data source name, database type, driver class, data source address, database name, user name, password and remarks, and uses JDBC to connect to the database to obtain data tables;
[0023] The management data table module manages the data table for data query:
[0024] Create data tables through web visual management, define table name, table description, status, field name, field notes, field length, default value, field type, whether it is primary key and whether null value is allowed,
[0025] And / or select to connect to the data source, import the existing data table according to the requirements, and obtain the library table information based on the imported data table.
[0026] And / or import the files to be uploaded according to the file data source and create a data table based on the uploaded files,
[0027] Management public interface module manages public interface and performs data query through public interface: select the public interface creation method, which includes creating interface based on data table and creating interface based on SQL query.
[0028] Create an interface based on the data table: select the data source, configure the data table attributes, select the interface code generation method, configure the interface code, and complete the interface creation.
[0029] Create an interface based on SQL query: configure SQL statements and verify SQL statements, automatically generate interface codes, and complete interface creation.
[0030] According to the public interface creation method, select the calling method to obtain the data table information for data query.
[0031] Furthermore, the management data table module of the management device for data query based on a public interface imports the file to be uploaded according to the file data source and creates a data table according to the uploaded file, including: if the file to be uploaded is an Excel file, when creating the data table, configure the sheet page, field row, data row, whether to create a new table and select the data source. If it is a new table, enter the table name, otherwise select the data table, and configure the mapping between the library table field and the file field.
[0032] Furthermore, the management data table module of the management device for data query based on a public interface imports the file to be uploaded according to the file data source and creates a data table according to the uploaded file, including: if the file to be uploaded is a txt file, when creating the data table, configure the record delimiter, field delimiter, text identifier, field row, data row, whether to create a new table and select the data source. If a new table is created, enter the table name, otherwise select the data table, and configure the mapping between the library table field and the file field.
[0033] Furthermore, the management data table module of the management device for data query based on a public interface imports the file to be uploaded according to the file data source and creates a data table according to the uploaded file, including: if the file to be uploaded is a csv file, when creating the data table, configure the record delimiter, field delimiter, field row, data row, whether to create a new table and select the data source. If a new table is created, enter the table name, otherwise select the data table, and configure the mapping between the library table field and the file field.
[0034] Furthermore, the management public interface module of the management device for performing data query based on the public interface selects a calling method according to the public interface creation mode, obtains the information of the data table for data query, and includes:
[0035] For the interface created based on the data table, use POST call, set the interface call path and parameters, perform paging query, and pass the query conditions and sorting method in JSON format;
[0036] For the interface created based on SQL query, use GET call, set the interface call path and parameters, query by page, and splice query conditions in the path.
[0037] The benefits of the present invention are:
[0038] The technical solution provided by the present invention can meet the data query and management needs of business systems such as the city brain, improve the flexibility and efficiency of data processing, improve user experience, and optimize the accuracy and reliability of data. Compared with the current conventional data management system, the present invention has the following technical advantages:
[0039] (1) Enhance system scalability and flexibility: The system can flexibly add or modify interface functions according to actual business needs. This flexibility helps to cope with the rapidly changing market environment and technological trends, ensuring that the system can continue to meet user needs;
[0040] (2) Improve the efficiency of data exchange and sharing: Through public interfaces, data exchange and sharing between different systems and platforms become more efficient and convenient, which reduces the complexity and error rate of data conversion and improves the speed and accuracy of data circulation;
[0041] (3) Reduce development and maintenance costs: The design and implementation of standardized interfaces enable developers to follow unified specifications and protocols for development, reducing development difficulty and costs. At the same time, centralized management of public interfaces also simplifies system maintenance and reduces the extra workload caused by interface changes.
[0042] (4) Promoting data standardization and normalization: It can further promote the development of data standardization and normalization, which will help eliminate data silos, promote the integration and utilization of data resources, and provide strong support for the development of technologies such as big data analysis and artificial intelligence;
[0043] (5) Support decision analysis and business optimization: It can provide strong support for decision analysis. Through real-time and accurate data indicators, users can better understand business conditions and market trends, providing strong data support for decision-making. At the same time, this method can also help users discover problems and bottlenecks in the business and provide guidance for business optimization. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 The invention relates to a database management flow chart.
[0045] Figure 2 The invention relates to a data table management flow chart.
[0046] Figure 3 The present invention relates to an interface creation process diagram.
[0047] Figure 4 The present invention relates to an interface calling flow chart. DETAILED DESCRIPTION
[0048] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it, but the embodiments are not intended to limit the present invention.
[0049] Example 1
[0050] The present invention provides a management method for data query based on a public interface, comprising:
[0051] Step 1: Manage database connection: configure data source code, data source name, database type, driver class, data source address, database name, user name, password and remarks, and use JDBC to connect to the database to obtain data tables.
[0052] A visual interface can be provided for users to enter information for data source connection. Users can enter and save relevant information such as data source address, database type, user name, password, etc.
[0053] After the entry is completed, based on the existing configuration, connect to the specified data source through JDBC (Java Database Connectivity) database connection technology, and select the corresponding driver according to the database type to verify the database connectivity.
[0054] The maintained data source information is displayed in the query list for providing to users in subsequent embodiments.
[0055] Step 2: Manage data tables for data query:
[0056] Create data tables through web visual management, define table name, table description, status, field name, field remarks, field length, default value, field type, whether it is primary key and whether null values are allowed.
[0057] The web visualization method is used to create data tables, providing a visual interface for users to maintain database tables, and they can enter table names, data table descriptions, field-related attributes and other information. The entered database tables are displayed in the query list for data maintenance and query.
[0058] You can also and / or choose to connect to a data source, import an existing data table as required, and obtain library table information based on the imported data table.
[0059] You can also import the files to be uploaded and create a data table based on the uploaded files according to the file data source. If it is an Excel file, configure the sheet page, field row, data row, whether to create a new table, select the data source, if it is a new table, enter the table name, otherwise select the data table, and configure the mapping between the library table field and the file field.
[0060] If it is a txt file, configure the record delimiter, field delimiter, text identifier, field row, data row, whether to create a new table, select the data source, if a new table is to be created, enter the table name, otherwise select the data table, and configure the mapping between the library table field and the file field.
[0061] If it is a CSV file, configure the record delimiter, field delimiter, field row, data row, whether to create a new table, and select the data source. If it is a new table, you need to enter the table name, otherwise select the data table and configure the mapping between the library table field and the file field.
[0062] You can also configure synchronization rules according to your needs and choose to append records or clear the table and write.
[0063] Step 3: Manage the public interface and query data through the public interface, query and maintain the interface information, provide users with a visual interface configuration and verification method, and parse the required information based on the returned results, so that users who know less about interface call operations can add interface information based on the visualization page, which is convenient for business users, maintenance personnel and general development role personnel to perform online interface configuration development. On the other hand, it provides a list of configured interfaces for the display system, which can be directly called and used.
[0064] Specifically:
[0065] Select the public interface creation method, which includes creating an interface based on a data table and creating an interface based on a SQL query.
[0066] Create an interface based on the data table: select the data source, configure the data table properties, select the interface code generation method, configure the interface code, and complete the interface creation.
[0067] Create an interface based on SQL query: configure SQL statements and verify them, automatically generate interface codes, and complete interface creation.
[0068] When selecting the interface code generation method, if you select custom code, enter the service code. If you select automatic generation, the system automatically generates a service number, which is used for subsequent interface calls. According to the SQL creation method, the interface code generation method is fixed to custom.
[0069] The interface is displayed in the query list and the interface data can be viewed for use by the front-end system call.
[0070] According to the public interface creation method, select the calling method to obtain the information of the data table for data query. This can further include:
[0071] For the interface created based on the data table, use POST call to perform paging query, set the interface call path and parameters, such as the standard path is / data / listAllData / {serviceCode}, and pass the query conditions and sorting method in JSON format.
[0072] For the interface created based on SQL query, use GET call, paging query, set the interface call path and parameters, for example, the standard path is / data / listAllBySql / {serviceCode}?queryParam=, and concatenate the query conditions in the path.
[0073] The above method provides an interface to query data information for display and use by the front-end system.
[0074] Example 2
[0075] The present invention also provides a management device for data query based on a public interface, including a management database module, a management data table module, and a management public interface module.
[0076] The management database module manages database connections: configures data source code, data source name, database type, driver class, data source address, database name, user name, password and remarks, and uses JDBC to connect to the database to obtain data tables;
[0077] The management data table module manages the data table for data query:
[0078] Create data tables through web visual management, define table name, table description, status, field name, field notes, field length, default value, field type, whether it is primary key and whether null value is allowed,
[0079] And / or select to connect to the data source, import the existing data table according to the requirements, and obtain the library table information based on the imported data table.
[0080] And / or import the files to be uploaded according to the file data source and create a data table based on the uploaded files,
[0081] Management public interface module manages public interface and performs data query through public interface: select the public interface creation method, which includes creating interface based on data table and creating interface based on SQL query.
[0082] Create an interface based on the data table: select the data source, configure the data table attributes, select the interface code generation method, configure the interface code, and complete the interface creation.
[0083] Create an interface based on SQL query: configure SQL statements and verify SQL statements, automatically generate interface codes, and complete interface creation.
[0084] According to the public interface creation method, select the calling method to obtain the data table information for data query.
[0085] As the information interaction and execution process between the modules in the above-mentioned device are based on the same concept as the embodiment of the method of the present invention, the specific contents can be found in the description of the embodiment of the method of the present invention and will not be repeated here.
[0086] Similarly, the device of the present invention can meet the data query and management needs of business systems such as the city brain, improve the flexibility and efficiency of data processing, improve user experience, and optimize the accuracy and reliability of data. Compared with the current conventional data management system, the present invention has the following technical advantages:
[0087] (1) Enhance system scalability and flexibility: The system can flexibly add or modify interface functions according to actual business needs. This flexibility helps to cope with the rapidly changing market environment and technological trends, ensuring that the system can continue to meet user needs;
[0088] (2) Improve the efficiency of data exchange and sharing: Through public interfaces, data exchange and sharing between different systems and platforms become more efficient and convenient, which reduces the complexity and error rate of data conversion and improves the speed and accuracy of data circulation;
[0089] (3) Reduce development and maintenance costs: The design and implementation of standardized interfaces enable developers to follow unified specifications and protocols for development, reducing development difficulty and costs. At the same time, centralized management of public interfaces also simplifies system maintenance and reduces the extra workload caused by interface changes.
[0090] (4) Promoting data standardization and normalization: It can further promote the development of data standardization and normalization, which will help eliminate data silos, promote the integration and utilization of data resources, and provide strong support for the development of technologies such as big data analysis and artificial intelligence;
[0091] (5) Support decision analysis and business optimization: It can provide strong support for decision analysis. Through real-time and accurate data indicators, users can better understand business conditions and market trends, providing strong data support for decision-making. At the same time, this method can also help users discover problems and bottlenecks in the business and provide guidance for business optimization.
[0092] It should be noted that not all steps and modules in the above-mentioned processes and device structures are necessary, and some steps or modules can be ignored according to actual needs. The execution order of each step is not fixed and can be adjusted as needed. The system structure described in the above-mentioned embodiments can be a physical structure or a logical structure, that is, some modules may be implemented by the same physical entity, or some modules may be implemented by multiple physical entities, or some components in multiple independent devices may be implemented together.
[0093] The above-described embodiments are only preferred embodiments for fully illustrating the present invention, and the protection scope of the present invention is not limited thereto. Equivalent substitutions or changes made by those skilled in the art based on the present invention are within the protection scope of the present invention. The protection scope of the present invention shall be subject to the claims.
Claims
1. A management method for data query based on a public interface, characterized in that include: Step 1: Manage database connection: configure data source code, data source name, database type, driver class, data source address, database name, user name, password and remarks, and use JDBC to connect to the database to obtain data tables; Step 2: Manage data tables for data query: Create data tables through web visual management, define table name, table description, status, field name, field notes, field length, default value, field type, whether it is primary key and whether null value is allowed, And / or select to connect to the data source, import the existing data table according to the requirements, and obtain the library table information based on the imported data table. And / or import the file to be uploaded according to the file data source and create a data table according to the uploaded file; Step 3: Manage the public interface and query data through the public interface: Select the public interface creation method. The public interface creation methods include creating an interface based on a data table and creating an interface based on a SQL query. Create an interface based on the data table: select the data source, configure the data table attributes, select the interface code generation method, configure the interface code, and complete the interface creation. Create an interface based on SQL query: configure SQL statements and verify SQL statements, automatically generate interface codes, and complete interface creation. According to the public interface creation method, select the calling method to obtain the data table information for data query.
2. A management method for data query based on a public interface according to claim 1, characterized in that In step 2, import the file to be uploaded according to the file data source and create a data table according to the uploaded file, including: if the file to be uploaded is an Excel file, when creating the data table, configure the sheet page, field row, data row, whether to create a new table and select the data source. If it is a new table, enter the table name, otherwise select the data table and configure the mapping between the library table field and the file field.
3. A management method for data query based on a public interface according to claim 1, characterized in that In step 2, import the file to be uploaded according to the file data source and create a data table according to the uploaded file, including: if the file to be uploaded is a txt file, when creating the data table, configure the record delimiter, field delimiter, text identifier, field row, data row, whether to create a new table and select the data source. If it is a new table, enter the table name, otherwise select the data table and configure the mapping between the library table field and the file field.
4. A management method for data query based on a public interface according to claim 1, characterized in that In step 2, import the file to be uploaded according to the file data source and create a data table according to the uploaded file, including: if the file to be uploaded is a CSV file, when creating the data table, configure the record delimiter, field delimiter, field row, data row, whether to create a new table and select the data source. If it is a new table, enter the table name, otherwise select the data table and configure the mapping between the library table field and the file field.
5. A management method for data query based on a public interface according to claim 1, characterized in that In step 3, according to the public interface creation method, select the calling method to obtain the data table information for data query, including: For the interface created based on the data table, use POST call, set the interface call path and parameters, perform paging query, and pass the query conditions and sorting method in JSON format; For the interface created based on SQL query, use GET call, set the interface call path and parameters, query by page, and splice query conditions in the path.
6. A management device for data query based on a public interface, characterized in that Including database management module, data table management module and public interface management module. The management database module manages database connections: configures data source code, data source name, database type, driver class, data source address, database name, user name, password and remarks, and uses JDBC to connect to the database to obtain data tables; The management data table module manages the data table for data query: Create data tables through web visual management, define table name, table description, status, field name, field notes, field length, default value, field type, whether it is primary key and whether null value is allowed, And / or select to connect to the data source, import the existing data table according to the requirements, and obtain the library table information based on the imported data table. And / or import the files to be uploaded according to the file data source and create a data table based on the uploaded files, Management public interface module manages public interface and performs data query through public interface: select the public interface creation method, which includes creating interface based on data table and creating interface based on SQL query. Create an interface based on the data table: select the data source, configure the data table attributes, select the interface code generation method, configure the interface code, and complete the interface creation. Create an interface based on SQL query: configure SQL statements and verify SQL statements, automatically generate interface codes, and complete interface creation. According to the public interface creation method, select the calling method to obtain the data table information for data query.
7. A management device for data query based on a public interface according to claim 6, characterized in that The data table management module imports the files to be uploaded according to the file data source and creates a data table based on the uploaded files, including: if the file to be uploaded is an Excel file, when creating a data table, configure the sheet page, field row, data row, whether to create a new table and select the data source. If it is a new table, enter the table name, otherwise select the data table and configure the mapping between the library table fields and the file fields.
8. A management device for data query based on a public interface according to claim 6, characterized in that The data table management module imports the files to be uploaded according to the file data source and creates a data table according to the uploaded files, including: if the file to be uploaded is a txt file, when creating the data table, configure the record delimiter, field delimiter, text identifier, field row, data row, whether to create a new table and select the data source. If a new table is created, enter the table name, otherwise select the data table and configure the mapping between the library table fields and the file fields.
9. A management device for data query based on a public interface according to claim 6, characterized in that The data table management module imports the files to be uploaded according to the file data source and creates a data table according to the uploaded files, including: if the file to be uploaded is a csv file, when creating the data table, configure the record delimiter, field delimiter, field row, data row, whether to create a new table and select the data source. If a new table is created, enter the table name, otherwise select the data table and configure the mapping between the library table fields and the file fields.
10. A management device for data query based on a public interface according to claim 6, characterized in that The management public interface module selects the calling method according to the public interface creation method, obtains the information of the data table for data query, including: For the interface created based on the data table, use POST call, set the interface call path and parameters, perform paging query, and pass the query conditions and sorting method in JSON format; For the interface created based on SQL query, use GET call, set the interface call path and parameters, query by page, and splice query conditions in the path.
Citation Information
Patent Citations
Interface data query method and data query engine for multi-source data
CN114490842A
Interface data integration method and device, computer equipment and storage medium
CN116541455A
