Data exporting method and device and electronic equipment

By determining the pending data table in response to user requests and configuration information, and automatically identifying the data table attributes using annotations and mapping data, the problems of low data export efficiency and poor flexibility in the prior art are solved, and efficient and flexible data export is achieved.

CN120470045APending Publication Date: 2025-08-12AGRICULTURAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510612455.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-13
Publication Date
2025-08-12

AI Technical Summary

Technical Problem

Existing data export methods require customized large number of export templates in different business scenarios, resulting in low efficiency and poor flexibility in data export.

Method used

The data table to be processed is determined by in response to the user's data query request and the connection data in the preset configuration information, and the annotation data and mapping data are used to determine the data set to be exported in the data table, and finally exported according to the export format.

Benefits of technology

Improves the efficiency and flexibility of data export, can automatically identify relevant data tables and their properties, reduce manual configuration and repetitive queries, and ensures the accuracy of querying and exporting data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120470045A_ABST
    Figure CN120470045A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data exporting method and device and electronic equipment. The method comprises the steps that firstly, in response to a data query request of a user and connection data in preset configuration information, a to-be-processed data table is determined, the connection data is used for indicating the relation between different data tables and different service attributes, and the data query request carries to-be-queried service attributes; according to annotation data and mapping data in the configuration information, a to-be-exported data set is determined in the to-be-processed data table, the annotation data is used for indicating attributes of a preset first entity class allowed to be exported, and the mapping data is used for indicating a corresponding relation between column names of different data tables and attributes of different entity classes; and finally exporting the data set to be exported. According to the method provided by the invention, data export is realized, and the data export efficiency and the data export flexibility are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a data export method, device and electronic device. Background Art

[0002] As the pace of digital transformation accelerates, business operations are gradually shifting from offline operations to online information systems. Due to internal management needs or external application requirements, it is necessary to download and export the required data from online information systems.

[0003] Existing data export methods primarily rely on customizing export templates for the data fields to be exported. First, you customize the export template, enter the data fields to be exported, then generate corresponding key-value pairs for the data fields to be exported. Then, you fill in the data fields according to the customized export template to export the data.

[0004] However, existing data export methods require the customization of a large number of export templates in different business scenarios, resulting in low data export efficiency and poor export flexibility. Summary of the Invention

[0005] The embodiments of the present application provide a data export method, device, and electronic device to improve the efficiency and flexibility of data export.

[0006] In a first aspect, an embodiment of the present application provides a method for exporting data, comprising:

[0007] Determining a data table to be processed in response to a user's data query request and connection data in preset configuration information, wherein the connection data is used to indicate the relationship between different data tables and different business attributes, and the data query request carries the business attribute to be queried;

[0008] Determining a set of data to be exported in the to-be-processed data table based on annotation data and mapping data in the configuration information, wherein the annotation data is used to indicate preset attributes of the first entity class that are allowed to be exported, and the mapping data is used to indicate correspondences between column names of different data tables and attributes of different entity classes;

[0009] Export the data set to be exported.

[0010] In one or more embodiments, before determining the data table to be processed in response to the user's data query request and the connection data in the preset configuration information, the method further includes:

[0011] Determining the connection data according to a table name of at least one data table and a business attribute of the at least one data table;

[0012] Determining the annotation data according to the attributes of the first entity class that are allowed to be exported;

[0013] The mapping data is determined according to the column name of the at least one data table and the attribute of the at least one entity class.

[0014] In one or more embodiments, determining the set of data to be exported in the table of data to be processed based on the annotation data and mapping data in the configuration information includes:

[0015] Determining, based on the mapping data, the attribute values corresponding to the attributes of the entity class to be processed corresponding to the data table to be processed;

[0016] Determining attributes of a second entity class that are common to the attributes of the entity class to be processed and the attributes of the first entity class;

[0017] Determine the attribute value corresponding to the attribute of the second entity class from the attribute values corresponding to the attributes of the entity class to be processed;

[0018] The attribute values corresponding to the attributes of the second entity class are determined as the data set to be exported.

[0019] In one or more embodiments, determining, based on the mapping data, the attribute value corresponding to the attribute of the entity class to be processed corresponding to the data table to be processed includes:

[0020] Determining the attributes of the entity class corresponding to the column names of the data table to be processed from the mapping data;

[0021] According to the attribute value corresponding to the attribute of the entity class corresponding to the column name of the data table to be processed, the attribute value corresponding to the attribute of the entity class to be processed corresponding to the data table to be processed is determined.

[0022] In one or more embodiments, exporting the to-be-exported data set includes:

[0023] Obtaining an export setting request from a user, wherein the export setting request carries an export format of the data set to be exported;

[0024] The to-be-exported data set is exported according to the export format.

[0025] In one or more embodiments, exporting the to-be-exported data set according to the export format includes:

[0026] If the export format is an Excel table format, the data set to be exported is processed using an Excel export tool to obtain a first data file and export the first data file;

[0027] If the export format is a text format, use a Java export tool to process the data set to be exported to obtain a second data file and export it;

[0028] If the export format is a comma-separated value (CSV) format, the data set to be exported is processed using the CSV format standard to obtain a third data file and export the file;

[0029] If the export format is a structured query statement SQL format, the data set to be exported is processed using SQL language information to obtain a fourth data file and export it.

[0030] In one or more embodiments, exporting the to-be-exported data set includes:

[0031] Determining the amount of data in the data set to be exported;

[0032] If the data volume is greater than a preset threshold, an asynchronous export strategy is used to export the data set to be exported;

[0033] If the data volume is less than or equal to a preset threshold, a synchronous export strategy is adopted to export the data set to be exported.

