CN109062883B - Data table dynamic derivation method and device, computer equipment and storage medium - Google Patents

Data table dynamic derivation method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN109062883B
CN109062883B CN201810788103.7A CN201810788103A CN109062883B CN 109062883 B CN109062883 B CN 109062883B CN 201810788103 A CN201810788103 A CN 201810788103A CN 109062883 B CN109062883 B CN 109062883B
Authority
CN
China
Prior art keywords
data
configuration
target
source
export
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810788103.7A
Other languages
Chinese (zh)
Other versions
CN109062883A (en
Inventor
李源
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201810788103.7A priority Critical patent/CN109062883B/en
Priority to PCT/CN2018/106252 priority patent/WO2020015150A1/en
Publication of CN109062883A publication Critical patent/CN109062883A/en
Application granted granted Critical
Publication of CN109062883B publication Critical patent/CN109062883B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/174Form filling; Merging

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a data table dynamic exporting method and device, computer equipment and a storage medium. The data table dynamic derivation method comprises the following steps: acquiring a data export request, wherein the data export request comprises a target data table ID; inquiring a database based on the ID of the target data table, and acquiring a target configuration table corresponding to the ID of the target data table, wherein the target configuration table comprises at least two target configuration data, and each target configuration data comprises a table ID, a source table ID and a derivation field; traversing each target configuration data in the target configuration table, and acquiring a target query statement corresponding to the table ID based on the source table ID and the derived field; and acquiring target data based on the target query statement, storing the target data in an EXCEL table, and acquiring and deriving a target paging table corresponding to the table ID. The method can lead each data export request to rapidly export at least two target paging tables, and the process does not need to write or modify codes, thereby being beneficial to improving the efficiency of data paging export.

Description

Data table dynamic derivation method and device, computer equipment and storage medium
Technical Field
The present invention relates to the field of data processing, and in particular, to a method and an apparatus for dynamically exporting a data table, a computer device, and a storage medium.
Background
In the process of project development, there are often business requirements for exporting data into a data table in an EXCEL format, and particularly, the data needs to be exported into a plurality of data tables in the EXCEL format, that is, the data needs to be exported in pages, so that each data table contains data in different export fields. When data is exported in a paging mode, corresponding codes need to be written for exporting each data sheet, so that the code writing workload is large, the project development workload is increased, and the project development efficiency is reduced. Moreover, when the data is exported in the paging mode, the code needs to be modified when the paging content of the paging is changed, such as sequential modification, addition or deletion, and the like, so that the workload of exporting the data in the paging mode is large. In addition, when the data is exported in a paging mode, the code also needs to be modified when fields in the data table exported in each paging mode are changed, such as the order adjustment, addition, deletion and modification of the exported fields, so that the workload of exporting the data in the paging mode is increased. In summary, when data is exported in a paging manner in the project development process, corresponding codes need to be written or modified, so that the workload of the project development is greatly increased, project development errors are easily caused, and the quality and the efficiency of the project development are affected.
Disclosure of Invention
The embodiment of the invention provides a method and a device for dynamically exporting a data table, computer equipment and a storage medium, which aim to solve the problems of high workload and high possibility of errors in the current data paging export process.
A method for dynamically exporting a data table, comprising:
acquiring a data export request, wherein the data export request comprises a target data table ID;
querying a database based on the target data table ID to obtain a target configuration table corresponding to the target data table ID, wherein the target configuration table comprises at least two target configuration data, and each target configuration data comprises a table ID, a source table ID and a derived field;
traversing each target configuration data in the target configuration table, and acquiring a target query statement corresponding to the table ID based on the source table ID and the derived field;
and acquiring target data based on the target query statement, storing the target data in an EXCEL table, and acquiring and deriving a target paging table corresponding to the table ID.
A data table dynamic derivation apparatus, comprising:
the data export request acquisition module is used for acquiring a data export request, and the data export request comprises a target data table ID;
a target configuration table obtaining module, configured to query a database based on the target data table ID, and obtain a target configuration table corresponding to the target data table ID, where the target configuration table includes at least two target configuration data, and each target configuration data includes a table ID, a source table ID, and a derivation field;
a query statement obtaining module, configured to traverse each target configuration data in the target configuration table, and obtain a target query statement corresponding to the table ID based on the source table ID and the derived field;
and the target paging table acquisition module is used for acquiring target data based on the target query statement, storing the target data in an EXCEL table, and acquiring and deriving a target paging table corresponding to the table ID.
A computer device comprising a memory, a processor and a computer program stored in said memory and executable on said processor, said processor implementing the steps of the above data table dynamic derivation method when executing said computer program.
A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, implements the steps of the above method for dynamically deriving a data table.
According to the data table dynamic export method, the data table dynamic export device, the computer equipment and the storage medium, the target configuration table can be quickly inquired and obtained according to the target data table ID in the data export request; because the target configuration table comprises at least two target configuration data, the corresponding target query statement can be automatically and quickly acquired according to the source table ID and the export field in each target configuration data, manual intervention is not needed in the process, and the efficiency of data export is improved; and querying and acquiring target data based on each target query statement, and storing the target data in an EXCEL table, namely acquiring and exporting a corresponding target paging table. Because each target configuration table comprises at least two target configuration data, each target configuration data can derive one target paging table, so that each data derivation request can rapidly derive at least two target paging tables, and the process does not need to write or modify codes, thereby being beneficial to improving the efficiency of data paging derivation.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive labor.
FIG. 1 is a diagram of an application environment of a method for dynamically deriving a data table according to an embodiment of the present invention;
FIG. 2 is a flowchart of a method for dynamically deriving a table of data according to an embodiment of the present invention;
FIG. 3 is another flow chart of a method for dynamically deriving a data table according to an embodiment of the present invention;
FIG. 4 is another flow chart of a method for dynamically exporting a data table according to an embodiment of the present invention;
FIG. 5 is another flow chart of a method for dynamically exporting a data table according to an embodiment of the present invention;
FIG. 6 is another flow chart of a method for dynamically deriving a data table according to an embodiment of the present invention;
FIG. 7 is another flow chart of a method for dynamically deriving a data table according to an embodiment of the present invention;
FIG. 8 is a diagram of an apparatus for dynamically deriving data tables according to an embodiment of the present invention;
FIG. 9 is a schematic diagram of a computer device according to an embodiment of the invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The method for dynamically exporting the data table provided by the embodiment of the invention can be applied to an application environment shown in fig. 1, wherein a client communicates with a server through a network and is used for enabling the server to execute the operation of dynamically exporting the data table based on a data export request uploaded by the client. The client is also called a user side, and refers to a program corresponding to the server and providing local services for the client. The client may be installed in, but is not limited to, various personal computers, laptops, smart phones, tablets, and portable wearable devices. The server may be implemented as a stand-alone server or as a server cluster comprised of multiple servers.
In an embodiment, as shown in fig. 2, a method for dynamically exporting a data table is provided, which is described by taking the method as an example applied to the server in fig. 1, and the method for dynamically exporting a data table includes the following steps:
s10: a data export request is obtained, the data export request including a target data table ID.
The data export request is a request for triggering the server to perform data table dynamic export processing. The target data table ID is a data table ID corresponding to the data export request of this time, and the data table ID is an identifier for uniquely identifying the configuration table.
In this embodiment, a plurality of configuration tables are pre-stored in the database, and each configuration table corresponds to a data table ID, so that a subsequent query based on the data table ID can obtain the corresponding configuration table. Specifically, at least one configuration table is pre-stored in the database, and the configuration table is a compliance configuration table which is pre-configured by a user according to service requirements and subjected to deduplication and compliance verification, so that errors are avoided when the data table is dynamically exported subsequently based on the configuration table, and smooth dynamic export of the data table is guaranteed. The compliance configuration table is a configuration table obtained through the re-processing and compliance verification in advance.
In this embodiment, a script (i.e., a computer program) capable of dynamically exporting a data table is preconfigured in the server, and in a process of developing a project, if data needs to be exported in a paging manner, a user may trigger the data export request by clicking a "data export" button on a client or inputting a corresponding control instruction through a command line, and send the data export request to the server, so that the server receives the data export request, and thus the script preconfigured in the server may perform an operation of dynamically exporting the data table according to the data export request.
S20: and querying the database based on the target data table ID to obtain a target configuration table corresponding to the target data table ID, wherein the target configuration table comprises at least two target configuration data, and each target configuration data comprises a table ID, a source table ID and a derivation field.
The target configuration table is a compliance configuration table corresponding to the target data table ID acquired after querying the database based on the target data table ID. Specifically, the server takes the target data table ID as a query field, executes a query statement corresponding to the query field, and acquires a target configuration table corresponding to the target data table ID from the database.
The target configuration data is the configuration data configured in advance in the target configuration table, and each target configuration data can correspondingly derive a data table. That is, the target configuration table includes at least two target configuration data, so that the target configuration table can correspondingly export at least two data tables, and data paging export can be realized.
Specifically, each target configuration data includes a table ID, a source table ID, and a lead-out field, and may also include a table name, as shown in table one below. The table ID is an identifier for uniquely identifying each data table after the data page is exported, such as table 1 and table 2 in table one. The source table ID is an identifier that uniquely identifies the source data set from which data is to be exported, such as 1001 and 1002 in table one. The source data set is a data table for storing original data, and is a data source from which data export is required. The export field is used to define the fields contained in the data table after the page is exported, such as Name, Age, City, etc. in table one. The export field needs to be a field existing in the source data set corresponding to the source table ID to avoid the problem that data cannot be exported smoothly. The table name is used to define the table name of the data table after the page export, for example, in table one, "result export page 1" is the name of the data table after the data page export is performed based on the target configuration data of the SHEET _ 1. In this embodiment, in the target configuration table, the table IDs are sequentially incremented according to the number of rows in the target configuration table, so that the table IDs have uniqueness, and thus, the existence of two completely identical table IDs is avoided, and when data paging export is subsequently performed, the corresponding target configuration data cannot be uniquely determined.
Table-target configuration table
Form ID Name of table Source table ID Derived field
SHEET_1 Result derived page 1 1001 Name,Age,City
SHEET_2 Result derived paging 2 1002 Name,Level,……,Group
S30: and traversing each target configuration data in the target configuration table, and acquiring a target query statement corresponding to the table ID based on the source table ID and the derived field.
Specifically, the server traverses at least two target configuration data in the target configuration table, and obtains a target query statement based on the source table ID and the derived field in each target configuration data, so that the target query statement corresponds to the table ID thereof. In this embodiment, the source table ID may uniquely determine the source data set corresponding to the source table ID, the export field may limit the content included in the data table exported by paging, and the corresponding target query statement may be generated based on the source table ID and the export field, so that one data table may be exported correspondingly for each target query statement.
S40: and acquiring target data based on the target query statement, storing the target data in an EXCEL table, and acquiring and exporting a target paging table corresponding to the table ID.
The target data refers to a target query statement formed by using a source table ID and a lead-out field, a source data set corresponding to the source table ID is queried, and data corresponding to the lead-out field in the source data set is obtained. The target paging table is an EXCEL table formed based on target data, and is a data table acquired after the server performs a data paging export operation. Each target configuration data corresponds to a target paging table, in this embodiment, the target configuration data in the target configuration table includes at least two, so that the target paging table includes at least two.
Specifically, after querying a source data set corresponding to a source table ID based on a target query statement and acquiring target data, the server stores the target data in an EXCEL table, thereby generating a target paging table corresponding to the table ID and exporting the target paging table. Because the target data table ID in the data exporting request comprises at least two target configuration data, each target configuration data can generate and export a target paging table, the server executes the steps S20-S40 under the triggering of the data exporting request, the purpose of dynamically exporting the at least two target paging tables can be realized, the process can be automatically executed through a script pre-configured by the server, the code does not need to be written or modified, the code development amount is reduced, the probability of code errors is reduced, the efficiency of data paging exporting is improved, and the progress of project development is guaranteed.
Further, after the target page table is derived, the user can locate whether the target configuration data is problematic based on the content of each column in the target page table and the order between columns. Specifically, a user can visually see the content of each column and the sequence between columns in the target paging table, and if the content of each column is empty or the sequence between columns has a problem, the user can directly locate the target configuration data corresponding to the target paging table in the target configuration table, which may have an error, and does not need to look up codes to find the cause of the problem, which is helpful for improving the efficiency of project development.
In the dynamic export method of a data table provided in this embodiment, a target configuration table may be quickly obtained by querying according to a target data table ID in a data export request; because the target configuration table comprises at least two target configuration data, the corresponding target query statement can be automatically and quickly acquired according to the source table ID and the export field in each target configuration data, manual intervention is not needed in the process, and the efficiency of data export is improved; and inquiring and acquiring target data based on each target inquiry statement, and storing the target data in an EXCEL table to acquire and derive a corresponding target paging table. Because each target configuration table comprises at least two target configuration data, each target configuration data can derive one target paging table, so that each data derivation request can rapidly derive at least two target paging tables, and the process does not need to write or modify codes, thereby being beneficial to improving the efficiency of data paging derivation. The dynamic export mentioned in this embodiment means that after the initial code of the script pre-configured by the server is completed, when data paging export is subsequently performed based on the script, the code of the script does not need to be modified, and only the content of the target configuration table needs to be adjusted, which is beneficial to greatly reducing the workload of writing and modifying the code in the process of data paging export.
In an embodiment, the obtaining, in step S30, a target query statement corresponding to the form ID based on the source form ID and the derived field specifically includes the following steps: and processing the ID and the derived field of the source table by using an SQL query statement generating rule to obtain a target query statement corresponding to the ID of the table.
The SQL query statement generation rule is a preset rule for generating the SQL query statement according to the source table ID and the derived field. In this embodiment, the SQL query statement generation rule is specifically "Select derived field From source table ID", and the source table ID and derived field may be quickly processed based on the SQL query statement generation rule to generate the target query statement.
As shown in table one, for the target configuration data, i.e. short _1, when the SQL query statement generation rule is used to process the source table ID and the derived field, the target query statement "Select Name, Age, City From 1001" may be obtained. Accordingly, in step S40, the server executes a target query statement "Select Name, Age, City From 1001", to query and obtain target data corresponding to three export fields, Name, Age, and City, From the source data set corresponding to the source table ID 1001, and store the three export fields, Name, Age, and City, and the target data corresponding to the three export fields in the EXCEL table, so as to generate a target page table corresponding to the table ID, which may be named by the table Name, of the list _ 1.
In this embodiment, since the server stores the SQL query statement generation rule, the server can automatically generate a corresponding target query statement based on each target configuration data in the target configuration table, and does not need to manually write a corresponding code, so as to improve the efficiency of subsequently acquiring the target data based on the target query statement to acquire and derive the target paging table. It can be understood that, when each target configuration data in the target configuration table is traversed in step S30, each target configuration data is analyzed by the server background, and the source table ID and the derived field are processed by the SQL query statement generation rule, so that a corresponding target query statement can be obtained in the server background, and project developers are not required to compile corresponding query statements according to different derived fields and source table IDs, which reduces the workload of the project developers in compiling codes and is also beneficial to reducing the probability of errors in manually compiling codes.
In an embodiment, as shown in fig. 3, the acquiring, in step S40, target data based on the target query statement, and storing the target data in the EXCEL table specifically includes the following steps:
s41: and querying the source data set corresponding to the source table ID based on the target query statement, and acquiring target data corresponding to the derived field from the source data set.
Specifically, after acquiring the corresponding target query statement according to the source table ID and the export field in each target configuration data, the server may query the source data set corresponding to the source table ID, such as the source data set corresponding to 1001 in table one, by using the target query request, so as to acquire the content corresponding to the export field from the source data set as the target data.
S42: and storing the target data in an EXCEL table by adopting a JAVA reflection principle, and acquiring and deriving a target paging table corresponding to the table ID.
The JAVA reflection principle is that in the running state, for any class, all the attributes and methods of the class can be known; any method and attribute of any object can be called; this dynamically acquired information and the functionality of the method of dynamically invoking objects is referred to as the reflection mechanism of the java language.
In this embodiment, when the server writes a preconfigured script in the JAVA language in advance, during the execution of the script, after the target data corresponding to the derived field is obtained according to the target query statement, the derived field and the target data are stored in an EXCEL table by using the JAVA reflection principle, so as to obtain a target paging table corresponding to the table ID, and export the target paging table.
For example, in the first table, the server traverses the target configuration table, first traverses a target configuration data item, i.e., the schedule _1, acquires the target query statement based on three derived fields, i.e., the source table ID, the Name, the Age, and the City, first acquires the source data set LIST _1 corresponding to the source table ID according to the target query statement, and then acquires specific contents of the three derived fields, i.e., the Name, the Age, and the City, in the source data set LIST _1 as target data according to the derived fields, i.e., the Name, the Age, and the City, by using the JAVA reflection principle, and fills the target data corresponding to the three derived fields, i.e., the Name, the Age, and the City, in the EXCEL table in sequence to form a target score table. Then, the target configuration data, i.e. the page _2, is traversed to obtain the corresponding target paging table, until all the target configuration data in the target configuration table is obtained into the corresponding target paging table, and then all the target paging tables are exported.
In this embodiment, after an initial code of a script that can realize data paging export is written in advance in JAVA, after a server receives a data export request, the script is triggered to run to execute obtaining of at least two target configuration data in a target configuration table according to the data export request, after a corresponding target query statement is obtained according to a source table ID and a export field in each target configuration data, the target data is obtained based on the data query statement, and the target data is stored in an EXCEL table by using a JAVA reflection principle to obtain a target paging table corresponding to the target configuration data. In this embodiment, after the initial code writing is completed by the script preset in the server, in the process of executing the script to realize the paged export of the data, the dynamic export of the at least two target paging tables can be realized according to the content of the target configuration table without writing or modifying the code of the script, so that the workload of code writing or modifying in the paged export of the data is greatly reduced, and the efficiency of project development is favorably improved.
In an embodiment, when data is exported in a paging manner, a database needs to be queried based on a target data table ID in a data export request to obtain a target configuration table corresponding to the target data table, so that a database storing at least one configuration table, one data table ID corresponding to each configuration table, needs to be created in advance. As shown in fig. 4, namely before the step of obtaining the data export request in step S10, the method for dynamically exporting a data table further includes:
s51: the method includes obtaining a paging configuration request, where the paging configuration request includes an original configuration table, and the original configuration table includes at least two original configuration data, and each original configuration data includes a table ID, a source table ID, and a derivation field.
The paging configuration request is a request for triggering the server to configure a configuration table from which data paging can be derived. The original configuration table is a configuration table which is configured by a user according to the self service requirement. The original configuration data is the configuration data configured by the user in the original configuration table, and the user can determine the information of the data table needing to be exported in a paging mode according to the service requirement of the user. Each raw configuration data includes a table ID, a source table ID, and a derived field, and may also include a table name, as shown in table two. The table ID is an identifier for uniquely identifying the data table after data paging derivation according to the original configuration data. The source table ID is an identifier for uniquely identifying the source data set from which data paging is to be derived. The export field is the field to be included in the data table that defines the export of the page. The table names are used to define the name of each data table after the data pages are exported.
In this embodiment, a user may send a paging configuration request to the server through the client, where the paging configuration request carries the original configuration table shown in table two, so that the server obtains the original configuration table. In the original configuration table, the number of original configuration data is the number of data tables required to perform data paging derivation for the current paging configuration request. The sequence between the derived fields in the original configuration table is the sequence between the fields in the data table formed by the data paging derivation.
Original configuration table of table two
Form ID Name of table Source table ID Derived field
SHEET_1 Result derived page 1 1001 Name,Age,City
SHEET_2 Result derived page 2 1002 Name,Level,……,Group
SHEET_3 Result derived page 1 1001 Name,Age,City
SHEET_4 Result derived paging 4 1001 Name,City,Age
SHEET_5 Result derived paging 5 1001 Name,Age,City
SHEET_6 Result derived paging 6 1002 Name;Level;……;Group
S52: and performing deduplication processing on at least two original configuration data in the original configuration table to obtain a first configuration table.
Because the original configuration table in the current paging configuration request is the configuration table uploaded by the user independently, when the amount of the original configuration data configured in the original configuration table is large, a phenomenon of repeated configuration may occur, so that when data paging export is directly performed on the basis of the original configuration table in the following process, a problem that export efficiency is affected by repeated export may occur. The first configuration table is a configuration table obtained by performing deduplication processing on original configuration data in the original configuration table. Specifically, the performing of deduplication processing on at least two pieces of original configuration data refers to a process of processing at least two pieces of original configuration data in which a source table ID and a derived field in the original configuration data are the same, so that the first configuration table only includes one piece of original configuration data.
S53: and performing compliance verification on each original configuration data in the first configuration table, acquiring a compliance configuration table passing the compliance verification, and storing the compliance configuration table in a database.
After the first configuration table is obtained by performing deduplication processing on the original configuration table, the first configuration table further includes at least one piece of original configuration data, where each piece of original configuration data is configuration data that is filled by a user autonomously, and filling of the original configuration data may not meet a preset filling specification, so that the original configuration data cannot be executed by a script that is preset by a server, thereby causing a problem of a derivation error when data paging derivation is performed subsequently based on the first configuration table. Therefore, in step S53, compliance verification is performed on each original configuration data in the first configuration table to obtain a compliance configuration table that passes the compliance verification, so that each original configuration data in the compliance configuration table conforms to the preset filling specification, and the compliance configuration table is stored in the database to reduce the probability of errors occurring when the compliance configuration table in the database is subsequently called to perform data paging export.
In the data table dynamic export method provided in this embodiment, the first configuration table is obtained by performing deduplication processing between at least two pieces of original configuration data in the original configuration table carried by the paging configuration request, so as to avoid the need of performing repeated export operations when performing data paging export based on the at least two pieces of original configuration data in the first configuration table, thereby improving the efficiency of data paging export. Then, compliance verification is carried out on each original configuration data in the first configuration table, so that a compliance configuration table formed by all original configuration data passing the compliance verification is reserved, the error rate is reduced when data paging export is carried out subsequently based on the compliance configuration table, and the efficiency of data paging export is improved. It is understood that the compliance configuration tables configured through steps S51-S53 are stored in the database, and each compliance configuration table corresponds to a data table ID, so that the corresponding compliance configuration table is subsequently queried as the target configuration table based on the target data table ID in the data export request.
In one embodiment, the original configuration data table ID, source table ID, export field, and table name. As shown in fig. 5, the step S52 of performing deduplication processing on at least two original configuration data in the original configuration table to obtain the first configuration table specifically includes the following steps:
s521: and judging whether at least two original configuration data in the original configuration table have at least two duplicate configuration data with the same source table ID and the same derived field.
Specifically, after acquiring the current paging configuration request, the server acquires an original configuration table (as shown in table two) in the paging configuration request, and determines whether at least two pieces of original configuration data in the original configuration table have at least two pieces of duplicate configuration data with identical source table IDs and identical export fields. The at least two duplicate configuration data are at least two original configuration data having identical source table IDs and derived fields. Because the target query statement needs to be acquired based on the source table ID and the derived field in the target configuration data in the data paging deriving process, if two duplicate configuration data with the same source table ID and derived field exist, the target query statement formed subsequently may be the same, which may cause duplicate operations, and thus the efficiency is reduced. In this embodiment, the source table ID and the derived field are identical, which includes not only that the source table ID and the derived field have the same name, but also that the derived fields have the same sequence, because the sequence of the derived fields determines the sequence of the fields in the target page table derived from the subsequent data page. As shown in table two, the original configuration data corresponding to table IDs of short _1, short _3, and short _5 have the same source table ID and derived field, so the original configuration data corresponding to short _1, short _3, and short _5 are duplicate configuration data. However, the original configuration data of SHEET _4 is not identical to the sequence of the derived fields of three original configuration data, SHEET _1, SHEET _3, and SHEET _5, and is not duplicate configuration data.
S522: and if at least two pieces of repeated configuration data with the same source table ID and the same derived field exist, judging whether the table names in the at least two pieces of repeated configuration data are the same.
Since the target query statement is formed based on the source table ID and the derived field, a target paging table can be obtained based on each target query statement, and each target paging table is named by a table name, when at least two duplicate configuration data with the same source table ID and derived field exist, it is necessary to determine whether the table names in the at least two duplicate configuration data are the same. If the table names of the at least two duplicate configuration data are the same, at least two target paging tables with the same content and the same name are derived based on the at least two duplicate configuration data. If the table names of the two repeated configuration data are different, at least two target page tables with the same content and different names are derived when the two target page tables acquired based on the at least two repeated configuration data are derived, so that confusion occurs in the process of subsequently calling the at least two target page tables, repeated operation occurs in the data paging deriving process, and the data paging deriving efficiency is reduced.
S523: if the table names in the at least two repeated configuration data are the same, one repeated configuration data is reserved, and the first configuration table is obtained.
Specifically, if the table names in the at least two pieces of duplicate configuration data are the same, it means that the subsequent target query statements formed based on the source table ID and the derived field of the at least two pieces of duplicate configuration data are the same, and the table names obtained by executing the at least two same target query statements to the at least two target page table are also the same, and at this time, only one piece of duplicate configuration data needs to be retained, and the first configuration table from which the duplicate configuration data is removed from the original configuration table can be obtained. As shown in table two, the original configuration data corresponding to the shift _1, shift _3, and shift _5 are duplicate configuration data, and among the three duplicate configuration data, the table names of the shift _1 and shift _3 are the same, that is, the table names of the target page table formed subsequently based on the two duplicate configuration data, shift _1 and shift _3, are both "result derived page 1", and both are completely the same, so only one of the duplicate configuration data can be retained to obtain the first configuration table, and the same operation needs to be repeatedly executed when data page derivation is performed subsequently based on the original configuration data in the first configuration table, which affects the efficiency of data page derivation.
S524: and if the table names in the at least two repeated configuration data are different, generating prompt information, sending the prompt information to a client triggering a paging configuration request, acquiring modification information fed back by the client, and acquiring the first configuration table based on the modification information.
Specifically, if the table names in the at least two pieces of repeated configuration data are different, it is indicated that the target query statements formed subsequently based on the source table ID and the derivation field of the at least two pieces of repeated configuration data are the same, and at least two identical target query statements are executed to obtain different table names in the at least two target paging tables, that is, at least two target paging tables with the same content and different names are derived, so that repeated operation is performed in a subsequent data paging derivation process, and efficiency of data paging derivation is reduced.
In this embodiment, when the server determines that the table names of the at least two pieces of repeated configuration data are different, the server generates a prompt message, where the prompt message prompts that at least two pieces of repeated data with different table names exist in the original configuration table in the current paging configuration request, where the source table ID and the derived field are the same. Then, the server sends the generated prompt information to the client triggering the current paging configuration request, so that the user can view the prompt information through the client and feed back corresponding modification information, wherein the modification information is to delete at least one of at least two repeated configuration data so as to reserve one of the repeated configuration data. After obtaining the modification information fed back by the client, the server obtains a first configuration table based on the modification information.
In steps S521-S524, after it is determined that at least two pieces of duplicate configuration data with identical source table IDs and identical export fields exist in the original configuration table, according to whether the table names of the at least two pieces of duplicate configuration data are identical, the at least two pieces of duplicate configuration data are subjected to deduplication processing to obtain a first configuration table, so as to ensure that after a compliance configuration table is subsequently obtained based on the first configuration table, the compliance configuration table does not contain duplicate configuration data, so that repeated export operation is avoided when data paging export is subsequently performed, and efficiency of data paging export is improved.
In an embodiment, as shown in fig. 6, the performing compliance verification on each original configuration data in the first configuration table in step S53 to obtain a compliance configuration table that passes the compliance verification specifically includes the following steps:
s531: and judging whether a derived field exists in a source data set corresponding to the source table ID in each original configuration data in the first configuration table.
Specifically, after the server performs deduplication processing on the original configuration data in the original configuration table to obtain the first configuration table, compliance verification needs to be performed on each original configuration data in the first configuration table to determine that each original configuration data in the first configuration table can be executed by a script configured in advance by the server subsequently, so that smooth proceeding of data paging export based on the original configuration data subsequently is guaranteed.
When data paging export is carried out based on original configuration data, a target query statement is required to be formed based on a source table ID and an export field, and a source data set corresponding to the source table ID is obtained based on the target query statement query, so that target data corresponding to the export field is obtained.
S532: if the export field exists in the source data set corresponding to the source table ID, whether the export field comprises at least two export fields is judged.
Specifically, when a export field set in the original configuration data exists in the source data set corresponding to the source table ID in each original configuration data, it indicates that data paging export can be performed subsequently based on the original configuration data. Each original configuration data can be configured with one derived field or at least two derived fields, and if at least two derived fields are configured, preset symbols are required to be used for separating the derived fields from the derived fields. The preset symbol is a preset cutting symbol, and when data paging export is performed subsequently, if a script preset by a server identifies the preset symbol, two export fields before and after the preset symbol need to be cut. In this embodiment, the preset symbol may adopt a comma, and when the comma is adopted as a separator between any two derived fields in each original configuration data, the original configuration data passes compliance verification; otherwise, the compliance verification fails.
It can be understood that, in each original configuration data, if there is no corresponding export field set by the original configuration data in the source data set corresponding to the source table ID, prompt information needs to be generated, where the prompt information prompts that there is no corresponding export field in the source data set corresponding to the source table ID. Further, the prompt message may also display all fields existing in the source data set corresponding to the source table ID for the user to select. Then, the server sends the prompt information to the client terminal triggering the current paging configuration request, so that the user can check the prompt information through the client terminal and feed back corresponding modification information.
S533: and if the derived field comprises at least two derived fields, judging whether a separator between any two derived fields is matched with a preset symbol, and if so, acquiring a compliance configuration table passing compliance verification.
In this embodiment, if the derived field of any original configuration data includes at least two derived fields, it needs to determine whether a separator between any two derived fields matches a preset symbol; if the separator between any two derived fields is matched with a preset symbol, acquiring a compliance configuration table passing compliance verification; and if the separators between any two derived fields are not matched with the preset symbols, sending prompt information to the client triggering the paging configuration request so as to prompt a user to modify through the client until the separators between any two derived fields in all the original configuration data are matched with the preset symbols.
If the preset symbol is comma, the two original configuration data, namely SHEET _2 and SHEET _4 shown in the table two, respectively comprise at least three derived fields, and as commas are adopted as separators between any two derived fields of the original configuration data, namely SHEET _2, and are matched with the preset symbol, the original configuration data passes compliance verification; and when any two derived fields of the original configuration data of SHEET _4 adopt the semicolon as a separator and are not matched with the preset symbol, prompt information needs to be generated and sent to a client triggering the current paging configuration request to prompt a user to modify the corresponding separator, and a compliance configuration table passing compliance verification is obtained until all the original configuration data in the first configuration table pass compliance verification.
S534: and if the export field does not comprise at least two export fields, acquiring a compliance configuration table passing the compliance check.
In this embodiment, if there are derived fields in the source data set corresponding to the source table ID in any original configuration data table, and the derived fields do not include at least two derived fields, the step of determining whether the separator between any two derived fields matches the preset symbol is not needed, and it is directly determined that the original configuration data is compliant and passes the verification. And when all the original configuration data in the first configuration table pass the compliance verification, acquiring a compliance configuration table passing the compliance verification. As can be appreciated, the compliance configuration table corresponds to a data table ID, and the data table ID is stored in association with the compliance configuration table in the data table for subsequent retrieval of the corresponding compliance configuration table based on a query of the data table ID.
In steps S531-S534, compliance verification is performed on each original configuration data in the first configuration table obtained after deduplication processing of the original configuration table to obtain a compliance configuration table that passes compliance verification, so that subsequent data paging export based on the compliance configuration table can be performed smoothly, and the problem of export errors occurring in the data paging export process is avoided. Specifically, the server first judges whether a corresponding export field exists in the source data set corresponding to the source table ID, so as to avoid the situation that the corresponding target data cannot be found by the subsequent target query statement formed based on the source table ID and the export field, thereby ensuring that the subsequent data is exported in a paging manner smoothly. Then, when the export fields exist in the source data set corresponding to the source table ID, the server needs to ensure that the separators between any two export fields are matched with the preset symbols, so that when data paging export is subsequently performed, field separation can be performed based on the preset symbols, which is beneficial to ensuring smooth data paging export.
In one embodiment, after each compliance configuration table is obtained in step S50, each compliance configuration table is configured with a corresponding data table ID, so that each compliance configuration table corresponds to a data table ID, and the compliance configuration table and the data table ID are stored in the database in an associated manner. After the compliance configuration table is obtained and stored in the database, the user may modify the compliance configuration table in the database according to a new service requirement or other requirements to adjust the sequence of the original configuration data in the compliance configuration table, or adjust the contents of the source table ID, the export field, the table name, and the like in each original configuration data, so that the updated compliance configuration table better meets the user requirement.
As shown in fig. 7, after step S50, i.e. after the step of storing the compliance configuration table in the database, the data table dynamic derivation method includes the steps of:
s61: and acquiring a data modification request, wherein the data modification request comprises the ID and the modification identification of the data table to be modified.
Wherein the data modification request is a request for triggering the server to modify the rule configuration table. And the ID of the data table to be modified is used for determining a compliance configuration table which needs to be modified by the data modification request. The modification identifier is an identifier for performing a modification operation, and each modification identifier corresponds to a modification function. In this embodiment, the modification identifier includes a deletion identifier, an addition identifier, and a replacement identifier.
S62: and querying the database according to the ID of the data table, and acquiring a compliance configuration table corresponding to the ID of the data table as a configuration table to be modified.
Specifically, after acquiring the data modification request, the server queries the database based on the data table ID in the data modification request, and acquires the compliance configuration table corresponding to the data table ID as the configuration table to be modified. The configuration table to be modified is a compliance configuration table which needs to be modified in the data modification request.
S63: and modifying the configuration table to be modified by adopting a modification function corresponding to the modification identifier to obtain the modified compliance configuration table.
Specifically, after the server acquires the configuration table to be modified, the configuration table to be modified is modified based on the modification function corresponding to the modification identifier in the data modification request, so as to acquire the modified compliance configuration data. In this embodiment, after receiving the data modification request, the server may enter a corresponding information modification interface according to the modification identifier in the data modification request, receive a modification parameter input by the user on the information modification interface, transfer the modification parameter to the modification function corresponding to the modification identifier, and modify the configuration table to be modified based on the modification function.
For example, if the modification identifier is a deletion identifier, the modification function corresponding to the deletion identifier is a deletion function, and a corresponding information modification interface is entered according to the deletion identifier, so that a user inputs a corresponding modification parameter on the information modification interface, and if original configuration data needs to be deleted, the modification parameter is a form ID; if some export fields in the original configuration data need to be deleted, the modification parameters are the table ID and the export field to be deleted. After receiving the modification parameters, the server transmits the modification parameters to the corresponding deletion function, and deletes the configuration table to be modified by using the deletion function to obtain the modified compliance configuration table, so that the modified compliance configuration table better meets the requirements of users.
For example, if the modification identifier is an added identifier, the modification function corresponding to the added identifier is an added function, and the corresponding information modification interface is entered according to the added identifier, so that the user inputs the corresponding modification parameter on the information modification interface, and if an original configuration data needs to be added, the modification parameter is a form ID, a source form ID and a lead-out field; if an export field in the original configuration data needs to be added, the modification parameters are the table ID and the export field that needs to be added. After receiving the modification parameters, the server transmits the modification parameters to the corresponding increasing functions, and performs increasing processing on the configuration table to be modified by using the increasing functions to obtain the modified compliance configuration table, so that the modified compliance configuration table better meets the requirements of users.
For example, if the modification identifier is a replacement identifier, the modification function corresponding to the replacement identifier is a replacement function, and a corresponding information modification interface is entered according to the replacement identifier, so that a user inputs a corresponding modification parameter on the information modification interface; if the table name in the original configuration data needs to be modified, the modification parameters are the table ID and the replaced table name; if the derived field of an original configuration parameter needs to be modified, the modified parameters are the form ID and the modified derived field. After receiving the modification parameters, the server transmits the modification parameters to the corresponding replacement functions, and performs replacement processing on the configuration table to be modified by using the replacement functions, namely deleting the content corresponding to the modification parameters before modification and replacing the content with the content corresponding to the modification parameters to obtain the modified compliance configuration table, so that the modified compliance configuration table better meets the requirements of users.
In the dynamic export method of data table provided by this embodiment, the user can respond to the user 'S requirement in time through steps S61-S63, and update the compliance configuration table in the database to make it more suitable for the user' S requirement. When the data paging export is carried out based on the compliance configuration table, the script which is preset by the server and can carry out data paging export does not need to carry out code modification, and only needs to modify the original configuration parameters in the compliance configuration table, so that the process can effectively reduce the workload of code compiling and modifying in the project development process, and can be beneficial to accelerating the progress of the project development.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by functions and internal logic of the process, and should not limit the implementation process of the embodiments of the present invention in any way.
In an embodiment, a data table dynamic derivation apparatus is provided, and the data table dynamic derivation apparatus corresponds to the data table dynamic derivation methods in the above embodiments one to one. As shown in fig. 8, the data table dynamic derivation apparatus includes an derivation request obtaining module 10, a target configuration table obtaining module 20, a query statement obtaining module 30, and a target paging table obtaining module 40. The functional modules are explained in detail as follows:
export request acquisition module 10 is configured to acquire a data export request, where the data export request includes a target data table ID.
And a target configuration table obtaining module 20, configured to query the database based on the target data table ID, and obtain a target configuration table corresponding to the target data table ID, where the target configuration table includes at least two target configuration data, and each target configuration data includes a table ID, a source table ID, and a derived field.
And the query statement acquisition module 30 is configured to traverse each target configuration data in the target configuration table, and acquire a target query statement corresponding to the table ID based on the source table ID and the derived field.
And the target paging table obtaining module 40 is configured to obtain target data based on the target query statement, store the target data in the EXCEL table, and obtain and derive a target paging table corresponding to the table ID.
Preferably, the query statement obtaining module 30 is configured to process the source table ID and the derived field by using the SQL query statement generation rule, and obtain the target query statement corresponding to the table ID.
Preferably, the target page table obtaining module 40 includes a target data obtaining unit 41 and a page table obtaining unit 42.
A target data obtaining unit 41, configured to query the source data set corresponding to the source table ID based on the target query statement, and obtain target data corresponding to the export field from the source data set.
And the paging table acquisition unit 42 is configured to store the target data in the EXCEL table by using the JAVA reflection principle, and acquire and derive a target paging table corresponding to the table ID.
Preferably, the data table dynamic derivation apparatus further includes a configuration request obtaining unit 51, a deduplication processing unit 52, and a compliance verification unit 53.
The configuration request obtaining unit 51 is configured to obtain a paging configuration request, where the paging configuration request includes an original configuration table, the original configuration table includes at least two original configuration data, and each original configuration data includes a table ID, a source table ID, and a derivation field.
The deduplication processing unit 52 is configured to perform deduplication processing on at least two pieces of original configuration data in the original configuration table to obtain a first configuration table.
And the compliance checking unit 53 is configured to perform compliance checking on each piece of original configuration data in the first configuration table, obtain a compliance configuration table that passes the compliance checking, and store the compliance configuration table in the database.
Preferably, the raw configuration data further comprises a table name.
The deduplication processing unit 52 includes a duplication judgment subunit 521, a name judgment subunit 522, a first deduplication processing unit 523, and a second deduplication processing unit 524.
A repeated judging subunit 521, configured to judge whether at least two pieces of repeated configuration data with identical source table IDs and derived fields exist in at least two pieces of original configuration data in the original configuration table.
A name determining subunit 522, configured to determine whether the table names in the at least two duplicate configuration data are the same, if there are at least two duplicate configuration data whose source table ID and derived field are completely the same.
A first duplicate removal processing unit 523, configured to reserve one duplicate configuration data and obtain a first configuration table if the table names in at least two duplicate configuration data are the same.
The second duplicate removal processing unit 524 is configured to generate a prompt message if the table names in the at least two duplicate configuration data are different, send the prompt message to the client that triggers the paging configuration request, obtain modification information fed back by the client, and obtain the first configuration table based on the modification information.
Preferably, the compliance checking unit 53 includes a field existence judging subunit 531, a field number judging subunit 532, a first compliance checking subunit 533, and a second compliance checking subunit 534.
A field existence determining subunit 531, configured to determine whether a derived field exists in the source data set corresponding to the source table ID in each original configuration data in the first configuration table.
A field number determining subunit 532, configured to determine whether the derived field includes at least two derived fields if the derived field exists in the source data set corresponding to the source table ID.
The first compliance verification subunit 533, configured to, if the derived field includes at least two derived fields, determine whether a separator between any two derived fields matches the preset symbol, and if so, obtain a compliance configuration table that the compliance verification passes.
A second compliance checking subunit 534, configured to obtain a compliance configuration table that the compliance checking passes if the derived field does not include at least two derived fields.
Preferably, each compliance configuration table corresponds to a data table ID.
The data table dynamic derivation device further includes a modification request acquisition unit 61, a to-be-modified configuration table acquisition unit 62, and a configuration table modification processing unit 63.
A modification request obtaining unit 61, configured to obtain a data modification request, where the data modification request includes a data table ID, a table ID, and a modification identifier.
And a to-be-modified configuration table obtaining unit 62, configured to query the database according to the data table ID, and obtain the compliance configuration table corresponding to the data table ID as the to-be-modified configuration table.
And the configuration table modification processing unit 63 is configured to modify the configuration table to be modified by using a modification function corresponding to the modification identifier, and obtain a modified compliance configuration table.
For specific limitations of the apparatus for dynamically deriving a data table, reference may be made to the above limitations of the method for dynamically deriving a data table, which are not described in detail herein. All or part of the modules in the above data table dynamic derivation apparatus can be implemented by software, hardware and their combination. The modules can be embedded in a hardware form or independent of a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, and the internal structure thereof may be as shown in fig. 9. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used for a compliance configuration table and a target paging table, as well as other data formed during the data paging export process. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method for dynamic derivation of a data table.
In one embodiment, there is provided a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program: acquiring a data export request, wherein the data export request comprises a target data table ID; inquiring a database based on the ID of the target data table, and acquiring a target configuration table corresponding to the ID of the target data table, wherein the target configuration table comprises at least two target configuration data, and each target configuration data comprises a table ID, a source table ID and a derived field; traversing each target configuration data in the target configuration table, and acquiring a target query statement corresponding to the table ID based on the source table ID and the derived field; and acquiring target data based on the target query statement, storing the target data in an EXCEL table, and acquiring and exporting a target paging table corresponding to the table ID.
In an embodiment, the processor, when executing the computer program, performs the steps of: and processing the ID and the derived field of the source table by using an SQL query statement generating rule to obtain a target query statement corresponding to the ID of the table.
In an embodiment, the processor, when executing the computer program, performs the steps of: inquiring a source data set corresponding to the source table ID based on the target inquiry statement, and acquiring target data corresponding to the derived field from the source data set; and storing the target data in an EXCEL table by adopting a JAVA reflection principle, and acquiring and deriving a target paging table corresponding to the table ID.
In an embodiment, prior to the step of obtaining the data export request, the processor when executing the computer program further performs the steps of: obtaining a paging configuration request, wherein the paging configuration request comprises an original configuration table, the original configuration table comprises at least two pieces of original configuration data, and each piece of original configuration data comprises a table ID, a source table ID and a derived field; carrying out duplicate removal processing on at least two original configuration data in the original configuration table to obtain a first configuration table; and performing compliance verification on each original configuration data in the first configuration table, acquiring a compliance configuration table passing the compliance verification, and storing the compliance configuration table in a database.
In one embodiment, the raw configuration data also includes a table name. The processor when executing the computer program realizes the following steps: judging whether at least two original configuration data in the original configuration table have at least two repeated configuration data with completely same source table ID and export field; if at least two pieces of repeated configuration data with the same source table ID and the same derived field exist, judging whether the table names in the at least two pieces of repeated configuration data are the same; if the table names in the at least two repeated configuration data are the same, one repeated configuration data is reserved, and a first configuration table is obtained; and if the table names in the at least two repeated configuration data are different, generating prompt information, sending the prompt information to a client triggering a paging configuration request, acquiring modification information fed back by the client, and acquiring the first configuration table based on the modification information.
In an embodiment, the processor, when executing the computer program, performs the steps of: judging whether a derived field exists in a source data set corresponding to a source table ID in each original configuration data in the first configuration table; if the export fields exist in the source data set corresponding to the source table ID, judging whether the export fields contain at least two export fields; if the derived field comprises at least two derived fields, judging whether a separator between any two derived fields is matched with a preset symbol, and if so, acquiring a compliance configuration table passing compliance verification; and if the export field does not contain at least two export fields, acquiring a compliance configuration table passing the compliance verification.
In one embodiment, each compliance configuration table corresponds to a data table ID. After the step of storing the compliance configuration table in the database, the processor when executing the computer program further performs the steps of: acquiring a data modification request, wherein the data modification request comprises a data table ID, a table ID and a modification identifier; inquiring a database according to the ID of the data table, and acquiring a compliance configuration table corresponding to the ID of the data table as a configuration table to be modified; and modifying the configuration table to be modified by adopting a modification function corresponding to the modification identifier to obtain the modified compliance configuration table.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of: acquiring a data export request, wherein the data export request comprises a target data table ID; inquiring a database based on the ID of the target data table, and acquiring a target configuration table corresponding to the ID of the target data table, wherein the target configuration table comprises at least two target configuration data, and each target configuration data comprises a table ID, a source table ID and a derived field; traversing each target configuration data in the target configuration table, and acquiring a target query statement corresponding to the table ID based on the source table ID and the derived field; and acquiring target data based on the target query statement, storing the target data in an EXCEL table, and acquiring and exporting a target paging table corresponding to the table ID.
In an embodiment, the computer program when executed by the processor performs the steps of: and processing the ID of the source table and the derived field by using an SQL query statement generating rule to obtain a target query statement corresponding to the ID of the table.
In an embodiment, the computer program when executed by the processor performs the steps of: inquiring a source data set corresponding to the source table ID based on the target query statement, and acquiring target data corresponding to the derived field from the source data set; and storing the target data in an EXCEL table by adopting a JAVA reflection principle, and acquiring and deriving a target paging table corresponding to the table ID.
In an embodiment, the computer program when executed by the processor further performs the steps of, prior to the step of obtaining a data export request: obtaining a paging configuration request, wherein the paging configuration request comprises an original configuration table, the original configuration table comprises at least two pieces of original configuration data, and each piece of original configuration data comprises a table ID, a source table ID and a derived field; performing deduplication processing on at least two original configuration data in the original configuration table to obtain a first configuration table; and performing compliance verification on each original configuration data in the first configuration table, acquiring a compliance configuration table passing the compliance verification, and storing the compliance configuration table in a database.
In one embodiment, the raw configuration data also includes a table name. The computer program when executed by the processor further realizes the steps of: judging whether at least two original configuration data in the original configuration table have at least two repeated configuration data with completely identical source table ID and derived fields; if at least two pieces of repeated configuration data with completely same source table ID and derived field exist, judging whether the table names in the at least two pieces of repeated configuration data are the same; if the table names in the at least two repeated configuration data are the same, one repeated configuration data is reserved, and a first configuration table is obtained; and if the table names in the at least two repeated configuration data are different, generating prompt information, sending the prompt information to a client triggering a paging configuration request, acquiring modification information fed back by the client, and acquiring the first configuration table based on the modification information.
In an embodiment, the computer program when executed by the processor performs the steps of: judging whether a derived field exists in a source data set corresponding to a source table ID in each original configuration data in the first configuration table; if the export field exists in the source data set corresponding to the source table ID, judging whether the export field contains at least two export fields; if the derived fields comprise at least two derived fields, judging whether separators between any two derived fields are matched with preset symbols, and if so, acquiring a compliance configuration table which passes compliance verification; and if the export field does not contain at least two export fields, acquiring a compliance configuration table passing the compliance verification.
In one embodiment, each compliance configuration table corresponds to a data table ID. After the step of storing the compliance configuration table in the database, the computer program when executed by the processor further performs the steps of: acquiring a data modification request, wherein the data modification request comprises a data table ID, a table ID and a modification identifier; inquiring a database according to the ID of the data table, and acquiring a compliance configuration table corresponding to the ID of the data table as a configuration table to be modified; and modifying the configuration table to be modified by adopting a modification function corresponding to the modification identifier to obtain the modified compliance configuration table.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above may be implemented by hardware instructions of a computer program, which may be stored in a non-volatile computer-readable storage medium, and when executed, may include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include non-volatile and/or volatile memory. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), synchronous Link (Synchlink) DRAM (SLDRAM), Rambus (Rambus) direct RAM (RDRAM), direct bused dynamic RAM (DRDRAM), and bused dynamic RAM (RDRAM).
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions.
The above examples are only intended to illustrate the technical solution of the present invention, and not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (8)

