WO2020015150A1 - 数据表动态导出方法、装置、计算机设备及存储介质 - Google Patents

数据表动态导出方法、装置、计算机设备及存储介质 Download PDF

Info

Publication number
WO2020015150A1
WO2020015150A1 PCT/CN2018/106252 CN2018106252W WO2020015150A1 WO 2020015150 A1 WO2020015150 A1 WO 2020015150A1 CN 2018106252 W CN2018106252 W CN 2018106252W WO 2020015150 A1 WO2020015150 A1 WO 2020015150A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
configuration
target
compliance
source
Prior art date
Application number
PCT/CN2018/106252
Other languages
English (en)
French (fr)
Inventor
李源
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2020015150A1 publication Critical patent/WO2020015150A1/zh

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

Definitions

  • the present application relates to the field of data processing, and in particular, to a method, a device, a computer device, and a storage medium for dynamically deriving a data table.
  • the embodiments of the present application provide a method, a device, a computer device, and a storage medium for dynamically exporting a data table, so as to solve the problems of large workload and error-proneness when exporting the current data in pages.
  • a data table dynamic export method includes:
  • the target configuration table includes at least two target configuration data, each of the target configuration data includes a table ID, a source Table ID and derived fields;
  • target data based on the target query, store the target data in an EXCEL table, and obtain and export a target paging table corresponding to the form ID.
  • a data table dynamic derivation device includes:
  • An export request obtaining module configured to obtain a data export request, where the data export request includes a target data table ID;
  • the target configuration table acquisition module is 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.
  • the target configuration table includes at least two target configuration data, each of which The target configuration data includes form ID, source table ID, and export fields;
  • a query statement acquisition module configured to traverse each of the 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;
  • the target paging table acquisition module is configured to acquire target data based on the target query statement, store the target data in an EXCEL table, and obtain and export a target paging table corresponding to the table ID.
  • a computer device includes a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor.
  • the processor executes the computer-readable instructions, the processor performs the following steps:
  • the target configuration table includes at least two target configuration data, each of the target configuration data includes a table ID, a source Table ID and derived fields;
  • target data based on the target query, store the target data in an EXCEL table, and obtain and export a target paging table corresponding to the form ID.
  • One or more non-volatile readable storage media storing computer readable instructions, where the computer readable storage medium stores computer readable instructions, and when the computer readable instructions are executed by one or more processors, Cause the one or more processors to perform the following steps:
  • the target configuration table includes at least two target configuration data, each of the target configuration data includes a table ID, a source Table ID and derived fields;
  • target data based on the target query, store the target data in an EXCEL table, and obtain and export a target paging table corresponding to the form ID.
  • FIG. 1 is a schematic diagram of an application environment of a method for dynamically deriving a data table in an embodiment of the present application
  • FIG. 2 is a flowchart of a method for dynamically deriving a data table in an embodiment of the present application
  • FIG. 3 is another flowchart of a method for dynamically deriving a data table according to an embodiment of the present application
  • FIG. 4 is another flowchart of a method for dynamically deriving a data table in an embodiment of the present application
  • FIG. 5 is another flowchart of a method for dynamically deriving a data table in an embodiment of the present application
  • FIG. 6 is another flowchart of a method for dynamically deriving a data table in an embodiment of the present application
  • FIG. 7 is another flowchart of a method for dynamically deriving a data table in an embodiment of the present application.
  • FIG. 8 is a schematic diagram of a device for dynamically deriving a data table in an embodiment of the present application.
  • FIG. 9 is a schematic diagram of a computer device according to an embodiment of the present application.
  • the method for dynamically deriving a data table provided in the embodiment of the present application can be applied in the application environment as shown in FIG. 1, in which a client communicates with a server through a network, and is used to cause the server to execute the data table based on a data export request uploaded by the client. Dynamically exported operations.
  • the client is also called the client, which refers to the program that provides local services for the client corresponding to the server.
  • Clients can be installed on, but are not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices.
  • the server can be implemented by an independent server or a server cluster composed of multiple servers.
  • a method for dynamically exporting a data table is provided. Taking the method applied to the server in FIG. 1 as an example for description, the method for dynamically exporting a data table includes the following steps:
  • the data export request includes a target data table ID.
  • the data export request is a request for triggering the server to perform a dynamic export processing of a data table.
  • the target data table ID is the data table ID corresponding to this data export request, and the data table ID is an identifier for uniquely identifying the configuration table.
  • a plurality of configuration tables are stored in the database in advance, and each configuration table corresponds to a data table ID, so that a subsequent configuration query is obtained based on the data table ID.
  • at least one configuration table is stored in the database in advance, and the configuration table is a compliance configuration table that is pre-configured by the user according to business requirements and is subjected to deduplication and compliance verification to avoid subsequent dynamic export of the data table based on the configuration table. An error occurs to ensure the smooth export of the data table.
  • the compliance configuration table is a configuration table obtained through deduplication processing and compliance verification in advance.
  • the server is pre-configured with a script (that is, a computer-readable instruction) that can dynamically export the data table.
  • a script that is, a computer-readable instruction
  • the user can click "Data export" "Button or input the corresponding control instruction through the command line to trigger the data export request and send the data export request to the server so that the server receives the data export request so that the pre-configured script of the server can be based on the data
  • the export request performs a dynamic export operation of the data table.
  • 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.
  • the target configuration table is a compliance configuration table corresponding to the target data table ID obtained after querying the database based on the target data table ID.
  • the server uses the target data table ID as a query field, executes a query statement corresponding to the query field, and obtains a target configuration table corresponding to the target data table ID from the database.
  • the target configuration data is pre-configured configuration data in the target configuration table, and each target configuration data can be exported correspondingly to a data table. That is, the target configuration table includes at least two target configuration data, so that the target configuration table can export at least two data tables correspondingly, and the data can be exported in pages.
  • each target configuration data includes a table ID, a source table ID, and a derived field, and may further include a table name, as shown in Table 1 below.
  • the form ID is an identifier for uniquely identifying each data table after paging and exporting the data, such as SHEET_1 and SHEET_2 in Table 1.
  • the source table ID is an identifier for uniquely identifying the source data set for which data is to be exported, such as 1001 and 1002 in Table 1.
  • the source data set is a data table used to store the original data, and it is a data source that needs data export.
  • the export fields are used to limit the fields contained in the exported data table, such as Name, Age, and City in Table 1.
  • the export field must be a field in the source data set corresponding to the source table ID to avoid the problem that the data cannot be exported smoothly.
  • the table name is used to limit the table name of the exported data table.
  • “Result export page 1” in Table 1 is the name of the data table that is formed based on the target configuration data of the SHEET_1.
  • the table ID is sequentially increased according to the number of rows in the target configuration table, so that the table ID is unique, avoiding the existence of two identical table IDs, and making subsequent paging export of data impossible. Uniquely determine its corresponding target configuration data.
  • S30 Traverse each target configuration data in the target configuration table, and obtain a target query corresponding to the table ID based on the source table ID and the derived field.
  • 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 its table ID.
  • the source table ID can uniquely determine its corresponding source data set
  • the export field can limit the content contained in the data table after paging export. Based on the source table ID and the export field, a corresponding target query can be generated, so that Each target query can export a data table.
  • S40 Obtain the target data based on the target query, store the target data in the EXCEL table, and obtain and export the target paging table corresponding to the form ID.
  • the target data refers to a target query statement formed by using a source table ID and an export field to query a source data set corresponding to the source table ID to obtain data corresponding to the export field in the source data set.
  • the target paging table is an EXCEL table formed based on the target data, and is a data table obtained after the server performs a data paging export operation.
  • Each target configuration data corresponds to a target paging table.
  • the target configuration data in the target configuration table includes at least two, so that its target paging table includes at least two.
  • the server queries the source data set corresponding to the source table ID based on the target query statement, obtains the target data, and stores the target data in the EXCEL table, thereby generating a target paging table corresponding to the form ID, and the target Paging table export.
  • the target data table ID in this data export request contains at least two target configuration data
  • each target configuration data can generate and export a target paging table, so that the server executes steps S20-S40 under the trigger of this data export request.
  • the steps can achieve the purpose of dynamically exporting at least two target paging tables. This process can be automatically executed by the server's pre-configured script, without writing or modifying the code, reducing the amount of code development, and helping to reduce the probability of code errors. It is beneficial to improve the efficiency of data paging and export, and ensure the progress of project development.
  • the user can locate whether there is a problem with the target configuration data based on the content of each column in the target paging table and the order between the columns and columns. Specifically, the user can intuitively see the content of each column in the target paging table and the order between columns. If the content of each column is empty or there is a problem with the order between columns, you can directly locate the The target configuration data in the target configuration table corresponding to the target paging table may have errors. It is not necessary to consult the code to find the cause of the problem, which helps to improve the efficiency of project development.
  • a target configuration table can be quickly queried according to the target data table ID in the data export request; since the target configuration table contains at least two target configuration data, according to each target configuration
  • the source table ID and derived fields in the data can automatically and quickly obtain the corresponding target query statement. This process does not require manual intervention and helps to improve the efficiency of data export.
  • the target data is stored.
  • the corresponding target paging table can be obtained and exported.
  • each target configuration table includes at least two target configuration data
  • each target configuration data can export a target paging table, so that each data export request can quickly export at least two target paging tables, the process does not need to write or modify the code .
  • the "dynamic export" mentioned in this embodiment means that after the initial code of the script pre-configured by the server is completed, subsequent page-based data export based on the script does not need to modify the code of the script, only the content of the target configuration table needs to be adjusted. Helps greatly reduce the workload of writing and modifying code during data paging export.
  • the target query statement corresponding to the table ID is obtained based on the source table ID and the derived field in step S30, and specifically includes the following steps: using a SQL query statement generation rule to process the source table ID and the derived field to obtain The target query corresponding to the table ID.
  • the SQL query statement generation rule is a preset rule for generating a SQL query statement according to the source table ID and the derived field.
  • the SQL query statement generation rule is specifically “Select export field From source table ID”. Based on the SQL query statement generation rule, the source table ID and the derived field can be quickly processed to generate a target query statement.
  • the target query "Select Name, Age, City From 1001" can be obtained.
  • the server can obtain three names: Name, Age, and City from the source data set corresponding to the source table ID 1001 by executing the target query “Select Name, Age, City From 1001”.
  • Target data corresponding to each export field and store the three export fields Name, Age, and City and their corresponding target data in the EXCEL table to generate a target paging table corresponding to the form ID of SHEET_1, the target paging table You can name the table.
  • the server because the server stores SQL query statement generation rules, it can automatically generate a corresponding target query statement based on each target configuration data in the target configuration table, without the need to manually write corresponding code to improve subsequent target-based
  • the query gets the target data to get and export the efficiency of the target paging table. Understandably, when each target configuration data in the target configuration table is traversed in step S30, each target configuration data is parsed through the server background, and its source table ID and derived fields are processed through the SQL query statement generation rule.
  • the corresponding target query is obtained in the background, which eliminates the need for the project developer to write corresponding query statements based on different export fields and source table IDs, reducing the workload of the project developer in writing code, and also reducing the probability of errors in manually writing code.
  • the target data is acquired based on the target query in step S40, and the target data is stored in the EXCEL table, which specifically includes the following steps:
  • S41 Query the source data set corresponding to the source table ID based on the target query statement, and obtain the target data corresponding to the derived field from the source data set.
  • the server can use the target query request to query the source data set corresponding to the source table ID, as shown in 1001 in Table 1.
  • the content corresponding to the derived field is obtained from the source data set as the target data.
  • S42 Use the JAVA reflection principle to store the target data in the EXCEL table, and obtain and export the target paging table corresponding to the form ID.
  • the JAVA reflection principle is that in the running state, for any class, you can know all the properties and methods of this class; for any object, you can call any of its methods and properties; this dynamically acquired information and dynamic call
  • the function of the method of the object is called the reflection mechanism of the Java language.
  • the server when the server writes a pre-configured script in the JAVA language in advance, during the execution of the script, after obtaining target data corresponding to the exported field according to the target query statement, the derived field and The target data is stored in an EXCEL table to obtain a target paging table corresponding to the form ID and export the target paging table.
  • the server traverses the target configuration table. It first traverses the target configuration data SHEET_1. After obtaining the target query based on the three export fields of the source table ID and Name, Age, and City, it first obtains the target query according to the target query.
  • the source data set LIST_1 corresponding to the source table ID. Based on the derived fields Name, Age, and City, the JAVA reflection principle is used to obtain the specific contents of the three exported fields Name, Age, and City in the source data set LIST_1 as the target data. Fill in the target data corresponding to the three export fields Name, Age, and City in order to form a target paging table.
  • the target configuration data SHEET_2 is traversed to obtain the corresponding target paging table, until all the target configuration data in the target configuration table has obtained the corresponding target paging table, and all target paging tables are exported.
  • the script is triggered to run to obtain the target configuration table obtained according to the data export request.
  • At least two target configuration data after obtaining the corresponding target query statement according to the source table ID and derived field in each target configuration data, the target data is obtained based on the data query statement, and the target data is stored in the EXCEL table using the JAVA reflection principle To obtain a target paging table corresponding to the target configuration data.
  • each configuration table corresponds to a data table ID.
  • the method for dynamically exporting a data table further includes:
  • the paging configuration request includes an original configuration table.
  • the original configuration table includes at least two original configuration data.
  • Each original configuration data includes a form ID, a source table ID, and a derived field.
  • the paging configuration request is a request for triggering the server to configure a configuration table that can be exported by data paging.
  • the original configuration table is a configuration table that users configure themselves according to their own business needs.
  • the original configuration data is user-configured configuration data in the original configuration table. The user can determine the information of the data table that needs to be paged out according to his own business requirements.
  • Each original configuration data includes a table ID, a source table ID, and a derived field, and may further include a table name, as shown in Table 2.
  • the form ID is an identifier for uniquely identifying a data table after data paging and export based on the original configuration data.
  • the source table ID is an identifier for uniquely identifying the source data set to be exported by data paging.
  • the export field is used to limit the fields to be included in the paginated data table.
  • the table name is used to limit the name of each data table after the data pagination export.
  • the user may send a paging configuration request to the server through the client.
  • the paging configuration request carries the original configuration table shown in Table 2, so that the server obtains the original configuration table.
  • the number of original configuration data is the number of data tables that are required to perform data paging export for the paging configuration request.
  • the order between the exported fields in the original configuration table is the order between the fields in the data table formed by the data paging export.
  • S52 Perform deduplication processing on at least two original configuration data in the original configuration table to obtain a first configuration table.
  • the original configuration table in this paging configuration request is a configuration table uploaded by the user, when there is a large amount of original configuration data configured in the original configuration table, there may be a duplicate configuration phenomenon, which makes subsequent subsequent directly based on the original configuration table.
  • the server needs to remove at least two original configuration data from the original configuration table carried by the pagination configuration request. Repeat processing to obtain the first configuration table.
  • the first configuration table is a configuration table obtained by performing deduplication processing on the original configuration data in the original configuration table.
  • performing deduplication processing on at least two original configuration data refers to processing on at least two original configuration data with the same source table ID and derived field in the original configuration data, so that the first configuration table includes only one of the original configuration data.
  • S53 Perform compliance verification on each of the original configuration data in the first configuration table, obtain a compliance configuration table that passes the compliance verification, and store the compliance configuration table in a database.
  • the first configuration table After the first configuration table obtained by performing deduplication processing on the original configuration table, the first configuration table further includes at least one original configuration data, and each original configuration data is configuration data filled by a user, and the filling of these original configuration data It may not meet the preset filling specifications, so that it cannot be executed by a script set by the server in advance, which leads to a problem of export errors in subsequent data pagination export based on the first configuration table. Therefore, in step S53, a compliance check is performed on each original configuration data in the first configuration table to obtain a compliance configuration table that passes the compliance check, so that each original configuration data in the compliance configuration table All meet the preset filling specifications, and store the compliance configuration table in the database to reduce the probability of errors when calling the compliance configuration table in the database for data paging export.
  • At least two original configuration data in the original configuration table carried by the paging configuration request is deduplicated to obtain a first configuration table to avoid being based on the first configuration.
  • At least two original configuration data in the table need to be exported repeatedly when performing pagination of data, so as to improve the efficiency of pagination of data.
  • compliance verification is performed on each original configuration data in the first configuration table to retain a compliance configuration table formed by all the original configuration data that passed the compliance verification, so that data is subsequently performed based on the compliance configuration table.
  • the error rate during pagination export is reduced, thereby improving the efficiency of data pagination export.
  • the compliance configuration table configured through steps S51-S53 is stored in the database, and each compliance configuration table corresponds to a data table ID, so that the corresponding query based on the target data table ID in the data export request is subsequently queried.
  • the compliance configuration table serves as the target configuration table.
  • the original configuration data table ID the original configuration data table ID, source table ID, derived field, and table name.
  • step S52 at least two pieces of original configuration data in the original configuration table are deduplicated to obtain a first configuration table, which specifically includes the following steps:
  • S521 Determine whether at least two pieces of original configuration data in the original configuration table have at least two duplicate configuration data with the same source table ID and derived fields.
  • the server After acquiring the paging configuration request, the server obtains the original configuration table (as shown in Table 2) in the paging configuration request, and determines whether at least two original configuration data in the original configuration table have a source table ID. At least two duplicate configuration data exactly the same as the export field. The at least two duplicate configuration data refer to at least two original configuration data with identical source table IDs and derived fields.
  • the target query statement needs to be obtained based on the source table ID and export fields in the target configuration data. If there are two duplicate configuration data with exactly the same source table ID and export fields, it may cause the subsequent formation of The same target query statement will cause repeated operations, which will reduce its efficiency.
  • the source table ID and the export field are exactly the same, not only including the source table ID and the export field name being the same, but also the same order of the export fields, because the order of the export fields determines the fields in the target pagination table of subsequent data paging exports. order.
  • Table 2 the source table ID and derived fields in the original configuration data corresponding to the table IDs SHEET_1, SHEET_3, and SHEET_5 are exactly the same. Therefore, the original configuration data corresponding to SHEET_1, SHEET_3, and SHEET_5 are duplicate configuration data.
  • the original configuration data of SHEET_4 is different from the sequence of the derived fields of the three original configuration data of SHEET_1, SHEET_3, and SHEET_5, so it is not duplicate configuration data.
  • a target paging table can be obtained based on each target query statement, and each target paging table is named after the table name. Therefore, there are source table IDs and derived fields.
  • the table names in the at least two repeated configuration data are the same, it means that the subsequent target query statements formed based on the source table IDs and derived fields of the at least two repeated configuration data are the same, and at least two identical target query statements are executed to obtain The table names of the at least two target paging tables are also the same.
  • the first configuration table from which the duplicate configuration data is removed from the original configuration table can be obtained.
  • the original configuration data corresponding to SHEET_1, SHEET_3, and SHEET_5 are duplicate configuration data.
  • the table names of SHEET_1 and SHEET_3 are the same, that is, the subsequent duplicate configuration data based on SHEET_1 and SHEET_3
  • the table names of the formed target paging tables are "Result export paging 1", both of which are exactly the same, so only one of the duplicate configuration data can be retained to obtain the first configuration table, avoiding subsequent based on the first configuration table.
  • the table names in the at least two repeated configuration data are different, it means that the subsequent target query statements formed based on the source table ID and the derived field of the at least two repeated configuration data are the same, and at least two identical target query statements are executed. If the names of the tables in the at least two target paging tables are different, at least two target paging tables with the same content and different names will be exported, which will cause repeated operations in the subsequent data paging export process and reduce the efficiency of data paging export.
  • the server when the server determines that at least two duplicate configuration data have different table names, it generates a prompt message, which prompts that the source table ID and the export field in the original configuration table in this paging configuration request are the same, but the table At least two duplicates with different names. Then, the server sends the generated prompt information to the client that triggered the paging configuration request, so that the user can view the prompt information through the client and feedback the corresponding modification information.
  • the modification information is to delete at least two duplicate configurations. Data to retain at least one of the duplicate configuration data. After obtaining the modification information fed back by the client, the server obtains the first configuration table based on the modification information.
  • steps S521-S524 after it is determined that there are at least two duplicate configuration data with identical source table ID and derived fields in the original configuration table, according to whether the table names of the at least two duplicate configuration data are the same, at least two duplicate configuration data Perform deduplication processing to obtain the first configuration table to ensure that after subsequent compliance configuration tables are obtained based on the first configuration table, the compliance configuration table does not contain duplicate configuration data, so that duplicates are avoided during subsequent data paging export Export operation to improve the efficiency of data paging export.
  • step S53 performs a compliance check on each of the original configuration data in the first configuration table to obtain a compliance configuration table that passes the compliance check.
  • the steps include the following steps: :
  • S531 Determine whether there is a derived field in the source data set corresponding to the source table ID in each of the original configuration data in the first configuration table.
  • the server needs to perform compliance verification on each of the original configuration data in the first configuration table to determine the first configuration table.
  • Each of the original configuration data in the subsequent can be executed by a script pre-configured by the server, thereby ensuring that the subsequent data paging export based on the original configuration data is performed smoothly.
  • a target query statement When exporting data based on the original configuration data, a target query statement needs to be formed based on the source table ID and the export field. Based on the target query statement, the source data set corresponding to the source table ID is obtained by query to obtain the target corresponding to the export field. Data, therefore, in each original configuration data, it is necessary to verify in advance whether there is a corresponding export field in the original configuration data in the source data set corresponding to the source table ID, so as to avoid subsequent data paging export, the corresponding data cannot be exported and the data Error during paging export.
  • each original configuration data when the export field set in the original configuration data exists in the source data set corresponding to the source table ID, it means that the data can be exported in pages based on the original configuration data.
  • One export field can be configured in each original configuration data, and at least two export fields can also be configured. If at least two export fields are configured, the export field and the export field must be separated by a preset symbol.
  • the preset symbol is a preset cutting symbol. In subsequent data paging export, if the preset script recognized by the server recognizes the preset symbol, the two export fields before and after the preset symbol need to be cut. In this embodiment, the preset symbol may use a comma. When any two exported fields in each original configuration data use a comma as a separator, the original configuration data passes the compliance check; otherwise, it conforms. The verification failed.
  • the prompt information prompts the source data set corresponding to the source table ID.
  • the prompt information may also display all fields existing in the source data set corresponding to the source table ID, so that the user can make a selection.
  • the server sends the prompt information to the client that triggered the paging configuration request, so that the user can view the prompt information through the client and feedback the corresponding modification information.
  • the export field of any original configuration data includes at least two export fields, it is necessary to determine whether the separator between any two export fields matches a preset symbol; if the If the delimiter matches the preset symbol, the compliance configuration table that passes the compliance check will be obtained; if the delimiter between any two exported fields does not match the preset symbol, the page that triggers the paging configuration request will be given.
  • the client sends a prompt message to prompt the user to modify through the client until the separator between any two exported fields in all the original configuration data matches the preset symbol.
  • the two original configuration data of SHEET_2 and SHEET_4 shown in Table 2 include at least three derived fields. Since any two derived fields of the original configuration data of SHEET_2 use a comma as a separator, and If the preset symbols match, the original configuration data compliance check passes; and SHEET_4 uses any semicolon as a separator between any two exported fields of the original configuration data. If the preset symbols do not match, you need to generate a prompt The information is sent to the client that triggered the paging configuration request to prompt the user to modify the corresponding delimiters until all the original configuration data in the first configuration table passes the compliance verification. Compliance configuration table.
  • the export field if there is an export field in the source data set corresponding to the source table ID in any of the original configuration data tables, and the export field does not include at least two export fields, there is no need to determine the separator between any two export fields.
  • the step of whether to match the preset symbol directly determines that the compliance verification of the original configuration data passes.
  • a compliance configuration table that passes the compliance check is obtained.
  • the compliance configuration table corresponds to a data table ID, and the data table ID and the compliance configuration table are associated and stored in the data table, so that a subsequent query based on the data table ID can obtain a corresponding compliance configuration table.
  • steps S531-S534 compliance verification is performed on each original configuration data in the first configuration table obtained after deduplication of the original configuration table, so as to obtain a compliance configuration table that passes the compliance verification, so that subsequent The data paging export can be performed smoothly based on the compliance configuration table to avoid the problem of export errors during the data paging export process.
  • the server first determines whether there is a corresponding derived field in the source data set corresponding to the source table ID, so as to avoid a situation in which subsequent target query statements formed based on the source table ID and the derived field cannot find the corresponding target data, thereby guaranteeing The subsequent data paging export went smoothly.
  • the server needs to ensure that the separator between any two export fields matches the preset symbol, so that subsequent page data export can be based on the preset symbol. Separating the fields helps to ensure the smooth export of data paging.
  • each compliance configuration table is obtained in step S50, a corresponding data table ID is assigned to each compliance configuration table, so that each compliance configuration table corresponds to a data table ID, and the compliance The configuration table is stored in the database in association with the data table ID.
  • the user may need to modify the compliance configuration table in the database according to new business requirements or other needs to adjust the original in the compliance configuration table. Configure the order of the data, or adjust the source table ID, derived fields, and table names in each of the original configuration data to make the updated compliance configuration table more consistent with user needs.
  • the method for dynamically exporting a data table includes the following steps:
  • the data modification request includes a data table ID to be modified and a modification identifier.
  • the data modification request is a request for triggering the server to modify the compliance configuration table.
  • the ID of the data table to be modified is used to determine the compliance configuration table that needs to be modified for this data modification request.
  • the modification identifier refers to an identifier that needs to be modified. Each modification identifier corresponds to a modification function. In this embodiment, modifying the identifier includes deleting the identifier, adding the identifier, and replacing the identifier.
  • S62 Query the database according to the data table ID, and obtain a compliance configuration table corresponding to the data table ID as the configuration table to be modified.
  • the server queries the database based on the data table ID in the data modification request, and obtains 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 that needs to be modified for this data modification request.
  • S63 A modification function corresponding to the modification identifier is used to modify the configuration table to be modified to obtain the modified compliance configuration table.
  • the server modifies the configuration table to be modified based on the modification function corresponding to the modification identifier in the data modification request to obtain the modified compliance configuration data.
  • the server may enter the corresponding information modification interface according to the modification identifier in the data modification request, receive the modification parameters entered by the user in the information modification interface, and pass the modification parameters to the After the modification identifies the corresponding modification function, the configuration table to be modified is modified based on the modification function.
  • the modification identifier is a deletion identifier
  • the modification function corresponding to the deletion identifier is a deletion function
  • the corresponding information modification interface is entered according to the deletion identifier, so that the user enters the corresponding modification parameters in the information modification interface.
  • its modification parameter is the form ID
  • some export fields in an original configuration data need to be deleted its modification parameters are the form ID and the export field to be deleted.
  • the server passes the modified parameters to its corresponding delete function, and uses the delete function to delete the configuration table to be modified to obtain the modified compliance configuration table so that the modified compliance configuration table More in line with user needs.
  • the modification identifier is an increase identifier
  • the modification function corresponding to the increase identifier is an increase function
  • the corresponding information modification interface is entered according to the added identifier, so that the user enters the corresponding modification parameters in the information modification interface.
  • its modification parameters are the form ID, source table ID, and derived fields; if it is necessary to add an export field in the original configuration data, its modification parameters are the form ID and the derived field to be added.
  • the server passes the modified parameters to its corresponding increase function, and uses the increase function to add processing to the modified configuration table to obtain the modified compliance configuration table to make the modified compliance configuration table More in line with user needs.
  • the modification identifier is a replacement identifier
  • the modification function corresponding to the replacement identifier is a replacement function
  • the corresponding information modification interface is entered according to the replacement identifier, so that the user enters the corresponding modification parameters in the information modification interface
  • the modification parameters are the form ID and the replaced form name
  • the export field of an original configuration parameter is modified
  • the modification parameters are the form ID and the modified export field.
  • the server passes the modified parameters to its corresponding replacement function, and uses the replacement function to replace the configuration table to be modified, that is, delete the content corresponding to the modified parameter before modification and replace it with the corresponding modified parameter.
  • the user can respond to the user's needs in a timely manner through steps S61-S63, and update the compliance configuration table in the database to make it more consistent with the user's needs.
  • the server's preset executable data paging export script does not need to modify the code. It only needs to modify the original configuration parameters in the compliance configuration table.
  • the process can effectively reduce project development. The workload of code writing and modification during the process can help speed up the development of the project.
  • a data table dynamic derivation device corresponds to the data table dynamic derivation method in the above embodiment.
  • the data table dynamic deriving device includes an export request acquisition module 10, a target configuration table acquisition module 20, a query statement acquisition module 30, and a target paging table acquisition module 40.
  • the detailed description of each function module is as follows:
  • the export request obtaining module 10 is configured to obtain a data export request, where the data export request includes a target data table ID.
  • the target configuration table acquisition module 20 is 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.
  • the target configuration table includes at least two target configuration data, and each target configuration data includes a form ID, Source table ID and derived fields.
  • the query statement acquisition module 30 is 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.
  • the target paging table acquisition module 40 is configured to acquire target data based on a target query statement, store the target data in an EXCEL table, and obtain and export a target paging table corresponding to the form ID.
  • the query statement acquisition module 30 is configured to process the source table ID and the derived fields by using a SQL query statement generation rule to obtain a target query statement corresponding to the table ID.
  • the target paging table acquisition module 40 includes a target data acquisition unit 41 and a paging table acquisition unit 42.
  • the target data obtaining unit 41 is configured to query a source data set corresponding to the source table ID based on the target query statement, and obtain target data corresponding to the derived field from the source data set.
  • the paging table acquisition unit 42 is configured to store target data in an EXCEL table by using the JAVA reflection principle, and obtain and export a target paging table corresponding to the form ID.
  • the data table dynamic deriving device further includes a configuration request obtaining unit 51, a deduplication processing unit 52, and a compliance verification unit 53.
  • a configuration request obtaining unit 51 is configured to obtain a paging configuration request.
  • the paging configuration request includes an original configuration table.
  • the original configuration table includes at least two original configuration data.
  • Each original configuration data includes a form ID, a source table ID, and a derived field.
  • the deduplication processing unit 52 is configured to perform deduplication processing on at least two original configuration data in the original configuration table to obtain a first configuration table.
  • the compliance verification unit 53 is configured to perform compliance verification on each of the original configuration data in the first configuration table, obtain a compliance configuration table that passes the compliance verification, and store the compliance configuration table in a database.
  • the original configuration data further includes a table name.
  • the deduplication processing unit 52 includes a duplicate determination subunit 521, a name determination subunit 522, a first deduplication processing unit 523, and a second deduplication processing unit 524.
  • the repeat determination subunit 521 is configured to determine whether at least two pieces of original configuration data in the original configuration table have at least two pieces of repeated configuration data with identical source table IDs and derived fields.
  • the name judging subunit 522 is 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 with the same source table ID and derived fields.
  • the first deduplication processing unit 523 is configured to: if at least two duplicate configuration data have the same table name, retain one duplicate configuration data to obtain a first configuration table.
  • the second deduplication processing unit 524 is configured to generate prompt information if the names of the tables in the at least two repeated configuration data are different, and send the prompt information to the client that triggers the paging configuration request to obtain the modification information fed back by the client. To obtain a first configuration table based on the modified information.
  • the compliance check unit 53 includes a field existence determination sub-unit 531, a field number determination sub-unit 532, a first compliance check sub-unit 533, and a second compliance check sub-unit 534.
  • the field existence judging subunit 531 is configured to determine whether, in each of the original configuration data in the first configuration table, the source data set corresponding to the source table ID has a derived field.
  • the field quantity judging subunit 532 is configured to determine whether the export field includes at least two export fields if the export field exists in the source data set corresponding to the source table ID.
  • the first compliance checker sub-unit 533 is configured to determine whether a separator between any two derived fields matches a preset symbol if the derived field includes at least two derived fields, and if they match, obtain compliance Checked compliance configuration table.
  • the second compliance check subunit 534 is configured to obtain a compliance configuration table that passes the compliance check if the derived field does not include at least two derived fields.
  • each compliance configuration table corresponds to a data table ID.
  • the data table dynamic deriving device further includes a modification request obtaining unit 61, a configuration table to be modified obtaining unit 62, and a configuration table modification processing unit 63.
  • the modification request obtaining unit 61 is configured to obtain a data modification request, where the data modification request includes a data table ID, a form ID, and a modification identifier.
  • the configuration table to be modified obtaining unit 62 is configured to query a database according to the data table ID, and obtain a compliance configuration table corresponding to the data table ID as the configuration table to be modified.
  • 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 to obtain the modified compliance configuration table.
  • Each module in the data table dynamic derivation device can be implemented in whole or in part by software, hardware, and a combination thereof.
  • the above-mentioned modules may be embedded in the hardware form or independent of the processor in the computer device, or may be stored in the memory of the computer device in the form of software, so that the processor calls and performs the operations corresponding to the above modules.
  • a computer device is provided.
  • the computer device may be a server, and its internal structure diagram may be as shown in FIG. 9.
  • the computer device includes a processor, a memory, a network interface, and a database connected through a system bus.
  • the processor of the computer device is used to provide computing and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system, computer-readable instructions, and a database.
  • the internal memory provides an environment for operating the operating system and computer-readable instructions in a non-volatile storage medium.
  • the database of the computer equipment is used for compliance configuration tables and target paging tables, as well as other data formed during the data paging export process.
  • the network interface of the computer device is used to communicate with an external terminal through a network connection.
  • the computer-readable instructions are executed by a processor to implement a method for dynamically exporting a data table.
  • a computer device including a memory, a processor, and computer-readable instructions stored on the memory and executable on the processor.
  • the processor executes the computer-readable instructions, the following steps are implemented: acquiring data Export request, the data export request includes the target data table ID; query the database based on the target data table ID to obtain the target configuration table corresponding to the target data table ID, the target configuration table includes at least two target configuration data, each target configuration data includes Table ID, source table ID, and derived fields; traverse each target configuration data in the target configuration table, based on the source table ID and derived fields, to obtain the target query statement corresponding to the table ID; obtain the target data based on the target query statement, and The target data is stored in the EXCEL table, and the target paging table corresponding to the form ID is obtained and exported.
  • the processor when the processor executes the computer-readable instructions, the processor implements the following steps: processing the source table ID and the derived field by using a SQL query statement generation rule to obtain a target query statement corresponding to the table ID.
  • the processor executes the computer-readable instructions, the following steps are implemented: querying the source data set corresponding to the source table ID based on the target query statement, obtaining the target data corresponding to the derived field from the source data set; using JAVA
  • the reflection principle stores the target data in the EXCEL table, and obtains and exports the target paging table corresponding to the form ID.
  • the processor before the step of obtaining the data export request, the processor further implements the following steps when executing the computer-readable instructions: obtaining a paging configuration request, the paging configuration request includes an original configuration table, and the original configuration table includes at least two original configurations Data, each original configuration data includes a form ID, a source table ID, and a derived field; deduplicates at least two original configuration data in the original configuration table to obtain a first configuration table; each of the first configuration table Compliance verification is performed on the original configuration data, a compliance configuration table that passes the compliance verification is obtained, and the compliance configuration table is stored in a database.
  • the original configuration data further includes a table name.
  • the processor executes the computer-readable instructions, the following steps are implemented: 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 derived field; if the source table ID and the derived field exist At least two duplicate configuration data that are identical, determine whether the table names in the at least two duplicate configuration data are the same; if the table names in at least two duplicate configuration data are the same, one duplicate configuration data is retained and the first configuration table is obtained ; If the names of the tables in the at least two duplicate configuration data are different, generate the prompt information and send the prompt information to the client that triggers the paging configuration request, obtain the modification information fed back by the client, and obtain the first configuration table based on the modification information .
  • the processor executes the computer-readable instructions, the following steps are implemented: judging whether the source data set corresponding to the source table ID exists in each of the original configuration data in the first configuration table; if the source table ID corresponds to If there are export fields in the source data set of , the system determines whether the export field contains at least two export fields. If the export field contains at least two export fields, it determines whether the separator between any two export fields matches the preset symbol. If they match, obtain a compliance configuration table for obtaining compliance verification passes; if the export field does not include at least two export fields, obtain a compliance configuration table for compliance verification passes.
  • each compliance configuration table corresponds to a data table ID.
  • the processor After the step of storing the compliance configuration table in the database, the processor also implements the following steps when executing the computer-readable instructions: obtaining a data modification request, the data modification request includes a data table ID, a form ID, and a modification identifier; according to the data table ID Query the database to obtain the compliance configuration table corresponding to the data table ID as the configuration table to be modified; use the modification function corresponding to the modification identifier to modify the configuration table to be modified to obtain the modified compliance configuration table.
  • one or more non-volatile readable storage media storing computer readable instructions are provided, the computer readable storage medium storing computer readable instructions, the computer readable instructions being replaced by one or When multiple processors are executed, the one or more processors are caused to perform the following steps: obtaining a data export request, the data export request includes a target data table ID; querying a database based on the target data table ID to obtain a corresponding data table ID Target configuration table, the target configuration table includes at least two target configuration data, each target configuration data includes table ID, source table ID and export fields; traverse each target configuration data in the target configuration table, based on the source table ID and export Field to obtain the target query statement corresponding to the table ID; obtain the target data based on the target query statement, and store the target data in the EXCEL table to obtain and export the target paging table corresponding to the table ID.
  • the one or more processors when the computer-readable instructions are executed by one or more processors, the one or more processors are caused to perform the following steps: using a SQL query statement generation rule to process the source table ID and derived fields To obtain the target query corresponding to the form ID.
  • the one or more processors when the computer-readable instructions are executed by one or more processors, the one or more processors are caused to perform the following steps: query a source data set corresponding to a source table ID based on a target query statement. , Obtain the target data corresponding to the exported fields from the source data set; use the JAVA reflection principle to store the target data in the EXCEL table, and obtain and export the target paging table corresponding to the form ID.
  • the one or more processors before the step of obtaining the data export request, when the computer-readable instructions are executed by one or more processors, the one or more processors are caused to perform the following steps: obtaining a paging configuration request, and paging
  • the 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 form ID, a source table ID, and an export field. At least two original configuration data in the original configuration table are deduplicated.
  • To obtain a first configuration table To obtain a first configuration table; perform compliance verification on each of the original configuration data in the first configuration table, obtain a compliance configuration table that passes the compliance verification, and store the compliance configuration table in a database.
  • the original configuration data further includes a table name.
  • the one or more processors are caused to perform the following steps: judging whether at least two original configuration data in the original configuration table have a source table ID and a derived field completely The same at least two duplicate configuration data; if there is at least two duplicate configuration data with exactly the same source table ID and derived field, determine whether the table name in the at least two duplicate configuration data is the same; if at least two duplicate configuration data If the table name is the same, one duplicate configuration data is retained to obtain the first configuration table; if the table names in at least two duplicate configuration data are different, a prompt message is generated and sent to the client that triggered the paging configuration request To obtain the modification information fed back by the client, and obtain a first configuration table based on the modification information.
  • the one or more processors when the computer-readable instructions are executed by one or more processors, the one or more processors are caused to perform the following steps: determine the source of each original configuration data in the first configuration table. Whether there are export fields in the source data set corresponding to the table ID; if there are export fields in the source data set corresponding to the source table ID, determine whether the export field contains at least two export fields; if the export field contains at least two export fields, then judge Whether the separator between any two exported fields matches the preset symbol. If they match, get the compliance configuration table that passed the compliance check; if the exported field does not contain at least two exported fields, get compliance Checked compliance configuration table.
  • each compliance configuration table corresponds to a data table ID.
  • the computer-readable instructions when executed by one or more processors, cause the one or more processors to perform the following steps: obtaining a data modification request, and data modification
  • the request includes a data table ID, a table ID, and a modification identifier; a query is made to the database according to the data table ID to obtain a compliance configuration table corresponding to the data table ID as a configuration table to be modified; a modification function corresponding to the modification identifier is used to modify the configuration table Make changes to get the revised compliance configuration table.
  • Non-volatile memory may 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.
  • RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Synchlink DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
  • SRAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDRSDRAM dual data rate SDRAM
  • ESDRAM enhanced SDRAM
  • SLDRAM synchronous chain Synchlink DRAM
  • Rambus direct RAM
  • DRAM direct memory bus dynamic RAM
  • RDRAM memory bus dynamic RAM

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