[0034] In one or more embodiments, before determining the data set to be exported in the to-be-processed data table based on the annotation data and mapping data in the configuration information, the method further includes:

[0035] The data table to be processed is filtered according to the query column name in the data query request.

[0036] In a second aspect, an embodiment of the present application provides a data export device, comprising:

[0037] a first determining module, configured to determine a data table to be processed in response to a user's data query request and connection data in preset configuration information, wherein the connection data is used to indicate a relationship between different data tables and different business attributes, and the data query request carries the business attribute to be queried;

[0038] a second determining module, configured to determine a set of data to be exported in the to-be-processed data table based on annotation data and mapping data in the configuration information, wherein the annotation data is used to indicate preset attributes of the first entity class that are allowed to be exported, and the mapping data is used to indicate correspondences between column names of different data tables and attributes of different entity classes;

[0039] The export module is used to export the data set to be exported.

[0040] In one or more embodiments, before determining the data table to be processed in response to the user's data query request and the connection data in the preset configuration information, the first determining module is further configured to:

[0041] Determining the connection data according to a table name of at least one data table and a business attribute of the at least one data table;

[0042] Determining the annotation data according to the attributes of the first entity class that are allowed to be exported;

[0043] The mapping data is determined according to the column name of the at least one data table and the attribute of the at least one entity class.

[0044] In one or more embodiments, the second determining module is specifically configured to:

[0045] Determining, based on the mapping data, the attribute values corresponding to the attributes of the entity class to be processed corresponding to the data table to be processed;

[0046] Determining attributes of a second entity class that are common to the attributes of the entity class to be processed and the attributes of the first entity class;

[0047] Determine the attribute value corresponding to the attribute of the second entity class from the attribute values corresponding to the attributes of the entity class to be processed;

[0048] The attribute values corresponding to the attributes of the second entity class are determined as the data set to be exported.

[0049] In one or more embodiments, the second determining module is configured to determine, based on the mapping data, the attribute value corresponding to the attribute of the entity class to be processed corresponding to the data table to be processed, and is specifically configured to:

[0050] Determining the attributes of the entity class corresponding to the column names of the data table to be processed from the mapping data;

[0051] According to the attribute value corresponding to the attribute of the entity class corresponding to the column name of the data table to be processed, the attribute value corresponding to the attribute of the entity class to be processed corresponding to the data table to be processed is determined.

[0052] In one or more embodiments, the export module is specifically configured to:

[0053] Obtaining an export setting request from a user, wherein the export setting request carries an export format of the data set to be exported;

[0054] The to-be-exported data set is exported according to the export format.

[0055] In one or more embodiments, the exporting module is configured to export the data set to be exported according to the export format, and is specifically configured to:

[0056] If the export format is an Excel table format, the data set to be exported is processed using an Excel export tool to obtain a first data file and export the first data file;

[0057] If the export format is a text format, use a Java export tool to process the data set to be exported to obtain a second data file and export it;

[0058] If the export format is a comma-separated value (CSV) format, the data set to be exported is processed using the CSV format standard to obtain a third data file and export the file;

[0059] If the export format is a structured query statement SQL format, the data set to be exported is processed using SQL language information to obtain a fourth data file and export it.

[0060] In one or more embodiments, the exporting module is configured to export the data set to be exported, specifically:

[0061] Determining the amount of data in the data set to be exported;

[0062] If the data volume is greater than a preset threshold, an asynchronous export strategy is used to export the data set to be exported;

[0063] If the data volume is less than or equal to a preset threshold, a synchronous export strategy is adopted to export the data set to be exported.

[0064] In one or more embodiments, before determining the data set to be exported in the to-be-processed data table based on the annotation data and mapping data in the configuration information, the second determining module is further configured to:

[0065] The data table to be processed is filtered according to the query column name in the data query request.

[0066] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory, a processor;

[0067] The memory stores computer-executable instructions;

[0068] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the above first aspect and / or various possible implementations of the first aspect.

[0069] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the first aspect above and / or various possible implementation methods of the first aspect.

[0070] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the above first aspect and / or various possible implementation methods of the first aspect.

[0071] The data export method, device and electronic device provided by the embodiments of the present application. The method first responds to the user's data query request and the connection data in the preset configuration information to determine the data table to be processed, wherein the connection data is used to indicate the relationship between different data tables and different business attributes, and the data query request carries the business attributes to be queried. Then, based on the annotation data and mapping data in the configuration information, the data set to be exported is determined in the data table to be processed, wherein the annotation data is used to indicate the attributes of the preset first entity class allowed to be exported, and the mapping data is used to indicate the correspondence between the column names of different data tables and the attributes of different entity classes. Finally, the data set to be exported is exported. In the above method, by pre-setting the connection data in the configuration information, the data table to be processed can be efficiently determined according to the business attributes to be queried carried in the data query request. The connection data indicates the relationship between different data tables and business attributes, ensuring that during the query process, the relevant data tables and their attributes can be automatically identified, avoiding manual configuration and a large number of repetitive queries, and improving the efficiency of data query; the entity class attributes allowed to be exported can be determined according to the annotation data, and the entity class attributes allowed to be exported can be customized according to the annotation data, which improves the flexibility of data export, and the mapping data indicates the correspondence between the column names and entity class attributes of different data tables, which can ensure accurate mapping when querying and exporting data, and then quickly determine the data to be exported in the data table to be processed and merge it for export, effectively improving the efficiency of data export. BRIEF DESCRIPTION OF THE DRAWINGS

[0072] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0073] Figure 1 A flowchart of a method for exporting existing data;