1. A method for dynamically exporting a data table, comprising:
obtaining a paging configuration request, wherein the paging configuration request comprises an original configuration table, the original configuration table comprises at least two original configuration data, and each original configuration data comprises a table ID, a source table ID and a derived field;
performing deduplication processing on at least two original configuration data in the original configuration table to obtain a first configuration table;
judging whether the export field exists in a source data set corresponding to the source table ID in each original configuration data in the first configuration table;
if the export field exists in the source data set corresponding to the source table ID, judging whether the export field contains at least two export fields;
if the derived fields comprise at least two derived fields, judging whether separators between any two derived fields are matched with a preset symbol, and if so, acquiring a compliance configuration table passing compliance verification;
if the export fields do not comprise at least two export fields, acquiring a compliance configuration table passing compliance verification, and storing the compliance configuration table in a database;
acquiring a data export request, wherein the data export request comprises a target data table ID;
querying a database based on the target data table ID to obtain a target configuration table corresponding to the target data table ID, wherein the target configuration table comprises at least two target configuration data, and each target configuration data comprises a table ID, a source table ID and a derived field;
traversing each target configuration data in the target configuration table, and acquiring a target query statement corresponding to the table ID based on the source table ID and the derived field;
and querying a source data set corresponding to the source table ID based on the target query statement, acquiring target data corresponding to the export field from the source data set, storing the target data in an EXCEL table, and acquiring and exporting a target paging table corresponding to the table ID.
2. The method for dynamically exporting data tables according to claim 1, wherein said obtaining a target query statement corresponding to said table ID based on said source table ID and said export field comprises:
and processing the source table ID and the derived field by using an SQL query statement generating rule to obtain a target query statement corresponding to the table ID.
3. The method of dynamic export of data sheets of claim 1, wherein storing the target data in an EXCEL sheet comprises:
and storing the target data in an EXCEL table by adopting a JAVA reflection principle, and acquiring and deriving a target paging table corresponding to the table ID.
4. The method of claim 1, wherein the raw configuration data further includes a table name;
the performing deduplication processing on at least two pieces of original configuration data in the original configuration table to obtain a first configuration table includes:
judging whether at least two original configuration data in the original configuration table have at least two repeated configuration data with completely identical source table IDs and derived fields;
if at least two pieces of repeated configuration data with completely identical source table IDs and derived fields exist, judging whether the table names in the at least two pieces of repeated configuration data are identical or not;
if the table names in at least two pieces of repeated configuration data are the same, reserving one piece of repeated configuration data to obtain a first configuration table;
and if the table names in at least two repeated configuration data are different, generating prompt information, sending the prompt information to a client triggering the paging configuration request, acquiring modification information fed back by the client, and acquiring a first configuration table based on the modification information.
5. The method of claim 4, wherein each compliance configuration table corresponds to a table ID;
after the step of storing the compliance configuration table in a database, the data table dynamic derivation method comprises the steps of:
acquiring a data modification request, wherein the data modification request comprises a data table ID, a table ID and a modification identifier;
inquiring a database according to the data table ID, and acquiring a compliance configuration table corresponding to the data table ID as a configuration table to be modified;
and modifying the configuration table to be modified by adopting a modification function corresponding to the modification identifier to obtain a modified compliance configuration table.
6. An apparatus for dynamically deriving a data table, comprising:
a configuration request obtaining unit, configured to obtain a paging configuration request, where the paging configuration request includes an original configuration table, the original configuration table includes at least two original configuration data, and each original configuration data includes a table ID, a source table ID, and a derived field;
the duplicate removal processing unit is used for carrying out duplicate removal processing on at least two original configuration data in the original configuration table to obtain a first configuration table;
a field existence judging subunit, configured to judge whether the derived field exists in a source data set corresponding to the source table ID in each original configuration data in the first configuration table;
a field number judging subunit, configured to, if the derived field exists in the source data set corresponding to the source table ID, judge whether the derived field includes at least two derived fields;
the first compliance verification subunit is configured to, if the derived field includes at least two derived fields, determine whether a separator between any two derived fields matches a preset symbol, and if the separator matches the preset symbol, obtain a compliance configuration table that passes compliance verification;
the second compliance verification subunit is used for acquiring a compliance configuration table passing compliance verification if the derived fields do not contain at least two derived fields, and storing the compliance configuration table in a database;
the data export request acquisition module is used for acquiring a data export request, and the data export request comprises a target data table ID;
a target configuration table obtaining module, configured to query a database based on the target data table ID, and obtain a target configuration table corresponding to the target data table ID, where the target configuration table includes at least two target configuration data, and each target configuration data includes a table ID, a source table ID, and a derived field;
a query statement obtaining module, configured to traverse each target configuration data in the target configuration table, and obtain a target query statement corresponding to the table ID based on the source table ID and the derived field;
and the target paging table acquisition module is used for inquiring the source data set corresponding to the source table ID based on the target query statement, acquiring target data corresponding to the export field from the source data set, storing the target data in the EXCEL table, and acquiring and exporting the target paging table corresponding to the table ID.
7. Computer device comprising a memory, a processor and a computer program stored in said memory and executable on said processor, characterized in that said processor implements the steps of the method for dynamic derivation of a data table according to any of claims 1 to 5 when executing said computer program.
8. A computer-readable storage medium, in which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of the method for dynamically deriving a data table according to any of claims 1 to 5.
CN201810788103.7A 2018-07-18 2018-07-18 Data table dynamic derivation method and device, computer equipment and storage medium Active CN109062883B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810788103.7A CN109062883B (en) 2018-07-18 2018-07-18 Data table dynamic derivation method and device, computer equipment and storage medium
PCT/CN2018/106252 WO2020015150A1 (en) 2018-07-18 2018-09-18 Method and device for dynamically exporting data table, computer apparatus, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810788103.7A CN109062883B (en) 2018-07-18 2018-07-18 Data table dynamic derivation method and device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109062883A CN109062883A (en) 2018-12-21
CN109062883B true CN109062883B (en) 2022-07-26