本申请公开一种数据表动态导出方法、装置、计算机设备及存储介质。该数据表动态导出方法,包括:获取数据导出请求,数据导出请求包括目标数据表ID;基于目标数据表ID查询数据库,获取与目标数据表ID相对应的目标配置表,目标配置表包括至少两个目标配置数据,每一目标配置数据包括表格ID、源表ID和导出字段;遍历目标配置表中的每一目标配置数据,基于源表ID和导出字段,获取与表格ID相对应的目标查询语句;基于目标查询语句获取目标数据,并将目标数据存储在EXCEL表中,获取并导出与表格ID相对应的目标分页表。该方法可使得每一数据导出请求可快速导出至少两个目标分页表,其过程无需编写或修改代码,有利于提高数据分页导出的效率。

Description

数据表动态导出方法、装置、计算机设备及存储介质
本申请以2018年7月18日提交的申请号为201810788103.7,名称为“数据表动态导出方法、装置、计算机设备及存储介质”的中国发明申请为基础,并要求其优先权。
技术领域
本申请涉及数据处理领域,尤其涉及一种数据表动态导出方法、装置、计算机设备及存储介质。
背景技术
在项目开发过程中,经常会有将数据导出成EXCEL格式的数据表的业务需求,尤其是需要将数据导出成多张EXCEL格式的数据表,即需要将数据分页导出,使得每一张数据表包含不同导出字段的数据。在将数据分页导出时,每一张数据表的导出,均需要编写相应的代码,使得代码编写的工作量大,增加项目开发的工作量,从而降低项目开发的效率。而且,在数据分页导出时,分页的顺序修改、新增或删除等分页内容变更均需要修改代码,使得数据分页导出的工作量较大。另外,在将数据分页导出时,每一分页导出的数据表中导出字段的顺序调整、增加、删除和修改等字段变更,也需要修改代码,使得数据分页导出的工作量增加。综上,在项目开发过程中将数据分页导出时,需编写或修改相应的代码,极大增加项目开发的工作量,也容易导致项目开发出错,影响项目开发的质量和效率。
发明内容
本申请实施例提供一种数据表动态导出方法、装置、计算机设备及存储介质,以解决当前数据分页导出时工作量较大且容易出错的问题。
一种数据表动态导出方法,包括:
获取数据导出请求,所述数据导出请求包括目标数据表ID;
基于所述目标数据表ID查询数据库,获取与所述目标数据表ID相对应的目标配置表,所述目标配置表包括至少两个目标配置数据,每一所述目标配置数据包括表格ID、源表ID和导出字段;
遍历所述目标配置表中的每一所述目标配置数据,基于所述源表ID和所述导出字段,获取与所述表格ID相对应的目标查询语句;
基于所述目标查询语句获取目标数据,并将所述目标数据存储在EXCEL表中,获取并导出与所述表格ID相对应的目标分页表。
一种数据表动态导出装置,包括:
导出请求获取模块,用于获取数据导出请求,所述数据导出请求包括目标数据表ID;
目标配置表获取模块,用于基于所述目标数据表ID查询数据库,获取与所述目标数据表ID相对应的目标配置表,所述目标配置表包括至少两个目标配置数据,每一所述目标配置数据包括表格ID、源表ID和导出字段;
查询语句获取模块,用于遍历所述目标配置表中的每一所述目标配置数据,基于所述源表ID和所述导出字段,获取与所述表格ID相对应的目标查询语句;
目标分页表获取模块,用于基于所述目标查询语句获取目标数据,并将所述目标数据存储在EXCEL表中,获取并导出与所述表格ID相对应的目标分页表。
一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时执行如下步骤:
获取数据导出请求,所述数据导出请求包括目标数据表ID;
基于所述目标数据表ID查询数据库,获取与所述目标数据表ID相对应的目标配置表,所述目标配置表包括至少两个目标配置数据,每一所述目标配置数据包括表格ID、源表ID和导出字段;
遍历所述目标配置表中的每一所述目标配置数据,基于所述源表ID和所述导出字段,获取与所述表格ID相对应的目标查询语句;
基于所述目标查询语句获取目标数据,并将所述目标数据存储在EXCEL表中,获取并导出与所述表格ID相对应的目标分页表。
一个或多个存储有计算机可读指令的非易失性可读存储介质,所述计算机可读存储介质存储有计算机可读指令,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:
获取数据导出请求,所述数据导出请求包括目标数据表ID;
基于所述目标数据表ID查询数据库,获取与所述目标数据表ID相对应的目标配置表,所述目标配置表包括至少两个目标配置数据,每一所述目标配置数据包括表格ID、源表ID和导出字段;
遍历所述目标配置表中的每一所述目标配置数据,基于所述源表ID和所述导出字段,获取与所述表格ID相对应的目标查询语句;
基于所述目标查询语句获取目标数据,并将所述目标数据存储在EXCEL表中,获取并导出与所述表格ID相对应的目标分页表。
本申请的一个或多个实施例的细节在下面的附图及描述中提出。本申请的其他特征和优点将从说明书、附图以及权利要求书变得明显。
附图说明
为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例的描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本申请一实施例中数据表动态导出方法的一应用环境示意图;
图2是本申请一实施例中数据表动态导出方法的一流程图;
图3是本申请一实施例中数据表动态导出方法的另一流程图;
图4是本申请一实施例中数据表动态导出方法的另一流程图;
图5是本申请一实施例中数据表动态导出方法的另一流程图;
图6是本申请一实施例中数据表动态导出方法的另一流程图;
图7是本申请一实施例中数据表动态导出方法的另一流程图;
图8是本申请一实施例中数据表动态导出装置的一示意图;
图9是本申请一实施例中计算机设备的一示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
本申请实施例提供的数据表动态导出方法,可应用在如图1的应用环境中,其中,客户端通过网络与服务器进行通信,用于基于客户端上传的数据导出请求,使服务器执行数据表动态导出的操作。其中,客户端又称为用户端,是指与服务器相对应,为客户提供本 地服务的程序。客户端可安装在但不限于各种个人计算机、笔记本电脑、智能手机、平板电脑和便携式可穿戴设备。服务器可以用独立的服务器或者是多个服务器组成的服务器集群来实现。
在一实施例中,如图2所示,提供一种数据表动态导出方法,以该方法应用在图1中的服务器为例进行说明,该数据表动态导出方法,包括如下步骤:
S10:获取数据导出请求,数据导出请求包括目标数据表ID。
其中,数据导出请求是用于触发服务器进行数据表动态导出处理的请求。目标数据表ID是本次数据导出请求所对应的数据表ID,而数据表ID是用于唯一识别配置表的标识。
本实施例中,数据库中预先存储有多个配置表,每一配置表对应一数据表ID,以便后续基于该数据表ID查询获取对应的配置表。具体地,数据库中预先存储至少一个配置表,该配置表为用户根据业务需求预先配置并进行去重和合规校验后的合规配置表,以避免后续基于该配置表进行数据表动态导出时出现错误,从而保证数据表动态导出的顺利进行。其中,合规配置表是预先经过去重处理和合规校验获取的配置表。
本实施例中,服务器中预先配置有可实现数据表动态导出的脚本(即计算机可读指令),在项目开发过程中,若需要进行数据分页导出时,用户可通过点击客户端上“数据导出”按钮或者通过命令行输入相应的控制指令,从而触发该数据导出请求,并将该数据导出请求发送给服务器,以使服务器接收到该数据导出请求,从而使服务器预先配置的脚本可根据该数据导出请求执行数据表动态导出的操作。
S20:基于目标数据表ID查询数据库,获取与目标数据表ID相对应的目标配置表,目标配置表包括至少两个目标配置数据,每一目标配置数据包括表格ID、源表ID和导出字段。
目标配置表是基于目标数据表ID查询数据库后,获取到的与目标数据表ID相对应的合规配置表。具体地,服务器以目标数据表ID作为查询字段,执行与该查询字段相对应的查询语句,从数据库中获取与目标数据表ID相对应的目标配置表。
目标配置数据是目标配置表中预先配置好的配置数据,每一目标配置数据可对应导出一张数据表。即目标配置表中包括至少两个目标配置数据,使得该目标配置表可相应导出至少两张数据表,可实现数据分页导出。
具体地,每一目标配置数据包括表格ID、源表ID和导出字段,还可以包括表格名称,如下表一所示。其中,表格ID是用于唯一识别数据分页导出后每一数据表的标识,如表一中的SHEET_1和SHEET_2。源表ID是用于唯一识别所要进行数据导出的源数据集的标识,如表一中的1001和1002。该源数据集是用于存储原始数据的数据表,是需要进行数据导出的数据来源。导出字段用于限定分页导出后的数据表所包含的字段,如表一中的Name、Age和City等。该导出字段需为源表ID对应的源数据集中存在的字段,以避免数据无法顺利导出的问题。表格名称用于限定分页导出后的数据表的表格名称,如表一中“结果导出分页1”是基于该SHEET_1这一条目标配置数据进行数据分页导出后形成的数据表的名称。本实施例中,目标配置表中,表格ID依据目标配置表中的行数依次递增,使得其表格ID具有唯一性,避免存在完全相同的两个表格ID,使得后续进行数据分页导出时,无法唯一确定其对应的目标配置数据。
表一目标配置表
表格ID 表格名称 源表ID 导出字段
SHEET_1 结果导出分页1 1001 Name,Age,City
SHEET_2 结果导出分页2 1002 Name,Level,……,Group
S30:遍历目标配置表中的每一目标配置数据,基于源表ID和导出字段,获取与表格ID相对应的目标查询语句。
具体地,服务器遍历目标配置表中的至少两个目标配置数据,基于每一目标配置数据 中的源表ID和导出字段,获取一目标查询语句,使得该目标查询语句与其表格ID相对应。本实施例中,源表ID可唯一确定其对应的源数据集,导出字段可限定分页导出后的数据表所包含的内容,基于该源表ID和导出字段可生成对应的目标查询语句,使得每一目标查询语句可对应导出一张数据表。
S40:基于目标查询语句获取目标数据,并将目标数据存储在EXCEL表中,获取并导出与表格ID相对应的目标分页表。
其中,目标数据是指采用源表ID和导出字段形成的目标查询语句,查询源表ID对应的源数据集,获取源数据集中与导出字段相对应的数据。目标分页表是基于目标数据形成的EXCEL表,是服务器执行数据分页导出操作后获取到的数据表。每一目标配置数据对应一目标分页表,本实施例中,目标配置表中的目标配置数据包括至少两个,使得其目标分页表包括至少两个。
具体地,服务器在基于目标查询语句查询源表ID对应的源数据集,获取目标数据后,将该目标数据存储在EXCEL表中,从而生成与表格ID相对应的目标分页表,并将该目标分页表导出。由于本次数据导出请求中的目标数据表ID包含至少两个目标配置数据,每一目标配置数据可生成并导出一目标分页表,使得服务器在本次数据导出请求触发下执行步骤S20-S40的步骤,可实现动态导出至少两个目标分页表的目的,此过程可通过服务器预先配置的脚本自动执行,无需编写或修改代码,减少代码开发量,并有助于减少代码发生错误的概率,从而有利于提高数据分页导出的效率,保障项目开发的进度。
进一步地,在导出目标分页表之后,用户可基于目标分页表中每一列的内容和列与列之间的顺序,定位出目标配置数据是否出现问题。具体地,用户可直观地看出目标分页表中的每一列的内容以及列与列之间的顺序,若每一列的内容为空或者列与列之间的顺序有问题,可直接定位到该目标配置表中与该目标分页表对应的目标配置数据可能出现错误,无需查阅代码以寻找问题的原因,有助于提高项目开发的效率。
本实施例所提供的数据表动态导出方法中,根据数据导出请求中的目标数据表ID可快速查询获取到目标配置表;由于目标配置表中包含至少两个目标配置数据,根据每一目标配置数据中的源表ID和导出字段可自动快速获取对应的目标查询语句,此过程无需人工干预,有助于提高数据导出的效率;基于每一目标查询语句查询获取目标数据,将该目标数据存储在EXCEL表中,即可获取并导出对应的目标分页表。由于每一目标配置表中包括至少两个目标配置数据,每一目标配置数据可导出一目标分页表,使得每一数据导出请求可快速导出至少两个目标分页表,其过程无需编写或修改代码,有利于提高数据分页导出的效率。本实施例所提及的“动态导出”是指服务器预先配置的脚本的初始代码完成后,后续基于该脚本进行数据分页导出时,无需修改该脚本的代码,只需调整目标配置表的内容,有助于大量减少数据分页导出过程中代码的编写和修改的工作量。
在一实施例中,步骤S30中基于源表ID和导出字段,获取与表格ID相对应的目标查询语句,具体包括如下步骤:采用SQL查询语句生成规则对源表ID和导出字段进行处理,获取与表格ID相对应的目标查询语句。
其中,SQL查询语句生成规则是预先设置的用于根据源表ID和导出字段生成SQL查询语句的规则。本实施例中,SQL查询语句生成规则具体为“Select导出字段From源表ID”,基于该SQL查询语句生成规则可快速对源表ID和导出字段进行处理,以生成目标查询语句。
如表一所示,对于SHEET_1这一目标配置数据,在采用SQL查询语句生成规则对源表ID和导出字段进行处理时,可获取到“Select Name,Age,City From 1001”这一目标查询语句。相应地,在步骤S40中,服务器通过执行“Select Name,Age,City From 1001”这一目标查询语句,可从源表ID为1001对应的源数据集中,查询获取到Name,Age和City这三个导出字段对应的目标数据,将Name,Age和City这三个导出字段和其对应的 目标数据存储在EXCEL表中,即可生成与SHEET_1这一表格ID对应的目标分页表,该目标分页表可以表格名称进行命名。
本实施例中,由于服务器存储有SQL查询语句生成规则,使得其可基于目标配置表中的每一目标配置数据自动生成相应的目标查询语句,无需人工编写相应的代码,以提高后续基于该目标查询语句获取目标数据,以获取并导出目标分页表的效率。可以理解地,步骤S30中遍历目标配置表中的每一目标配置数据时,通过服务器后台解析每一目标配置数据,通过SQL查询语句生成规则对其源表ID和导出字段进行处理,可在服务器后台获取到相应的目标查询语句,无需项目开发人员根据不同导出字段和源表ID编写相应的查询语句,减少项目开发人员编写代码的工作量,也有利于降低人工编写代码出错的概率。
在一实施例中,如图3所示,步骤S40中的基于目标查询语句获取目标数据,并将目标数据存储在EXCEL表中,具体包括如下步骤:
S41:基于目标查询语句查询与源表ID相对应的源数据集,从源数据集中获取与导出字段相对应的目标数据。
具体地,服务器在根据每一目标配置数据中的源表ID和导出字段获取到对应的目标查询语句之后,可利用该目标查询请求查询与源表ID对应的源数据集,如表一中1001对应的源数据集,以从该源数据集中获取导出字段对应的内容作为目标数据。
S42:采用JAVA反射原理将目标数据存储在EXCEL表中,获取并导出与表格ID相对应的目标分页表。
JAVA反射原理是在运行状态中,对于任意一个类,都能够知道这个类的所有属性和方法;对于任意一个对象,都能够调用它的任意一个方法和属性;这种动态获取的信息以及动态调用对象的方法的功能称为java语言的反射机制。
本实施例中,服务器预先采用JAVA语言编写预先配置的脚本时,使得该脚本在执行过程中,可在根据目标查询语句获取与导出字段相对应的目标数据后,采用JAVA反射原理将导出字段和目标数据存储在一EXCEL表中,以获取到与表格ID相对应的目标分页表,并将目标分页表导出。
如表一中,服务器遍历目标配置表,首先遍历SHEET_1这一个目标配置数据,在基于源表ID和Name,Age和City这三个导出字段获取到目标查询语句之后,根据目标查询语句,先获取源表ID对应的源数据集LIST_1,根据导出字段Name,Age和City,采用JAVA反射原理得到Name,Age和City这三个导出字段在源数据集LIST_1中的具体内容作为目标数据,在EXCEL表中依次填写Name,Age和City这三个导出字段对应的目标数据,以形成一目标分页表。然后,遍历SHEET_2这一个目标配置数据以获取对应的目标分页表,直至该目标配置表中所有目标配置数据均获取到相对应的目标分页表之后,将所有目标分页表导出。
本实施例中,预先采用JAVA语言编写好可实现数据分页导出的脚本的初始代码后,在服务器接收到数据导出请求后,触发该脚本运行,以执行在根据数据导出请求获取目标配置表中的至少两个目标配置数据,根据每一目标配置数据中的源表ID和导出字段获取相应的目标查询语句后,基于该数据查询语句获取目标数据,采用JAVA反射原理将目标数据存储在EXCEL表中,以获取与该目标配置数据相对应的目标分页表。本实施例中,服务器中预先设置的脚本在完成初始代码编写之后,在执行脚本以实现数据分页导出的过程中,无需编写或修改该脚本的代码,即可依据目标配置表的内容,实现至少两个目标分页表的动态导出,使得数据分页导出过程中代码编写或修改的工作量大幅减少,有利于提高项目开发的效率。
在一实施例中,由于数据分页导出时,需要基于数据导出请求中的目标数据表ID查询数据库,获取与该目标数据表相对应的目标配置表,因此,需要预先创建存储有至少一个配置表的数据库,每一配置表对应的一数据表ID。如图4所示,即在步骤S10中的获取 数据导出请求的步骤之前,该数据表动态导出方法还包括:
S51:获取分页配置请求,分页配置请求包括原始配置表,原始配置表包括至少两个原始配置数据,每一原始配置数据包括表格ID、源表ID和导出字段。
其中,分页配置请求是用于触发服务器配置可进行数据分页导出的配置表的请求。原始配置表是用户根据自身业务需求自行配置的配置表。原始配置数据是原始配置表中用户自行配置的配置数据,可用户根据自身业务需求确定需要分页导出的数据表的信息。每一原始配置数据包括表格ID、源表ID和导出字段,还可以包括表格名称,如表二所示。表格ID是用于唯一识别依据该原始配置数据进行数据分页导出后的数据表的标识。源表ID是用于唯一识别所要进行数据分页导出的源数据集的标识。导出字段是用于限定分页导出的数据表所要包含的字段。表格名称用于限定数据分页导出后每一数据表的名称。
本实施例中,用户可通过客户端给服务器发送一分页配置请求,该分页配置请求中携带如表二所示的原始配置表,使得服务器获取该原始配置表。在该原始配置表中,原始配置数据的数量为本次分页配置请求所需要进行数据分页导出的数据表的数量。原始配置表中的导出字段之间的顺序即为数据分页导出形成的数据表中字段之间的顺序。
表二原始配置表
表格ID 表格名称 源表ID 导出字段
SHEET_1 结果导出分页1 1001 Name,Age,City
SHEET_2 结果导出分页2 1002 Name,Level,……,Group
SHEET_3 结果导出分页1 1001 Name,Age,City
SHEET_4 结果导出分页4 1001 Name,City,Age
SHEET_5 结果导出分页5 1001 Name,Age,City
SHEET_6 结果导出分页6 1002 Name;Level;……;Group
S52:对原始配置表中的至少两个原始配置数据进行去重处理,获取第一配置表。
由于本次分页配置请求中的原始配置表是用户自主上传的配置表,在原始配置表中配置的原始配置数据的数量较多时,可能存在重复配置的现象,使得后续直接基于该原始配置表进行数据分页导出时,可能出现重复导出而影响导出效率的问题,因此,在获取到每一分页配置请求后,服务器需对该分页配置请求携带的原始配置表中的至少两个原始配置数据进行去重处理,获取第一配置表。其中,第一配置表是对原始配置表中的原始配置数据进行去重处理后得到的配置表。具体地,对至少两个原始配置数据进行去重处理,是指对原始配置数据中源表ID和导出字段相同的至少两个原始配置数据进行处理,使得第一配置表中只包含其中一个原始配置数据的过程。
S53:对第一配置表中的每一原始配置数据进行合规校验,获取合规校验通过的合规配置表,将合规配置表存储在数据库中。
在对原始配置表进行去重处理获得的第一配置表后,该第一配置表中还包括至少一个原始配置数据,每一原始配置数据是用户自主填写的配置数据,这些原始配置数据的填写可能不符合预先设置的填写规范,使其不能被服务器预先设置的脚本执行,从而导致后续基于该第一配置表进行数据分页导出时,出现导出错误的问题。因此,步骤S53中需对第一配置表中的每一原始配置数据进行合规校验,以获取合规校验通过的合规配置表,使得该合规配置表中的每一原始配置数据均符合预先设置的填写规范,将该合规配置表存储在数据库中,以减少后续调用该数据库中的合规配置表进行数据分页导出时出现错误的概率。
本实施例所提供的数据表动态导出方法中,通过对分页配置请求携带的原始配置表中至少两个原始配置数据之间进行去重处理,以获取第一配置表,以避免基于第一配置表中的至少两个原始配置数据进行数据分页导出时需执行重复导出操作,从而提高数据分页导出的效率。然后,通过对第一配置表中的每一原始配置数据进行合规校验,以保留合规校 验通过的所有原始配置数据形成的合规配置表,使得后续基于该合规配置表进行数据分页导出时出错率减少,从而提高数据分页导出的效率。可以理解地,通过步骤S51-S53配置好的合规配置表存储在数据库中,每一合规配置表对应一数据表ID,以使后续基于数据导出请求中的目标数据表ID查询到对应的合规配置表作为目标配置表。
在一实施例中,原始配置数据表格ID、源表ID、导出字段和表格名称。如图5所示,步骤S52中对原始配置表中的至少两个原始配置数据进行去重处理,获取第一配置表,具体包括如下步骤:
S521:判断原始配置表中的至少两个原始配置数据是否存在源表ID和导出字段完全相同的至少两个重复配置数据。
具体地,服务器在获取到本次分页配置请求之后,获取该分页配置请求中的原始配置表(如表二所示),判断该原始配置表中的至少两个原始配置数据是否存在源表ID和导出字段完全相同的至少两个重复配置数据。该至少两个重复配置数据是指源表ID和导出字段完全相同的至少两个原始配置数据。由于后续在数据分页导出过程中,需基于目标配置数据中的源表ID和导出字段获取目标查询语句,若存在源表ID和导出字段完全相同的两个重复配置数据,可能使得其后续形成的目标查询语句相同,会导致重复操作,使得其效率降低。本实施例中,源表ID和导出字段完全相同不仅包括源表ID和导出字段的名称相同,还包括导出字段的顺序相同,因为导出字段的顺序决定后续数据分页导出的目标分页表中字段的顺序。如表二所示,表格ID为SHEET_1、SHEET_3和SHEET_5对应的原始配置数据中源表ID和导出字段完全相同,因此,SHEET_1、SHEET_3和SHEET_5对应的原始配置数据为重复配置数据。但SHEET_4这一原始配置数据与SHEET_1、SHEET_3和SHEET_5这三个原始配置数据的导出字段的顺序不相同,则其不是重复配置数据。
S522:若存在源表ID和导出字段完全相同的至少两个重复配置数据,则判断至少两个重复配置数据中的表格名称是否相同。
由于后续基于源表ID和导出字段会形成目标查询语句,基于每一目标查询语句均可获取一目标分页表,每一目标分页表以表格名称进行命名,因此,在存在源表ID和导出字段完全相同的至少两个重复配置数据时,需判断至少两个重复配置数据中的表格名称是否相同。若至少两个重复配置数据的表格名称相同,则后续基于至少两个重复配置数据会导出内容相同且名称相同的至少两个目标分页表。若两个重复配置数据的表格名称不相同,则后续基于至少两个重复配置数据获取的两个目标分页表在导出时,会导出内容相同而名称不同的至少两个目标分页表,使得后续调用至少两个目标分页表过程中出现混乱,而且导致其数据分页导出过程中出现重复操作,降低数据分页导出的效率。
S523:若至少两个重复配置数据中的表格名称相同,则保留一个重复配置数据,获取第一配置表。
具体地,若至少两个重复配置数据中的表格名称相同,则说明后续基于至少两个重复配置数据的源表ID和导出字段形成的目标查询语句相同,执行至少两个相同的目标查询语句获取到至少两个目标分页表的表格名称也相同,此时,只需保留一个重复配置数据,即可获取从原始配置表中去除重复配置数据的第一配置表。如表二所示,SHEET_1、SHEET_3和SHEET_5对应的原始配置数据为重复配置数据,在这三个重复配置数据中,SHEET_1和SHEET_3的表格名称相同,即后续基于SHEET_1和SHEET_3这两个重复配置数据所形成的目标分页表的表格名称均为“结果导出分页1”,两者完全相同,因此可只保留其中一个重复配置数据,以获取第一配置表,避免后续基于该第一配置表中的原始配置数据进行数据分页导出时,需重复执行相同的操作,影响数据分页导出的效率。
S524:若至少两个重复配置数据中的表格名称不相同,则生成提示信息,并将提示信息发送给触发分页配置请求的客户端,获取客户端反馈的修改信息,基于修改信息获取第一配置表。
具体地,若至少两个重复配置数据中的表格名称不相同,则说明后续基于至少两个重复配置数据的源表ID和导出字段形成的目标查询语句相同,执行至少两个相同的目标查询语句获取到至少两个目标分页表中的表格名称不相同,即会导出内容相同而名称不同的至少两个目标分页表,使得后续进行数据分页导出过程中进行重复操作,降低数据分页导出的效率。
本实施例中,服务器在判断至少两个重复配置数据的表格名称不相同时,生成提示信息,该提示信息提示本次分页配置请求中原始配置表中存在源表ID和导出字段相同,但表格名称不相同的至少两个重复数据。然后,服务器将生成的提示信息发送给触发本次分页配置请求的客户端,以使用户通过该客户端查看到该提示信息,并反馈相应的修改信息,该修改信息为删除至少两个重复配置数据中的至少一个,以保留其中一个重复配置数据。服务器在获取到客户端反馈的修改信息后,基于该修改信息获取第一配置表。
步骤S521-S524中,在确定原始配置表中存在源表ID和导出字段完全相同的至少两个重复配置数据之后,根据至少两个重复配置数据的表格名称是否相同,对至少两个重复配置数据进行去重处理,以获取第一配置表,以确保后续基于该第一配置表获取合规配置表后,其合规配置表中不包含重复配置数据,使得后续进行数据分页导出时避免进行重复导出操作,提高数据分页导出的效率。
在一实施例中,如图6所示,步骤S53中的对第一配置表中的每一原始配置数据进行合规校验,获取合规校验通过的合规配置表,具体包括如下步骤:
S531:判断第一配置表中的每一原始配置数据中,源表ID对应的源数据集是否存在导出字段。
具体地,服务器在对原始配置表中的原始配置数据进行去重处理获得第一配置表后,需对第一配置表中的每一原始配置数据进行合规校验,以确定第一配置表中的每一原始配置数据在后续能够被服务器预先配置的脚本执行,从而保障后续基于原始配置数据进行数据分页导出的顺利进行。
由于在基于原始配置数据进行数据分页导出时,需基于源表ID和导出字段形成目标查询语句,基于该目标查询语句查询获取源表ID对应的源数据集,从而获取与导出字段相对应的目标数据,因此,需预先校验每一原始配置数据中,源表ID对应的源数据集中是否存在原始配置数据中对应的导出字段,以避免后续进行数据分页导出时,无法导出相应数据,使得数据分页导出过程出错。
S532:若源表ID对应的源数据集中存在导出字段,则判断是否导出字段是否包含至少两个导出字段。
具体地,在每一原始配置数据中,源表ID对应的源数据集中存在该原始配置数据中设置的导出字段时,说明后续基于该原始配置数据可进行数据分页导出。每一原始配置数据中可配置一个导出字段,也可以配置至少两个导出字段,若配置有至少两个导出字段时,导出字段与导出字段之间需采用预设符号进行分隔。预设符号是预先设置的切割符号,在后续进行数据分页导出时,若服务器预先设置的脚本识别到该预设符号时,需将预设符号前后两个导出字段进行切割。本实施例中,该预设符号可采用逗号,在每一原始配置数据中任意两个导出字段之间采用逗号作为分隔符时,则该原始配置数据合规校验通过;反之,则合规校验不通过。
可以理解地,在每一原始配置数据中,若源表ID对应的源数据集中不存在原始配置数据设置的相应导出字段时,需生成提示信息,该提示信息提示源表ID对应的源数据集中不存在对应的导出字段。进一步地,该提示信息还可显示源表ID对应的源数据集中存在的所有字段,以便用户进行选择。然后,服务器将该提示信息发送给触发本次分页配置请求的客户端,以使用户通过该客户端查看到该提示信息,并反馈相应的修改信息。
S533:若导出字段包含至少两个导出字段,则判断任意两个导出字段之间的分隔符是 否与预设符号相匹配,若相匹配,获取获取合规校验通过的合规配置表。
本实施例中,若任一原始配置数据的导出字段包含至少两个导出字段,需判断任意两个导出字段之间的分隔符是否与预设符号相匹配;若任意两个导出字段之间的分隔符与预设符号相匹配,则获取合规校验通过的合规配置表;若任意两个导出字段之间的分隔符与预设符号不相匹配,则给触发本次分页配置请求的客户端发送提示信息,以提示用户通过客户端进行修改,直至所有原始配置数据中任意两个导出字段之间的分隔符与预设符号相匹配。
若预设符号为逗号,表二所示的SHEET_2和SHEET_4这两个原始配置数据均包含至少三个导出字段,由于SHEET_2这个原始配置数据的任意两个导出字段之间采用逗号作为分隔符,与预设符号相匹配,则该原始配置数据合规校验通过;而SHEET_4这个原始配置数据的任意两个导出字段之间采用分号作为分隔符,与预设符号不相匹配,则需要生成提示信息并发送给触发本次分页配置请求的客户端,以提示用户修改相应的分隔符,直至该第一配置表中所有的原始配置数据均合规校验通过时,获取合规校验通过的合规配置表。
S534:若导出字段不包含至少两个导出字段,则获取合规校验通过的合规配置表。
本实施例中,若任一原始配置数据表中,源表ID对应的源数据集中存在导出字段,且导出字段不包含至少两个导出字段,则无需判断任意两个导出字段之间的分隔符是否与预设符号相匹配的步骤,直接确定该原始配置数据合规校验通过。在第一配置表中所有原始配置数据均合规校验通过时,获取合规校验通过的合规配置表。可以理解地,该合规配置表对应一数据表ID,并将数据表ID与合规配置表关联存储在数据表中,以便后续基于数据表ID查询获取到对应的合规配置表。
步骤S531-S534中,通过对原始配置表去重处理后获得的第一配置表中的每一原始配置数据进行合规校验,以获取合规校验通过的合规配置表,以使后续可基于该合规配置表中进行数据分页导出的顺利进行,避免数据分页导出过程中出现导出错误的问题出现。具体地,服务器先通过判断源表ID对应的源数据集中是否存在对应的导出字段,以避免后续基于源表ID和导出字段形成的目标查询语句无法查找到相应的目标数据的情况出现,从而保障后续数据分页导出的顺利进行。然后,服务器在源表ID对应的源数据集中存在导出字段时,需保证任意两个导出字段之间的分隔符与预设符号相匹配,以使后续进行数据分页导出时,可基于预设符号进行字段分隔,有利于保障数据分页导出的顺利进行。
在一实施例中,在步骤S50获取到每一合规配置表之后,给每一合规配置表配置对应的数据表ID,使得每一合规配置表对应一数据表ID,并将该合规配置表与数据表ID关联存储在数据库中。在获取到合规配置表并将该合规配置表存储在数据库之后,用户可能根据新的业务需求或者其他需求,需对数据库中的合规配置表进行修改,以调整合规配置表中原始配置数据的顺序,或者调整每一原始配置数据中的源表ID、导出字段和表格名称等内容,以使更新后的合规配置表更符合用户需求。
如图7所示,在步骤S50之后,即在将合规配置表存储在数据库中的步骤之后,该数据表动态导出方法包括如下步骤:
S61:获取数据修改请求,数据修改请求包括待修改数据表ID和修改标识。
其中,数据修改请求是用于触发服务器对合规配置表进行修改的请求。待修改数据表ID用于确定本次数据修改请求所需要进行修改的合规配置表。修改标识是指需要进行修改操作的标识,每一修改标识对应有一修改函数。本实施例中,修改标识包括删除标识、增加标识和替换标识。
S62:根据数据表ID查询数据库,获取与数据表ID相对应的合规配置表作为待修改配置表。
具体地,服务器在获取到数据修改请求后,基于该数据修改请求中的数据表ID查询数据库,获取与该数据表ID相对应的合规配置表作为待修改配置表。该待修改配置表是 本次数据修改请求所需要进行修改的合规配置表。
S63:采用与修改标识相对应的修改函数对待修改配置表进行修改,获取修改后的合规配置表。
具体地,服务器在获取待修改配置表之后,基于该数据修改请求中的修改标识对应的修改函数对待修改配置表进行修改,以获取修改后的合规配置数据。本实施例中,服务器在接收到数据修改请求之后,可根据该数据修改请求中的修改标识进入相应的信息修改界面,接收用户在该信息修改界面输入的修改参数,将该修改参数传递给与该修改标识相对应的修改函数之后,基于该修改函数对待修改配置表进行修改。
例如,若修改标识为删除标识,则该删除标识对应的修改函数为删除函数,根据该删除标识进入相应的信息修改界面,以使用户在该信息修改界面输入相应的修改参数,如需删除一原始配置数据,则其修改参数为表格ID;如需删除一原始配置数据中的某些导出字段,则其修改参数为表格ID和所需删除的导出字段。服务器在接收到这些修改参数之后,将该修改参数传递其对应的删除函数,利用该删除函数对待修改配置表进行删除处理,获取修改后的合规配置表,以使修改后的合规配置表更符合用户需求。
例如,若修改标识为增加标识,则该增加标识对应的修改函数为增加函数,根据该增加标识进入相应的信息修改界面,以使用户在该信息修改界面输入相应的修改参数,如需增加一原始配置数据,则其修改参数为表格ID、源表ID和导出字段;如需增加一原始配置数据中的导出字段,则其修改参数为表格ID和所需增加的导出字段。服务器在接收到这些修改参数之后,将该修改参数传递给其对应的增加函数,利用增加函数对待修改配置表进行增加处理,获取修改后的合规配置表,以使修改后的合规配置表更符合用户需求。
例如,若修改标识为替换标识,该替换标识对应的修改函数为替换函数,根据该替换标识进入相应的信息修改界面,以使用户在该信息修改界面输入相应的修改参数;如需对一原始配置数据中的表格名称进行修改,则其修改参数为表格ID和替换后的表格名称;如需对一原始配置参数的导出字段进行修改,其修改参数为表格ID和修改后的导出字段。服务器在接收到这些修改参数之后,将修改参数传递给其对应的替换函数,利用该替换函数对待修改配置表进行替换处理,即删除修改前该修改参数对应的内容,替换为该修改参数对应的内容,以获取修改后的合规配置表,以使修改后的合规配置表更符合用户需求。
本实施例所提供的数据表动态导出方法中,用户可通过步骤S61-S63及时响应用户的需求,更新数据库中合规配置表,以使其更符合用户需求。在基于合规配置表进行数据分页导出时,服务器预先设置的可执行数据分页导出的脚本无需进行代码修改,只需对合规配置表中的原始配置参数进行修改,其过程可有效减少项目开发过程中的代码编写和修改的工作量,可有助于加快项目开发的进度。
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
在一实施例中,提供一种数据表动态导出装置,该数据表动态导出装置与上述实施例中数据表动态导出方法一一对应。如图8所示,该数据表动态导出装置包括导出请求获取模块10、目标配置表获取模块20、查询语句获取模块30和目标分页表获取模块40。各功能模块详细说明如下:
导出请求获取模块10,用于获取数据导出请求,数据导出请求包括目标数据表ID。
目标配置表获取模块20,用于基于目标数据表ID查询数据库,获取与目标数据表ID相对应的目标配置表,目标配置表包括至少两个目标配置数据,每一目标配置数据包括表格ID、源表ID和导出字段。
查询语句获取模块30,用于遍历目标配置表中的每一目标配置数据,基于源表ID和导出字段,获取与表格ID相对应的目标查询语句。
目标分页表获取模块40,用于基于目标查询语句获取目标数据,并将目标数据存储 在EXCEL表中,获取并导出与表格ID相对应的目标分页表。
优选地,查询语句获取模块30,用于采用SQL查询语句生成规则对源表ID和导出字段进行处理,获取与表格ID相对应的目标查询语句。
优选地,目标分页表获取模块40包括目标数据获取单元41和分页表获取单元42。
目标数据获取单元41,用于基于目标查询语句查询与源表ID相对应的源数据集,从源数据集中获取与导出字段相对应的目标数据。
分页表获取单元42,用于采用JAVA反射原理将目标数据存储在EXCEL表中,获取并导出与表格ID相对应的目标分页表。
优选地,数据表动态导出装置还包括配置请求获取单元51、去重处理单元52和合规校验单元53。
配置请求获取单元51,用于获取分页配置请求,分页配置请求包括原始配置表,原始配置表包括至少两个原始配置数据,每一原始配置数据包括表格ID、源表ID和导出字段。
去重处理单元52,用于对原始配置表中的至少两个原始配置数据进行去重处理,获取第一配置表。
合规校验单元53,用于对第一配置表中的每一原始配置数据进行合规校验,获取合规校验通过的合规配置表,将合规配置表存储在数据库中。
优选地,原始配置数据还包括表格名称。
去重处理单元52包括重复判断子单元521、名称判断子单元522、第一去重处理单元523和第二去重处理单元524。
重复判断子单元521,用于判断原始配置表中的至少两个原始配置数据是否存在源表ID和导出字段完全相同的至少两个重复配置数据。
名称判断子单元522,用于若存在源表ID和导出字段完全相同的至少两个重复配置数据,则判断至少两个重复配置数据中的表格名称是否相同。
第一去重处理单元523,用于若至少两个重复配置数据中的表格名称相同,则保留一个重复配置数据,获取第一配置表。
第二去重处理单元524,用于若至少两个重复配置数据中的表格名称不相同,则生成提示信息,并将提示信息发送给触发分页配置请求的客户端,获取客户端反馈的修改信息,基于修改信息获取第一配置表。
优选地,合规校验单元53包括字段存在判断子单元531、字段数量判断子单元532、第一合规校验子单元533和第二合规校验子单元534。
字段存在判断子单元531,用于判断第一配置表中的每一原始配置数据中,源表ID对应的源数据集是否存在导出字段。
字段数量判断子单元532,用于若源表ID对应的源数据集中存在导出字段,则判断是否导出字段是否包含至少两个导出字段。
第一合规校验子单元533,用于若导出字段包含至少两个导出字段,则判断任意两个导出字段之间的分隔符是否与预设符号相匹配,若相匹配,获取获取合规校验通过的合规配置表。
第二合规校验子单元534,用于若导出字段不包含至少两个导出字段,则获取合规校验通过的合规配置表。
优选地,每一合规配置表对应一数据表ID。
数据表动态导出装置还包括修改请求获取单元61、待修改配置表获取单元62和配置表修改处理单元63。
修改请求获取单元61,用于获取数据修改请求,数据修改请求包括数据表ID、表格ID和修改标识。
待修改配置表获取单元62,用于根据数据表ID查询数据库,获取与数据表ID相对应的合规配置表作为待修改配置表。
配置表修改处理单元63,用于采用与修改标识相对应的修改函数对待修改配置表进行修改,获取修改后的合规配置表。
关于数据表动态导出装置的具体限定可以参见上文中对于数据表动态导出方法的限定,在此不再赘述。上述数据表动态导出装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
在一个实施例中,提供了一种计算机设备,该计算机设备可以是服务器,其内部结构图可以如图9所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机可读指令和数据库。该内存储器为非易失性存储介质中的操作系统和计算机可读指令的运行提供环境。该计算机设备的数据库用于合规配置表和目标分页表,以及数据分页导出过程中形成的其他数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机可读指令被处理器执行时以实现一种数据表动态导出方法。
在一个实施例中,提供了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机可读指令,处理器执行计算机可读指令时实现以下步骤:获取数据导出请求,数据导出请求包括目标数据表ID;基于目标数据表ID查询数据库,获取与目标数据表ID相对应的目标配置表,目标配置表包括至少两个目标配置数据,每一目标配置数据包括表格ID、源表ID和导出字段;遍历目标配置表中的每一目标配置数据,基于源表ID和导出字段,获取与表格ID相对应的目标查询语句;基于目标查询语句获取目标数据,并将目标数据存储在EXCEL表中,获取并导出与表格ID相对应的目标分页表。
在一实施例中,处理器执行计算机可读指令时实现以下步骤:采用SQL查询语句生成规则对源表ID和导出字段进行处理,获取与表格ID相对应的目标查询语句。
在一实施例中,处理器执行计算机可读指令时实现以下步骤:基于目标查询语句查询与源表ID相对应的源数据集,从源数据集中获取与导出字段相对应的目标数据;采用JAVA反射原理将目标数据存储在EXCEL表中,获取并导出与表格ID相对应的目标分页表。
在一实施例中,在获取数据导出请求的步骤之前,处理器执行计算机可读指令时还实现以下步骤:获取分页配置请求,分页配置请求包括原始配置表,原始配置表包括至少两个原始配置数据,每一原始配置数据包括表格ID、源表ID和导出字段;对原始配置表中的至少两个原始配置数据进行去重处理,获取第一配置表;对第一配置表中的每一原始配置数据进行合规校验,获取合规校验通过的合规配置表,将合规配置表存储在数据库中。
在一实施例中,原始配置数据还包括表格名称。处理器执行计算机可读指令时实现以下步骤:判断原始配置表中的至少两个原始配置数据是否存在源表ID和导出字段完全相同的至少两个重复配置数据;若存在源表ID和导出字段完全相同的至少两个重复配置数据,则判断至少两个重复配置数据中的表格名称是否相同;若至少两个重复配置数据中的表格名称相同,则保留一个重复配置数据,获取第一配置表;若至少两个重复配置数据中的表格名称不相同,则生成提示信息,并将提示信息发送给触发分页配置请求的客户端,获取客户端反馈的修改信息,基于修改信息获取第一配置表。
在一实施例中,处理器执行计算机可读指令时实现以下步骤:判断第一配置表中的每一原始配置数据中,源表ID对应的源数据集是否存在导出字段;若源表ID对应的源数据集中存在导出字段,则判断是否导出字段是否包含至少两个导出字段;若导出字段包含至少两个导出字段,则判断任意两个导出字段之间的分隔符是否与预设符号相匹配,若相匹 配,获取获取合规校验通过的合规配置表;若导出字段不包含至少两个导出字段,则获取合规校验通过的合规配置表。
在一实施例中,每一合规配置表对应一数据表ID。在将合规配置表存储在数据库中的步骤之后,处理器执行计算机可读指令时还实现以下步骤:获取数据修改请求,数据修改请求包括数据表ID、表格ID和修改标识;根据数据表ID查询数据库,获取与数据表ID相对应的合规配置表作为待修改配置表;采用与修改标识相对应的修改函数对待修改配置表进行修改,获取修改后的合规配置表。
在一个实施例中,提供一个或多个存储有计算机可读指令的非易失性可读存储介质,所述计算机可读存储介质存储有计算机可读指令,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:获取数据导出请求,数据导出请求包括目标数据表ID;基于目标数据表ID查询数据库,获取与目标数据表ID相对应的目标配置表,目标配置表包括至少两个目标配置数据,每一目标配置数据包括表格ID、源表ID和导出字段;遍历目标配置表中的每一目标配置数据,基于源表ID和导出字段,获取与表格ID相对应的目标查询语句;基于目标查询语句获取目标数据,并将目标数据存储在EXCEL表中,获取并导出与表格ID相对应的目标分页表。
在一实施例中,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:采用SQL查询语句生成规则对源表ID和导出字段进行处理,获取与表格ID相对应的目标查询语句。
在一实施例中,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:基于目标查询语句查询与源表ID相对应的源数据集,从源数据集中获取与导出字段相对应的目标数据;采用JAVA反射原理将目标数据存储在EXCEL表中,获取并导出与表格ID相对应的目标分页表。
在一实施例中,在获取数据导出请求的步骤之前,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:获取分页配置请求,分页配置请求包括原始配置表,原始配置表包括至少两个原始配置数据,每一原始配置数据包括表格ID、源表ID和导出字段;对原始配置表中的至少两个原始配置数据进行去重处理,获取第一配置表;对第一配置表中的每一原始配置数据进行合规校验,获取合规校验通过的合规配置表,将合规配置表存储在数据库中。
在一实施例中,原始配置数据还包括表格名称。所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:判断原始配置表中的至少两个原始配置数据是否存在源表ID和导出字段完全相同的至少两个重复配置数据;若存在源表ID和导出字段完全相同的至少两个重复配置数据,则判断至少两个重复配置数据中的表格名称是否相同;若至少两个重复配置数据中的表格名称相同,则保留一个重复配置数据,获取第一配置表;若至少两个重复配置数据中的表格名称不相同,则生成提示信息,并将提示信息发送给触发分页配置请求的客户端,获取客户端反馈的修改信息,基于修改信息获取第一配置表。
在一实施例中,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:判断第一配置表中的每一原始配置数据中,源表ID对应的源数据集是否存在导出字段;若源表ID对应的源数据集中存在导出字段,则判断是否导出字段是否包含至少两个导出字段;若导出字段包含至少两个导出字段,则判断任意两个导出字段之间的分隔符是否与预设符号相匹配,若相匹配,获取获取合规校验通过的合规配置表;若导出字段不包含至少两个导出字段,则获取合规校验通过的合规配置表。
在一实施例中,每一合规配置表对应一数据表ID。在将合规配置表存储在数据库中的步骤之后,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:获取数据修改请求,数据修改请求包括数据表ID、表格ID和修改标识; 根据数据表ID查询数据库,获取与数据表ID相对应的合规配置表作为待修改配置表;采用与修改标识相对应的修改函数对待修改配置表进行修改,获取修改后的合规配置表。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一非易失性计算机可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。
以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。