[0074] Figure 2 Schematic diagram of the process of exporting data provided in the embodiment of this application Figure 1 ;

[0075] Figure 3Schematic diagram of the process of exporting data provided in the embodiment of this application Figure 2 ;

[0076] Figure 4 Schematic diagram of the process of exporting data provided in the embodiment of this application Figure 3 ;

[0077] Figure 5 A schematic diagram of the structure of a data export device provided in an embodiment of the present application;

[0078] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0079] The above drawings illustrate specific embodiments of the present application, which will be described in more detail below. These drawings and the textual description are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION

[0080] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.

[0081] Before introducing the embodiments of the present application, the terms involved in the present application are first explained:

[0082] Class: In a programming language environment, it is an abstraction of a class of objects with the same attributes. A class contains attributes and methods. Attributes are abstractions of the inherent static characteristics of an object, while methods are abstractions of the dynamic characteristics of an object.

[0083] List data: refers to the data stored in the information system database, displayed in the form of rows, each row contains multiple attribute values;

[0084] Entity class: In an information system, a data table can correspond to an entity class. Each column of the table corresponds to each attribute of the class one by one. The attribute type uses a wrapper class of the type defined in the data table or a similar type. The object of the entity class is the information carrier of the database operated by the program.

[0085] Synchronization: refers to the synchronous attention message communication mechanism. When interface A calls interface B in the application system, it is necessary to wait for interface B to return information or complete execution before proceeding to the next step.

[0086] Asynchronous: refers to the asynchronous message communication mechanism. When interface A calls interface B in the application system, it can continue execution without waiting for the response of interface B.

[0087] Persistence layer development framework: refers to the technology used to manage data persistence in software development, that is, saving data to a long-term storage location, such as a database or hard disk. Its main function is to map objects in the program with data in the database, simplifying traditional database operation processes;

[0088] Annotation: refers to a comment mechanism that allows metadata to be added to program elements such as classes, methods, and variables. Its main function is to provide additional information without directly affecting program execution. Common annotation types include marker annotations, single-value annotations, and complete annotations.

[0089] Reflection mechanism: It means that in the running state, for any class in Java, all the properties and defined methods of the class can be obtained; the values of specific properties of the class objects can be dynamically obtained, or specific methods of the class can be called.

[0090] Next, the background technology of the embodiments of the present application is explained:

[0091] As the pace of digital transformation accelerates, business operations are gradually shifting from offline operations to online information systems. Due to internal management needs or external application requirements, it is necessary to download and export the required data from online information systems.

[0092] Existing data export methods primarily rely on customizing export templates for the data fields to be exported. First, you customize the export template, enter the data fields to be exported, then generate corresponding key-value pairs for the data fields to be exported. Then, you fill in the data fields according to the customized export template to export the data.

[0093] like, Figure 1 A flowchart of the method for exporting existing data, such as Figure 1 As shown, the existing data export method mainly includes the following execution steps:

[0094] S1: Customize the Excel export template according to business needs, and write the column names to be exported and the fields corresponding to the column names;

[0095] S2: After the user requests to query data, the data is preprocessed to generate key-value pairs corresponding to the field name and field value of the target column in the data;

[0096] S3: Fill in the target column field values and export based on the customized Excel export template and key-value pair data.

[0097] However, existing data export methods require the customization of a large number of export templates in different business scenarios, resulting in low data export efficiency and poor export flexibility.

[0098] The data export method provided by the present application is intended to solve the above technical problems of the prior art. The invention concept of the present application is as follows: the existing data export method needs to customize the data export template according to business needs, the data export efficiency is low and the export flexibility is poor, the data export is mainly carried out by determining the data table to be processed and then selecting the data that is allowed to be exported in the data table to be processed. If the correspondence between the column name of the data table and the attribute of the entity class can be determined in advance, and the attribute of the entity class is annotated to indicate whether the attribute value corresponding to the attribute of the entity class is allowed to be exported, then in the subsequent export, the attribute of the entity class corresponding to the column name of the data table to be processed can be quickly determined based on the correspondence, and further based on the attribute of the entity class The annotation annotation can quickly determine the attribute values corresponding to the attributes of the entity class corresponding to the column names of the data table to be processed that are allowed to be exported, and obtain the data set to be exported. Therefore, this application first responds to the user's data query request and the connection data in the preset configuration information to quickly determine the data table to be processed, and then through the mapping data in the preset configuration information, it can quickly determine the attributes of the entity class corresponding to the column names of the data table to be processed, thereby improving the data export efficiency. Through the annotation data in the preset configuration information, it can be set whether the attribute values corresponding to the attributes of the entity class are allowed to be exported according to business needs, thereby effectively improving the flexibility of data export.

[0099] The execution subject of the embodiments of the present application is an electronic device, which can be a terminal device, such as a laptop computer, a desktop computer, a tablet computer, etc., or a server. In actual applications, whether the electronic device is a terminal device or a server can be determined based on actual conditions and is not specifically limited to this.

[0100] The following specific embodiments describe in detail the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0101] Figure 2 Schematic diagram of the process of exporting data provided in the embodiment of this application Figure 1 .like Figure 2 As shown, the data export method includes the following steps:

[0102] S210, determining a data table to be processed in response to a user's data query request and connection data in preset configuration information;

[0103] The connection data is used to indicate the relationship between different data tables and different business attributes, and the data query request carries the business attributes to be queried.

[0104] In this step, in response to the user's data query request and obtaining the business attributes to be queried carried in the data query request, the connection data in the preset configuration information is used to indicate the relationship between different data tables and different business attributes. According to the connection data in the preset configuration information, the data table corresponding to the business attributes to be queried is determined, and the data table is used as the data table to be processed.

[0105] In a possible implementation, before step S210, the method further includes the following steps:

[0106] Step 1: Determine connection data based on the table name of at least one data table and the business attributes of at least one data table.

[0107] Exemplarily, there is a correspondence between the table name of at least one data table and the business attribute of at least one data table, and the correspondence between the table name of at least one data table and the business attribute of at least one data table is determined as connection data.

[0108] For example, the table name of data table 1 is Business A Detail Table, and the corresponding business attribute is Business A; the table name of data table 2 is Business B Detail Table, and the corresponding business attribute is Business B.

[0109] Step 2: Determine the annotation data based on the attributes of the first entity class that is allowed to be exported.

[0110] For example, the annotation data may contain two fields. Field 1 is the Boolean attribute export. When the export value is set to true, it indicates that the attribute export of the entity class is allowed. When the export value is set to false, it indicates that the attribute export of the entity class is not allowed. Field 2 is the character attribute cnName, and its value is the Chinese name corresponding to the attribute.

[0111] In one possible implementation, the attributes of the first entity class that are allowed to be exported are annotated, and the corresponding field 1 of the annotation data is set to true, indicating that the attributes of the entity class are allowed to be exported, and field 2 is the Chinese name of cnName1; the attributes of the first entity class that are not allowed to be exported are annotated, and the corresponding field 1 of the annotation data is set to false, indicating that the attributes of the entity class are allowed to be exported, and field 2 is the Chinese name of cnName2.

[0112] Step 3: Determine the mapping data based on the column name of at least one data table and the attribute of at least one entity class.

[0113] Exemplarily, the corresponding attributes of at least one entity class may be generated according to the column name of at least one data table, and the mapping data may be determined according to the column name of at least one data table and the corresponding attributes of at least one entity class.

[0114] For example, data table 1 includes column name L1, column name L2, and column name L3, which correspond to attributes S1, attribute S2, and attribute S3 of entity class 1 respectively. Then the mapping data is determined to include: column name L1 in data table 1 corresponds to attribute S1 of entity class 1, column name L2 in data table 1 corresponds to attribute S2 of entity class 1, and column name L3 in data table 1 corresponds to attribute S3 of entity class 1.

[0115] S220: Determine a data set to be exported in the data table to be processed based on the annotation data and mapping data in the configuration information;

[0116] The annotation data is used to indicate the preset attributes of the first entity class that are allowed to be exported, and the mapping data is used to indicate the correspondence between the column names of different data tables and the attributes of different entity classes.

[0117] In this step, based on the mapping data in the configuration information for indicating the correspondence between the column names of different data tables and the attributes of different entity classes, the attributes of the entity class corresponding to the column names of the data table to be processed are determined in the data table to be processed. Then, based on the annotation data in the configuration information for indicating the attributes of the preset first entity class allowed to be exported, the attributes of the entity class that are allowed to be exported among the attributes of the entity class corresponding to the column names of the data table to be processed are determined. The attribute values corresponding to the attributes of the entity class that are allowed to be exported among the attributes of the entity class corresponding to the column names of the data table to be processed are determined as the data set to be exported.

[0118] In a possible implementation, before the above step S220, the method further includes: filtering the data table to be processed according to the query column name in the data query request.

[0119] Exemplarily, the data query request includes a query column name, which is determined based on a column name in the data table to be processed.

[0120] In one possible implementation, filtering the data table to be processed according to the query column name in the data query request can be to retain the column names and corresponding column values in the data table to be processed that are the same as the query column names, and delete the column names and corresponding column values in the data table to be processed that are different from the query column names.

[0121] For example, the column names in the data table to be processed include: business type, business time, business amount, and user information, and the query column names include: business type, business time, and business amount. According to the query column name in the data query request, the data table to be processed is filtered, and the columns named business type, business time, and business amount in the data table to be processed are retained, and the column named user information in the data table to be processed is deleted.

[0122] S230: Export the data set to be exported.

[0123] In a possible implementation, the data set to be exported may be exported according to different export formats.

[0124] For example, the export format may be one of a table Excel format, a text format, a Comma-Separated Values (CSV) format, and a Structured Query Language (SQL) format.

[0125] The data export method provided in an embodiment of the present application first determines the data table to be processed in response to the user's data query request and the connection data in the preset configuration information, wherein the connection data is used to indicate the relationship between different data tables and different business attributes, and the data query request carries the business attributes to be queried. Then, based on the annotation data and mapping data in the configuration information, the data set to be exported is determined in the data table to be processed, wherein the annotation data is used to indicate the attributes of the preset first entity class allowed to be exported, and the mapping data is used to indicate the correspondence between the column names of different data tables and the attributes of different entity classes. Finally, the data set to be exported is exported. In this embodiment, by pre-setting the connection data in the configuration information, the data table to be processed can be efficiently determined according to the business attributes to be queried carried in the data query request. The connection data indicates the relationship between different data tables and business attributes, ensuring that during the query process, the relevant data tables and their attributes can be automatically identified, avoiding manual configuration and a large number of repetitive queries, and improving the efficiency of data query; the entity class attributes allowed to be exported can be determined according to the annotation data, and the entity class attributes allowed to be exported can be customized according to the annotation data, thereby improving the flexibility of data export, and the mapping data indicates the correspondence between the column names and entity class attributes of different data tables, which can ensure accurate mapping when querying and exporting data, and then quickly determine the data to be exported in the data table to be processed and merge it for export, effectively improving the efficiency of data export.

[0126] Based on the above embodiments, Figure 3 Schematic diagram of the data export method provided in this application Figure 2 .like Figure 3As shown, a possible implementation of the above step S220 further includes the following steps:

[0127] S310: Determine, based on the mapping data, the attribute values corresponding to the attributes of the entity class to be processed corresponding to the data table to be processed.

[0128] In this step, the mapping data is used to indicate the correspondence between the column names of different data tables and the attributes of different entity classes. According to the mapping data, the attributes of the entity class to be processed corresponding to the data table to be processed can be determined, and then the attribute values corresponding to the attributes of the entity class to be processed corresponding to the data table to be processed can be determined according to the column names of the data table to be processed.

[0129] In a possible implementation, a possible implementation of step S310 further includes the following steps:

[0130] Step 1: Determine the attributes of the entity class corresponding to the column names of the data table to be processed from the mapping data.

[0131] Exemplarily, the mapping data is used to indicate the correspondence between column names of different data tables and attributes of different entity classes. Then, the attributes of the entity classes corresponding to the column names of the data tables to be processed can be determined in the mapping data according to the column names of the data tables to be processed.

[0132] For example, the data table to be processed is data table 1, including column name L1, column name L2, and column name L3. The mapping data includes: column name L1 in data table 1 corresponds to attribute S1 of entity class 1, column name L2 in data table 1 corresponds to attribute S2 of entity class 1, and column name L3 in data table 1 corresponds to attribute S3 of entity class 1. Then, the column name L1, column name L2, and column name L3 of the data table to be processed can be determined in the mapping data to correspond to attribute S1, attribute S2, and attribute S3 of entity class 1 respectively.

[0133] Step 2: Determine the attribute value corresponding to the attribute of the entity class to be processed corresponding to the data table to be processed according to the attribute value corresponding to the attribute of the entity class to be processed corresponding to the column name of the data table to be processed.

[0134] Exemplarily, the attribute value corresponding to the attribute of the entity class to be processed corresponding to the data table to be processed is the data value corresponding to the column name of the data table to be processed.

[0135] For example, the data table to be processed is data table 1, in which the column name L1 includes: data value Z1 is "11", data value Z2 is "22", and data value Z3 is "33". Then the attribute value Y1 corresponding to the attribute S1 of the corresponding entity class to be processed is "11", the attribute value Y2 corresponding to the attribute S1 is "22", and the attribute value Y3 corresponding to the attribute S1 is "33".

[0136] S320: Determine attributes of the second entity class that are common to the attributes of the entity class to be processed and the attributes of the first entity class.

[0137] In this step, the attributes of the entity class to be processed are compared with the attributes of the first entity class, and the attributes of the entity class to be processed that are the same as the attributes of the first entity class are determined as the attributes of the second entity class that are common to the attributes of the entity class to be processed and the attributes of the first entity class.

[0138] Exemplarily, the attributes of the first entity class are attributes that are allowed to be exported, and the attributes of the second entity class are used to indicate the attributes that are allowed to be exported among the attributes of the entity class to be processed.

[0139] For example, the attributes of the entity class to be processed include attribute S1, attribute S2, and attribute S3. The attribute of the first entity class is attribute S1. The attribute shared by the attributes of the entity class to be processed and the attributes of the first entity class is attribute S1. Then, the attribute of the second entity class is determined to be attribute S1.

[0140] In one possible implementation, determining the attributes of the second entity class can be to obtain the name of the entity class to be processed corresponding to the first data (i.e., the first object) in the data table to be processed, read the attributes and methods of the entity class to be processed through the reflection mechanism, traverse the attributes of each entity class to be processed, and obtain annotation data, compare it with the attributes of the first entity class that is allowed to be exported, and for the attributes of the entity class to be processed that are allowed to be exported, add the attribute to the attribute set to be exported to obtain the attributes of the second entity class.

[0141] S330: Determine the attribute value corresponding to the attribute of the second entity class from the attribute values corresponding to the attributes of the entity class to be processed.

[0142] In this step, attribute values corresponding to the attributes of the entity class to be processed are matched with the attributes of the second entity class to determine the attribute values corresponding to the attributes of the second entity class.

[0143] For example, the attribute of the second entity class is attribute S1, the attribute value Y1 corresponding to attribute S1 of the entity class to be processed is "11", the attribute value Y2 corresponding to attribute S1 is "22", and the attribute value Y3 corresponding to attribute S1 is "33". According to the attribute S1 of the second entity class, the attribute values corresponding to attribute S1 of the second entity class are "11", "22", and "33" respectively.

[0144] S340: Determine the attribute values corresponding to the attributes of the second entity class as the data set to be exported.

[0145] In this step, the attribute values corresponding to the attributes of the second entity class are used as data in the data set, and the data set is determined as the data set to be exported.

[0146] For example, if the attribute values corresponding to the attributes of the second entity class are "11", "22", and "33", the data set to be exported is (11, 22, 33).

[0147] The data export method provided in the embodiment of the present application first determines the attribute value corresponding to the attribute of the entity class to be processed corresponding to the data table to be processed according to the mapping data, then determines the attribute of the second entity class that is shared by the attribute of the entity class to be processed and the attribute of the first entity class, then determines the attribute value corresponding to the attribute of the second entity class from the attribute value corresponding to the attribute of the entity class to be processed, and finally determines the attribute value corresponding to the attribute of the second entity class as the data set to be exported. In this embodiment, according to the mapping data, the relationship between the column in the data table to be processed and the attribute of the entity class to be processed can be automatically identified, and the attribute value corresponding to the attribute of the entity class to be processed can be determined. The error rate of manual configuration can be reduced through automated mapping, and the accuracy of data processing can be improved. By determining that the attribute of the entity class to be processed and the attribute of the first entity class share the attribute and corresponding attribute value of the second entity class, and determining the attribute value corresponding to the attribute of the second entity class as the data set to be exported, it is ensured that the attribute value corresponding to the attribute of the entity class allowed to be exported is used as the data set to be exported, and the conversion from complex data source to final export result can be completed automatically, effectively improving the efficiency and accuracy of data export.

[0148] Based on the above embodiments, Figure 4 Schematic diagram of the data export method provided in this application Figure 3 .like Figure 4 As shown, a possible implementation of the above step S230 further includes the following steps:

[0149] S410: Obtaining a user's export setting request;

[0150] The export setting request carries the export format of the data set to be exported.

[0151] In this step, the export setting request carries the export format of the data set to be exported. The user's export setting request can be obtained, and the export format of the data set to be exported carried in the export setting request can be determined.

[0152] Exemplarily, the export format is used to indicate that the data in the to-be-exported data set is to be exported according to a fixed data format.

[0153] In a possible implementation, the export format may be one of a table Excel format, a text format, a comma-separated value CSV format, and a structured query statement SQL format.

[0154] S420: Export the data set to be exported according to the export format.

[0155] In this step, the data set to be exported is converted into a format according to the export format, and the data set to be exported that conforms to the export format is exported.

[0156] In one possible implementation, the export format can be a table Excel format, and the data in the data set to be exported is converted into the data format of the table Excel and then exported; the export format can be a text format, that is, the data in the data set to be exported is converted into the data format of a text file and then exported; the export format can be a comma-separated value CSV format, and the data in the data set to be exported is converted into the data format of the comma-separated value CSV and then exported; the export format can also be a structured query statement SQL format, and the data in the data set to be exported is converted into the data format of the structured query statement SQL format and then exported.

[0157] In a possible implementation, a possible implementation of step S420 further includes the following situation:

[0158] The first method is to use an Excel export tool to process the data set to be exported, obtain a first data file, and export the first data file.

[0159] In a possible implementation, the data set to be exported is input into an Excel export tool, cleaned or sorted (such as deduplication, sorting, etc.), and a first data file with a unified format is obtained and exported.

[0160] Exemplarily, the first data file is a file in a spreadsheet Excel format.

[0161] The second method is to use a Java export tool to process the data set to be exported if the export format is text, obtain a second data file, and export it.

[0162] In one possible implementation, a Java export tool, FileWriter or BufferedWriter, can be used to write the data in the data set to be exported to a text file in a specified path. Comma or tab characters can be used to separate each line of data.

[0163] Exemplarily, the second data file is a file in text format.

[0164] The third method is to process the data set to be exported using the CSV format standard to obtain and export the third data file if the export format is comma-separated value (CSV) format.

[0165] In a possible implementation, the comma-separated value (CSV) format standard requires that each line of data use a comma to separate each field, and supports fields containing special characters (such as commas, quotation marks, etc.). Between each line of data, a comma is used for separation, and a line break character is used to separate each line of data.

[0166] Exemplarily, the third data file is a file in comma-separated value (CSV) format.

[0167] A fourth method is to process the data set to be exported using SQL language information if the export format is a structured query statement (SQL) format, obtain a fourth data file, and export the file.

[0168] In one possible implementation, the data set to be exported is converted into an SQL insert statement using SQL language information. After the table structure is created, the data set to be exported is looped through to generate an SQL insert statement for each data record. The data record is inserted into the created table to obtain a fourth data file and export it.

[0169] Exemplarily, the fourth data file is a file in the structured query statement SQL format.

[0170] In a possible implementation, the above-mentioned exporting of the to-be-exported data set may include the following steps:

[0171] Step 1: Determine the amount of data in the data set to be exported.

[0172] Exemplarily, the data in the first column of the data set to be exported may be traversed, the number of data records in the first column may be cumulatively calculated, and determined as the amount of data in the data set to be exported.

[0173] In a possible implementation, the first column in the to-be-exported data set contains the same number of data records as the other columns.

[0174] Step 2: If the data volume is greater than the preset threshold, the asynchronous export strategy is used to export the data set to be exported.

[0175] In a possible implementation, the data volume may be compared with a preset threshold to determine an export strategy for exporting the data set to be exported.

[0176] Exemplarily, the asynchronous export strategy may be to temporarily store the files of the data set to be exported on the server, and then download the files to the user's local computer during a set idle download time.

[0177] In one possible implementation, when a data set to be exported is exported, the data set to be exported will not be processed immediately. Instead, the export operation task will be added to the task queue of the server, and the server will asynchronously process the data set to be exported, and temporarily store the generated file of the data set to be exported on the server. The user can download the file to the user's local computer during the set idle download time.

[0178] Step 3: If the data volume is less than or equal to the preset threshold, the data set to be exported is exported using the synchronous export strategy.

[0179] Exemplarily, the synchronous export strategy may be to directly download the file of the data set to be exported to the user's local computer.

[0180] In a possible implementation, when the data set to be exported is exported, the data set to be exported is immediately processed and a file of the exported data set is generated. After all the exports are completed, the file of the data set to be exported is directly downloaded to the user's local computer.

[0181] The data export method provided in an embodiment of the present application first obtains a user's export setting request, wherein the export setting request carries the export format of the data set to be exported, and then exports the data set to be exported according to the export format. In this embodiment, by specifying the export format of the data set to be exported in the export setting request, different export formats have different structures and forms of expression, and the appropriate export format can be determined for different export requirements. The user can flexibly select the export format according to actual needs, thereby improving the customizability and applicability of data export and meeting various business needs.