Family

ID=64817061

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810788103.7A Active CN109062883B (en) 2018-07-18 2018-07-18 Data table dynamic derivation method and device, computer equipment and storage medium

Country Status (2)

Country Link
CN (1) CN109062883B (en)
WO (1) WO2020015150A1 (en)

Families Citing this family (28)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109710859A (en) * 2019-01-21 2019-05-03 北京字节跳动网络技术有限公司 Data query method and apparatus
CN109902272B (en) * 2019-01-28 2024-02-06 平安科技(深圳)有限公司 Electronic form data processing method, electronic form data processing device, computer equipment and storage medium
CN110119319B (en) * 2019-03-29 2021-09-03 北京康爱营养科技股份有限公司 Interface matching method and device
CN110377649B (en) * 2019-06-17 2023-07-14 中国平安财产保险股份有限公司 Construction and query methods, devices, equipment and storage medium of tagged data
CN110413974A (en) * 2019-07-26 2019-11-05 北京恒华伟业科技股份有限公司 Form template configuration and device, table deriving method and device
CN110704523B (en) * 2019-09-06 2023-08-11 中国平安财产保险股份有限公司 Data export method, device, equipment and computer readable storage medium
CN112699114A (en) * 2019-10-22 2021-04-23 合肥美亚光电技术股份有限公司 Tire formula data processing method and system, detection device and management device
CN111026800B (en) * 2019-12-09 2023-07-21 爱信诺征信有限公司 Data export method and device, electronic equipment and storage medium
CN111290745A (en) * 2020-02-11 2020-06-16 车配齐(珠海横琴)科技有限公司 Device and method for realizing general data export
CN111367976A (en) * 2020-02-28 2020-07-03 平安医疗健康管理股份有限公司 Method and device for exporting EXCEL file data based on JAVA reflection mechanism
CN111597240A (en) * 2020-04-22 2020-08-28 深圳追一科技有限公司 Data export method, data export device, computer equipment and storage medium
CN112417012A (en) * 2020-04-29 2021-02-26 上海哔哩哔哩科技有限公司 Data processing method and system
CN111597235B (en) * 2020-05-21 2024-03-08 北京明略昭辉科技有限公司 Data processing method and device and electronic equipment
CN111708917A (en) * 2020-06-10 2020-09-25 武汉钢铁有限公司 Steel report data acquisition system
CN111814442A (en) * 2020-06-29 2020-10-23 四川长虹电器股份有限公司 Excel data processing method based on SpringBoot
CN112036130B (en) * 2020-09-01 2024-04-30 浪潮通用软件有限公司 Excel data export method and device and electronic equipment
CN112286910B (en) * 2020-11-23 2024-04-12 中国农业银行股份有限公司 Data verification method and device
CN112967048A (en) * 2020-11-24 2021-06-15 辽宁振兴银行股份有限公司 Intelligent route for collecting and paying instead based on distributed architecture
CN112347180B (en) * 2020-12-04 2023-08-01 航天信息股份有限公司企业服务分公司 Data pushing method and electronic equipment
CN112380293A (en) * 2020-12-11 2021-02-19 上海中通吉网络技术有限公司 Method and device for processing database and table data
CN113779122B (en) * 2021-02-19 2023-11-03 北京京东振世信息技术有限公司 Method and device for exporting data
CN113138990B (en) * 2021-05-17 2023-04-18 青岛海信网络科技股份有限公司 Data blood margin construction and tracing method, device and equipment
CN113868282A (en) * 2021-08-06 2021-12-31 安徽希施玛数据科技有限公司 Data processing method and device, terminal and computer readable storage medium
CN114169309A (en) * 2021-12-13 2022-03-11 平安养老保险股份有限公司 Method and device for modifying behavior data table, computer equipment and storage medium
CN114237806B (en) * 2021-12-29 2024-03-12 瀚云科技有限公司 Page information display method and device, electronic equipment and storage medium
CN114637761B (en) * 2022-03-10 2024-03-19 马上消费金融股份有限公司 Business object generation method and device
CN116226786B (en) * 2023-03-22 2023-08-22 中国人民解放军军事科学院系统工程研究院 Data processing method and device for information system data fusion
CN116150249B (en) * 2023-04-13 2023-06-16 新兴际华集团财务有限公司 Table data export method, apparatus, electronic device and computer readable medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103092993A (en) * 2013-02-18 2013-05-08 五八同城信息技术有限公司 Data exporting method and data exporting device
WO2015178985A1 (en) * 2014-05-20 2015-11-26 IfWizard Corporation Method for transporting relational data
CN106202283A (en) * 2016-06-30 2016-12-07 国云科技股份有限公司 A kind of custom field derives the data method to Excel
CN107480186A (en) * 2017-07-07 2017-12-15 中国建设银行股份有限公司 A kind of business model data processing method and computer equipment
CN108052654A (en) * 2017-12-27 2018-05-18 北京京存技术有限公司 Data extraction method, device, equipment and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11093702B2 (en) * 2012-06-22 2021-08-17 Microsoft Technology Licensing, Llc Checking and/or completion for data grids
CN105808539A (en) * 2014-12-29 2016-07-27 北京航天测控技术有限公司 Data import and export method and device
CN107632880B (en) * 2017-08-31 2021-05-04 深圳市丰巢科技有限公司 Method for exporting excel data, storage medium and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103092993A (en) * 2013-02-18 2013-05-08 五八同城信息技术有限公司 Data exporting method and data exporting device
WO2015178985A1 (en) * 2014-05-20 2015-11-26 IfWizard Corporation Method for transporting relational data
CN106202283A (en) * 2016-06-30 2016-12-07 国云科技股份有限公司 A kind of custom field derives the data method to Excel
CN107480186A (en) * 2017-07-07 2017-12-15 中国建设银行股份有限公司 A kind of business model data processing method and computer equipment
CN108052654A (en) * 2017-12-27 2018-05-18 北京京存技术有限公司 Data extraction method, device, equipment and storage medium