Claims (20)

  1. 一种数据表动态导出方法,其特征在于,包括:
    获取数据导出请求,所述数据导出请求包括目标数据表ID;
    基于所述目标数据表ID查询数据库,获取与所述目标数据表ID相对应的目标配置表,所述目标配置表包括至少两个目标配置数据,每一所述目标配置数据包括表格ID、源表ID和导出字段;
    遍历所述目标配置表中的每一所述目标配置数据,基于所述源表ID和所述导出字段,获取与所述表格ID相对应的目标查询语句;
    基于所述目标查询语句获取目标数据,并将所述目标数据存储在EXCEL表中,获取并导出与所述表格ID相对应的目标分页表。
  2. 如权利要求1所述的数据表动态导出方法,其特征在于,所述基于所述源表ID和所述导出字段,获取与所述表格ID相对应的目标查询语句,包括:
    采用SQL查询语句生成规则对所述源表ID和所述导出字段进行处理,获取与所述表格ID相对应的目标查询语句。
  3. 如权利要求1所述的数据表动态导出方法,其特征在于,所述基于所述目标查询语句获取目标数据,并将所述目标数据存储在EXCEL表中,包括:
    基于所述目标查询语句查询与所述源表ID相对应的源数据集,从所述源数据集中获取与所述导出字段相对应的目标数据;
    采用JAVA反射原理将所述目标数据存储在EXCEL表中,获取并导出与所述表格ID相对应的目标分页表。
  4. 如权利要求1所述的数据表动态导出方法,其特征在于,在所述获取数据导出请求的步骤之前,所述数据表动态导出方法还包括:
    获取分页配置请求,所述分页配置请求包括原始配置表,所述原始配置表包括至少两个原始配置数据,每一原始配置数据包括表格ID、源表ID和导出字段;
    对所述原始配置表中的至少两个所述原始配置数据进行去重处理,获取第一配置表;
    对所述第一配置表中的每一原始配置数据进行合规校验,获取合规校验通过的合规配置表,将所述合规配置表存储在数据库中。
  5. 如权利要求4所述的数据表动态导出方法,其特征在于,所述原始配置数据还包括表格名称;
    所述对所述原始配置表中的至少两个所述原始配置数据进行去重处理,获取第一配置表,包括:
    判断所述原始配置表中的至少两个所述原始配置数据是否存在源表ID和导出字段完全相同的至少两个重复配置数据;
    若存在源表ID和导出字段完全相同的至少两个重复配置数据,则判断至少两个所述重复配置数据中的表格名称是否相同;
    若至少两个所述重复配置数据中的表格名称相同,则保留一个所述重复配置数据,获取第一配置表;
    若至少两个所述重复配置数据中的表格名称不相同,则生成提示信息,并将所述提示信息发送给触发所述分页配置请求的客户端,获取所述客户端反馈的修改信息,基于所述修改信息获取第一配置表。
  6. 如权利要求4所述的数据表动态导出方法,其特征在于,所述对所述第一配置表中的每一原始配置数据进行合规校验,获取合规校验通过的合规配置表,包括:
    判断所述第一配置表中的每一原始配置数据中,所述源表ID对应的源数据集是否存在所述导出字段;
    若所述源表ID对应的源数据集中存在所述导出字段,则判断是否所述导出字段是否包含至少两个导出字段;
    若所述导出字段包含至少两个导出字段,则判断任意两个所述导出字段之间的分隔符是否与预设符号相匹配,若相匹配,获取获取合规校验通过的合规配置表;
    若所述导出字段不包含至少两个导出字段,则获取合规校验通过的合规配置表。
  7. 如权利要求4所述的数据表动态导出方法,其特征在于,每一所述合规配置表对应一数据表ID;
    在所述将所述合规配置表存储在数据库中的步骤之后,所述数据表动态导出方法包括如下步骤:
    获取数据修改请求,所述数据修改请求包括数据表ID、表格ID和修改标识;
    根据所述数据表ID查询数据库,获取与所述数据表ID相对应的合规配置表作为待修改配置表;
    采用与所述修改标识相对应的修改函数对所述待修改配置表进行修改,获取修改后的合规配置表。
  8. 一种数据表动态导出装置,其特征在于,包括:
    导出请求获取模块,用于获取数据导出请求,所述数据导出请求包括目标数据表ID;
    目标配置表获取模块,用于基于所述目标数据表ID查询数据库,获取与所述目标数据表ID相对应的目标配置表,所述目标配置表包括至少两个目标配置数据,每一所述目标配置数据包括表格ID、源表ID和导出字段;
    查询语句获取模块,用于遍历所述目标配置表中的每一所述目标配置数据,基于所述源表ID和所述导出字段,获取与所述表格ID相对应的目标查询语句;
    目标分页表获取模块,用于基于所述目标查询语句获取目标数据,并将所述目标数据存储在EXCEL表中,获取并导出与所述表格ID相对应的目标分页表。
  9. 一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,其特征在于,所述处理器执行所述计算机可读指令时执行下步骤:
    获取数据导出请求,所述数据导出请求包括目标数据表ID;
    基于所述目标数据表ID查询数据库,获取与所述目标数据表ID相对应的目标配置表,所述目标配置表包括至少两个目标配置数据,每一所述目标配置数据包括表格ID、源表ID和导出字段;
    遍历所述目标配置表中的每一所述目标配置数据,基于所述源表ID和所述导出字段,获取与所述表格ID相对应的目标查询语句;
    基于所述目标查询语句获取目标数据,并将所述目标数据存储在EXCEL表中,获取并导出与所述表格ID相对应的目标分页表。
  10. 如权利要求9所述的计算机设备,其特征在于,所述基于所述目标查询语句获取目标数据,并将所述目标数据存储在EXCEL表中,包括:
    基于所述目标查询语句查询与所述源表ID相对应的源数据集,从所述源数据集中获取与所述导出字段相对应的目标数据;
    采用JAVA反射原理将所述目标数据存储在EXCEL表中,获取并导出与所述表格ID相对应的目标分页表。
  11. 如权利要求9所述的计算机设备,其特征在于,在所述获取数据导出请求的步骤之前,所述处理器执行所述计算机可读指令时还执行如下步骤:
    获取分页配置请求,所述分页配置请求包括原始配置表,所述原始配置表包括至少两个原始配置数据,每一原始配置数据包括表格ID、源表ID和导出字段;
    对所述原始配置表中的至少两个所述原始配置数据进行去重处理,获取第一配置表;
    对所述第一配置表中的每一原始配置数据进行合规校验,获取合规校验通过的合规配置表,将所述合规配置表存储在数据库中。
  12. 如权利要求11所述的计算机设备,其特征在于,所述原始配置数据还包括表格名称;
    所述对所述原始配置表中的至少两个所述原始配置数据进行去重处理,获取第一配置表,包括:
    判断所述原始配置表中的至少两个所述原始配置数据是否存在源表ID和导出字段完全相同的至少两个重复配置数据;
    若存在源表ID和导出字段完全相同的至少两个重复配置数据,则判断至少两个所述重复配置数据中的表格名称是否相同;
    若至少两个所述重复配置数据中的表格名称相同,则保留一个所述重复配置数据,获取第一配置表;
    若至少两个所述重复配置数据中的表格名称不相同,则生成提示信息,并将所述提示信息发送给触发所述分页配置请求的客户端,获取所述客户端反馈的修改信息,基于所述修改信息获取第一配置表。
  13. 如权利要求11所述的计算机设备,其特征在于,所述对所述第一配置表中的每一原始配置数据进行合规校验,获取合规校验通过的合规配置表,包括:
    判断所述第一配置表中的每一原始配置数据中,所述源表ID对应的源数据集是否存在所述导出字段;
    若所述源表ID对应的源数据集中存在所述导出字段,则判断是否所述导出字段是否包含至少两个导出字段;
    若所述导出字段包含至少两个导出字段,则判断任意两个所述导出字段之间的分隔符是否与预设符号相匹配,若相匹配,获取获取合规校验通过的合规配置表;
    若所述导出字段不包含至少两个导出字段,则获取合规校验通过的合规配置表。
  14. 如权利要求11所述的计算机设备,其特征在于,每一所述合规配置表对应一数据表ID;
    在所述将所述合规配置表存储在数据库中的步骤之后,所述所述处理器执行所述计算机可读指令时还执行如下步骤:
    获取数据修改请求,所述数据修改请求包括数据表ID、表格ID和修改标识;
    根据所述数据表ID查询数据库,获取与所述数据表ID相对应的合规配置表作为待修改配置表;
    采用与所述修改标识相对应的修改函数对所述待修改配置表进行修改,获取修改后的合规配置表。
  15. 一个或多个存储有计算机可读指令的非易失性可读存储介质,所述计算机可读存储介质存储有计算机可读指令,其特征在于,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:
    获取数据导出请求,所述数据导出请求包括目标数据表ID;
    基于所述目标数据表ID查询数据库,获取与所述目标数据表ID相对应的目标配置表,所述目标配置表包括至少两个目标配置数据,每一所述目标配置数据包括表格ID、源表ID和导出字段;
    遍历所述目标配置表中的每一所述目标配置数据,基于所述源表ID和所述导出字段,获取与所述表格ID相对应的目标查询语句;
    基于所述目标查询语句获取目标数据,并将所述目标数据存储在EXCEL表中,获取并导出与所述表格ID相对应的目标分页表。
  16. 如权利要求15所述的非易失性可读存储介质,其特征在于,所述基于所述目标 查询语句获取目标数据,并将所述目标数据存储在EXCEL表中,包括:
    基于所述目标查询语句查询与所述源表ID相对应的源数据集,从所述源数据集中获取与所述导出字段相对应的目标数据;
    采用JAVA反射原理将所述目标数据存储在EXCEL表中,获取并导出与所述表格ID相对应的目标分页表。
  17. 如权利要求15所述的非易失性可读存储介质,其特征在于,在所述获取数据导出请求的步骤之前,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器还执行如下步骤:
    获取分页配置请求,所述分页配置请求包括原始配置表,所述原始配置表包括至少两个原始配置数据,每一原始配置数据包括表格ID、源表ID和导出字段;
    对所述原始配置表中的至少两个所述原始配置数据进行去重处理,获取第一配置表;
    对所述第一配置表中的每一原始配置数据进行合规校验,获取合规校验通过的合规配置表,将所述合规配置表存储在数据库中。
  18. 如权利要求17所述的非易失性可读存储介质,其特征在于,所述原始配置数据还包括表格名称;
    所述对所述原始配置表中的至少两个所述原始配置数据进行去重处理,获取第一配置表,包括:
    判断所述原始配置表中的至少两个所述原始配置数据是否存在源表ID和导出字段完全相同的至少两个重复配置数据;
    若存在源表ID和导出字段完全相同的至少两个重复配置数据,则判断至少两个所述重复配置数据中的表格名称是否相同;
    若至少两个所述重复配置数据中的表格名称相同,则保留一个所述重复配置数据,获取第一配置表;
    若至少两个所述重复配置数据中的表格名称不相同,则生成提示信息,并将所述提示信息发送给触发所述分页配置请求的客户端,获取所述客户端反馈的修改信息,基于所述修改信息获取第一配置表。
  19. 如权利要求17所述的非易失性可读存储介质,其特征在于,所述对所述第一配置表中的每一原始配置数据进行合规校验,获取合规校验通过的合规配置表,包括:
    判断所述第一配置表中的每一原始配置数据中,所述源表ID对应的源数据集是否存在所述导出字段;
    若所述源表ID对应的源数据集中存在所述导出字段,则判断是否所述导出字段是否包含至少两个导出字段;
    若所述导出字段包含至少两个导出字段,则判断任意两个所述导出字段之间的分隔符是否与预设符号相匹配,若相匹配,获取获取合规校验通过的合规配置表;
    若所述导出字段不包含至少两个导出字段,则获取合规校验通过的合规配置表。
  20. 如权利要求17所述的非易失性可读存储介质,其特征在于,每一所述合规配置表对应一数据表ID;
    在所述将所述合规配置表存储在数据库中的步骤之后,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器还执行如下步骤:
    获取数据修改请求,所述数据修改请求包括数据表ID、表格ID和修改标识;
    根据所述数据表ID查询数据库,获取与所述数据表ID相对应的合规配置表作为待修改配置表;
    采用与所述修改标识相对应的修改函数对所述待修改配置表进行修改,获取修改后的合规配置表。
PCT/CN2018/106252 2018-07-18 2018-09-18 数据表动态导出方法、装置、计算机设备及存储介质 WO2020015150A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810788103.7A CN109062883B (zh) 2018-07-18 2018-07-18 数据表动态导出方法、装置、计算机设备及存储介质
CN201810788103.7 2018-07-18

Publications (1)

Publication Number Publication Date
WO2020015150A1 true WO2020015150A1 (zh) 2020-01-23

Family

ID=64817061

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/106252 WO2020015150A1 (zh) 2018-07-18 2018-09-18 数据表动态导出方法、装置、计算机设备及存储介质

Country Status (2)

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

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111597235A (zh) * 2020-05-21 2020-08-28 北京学之途网络科技有限公司 数据处理方法、装置和电子设备
CN111597240A (zh) * 2020-04-22 2020-08-28 深圳追一科技有限公司 数据导出方法、装置、计算机设备和存储介质
CN112036130A (zh) * 2020-09-01 2020-12-04 山东浪潮通软信息科技有限公司 Excel数据的导出方法及装置、电子设备
CN112286910A (zh) * 2020-11-23 2021-01-29 中国农业银行股份有限公司 一种数据校验方法及装置
CN112347180A (zh) * 2020-12-04 2021-02-09 航天信息股份有限公司企业服务分公司 推送数据的方法及电子设备
CN112380293A (zh) * 2020-12-11 2021-02-19 上海中通吉网络技术有限公司 一种分库分表数据的处理方法和装置
CN112861495A (zh) * 2020-11-24 2021-05-28 辽宁振兴银行股份有限公司 一种基于Excel模板文件生成ImpalaSQL语句的方法
CN113138990A (zh) * 2021-05-17 2021-07-20 青岛海信网络科技股份有限公司 一种数据血缘构建、追溯方法、装置及设备
CN113779122A (zh) * 2021-02-19 2021-12-10 北京京东振世信息技术有限公司 导出数据的方法和装置
CN113868282A (zh) * 2021-08-06 2021-12-31 安徽希施玛数据科技有限公司 数据处理方法及装置、终端及计算机可读存储介质
CN114237806A (zh) * 2021-12-29 2022-03-25 瀚云科技有限公司 一种页面信息的显示方法、装置、电子设备及存储介质
CN114637761A (zh) * 2022-03-10 2022-06-17 马上消费金融股份有限公司 业务对象生成方法及装置
CN116226786A (zh) * 2023-03-22 2023-06-06 中国人民解放军军事科学院系统工程研究院 一种用于信息系统数据融合的数据处理方法及装置

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109710859A (zh) * 2019-01-21 2019-05-03 北京字节跳动网络技术有限公司 数据查询方法和装置
CN109902272B (zh) * 2019-01-28 2024-02-06 平安科技(深圳)有限公司 电子表格数据处理方法、装置、计算机设备和存储介质
CN110119319B (zh) * 2019-03-29 2021-09-03 北京康爱营养科技股份有限公司 一种接口匹配方法及装置
CN110377649B (zh) * 2019-06-17 2023-07-14 中国平安财产保险股份有限公司 标签化数据的构建、查询方法、装置、设备及存储介质
CN110413974A (zh) * 2019-07-26 2019-11-05 北京恒华伟业科技股份有限公司 表格模板配置及装置、表格导出方法及装置
CN110704523B (zh) * 2019-09-06 2023-08-11 中国平安财产保险股份有限公司 数据导出方法、装置、设备及计算机可读存储介质
CN112699114A (zh) * 2019-10-22 2021-04-23 合肥美亚光电技术股份有限公司 轮胎配方数据的处理方法和系统、检测设备、管理设备
CN111026800B (zh) * 2019-12-09 2023-07-21 爱信诺征信有限公司 数据导出方法、装置、电子设备及存储介质
CN111290745A (zh) * 2020-02-11 2020-06-16 车配齐(珠海横琴)科技有限公司 一种实现通用数据导出的装置及方法
CN111367976A (zh) * 2020-02-28 2020-07-03 平安医疗健康管理股份有限公司 基于java反射机制的excel文件数据的导出方法及装置
CN111462845A (zh) * 2020-03-17 2020-07-28 平安国际智慧城市科技股份有限公司 动态表单生成方法、装置、计算机设备和存储介质
CN112417012A (zh) * 2020-04-29 2021-02-26 上海哔哩哔哩科技有限公司 数据处理方法及系统
CN111708917A (zh) * 2020-06-10 2020-09-25 武汉钢铁有限公司 一种钢铁报表数据采集系统
CN111814442A (zh) * 2020-06-29 2020-10-23 四川长虹电器股份有限公司 一种基于SpringBoot的excel数据处理方法
CN114169309A (zh) * 2021-12-13 2022-03-11 平安养老保险股份有限公司 修改行为数据表的方法、装置、计算机设备及存储介质
CN116150249B (zh) * 2023-04-13 2023-06-16 新兴际华集团财务有限公司 表格数据导出方法、装置、电子设备和计算机可读介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103092993A (zh) * 2013-02-18 2013-05-08 五八同城信息技术有限公司 数据导出方法及装置
US20130346844A1 (en) * 2012-06-22 2013-12-26 Microsoft Corporation Checking and/or completion for data grids
CN105808539A (zh) * 2014-12-29 2016-07-27 北京航天测控技术有限公司 一种数据导出导入方法及装置
CN106202283A (zh) * 2016-06-30 2016-12-07 国云科技股份有限公司 一种自定义字段导出数据到Excel的方法
CN107632880A (zh) * 2017-08-31 2018-01-26 深圳市丰巢科技有限公司 导出excel数据的方法、存储介质及电子设备

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9460174B2 (en) * 2014-05-20 2016-10-04 IfWizard Corporation Method for transporting relational data
CN107480186B (zh) * 2017-07-07 2021-08-27 中国建设银行股份有限公司 一种业务模型数据处理方法和计算机设备
CN108052654A (zh) * 2017-12-27 2018-05-18 北京京存技术有限公司 数据提取方法、装置、设备及存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130346844A1 (en) * 2012-06-22 2013-12-26 Microsoft Corporation Checking and/or completion for data grids
CN103092993A (zh) * 2013-02-18 2013-05-08 五八同城信息技术有限公司 数据导出方法及装置
CN105808539A (zh) * 2014-12-29 2016-07-27 北京航天测控技术有限公司 一种数据导出导入方法及装置
CN106202283A (zh) * 2016-06-30 2016-12-07 国云科技股份有限公司 一种自定义字段导出数据到Excel的方法
CN107632880A (zh) * 2017-08-31 2018-01-26 深圳市丰巢科技有限公司 导出excel数据的方法、存储介质及电子设备

Cited By (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111597240A (zh) * 2020-04-22 2020-08-28 深圳追一科技有限公司 数据导出方法、装置、计算机设备和存储介质
CN111597235B (zh) * 2020-05-21 2024-03-08 北京明略昭辉科技有限公司 数据处理方法、装置和电子设备
CN111597235A (zh) * 2020-05-21 2020-08-28 北京学之途网络科技有限公司 数据处理方法、装置和电子设备
CN112036130B (zh) * 2020-09-01 2024-04-30 浪潮通用软件有限公司 Excel数据的导出方法及装置、电子设备
CN112036130A (zh) * 2020-09-01 2020-12-04 山东浪潮通软信息科技有限公司 Excel数据的导出方法及装置、电子设备
CN112286910A (zh) * 2020-11-23 2021-01-29 中国农业银行股份有限公司 一种数据校验方法及装置
CN112286910B (zh) * 2020-11-23 2024-04-12 中国农业银行股份有限公司 一种数据校验方法及装置
CN112861495A (zh) * 2020-11-24 2021-05-28 辽宁振兴银行股份有限公司 一种基于Excel模板文件生成ImpalaSQL语句的方法
CN112347180A (zh) * 2020-12-04 2021-02-09 航天信息股份有限公司企业服务分公司 推送数据的方法及电子设备
CN112347180B (zh) * 2020-12-04 2023-08-01 航天信息股份有限公司企业服务分公司 推送数据的方法及电子设备
CN112380293A (zh) * 2020-12-11 2021-02-19 上海中通吉网络技术有限公司 一种分库分表数据的处理方法和装置
CN113779122A (zh) * 2021-02-19 2021-12-10 北京京东振世信息技术有限公司 导出数据的方法和装置
CN113779122B (zh) * 2021-02-19 2023-11-03 北京京东振世信息技术有限公司 导出数据的方法和装置
CN113138990B (zh) * 2021-05-17 2023-04-18 青岛海信网络科技股份有限公司 一种数据血缘构建、追溯方法、装置及设备
CN113138990A (zh) * 2021-05-17 2021-07-20 青岛海信网络科技股份有限公司 一种数据血缘构建、追溯方法、装置及设备
CN113868282A (zh) * 2021-08-06 2021-12-31 安徽希施玛数据科技有限公司 数据处理方法及装置、终端及计算机可读存储介质
CN114237806A (zh) * 2021-12-29 2022-03-25 瀚云科技有限公司 一种页面信息的显示方法、装置、电子设备及存储介质
CN114237806B (zh) * 2021-12-29 2024-03-12 瀚云科技有限公司 一种页面信息的显示方法、装置、电子设备及存储介质
CN114637761B (zh) * 2022-03-10 2024-03-19 马上消费金融股份有限公司 业务对象生成方法及装置
CN114637761A (zh) * 2022-03-10 2022-06-17 马上消费金融股份有限公司 业务对象生成方法及装置
CN116226786B (zh) * 2023-03-22 2023-08-22 中国人民解放军军事科学院系统工程研究院 一种用于信息系统数据融合的数据处理方法及装置
CN116226786A (zh) * 2023-03-22 2023-06-06 中国人民解放军军事科学院系统工程研究院 一种用于信息系统数据融合的数据处理方法及装置

Also Published As

Publication number Publication date
CN109062883B (zh) 2022-07-26
CN109062883A (zh) 2018-12-21

Similar Documents

Publication Publication Date Title
WO2020015150A1 (zh) 数据表动态导出方法、装置、计算机设备及存储介质
CN110069572B (zh) 基于大数据平台的hive任务调度方法、装置、设备及存储介质
CN110297672B (zh) 页面动态生成方法、装置、计算机设备及存储介质
WO2020215558A1 (zh) 数据存储方法、数据查询方法、装置、设备及存储介质
WO2019227573A1 (zh) 协同办公数据流处理方法、装置、计算机设备及存储介质
US9098618B2 (en) Validating visual components
WO2021169272A1 (zh) 数据库表格变更方法、装置、计算机设备及存储介质
WO2021003913A1 (zh) 注释信息处理方法、装置、计算机设备及存储介质
CN109857451B (zh) Ip核文件生成方法、装置、设备及介质
CN109062925B (zh) 自动生成insert语句的方法、装置、计算机设备及存储介质
CN109657177A (zh) 升级后页面的生成方法、装置、存储介质及计算机设备
US11720532B2 (en) System and method for customized graphQL data-handling scripts
CN111309593A (zh) Json接口校验的方法、装置、设备及计算机可读存储介质
CN111611009A (zh) 数据库脚本管理方法、装置、计算机设备及存储介质
CN112612491A (zh) 配置热刷新方法、装置、计算机设备及存储介质
CN107451202B (zh) 一种数据访问方法及设备
CN112434037A (zh) 数据处理方法、处理装置、数据处理设备和存储介质
US11740995B2 (en) Source quality check service
US9679015B2 (en) Script converter
CN113703777A (zh) 基于数据库表的代码生成方法、装置、存储介质和设备
CN114925142A (zh) 一种orm框架的多类型数据库兼容方法、装置、设备及介质
US11275725B2 (en) Transporting a database structure from a first version to a second version
CN113127501B (zh) 执行多条sql语句的方法、装置、智能终端及存储介质
CN110795451B (zh) Sql指纹还原方法、装置、计算机设备和存储介质
US11507586B2 (en) Database table annotation processing

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 17/05/2021)

122 Ep: pct application non-entry in european phase

Ref document number: 18926869

Country of ref document: EP

Kind code of ref document: A1