[0182] On the basis of the above embodiments, the following data export device provided in the embodiments of the present application can execute the method provided in the above method embodiments.

[0183] Figure 5 A schematic diagram of the structure of the data export device provided in the embodiment of the present application is shown as follows: Figure 5 As shown, the data exporting device 500 includes:

[0184] A first determining module 510 is configured to determine a data table to be processed in response to a user's data query request and connection data in preset configuration information, wherein the connection data indicates the relationship between different data tables and different business attributes, and the data query request carries the business attribute to be queried;

[0185] A second determining module 520 is configured to determine a set of data to be exported from the data table to be processed based on the annotation data and mapping data in the configuration information, wherein the annotation data is used to indicate the preset attributes of the first entity class that are allowed to be exported, and the mapping data is used to indicate the correspondence between column names of different data tables and attributes of different entity classes;

[0186] The export module 530 is used to export the data set to be exported.

[0187] In an optional embodiment, before determining the data table to be processed in response to the user's data query request and the connection data in the preset configuration information, the first determining module 510 is further configured to:

[0188] Determining connection data according to a table name of at least one data table and a business attribute of at least one data table;

[0189] Determine annotation data according to the attributes of the first entity class that is allowed to be exported;

[0190] Mapping data is determined according to a column name of at least one data table and an attribute of at least one entity class.

[0191] In an optional embodiment, the second determining module 520 is specifically configured to:

[0192] Determine the attribute value corresponding to the attribute of the entity class to be processed corresponding to the data table to be processed according to the mapping data;

[0193] Determine the attributes of the second entity class that are common to the attributes of the entity class to be processed and the attributes of the first entity class;

[0194] Determine the attribute value corresponding to the attribute of the second entity class from the attribute values corresponding to the attributes of the entity class to be processed;

[0195] The attribute values corresponding to the attributes of the second entity class are determined as the data set to be exported.

[0196] In an optional embodiment, based on the mapping data, the attribute value corresponding to the attribute of the entity class to be processed corresponding to the data table to be processed is determined. The second determining module 520 is specifically configured to:

[0197] Determine the attributes of the entity class corresponding to the column names of the data table to be processed from the mapping data;

[0198] According to the attribute value corresponding to the attribute of the entity class corresponding to the column name of the data table to be processed, the attribute value corresponding to the attribute of the entity class to be processed corresponding to the data table to be processed is determined.

[0199] In an optional embodiment, the export module 530 is specifically configured to:

[0200] Obtaining a user's export setting request, wherein the export setting request carries an export format of the data set to be exported;

[0201] Export the data set to be exported according to the export format.

[0202] In an optional embodiment, the data set to be exported is exported according to the export format, and the export module 530 is specifically configured to:

[0203] If the export format is Excel, the data set to be exported is processed using an Excel export tool to obtain a first data file and export the file;

[0204] If the export format is text format, use the Java export tool to process the data set to be exported, obtain the second data file and export it;

[0205] If the export format is comma-separated value (CSV) format, the data set to be exported is processed using the CSV format standard to obtain a third data file and export it;

[0206] If the export format is a structured query statement SQL format, the data set to be exported is processed using SQL language information to obtain a fourth data file and export it.

[0207] In an optional embodiment, the data set to be exported is exported, and the export module 530 is specifically configured to:

[0208] Determine the amount of data in the data set to be exported;

[0209] If the data volume is greater than the preset threshold, the asynchronous export strategy is used to export the data set to be exported;

[0210] If the data volume is less than or equal to the preset threshold, the data set to be exported is exported using the synchronous export strategy.

[0211] In an optional embodiment, before determining the data set to be exported in the to-be-processed data table according to the annotation data and mapping data in the configuration information, the second determining module 520 is further configured to:

[0212] Filter the data table to be processed according to the query column name in the data query request.

[0213] The data export device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effects are similar and will not be described in detail in this embodiment.

[0214] Based on the above embodiments, Figure 6 This is a schematic diagram of the structure of the electronic device provided in the embodiment of the present application. Figure 6As shown, the electronic device 600 includes: a processor 610, a memory 620 and a bus 630;

[0215] The memory 620 is used to store computer-executable instructions of the processor 610;

[0216] The processor 610 is configured to execute the technical solution of any of the aforementioned method embodiments by executing computer execution instructions.

[0217] Optionally, the memory 620 may be independent or integrated with the processor 610 .

[0218] Optionally, the memory 620 may include a random access memory (RAM), and may also include a non-volatile memory (NVM), such as at least one disk memory.

[0219] Bus 630 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. Buses can be classified as address buses, data buses, control buses, etc. For ease of illustration, the drawings of this application use only one thick line, but this does not mean that there is only one bus or only one type of bus.

[0220] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.

[0221] The electronic device is used to execute the technical solution of any of the aforementioned method embodiments, and its implementation principle and technical effects are similar and will not be repeated here.

[0222] An embodiment of the present application also provides a computer-readable storage medium on which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the technical solution provided by any of the above method embodiments.

[0223] An embodiment of the present application also provides a computer program product, including a computer program, which includes computer instructions stored in a computer-readable storage medium. When the computer program is executed by a processor, it is used to implement the technical solution provided by any of the above method embodiments.

[0224] It should be noted that for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all optional embodiments, and the actions and modules involved are not necessarily required by this application.

[0225] It should be further noted that, although the various steps in the flowchart are shown in sequence as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps may be performed in other orders. Moreover, at least a portion of the steps in the flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily performed at the same time, but may be performed at different times. The execution order of these sub-steps or stages is not necessarily to be performed in sequence, but may be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0226] It should be understood that the above-described device embodiments are merely illustrative, and the device of the present application may also be implemented in other ways. For example, the division of units / modules in the above-described embodiments is merely a logical functional division, and actual implementations may employ other division methods. For example, multiple units, modules, or components may be combined or integrated into another system, or some features may be omitted or not implemented.

[0227] In addition, unless otherwise specified, the functional units / modules in the various embodiments of the present application may be integrated into a single unit / module, each unit / module may exist physically separately, or two or more units / modules may be integrated together. The aforementioned integrated units / modules may be implemented in the form of hardware or software program modules.

[0228] If the integrated unit / module is implemented in hardware, the hardware may be digital circuits, analog circuits, etc. The physical implementation of the hardware structure includes, but is not limited to, transistors, memristors, etc. Unless otherwise specified, the processor may be any appropriate hardware processor, such as a CPU, GPU, FPGA, DSP, and ASIC. Unless otherwise specified, the storage unit may be any appropriate magnetic storage medium or magneto-optical storage medium, such as resistive random access memory (RRAM), dynamic random access memory (DRAM), static random access memory (SRAM), enhanced dynamic random access memory (EDRAM), high-bandwidth memory (HBM), hybrid memory cube (HMC), etc.

[0229] If the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes a number of instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned memory includes various media that can store program codes, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0230] In the above embodiments, the description of each embodiment has its own emphasis. For parts not described in detail in a particular embodiment, please refer to the relevant description of other embodiments. The technical features of the above embodiments can be combined in any way. To keep the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0231] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of the present application and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

Claims

1. A data export method, characterized in that: include: Determining a data table to be processed in response to a user's data query request and connection data in preset configuration information, wherein the connection data is used to indicate the relationship between different data tables and different business attributes, and the data query request carries the business attribute to be queried; Determining a set of data to be exported in the to-be-processed data table based on annotation data and mapping data in the configuration information, wherein the annotation data is used to indicate preset attributes of the first entity class that are allowed to be exported, and the mapping data is used to indicate correspondences between column names of different data tables and attributes of different entity classes; Export the data set to be exported.

2. The method according to claim 1, characterized in that Before determining the data table to be processed in response to the user's data query request and the connection data in the preset configuration information, the method further includes: Determining the connection data according to a table name of at least one data table and a business attribute of the at least one data table; Determining the annotation data according to the attributes of the first entity class that are allowed to be exported; The mapping data is determined according to the column name of the at least one data table and the attribute of the at least one entity class.

3. The method according to claim 1 or 2, characterized in that The step of determining a set of data to be exported in the table of data to be processed according to the annotation data and mapping data in the configuration information includes: Determining, based on the mapping data, the attribute values corresponding to the attributes of the entity class to be processed corresponding to the data table to be processed; Determining attributes of a second entity class that are common to the attributes of the entity class to be processed and the attributes of the first entity class; Determine the attribute value corresponding to the attribute of the second entity class from the attribute values corresponding to the attributes of the entity class to be processed; The attribute values corresponding to the attributes of the second entity class are determined as the data set to be exported.

4. The method according to claim 3, characterized in that The determining, based on the mapping data, the attribute value corresponding to the attribute of the entity class to be processed corresponding to the data table to be processed includes: Determining the attributes of the entity class corresponding to the column names of the data table to be processed from the mapping data; According to the attribute value corresponding to the attribute of the entity class corresponding to the column name of the data table to be processed, the attribute value corresponding to the attribute of the entity class to be processed corresponding to the data table to be processed is determined.

5. The method according to claim 1, wherein The exporting of the to-be-exported data set includes: Obtaining an export setting request from a user, wherein the export setting request carries an export format of the data set to be exported; The to-be-exported data set is exported according to the export format.

6. The method according to claim 5, characterized in that The step of exporting the to-be-exported data set according to the export format includes: If the export format is an Excel table format, the data set to be exported is processed using an Excel export tool to obtain a first data file and export the first data file; If the export format is a text format, use a Java export tool to process the data set to be exported to obtain a second data file and export it; If the export format is a comma-separated value (CSV) format, the data set to be exported is processed using the CSV format standard to obtain a third data file and export the file; If the export format is a structured query statement SQL format, the data set to be exported is processed using SQL language information to obtain a fourth data file and export it.

7. The method according to claim 5, characterized in that The step of exporting the to-be-exported data set includes: Determining the amount of data in the data set to be exported; If the data volume is greater than a preset threshold, an asynchronous export strategy is used to export the data set to be exported; If the data volume is less than or equal to a preset threshold, a synchronous export strategy is adopted to export the data set to be exported.

8. The method according to claim 1 or 2, characterized in that Before determining the data set to be exported in the to-be-processed data table based on the annotation data and mapping data in the configuration information, the method further includes: The data table to be processed is filtered according to the query column name in the data query request.

9. A data export device, characterized in that: include: a first determining module, configured to determine a data table to be processed in response to a user's data query request and connection data in preset configuration information, wherein the connection data is used to indicate a relationship between different data tables and different business attributes, and the data query request carries the business attribute to be queried; a second determining module, configured to determine a set of data to be exported in the to-be-processed data table based on annotation data and mapping data in the configuration information, wherein the annotation data is used to indicate preset attributes of the first entity class that are allowed to be exported, and the mapping data is used to indicate correspondences between column names of different data tables and attributes of different entity classes; The export module is used to export the data set to be exported.

10. An electronic device, characterized in that: include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 8.