Also Published As

Publication number Publication date
WO2020015150A1 (en) 2020-01-23
CN109062883A (en) 2018-12-21

Similar Documents

Publication Publication Date Title
CN109062883B (en) Data table dynamic derivation method and device, computer equipment and storage medium
CN110297672B (en) Page dynamic generation method and device, computer equipment and storage medium
CN110069572B (en) HIVE task scheduling method, device, equipment and storage medium based on big data platform
CN110147413B (en) Data storage method, data query method, device, equipment and storage medium
CN109325041B (en) Service data processing method, device, computer equipment and storage medium
CN110209650B (en) Data normalization and migration method and device, computer equipment and storage medium
CN111309785B (en) Database access method and device based on Spring framework, computer equipment and medium
CN109062925B (en) Method, device, computer equipment and storage medium for automatically generating insert sentences
CN108536745B (en) Shell-based data table extraction method, terminal, equipment and storage medium
CN107943466B (en) Database access statement generation method, device and equipment
CN109657177A (en) The generation method of the page, device, storage medium and computer equipment after upgrading
CN111767297B (en) Big data processing method, device, equipment and medium
CN112612491A (en) Method and device for configuring hot-brushing, computer equipment and storage medium
WO2021068740A1 (en) File management method and device
CN112434037A (en) Data processing method, processing device, data processing apparatus, and storage medium
CN113111669A (en) Increment-based front-end multi-language internationalized translation method and device
CN110543465B (en) Directory operation method and device, computer equipment and storage medium
CN112596723A (en) Database script generation method, device, equipment and medium
CN112069223A (en) Data acquisition demand processing method and device, computer equipment and storage medium
CN115687490A (en) Data export method and device, computer equipment and storage medium
US9679015B2 (en) Script converter
CN109446386B (en) Data query method and device
CN112463836A (en) Data query method and device based on Django framework, computer equipment and medium
CN113127501B (en) Method and device for executing multiple sql statements, intelligent terminal and storage medium
CN112783866A (en) Data reading method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant