Data export method and device based on ordered field configuration, equipment and medium
By generating field identifiers and column name sequences from the ordered field configuration data received from the requesting end, the problem of inconsistent interfaces caused by fixed fields in table export is solved, and the synchronization of table files and interface content is achieved.
Patent Information
- Application Number
- CN202611422400.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-14
- Publication Date
- 2026-11-27
AI Technical Summary
In existing technologies, the table export function cannot dynamically adjust field selection and language environment according to the current business scenario, resulting in inconsistencies between the generated table file and the interface content, which is particularly evident in fintech and healthcare businesses.
By receiving ordered field configuration data from the requesting end, a sequence of field identifiers and a sequence of column names are generated. Based on these sequences, field values are extracted and arranged from the data source to generate a table file in the target language.
It ensures that the field order and column names in the table file are consistent with the interface, adapts to the export needs of different positions and language environments, and ensures that the exported content is consistent with the current page.
Smart Images

Figure CN123180102A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data display technology, and in particular to a data export method, apparatus, device, and medium based on ordered field configuration. Background Technology
[0002] In existing enterprise applications, table export functionality typically relies on the backend to pre-define the export fields, field order, and column names. Because the exported content cannot be synchronized with changes in field selection, arrangement, and language environment within the current business scenario, the same export interface struggles to meet the needs of different page states and usage scenarios, often resulting in table files that do not accurately reflect the actual content displayed on the current interface.
[0003] In the fintech business, customer information, account information, transaction records, credit information, and risk assessment data often need to be exported for different job roles and language environments. When the existing export interface uses fixed fields and fixed column names, even if the business page has adjusted the field display range or sorting order, the generated table file may still use the backend's preset content, making it difficult to maintain consistency with the current financial business page.
[0004] In the healthcare business, patient information, medical records, test results, medication records, and cost information often need to be exported in different ways depending on the role and language environment. When the existing export interface uses a fixed field order and fixed column names, the generated table file is difficult to synchronize with the field display status, field order, and language settings of the current page, resulting in discrepancies between the exported content and the actual medical business interface. Summary of the Invention
[0005] The main objective of this invention is to provide a data export method, apparatus, device, and storage medium based on ordered field configuration, aiming to solve the technical problem in the prior art where the exported table fields and column names are fixedly configured by the backend, resulting in the exported file not being dynamically generated according to the field arrangement and target language determined by the requesting end.
[0006] To achieve the above objectives, the present invention provides a data export method based on ordered field configuration, comprising: The system receives export request data sent by the requesting end. The export request data includes data query conditions and ordered field configuration data. The ordered field configuration data includes field configuration items arranged in sequence. Each field configuration item includes a field identifier and column name data represented in the target language. Parse the ordered field configuration data and the data query conditions from the exported request data, and generate a field identifier sequence and a column name sequence based on the field identifier and column name data in each field configuration item, according to the order of each field configuration item in the ordered field configuration data. Obtain records to be exported that meet the data query conditions from the data source, and construct a set of records to be exported based on the records to be exported; For each record to be exported in the set of records to be exported, the field values corresponding to each field identifier are extracted from each record to be exported according to the field identifier sequence, and the field values are arranged according to the field identifier sequence to generate row data corresponding to each record to be exported. The row data is then collected to generate a row data set. Generate the table data to be output based on the column name sequence and the row data set; A table file is generated based on the data to be output, and the table file is sent to the requesting end.
[0007] Furthermore, to achieve the above objectives, the present invention provides a data export device based on ordered field configuration, comprising: The export request receiving module is used to receive export request data sent by the requesting end. The export request data includes data query conditions and ordered field configuration data. The ordered field configuration data includes field configuration items arranged in sequence. Each field configuration item includes a field identifier and column name data represented in the target language. The field configuration parsing module is used to parse the ordered field configuration data and the data query conditions from the exported request data, and generate a field identifier sequence and a column name sequence based on the field identifier and column name data in each field configuration item, according to the order of the field configuration items in the ordered field configuration data. The data acquisition module is used to acquire records to be exported that meet the data query conditions from the data source, and to form a set of records to be exported based on the records to be exported. The row data generation module is used to extract field values corresponding to each field identifier from each record to be exported in the record to be exported set according to the field identifier sequence, arrange the field values according to the field identifier sequence, generate row data corresponding to each record to be exported, and collect the row data to generate a row data set. The table data construction module is used to generate the table data to be output based on the column name sequence and the row data set; The table file output module is used to generate a table file based on the table data to be output, and send the table file to the requesting end.
[0008] Furthermore, to achieve the above objectives, the present invention also provides a computer device, the computer device including a memory, a processor, and a data export program based on ordered field configuration stored in the memory and executable on the processor, wherein when the data export program based on ordered field configuration is executed by the processor, it implements the steps of the data export method based on ordered field configuration as described above.
[0009] Furthermore, to achieve the above objectives, the present invention also provides a computer-readable storage medium storing a data export program based on ordered field configuration, wherein the data export program based on ordered field configuration, when executed by a processor, implements the steps of the data export method based on ordered field configuration as described above.
[0010] Beneficial Effects: This invention relates to the field of data visualization technology and discloses a data export method, apparatus, device, and medium based on ordered field configuration. The method includes: receiving an export request containing data query conditions and ordered field configuration data; generating a field identifier sequence and a column name sequence according to the order of the field configuration items; obtaining a set of records to be exported based on the data query conditions; extracting and arranging field values according to the field identifier sequence to generate a row data set; generating a table file based on the column name sequence and the row data set, and sending it to the requesting end. This invention can be applied to business scenarios such as fintech and healthcare. By configuring field identifiers and target language column names in an ordered manner, a consistent sequence of field identifiers and column names is generated, and field values are extracted and arranged accordingly, ensuring a consistent correspondence between column names and field values. This enables the generation of a table file according to the field order and target language determined by the requesting end. Attached Figure Description
[0011] The present invention will be further described below with reference to the accompanying drawings and embodiments. In the accompanying drawings: Figure 1 This is a schematic diagram of an application environment for a data export method based on ordered field configuration according to an embodiment of the present invention; Figure 2 This is a flowchart illustrating an embodiment of the data export method based on ordered field configuration of the present invention; Figure 3 for Figure 2 A detailed flowchart of step S10; Figure 4 for Figure 2 A detailed flowchart of step S20; Figure 5 for Figure 2 A detailed flowchart of step S30; Figure 6 for Figure 2 A detailed flowchart of step S40; Figure 7 for Figure 2 A detailed flowchart of step S50; Figure 8 for Figure 2 A detailed flowchart of step S60; Figure 9 This is a schematic diagram of the functional modules of a preferred embodiment of the data export device based on ordered field configuration of the present invention; Figure 10 This is a schematic diagram of the structure of a computer device according to an embodiment of the present invention; Figure 11 This is another structural schematic diagram of a computer device according to one embodiment of the present invention. Detailed Implementation
[0012] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.
[0013] The data export method based on ordered field configuration provided in this embodiment of the invention can be applied to, for example... Figure 1 In this application environment, the client communicates with the server via a network. The server can receive an export request from the client, including data query conditions and ordered field configuration data. It generates a field identifier sequence and a column name sequence according to the order of the field configuration items. Based on the data query conditions, it obtains the set of records to be exported, extracts and arranges field values according to the field identifier sequence, and generates a row data set. Based on the column name sequence and the row data set, it generates a table file and sends it to the requesting client. This invention can be applied to business scenarios such as fintech and healthcare. By configuring field identifiers and target language column names in an ordered manner, it generates a consistent sequence of field identifiers and column names, and extracts and arranges field values accordingly, ensuring that column names and field values correspond consistently. This allows it to generate a table file according to the field order and target language determined by the requesting client. The client can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented using a standalone server or a server cluster consisting of multiple servers. The invention will be described in detail below through specific embodiments.
[0014] Please see Figure 2 , Figure 2 This is a flowchart illustrating an embodiment of the data export method based on ordered field configuration provided by the present invention. It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that shown here.
[0015] like Figure 2 As shown, the data export method based on ordered field configuration proposed in this invention includes the following steps: S10, receive export request data sent by the requesting end. The export request data includes data query conditions and ordered field configuration data. The ordered field configuration data includes field configuration items arranged in sequence. Each field configuration item includes a field identifier and column name data represented in the target language. In this embodiment, the requesting end is used to collect export parameters and encapsulate the request payload. This can be a business page, a mobile application, or an upstream business service. The export request data uses structured data objects to carry the information required for this export and is associated with an export task through the same request identifier. Data query conditions originate from query controls, saved query configurations, or filter states in the business page, and are used to describe the object range, time range, status range, and record range of the data to be exported. Ordered field configuration data originates from the set of export fields and the field arrangement state determined by the requesting end, and can be carried using sequential arrays, sequential lists, or key-value sets that retain the insertion order. The sequential arrangement indicates that each field configuration item has a stable and identifiable positional relationship, which can be represented by element index, insertion order, or sequential position data, and remains unchanged during data transmission.
[0016] Field configuration items are used to store the pairing information for an exported field. Each field configuration item contains a field identifier and column name data. The field identifier originates from page field metadata, interface field definitions, or data object attribute definitions, and is used to distinguish different business fields. It can be represented by field name, field code, or attribute code. The target language originates from the page language environment, user language settings, or regional language configuration. The column name data originates from multilingual field name data and is the displayable text selected according to the target language. It is written to the same field configuration item as the field identifier. After receiving the request payload, the receiving end associates the data query conditions and ordered field configuration data with the same export task, maintaining the order of the field configuration items and the pairing relationship between the field identifier and column name data.
[0017] When the requesting and receiving ends communicate synchronously via an interface, the requesting end writes the data query conditions into a query data object, writes the field configuration items into a sequential array according to their page display positions, and then encapsulates the query data object and the sequential array into a single request payload. The receiving end receives the complete payload based on the request identifier and saves the sequential array according to the element positions at the time of reception, preventing the order of field configuration items from changing during transmission and storage.
[0018] When an export task uses asynchronous message passing, the requesting end serializes the export request data into a task message and configures a request identifier for the task message. Field configuration items can be stored as a sequential list, or sequential position data can be added to each field configuration item. The receiving end creates a task record based on the request identifier and writes the data query conditions and ordered field configuration data into the same task record. When using ordered position data, the receiving end stores the field configuration items and their sequential positions, suitable for operating environments where message forwarding or distributed storage may change the key-value insertion order.
[0019] In the fintech business, the transaction management page generates data query conditions based on transaction date, account type, settlement status, and risk assessment status, and configures the corresponding field items for transaction date, account name, transaction amount, and settlement status in the order displayed on the page. When the page language is set to English, the requesting end selects English column names from the multilingual field name data, pairs the English column names with the corresponding field identifiers, encapsulates them, and sends them, ensuring that the received content reflects the scope, column order, and language status of this financial data export.
[0020] In the healthcare business, the health management platform generates data query conditions based on the testing date, testing item category, and health assessment status, and configures the corresponding field configuration items for testing date, testing item, testing result, and reference range according to the current page layout. When the page language is set to Chinese, the requesting end pairs the Chinese column names with the corresponding field identifiers and writes them into the ordered field configuration data, which is then sent together with the data query conditions, ensuring that the received content maintains the field combinations and arrangement relationships determined by the current health data page.
[0021] This embodiment carries data query conditions and ordered field configuration data in the same export request data, and pairs and saves field identifiers and column name data represented in the target language in each field configuration item. The receiving end can completely retain the data range, field set, field order and language information of this export, reducing the restrictions of fixed field order and fixed column name on different export requests.
[0022] S20, parse the ordered field configuration data and the data query conditions from the exported request data, and generate a field identifier sequence and a column name sequence based on the field identifier and column name data in each field configuration item according to the arrangement order of each field configuration item in the ordered field configuration data; In this embodiment, the exported request data is decoded according to a preset data structure, mapping the data nodes carrying ordered field configuration data and the data nodes carrying data query conditions to their corresponding data objects. The parsing process preserves the number and arrangement of field configuration items in the ordered field configuration data, without reordering them. Each field configuration item is read sequentially according to its original position, obtaining field identifiers and column name data from the same field configuration item to maintain their pairing. Field identifiers are written into the field identifier sequence according to the arrangement position of the field configuration items, and column name data are written into the column name sequence according to the same arrangement position, ensuring that elements in the same position in both sequences originate from the same field configuration item. The data query conditions complete the field mapping according to the hierarchical structure in the request data, while preserving the query parameter names, parameter values, and combination relationships.
[0023] When ordered field configuration data is stored in an array, an array index is used to record the order of the field configuration items. After parsing and exporting the request data, the field configuration items are read in ascending order of the index. The field identifiers are written to the corresponding positions in the field identifier sequence, the column name data is written to the same positions in the column name sequence, and the data query conditions are mapped to independent query objects.
[0024] When the ordered field configuration data uses a set of field configuration items with sequential position data, the arrangement of the field configuration items is restored using the sequential position data. After the field configuration items are arranged according to their sequential position data, the field identifier and column name data are read separately, and a sequence of field identifiers and a sequence of column names are generated based on the same sequential position. For cases where the requested data is stored using nested objects, the ordered field configuration data and data query conditions are located using field paths to avoid confusion between data nodes with the same name.
[0025] In the fintech business, exported request data includes field configuration items corresponding to transaction date, transaction amount, and risk level. Each field configuration item also records the field identifier and the target language column name. After parsing, the field identifier sequence records the transaction date field, transaction amount field, and risk level field according to the page arrangement, and the column name sequence records the corresponding target language column name in the same position.
[0026] In the healthcare business field, the health management platform submits field configuration items corresponding to the test date, test items, and test results. The parsing process generates field identifier sequences and column name sequences according to the position of the field configuration items, ensuring that the test date field corresponds to the test date column name, the test item field corresponds to the test item column name, and the test result field corresponds to the test result column name.
[0027] This embodiment maintains the original order of field configuration items and generates field identifier sequences and column name sequences from the same field configuration item, ensuring that the positions of elements in the two sequences remain consistent, thus reducing the possibility of misalignment of field identifier and column name data due to independent sorting or unordered reading.
[0028] S30, obtain the records to be exported that meet the data query conditions from the data source, and construct a set of records to be exported based on the records to be exported; In this embodiment, after the data query conditions are read in a structured manner, they are mapped to query parameters recognizable by the data source according to parameter names, parameter values, and parameter combination relationships. Data query conditions may include data object range, time range, status conditions, classification conditions, and record range. Null parameters do not participate in the query, and multiple parameters jointly limit the record range according to the combination relationships stored in the request. The data source can be a relational database, document database, or business data service, and the query parameters are respectively mapped to field filtering expressions, index retrieval parameters, or service request parameters. Each piece of data returned by the data source is received according to a unified record structure, maintaining the original correspondence between field names and field values, and data records that meet the data query conditions are identified as records to be exported. Multiple records to be exported are written into the same data set according to the order returned by the data source, forming a set of records to be exported; when the query result is empty, a set of records to be exported without containing records to be exported is generated to avoid identifying empty results as query anomalies.
[0029] When the data source is a relational database, the data table range, filter expression, and record range parameters in the query statement are generated based on the data query conditions. Query values are passed in via parameter binding, reducing parsing errors caused by directly concatenating query values. The result rows returned by the database are mapped row by row to the records to be exported and written into the set of records to be exported according to the order of arrangement in the result set.
[0030] When the data source uses a business data service, service request parameters are generated based on the data query conditions. The time range, status conditions, and record range are written into the request object, and a request is sent to the corresponding data service. After receiving the record list returned by the data service, the data structure of each record is uniformly mapped, and the mapped records are written into the set of records to be exported. When the data volume exceeds the range of a single return, requests can be made in batches according to the pagination position, and the batches of records to be exported can be merged according to the pagination order.
[0031] In the fintech business, data query criteria include transaction date range, account type, and settlement status. Relational databases filter transaction records based on corresponding parameters, mapping records that meet the date range, account type, and settlement status to records to be exported, thus forming a set of records to be exported.
[0032] In the healthcare business, data query conditions include the range of testing dates, the type of testing items, and the health assessment status. The health data service returns a list of corresponding records based on the request parameters. Each record is then written into a set of records to be exported after being mapped using a unified field mapping, ensuring that the content of the set is consistent with the current query scope.
[0033] This embodiment maps data query conditions to query parameters that the data source can recognize, and only writes data records that meet the query range into the set of records to be exported, so that the range of exported data is consistent with the query content submitted by the requesting party, reducing the mixing of irrelevant records caused by a fixed data range.
[0034] S40, for each record to be exported in the set of records to be exported, extract the field values corresponding to each field identifier from each record to be exported according to the field identifier sequence, arrange the field values according to the field identifier sequence, generate row data corresponding to each record to be exported, and collect the row data to generate a row data set; In this embodiment, the set of records to be exported is read one by one according to the record boundaries. For each record to be exported, the correspondence between the record field identifier and the field value is preserved. The field identifier sequence serves as the basis for field selection and arrangement. For each field identifier, the matching field is located and its value is read within the same record to be exported. The location methods include key name lookup, attribute lookup, field path lookup, or field index lookup. The read field values are written into an ordered container according to the position of the field identifier in the field identifier sequence, ensuring that field values at the same position originate from the same field identifier. When a record lacks a matching field, null placeholder data or a preset default value can be written at the corresponding position to prevent subsequent field values from shifting. After writing the field values for one record to be exported, the ordered container is determined as the corresponding row data. Each row data is written into a collection container according to the arrangement order in the set of records to be exported or the record sequence number, forming a row data set and maintaining a one-to-one correspondence between the records to be exported and the row data.
[0035] When the records to be exported are stored in a key-value structure, the field identifier is used as the lookup key. The corresponding field value is sequentially queried in each record, and the field value is written into an array according to the index position of the field identifier sequence. If a field identifier does not exist in the record to be exported, a null value is written at the same index position as placeholder data. After all field identifiers have been retrieved, the array is saved as the corresponding row data.
[0036] When the records to be exported are stored in an object structure or a nested structure, a field access mapping data record is used to document the relationship between field identifiers and object attributes, field paths, or access entry points. For each field identifier in the field identifier sequence, the field value in the current record to be exported is located according to the field access mapping data. The field values are then written sequentially into a sequential list, and the sequential list is converted into row data. Each row of data is written into a row data set according to the reading order of the records to be exported.
[0037] In the fintech business, the set of records to be exported includes multiple transaction records, with the field identifier sequence pointing sequentially to the transaction date, account name, transaction amount, and settlement status. Each transaction record reads field values according to the same field identifier sequence and generates row data. If a transaction record lacks a settlement status, a null value is written in the corresponding position as a placeholder. The row data is written into the row data set according to the order of the transaction records.
[0038] In the healthcare business, the set of records to be exported in the health management platform includes multiple test records. The field identifier sequence points to the test date, test item, test result, and reference range in sequence. Each test record completes the field value location and sequential writing based on the field identifier. When the test records adopt a nested data structure, the test result and reference range are located through the field path. The data of each row is collected into a row data set according to the reading order of the test records.
[0039] This embodiment selects and arranges the field values in each record to be exported one by one using the same field identifier sequence, so that the row data generated by different records to be exported have a consistent field position relationship, and maintains the stability of the number and arrangement of fields by using null values as placeholders, thereby reducing the misalignment of field values caused by missing fields, differences in record structure, or changes in reading order.
[0040] S50, Generate table data to be output based on the column name sequence and the row data set; In this embodiment, the column name sequence provides column name data for each column according to predetermined positions, and the row data set provides multiple sets of row data according to record positions. The arrangement of field values in each set of row data is consistent with the column name positions in the column name sequence. When generating the output table data, a header area is established based on the column name sequence, and each column name data is written to its corresponding column position; a data area is established based on the row data set, and each row data is written to its corresponding data row according to the arrangement order in the set, and the field values in the row data are written to their corresponding columns according to their positions. When the number of field values in a row data is less than the number of column names, null values are written as placeholders in the missing positions; when the number of field values is the same as the number of column names, the positional correspondence between column name data and field values is directly established. The output table data is stored using a two-dimensional data structure containing a header area and a data area, so that column names, field values, column positions, and data row positions can be represented uniformly.
[0041] When the data volume can be written into memory, a two-dimensional array is used to generate the table data to be output. The number of columns is determined based on the length of the column name sequence, and the column name data is written into the header row of the two-dimensional array; the number of data rows is determined based on the number of data rows in the row data set, and the data of each row is written into the corresponding position after the header row in sequence, and null values are written as placeholders for positions with missing field values.
[0042] When dealing with large amounts of data, a segmented table data structure is used to reduce the data space occupied per operation. The column name sequence is saved as independent header data, and the row data set is divided into multiple row data segments according to a preset number of records. Each row data segment stores the row data and data row positions within its corresponding range. The header data is then associated with multiple row data segments to form the table data to be output.
[0043] In the fintech business, the column name sequence includes the transaction date, account name, transaction amount, and settlement status in sequence. Each group of row data in the row data set stores the field values of the corresponding transaction record in the same position. The column name data is written to the header area, and the transaction field values of each group are written to the corresponding data row, forming a table data to be output with consistent column positions.
[0044] In the healthcare business, the column name sequence includes the test date, test item, test result, and reference range in sequence. The row data set includes row data corresponding to multiple sets of test records. When a test record lacks a reference range, null values are written as placeholder data in the corresponding column position to ensure that the values of the other fields remain consistent with the corresponding column names.
[0045] This embodiment determines the position of the header column based on the column name sequence and writes the field values in the row data set according to the same positional relationship, so that the column name data and the field value maintain column-level correspondence. At the same time, the data row position is determined by the row data arrangement order, thereby reducing the situation of misalignment between column names and field values and confusion of row positions between different records.
[0046] S60, generate a table file based on the data to be output, and send the table file to the requesting end.
[0047] In this embodiment, the table data to be output is written into the table document structure according to the header area, data area, column position, and data row position. The table document structure may include workbooks, worksheets, row nodes, and cell nodes. The data for each column name is written into the cell corresponding to the header row, and the values for each field are written into the corresponding data row and column position. After writing is completed, the table document structure is encoded and encapsulated according to the target file format to generate a table file that can be read by a spreadsheet application. The table file can be saved as binary file data, file byte stream, or temporary file, and the file content retains the row and column relationships in the table data to be output. During the sending process, the table file is written into the request response, along with the configuration file name, file type, and data length, and transmitted to the requesting end through the network interface. When the file data volume is large, it can be sent segment by segment according to continuous data until the complete file transmission is completed.
[0048] If the amount of table data can be accommodated in memory, an in-memory workbook is used to generate the table file. Worksheet cells are created according to the row and column positions of the data to be output. Column names and field values are written into the corresponding cells, and the workbook is then encoded into file byte data. The file byte data is written into the request response, and the file name and file type are set before being sent to the requesting end.
[0049] When dealing with large amounts of tabular data, a streaming workbook is used to limit memory usage. The tabular data to be output is written to the worksheet row by row according to its position. Encoded rows are converted into file data segments, and their corresponding buffers are released. These file data segments are written to the response output stream in the order they were generated and sent to the requesting end via segmented transmission. An end-of-file marker indicates that the tabular file transmission is complete.
[0050] In the fintech business, the output table data includes headers and multiple rows of transaction data corresponding to the transaction date, account name, transaction amount, and settlement status. Each item is written into the worksheet according to the predetermined row and column positions, encoded to generate a transaction data table file, and sent to the business page via request and response. When there are a large number of transaction records, streaming writing and segmented sending are used to reduce memory usage during the export of large batches of transaction data.
[0051] In the healthcare business, the output table data includes headers and multiple rows of health test data, corresponding to the test date, test items, test results, and reference ranges. After the column names and field values are written into the corresponding cells, a table file is generated and sent to the requesting end of the health management platform via a network interface, so that the requesting end receives file data consistent with the currently exported content.
[0052] This embodiment writes the table document structure according to the row and column positions in the data to be output and directly writes the encoded table file into the request response. This maintains the positional relationship between the table header and field values, and completes the conversion of the exported content into a downloadable file. By using file byte transmission or streaming segmented transmission, it can also adapt to the needs of sending table files of different data sizes.
[0053] In one embodiment, such as Figure 3 As shown, step S10 above includes: S101, the receiving end obtains a set of field identifiers based on the field display status of the interface to be exported, the set of field identifiers includes each field identifier whose field display status indicates that it is allowed to be exported; S102, Receive field arrangement data generated by the requesting end based on the field display position corresponding to each field identifier in the field identifier set; S103, receive the target language determined by the requesting end based on the language environment data, and receive the column name data selected by the requesting end from the multilingual field name data based on the target language; S104, Receive ordered field configuration data generated by the requesting end based on the field identifier set, the column name data and the field arrangement data, wherein each field configuration item in the ordered field configuration data includes corresponding field identifiers and column name data, and is arranged sequentially according to the field arrangement data; S105, Receive the data query conditions generated by the requesting end based on the query input data; S106, Receive export request data generated by the requesting end based on the data query conditions and the ordered field configuration data.
[0054] In this embodiment, the requesting client reads the field display status from the field metadata of the interface to be exported. The field display status can be represented by a Boolean value, an enumeration value, or a status flag, used to distinguish between fields that are allowed to be exported and those that are not. The requesting client traverses the field nodes in the interface, writes the field identifiers corresponding to fields whose status values represent allowed exports into the field identifier set, and excludes fields that are hidden, disabled, or do not have export permissions. Field identifiers can be represented by field codes, attribute names, or data key names. Different fields in the same interface to be exported are configured with different field identifiers, and duplicate field identifiers can be retained based on the field node position.
[0055] The requesting client reads the field display position corresponding to each field identifier in the field identifier set. The field display position can be represented by the interface component index, column position number, or drag-and-drop sorting result. The requesting client establishes a mapping between field identifiers and their arrangement positions based on the field display positions, and writes each field identifier into an order list according to its arrangement position, generating field arrangement data. When field display positions are not consecutive, the arrangement relationship can be determined according to the relative size of the position values; when multiple fields have the same position, a stable arrangement can be determined based on the interface node index or the order in which the field identifiers are written.
[0056] Language environment data can be provided by page language settings, user language configuration, or regional language tags, and represented using language encoding, regional encoding, or a combination of language and regional encoding. The requesting client determines the target language based on the language environment data, and then uses the field identifier and the target language as an index to find the corresponding column name data from the multilingual field name data. The multilingual field name data can be stored using a mapping structure between field identifiers and text in multiple languages. When the text corresponding to the target language is missing, the text corresponding to the preset language or the field's default name can be used as the column name data to avoid missing column name content in the field configuration.
[0057] The requesting end reads the field identifiers item by item according to the field arrangement data and writes each field identifier and its corresponding column name data into the same field configuration item. Each field configuration item is then written sequentially into an array, a sequential list, or a data set with position numbers, according to its position in the field arrangement data, forming ordered field configuration data. Field identifiers are used to maintain field relationships, and column name data is used to maintain the display content in the target language. These two are permanently paired within the same field configuration item, and the storage location of the field configuration item indicates the order of the exported columns.
[0058] The input data for the query originates from filter controls, query parameter areas, or saved query configurations in the interface to be exported. The requesting end converts the input data into structured data query conditions, preserving parameter names, values, and relationships between parameters. The data query conditions and ordered field configuration data are written into the same request payload to generate the export request data. Various data items can be carried by different data nodes within the same request message, or by multiple messages with the same request identifier. When using multiple messages, the request identifier is used to associate the field identifier set, field arrangement data, column name data, data query conditions, and ordered field configuration data, preventing data from different export requests from being mixed.
[0059] This embodiment filters field identifiers based on the field display status of the interface to be exported, generates field arrangement data based on the field display position, and selects column name data based on the language environment data. This allows the export request data to simultaneously carry the currently allowed fields to be exported, the field arrangement relationship, the target language column name, and the query conditions, thereby reducing inconsistencies between the exported content and the interface status caused by fixed field sets, fixed column order, and fixed column name configurations.
[0060] In one embodiment, such as Figure 4 As shown, step S20 above includes: S201, read each field configuration item from the ordered field configuration data in the export request data according to the order of arrangement of each field configuration item in the ordered field configuration data, and read the data query conditions from the export request data; S202, extract field identifiers and column name data from each field configuration item, establish a relationship between the field identifiers and column name data in each field configuration item, and generate a field configuration parsing item corresponding to each field configuration item; S203, Arrange the corresponding field configuration parsing items according to the order of each field configuration item in the ordered field configuration data, and generate field configuration parsing data; S204, according to the order of each field configuration parsing item in the field configuration parsing data, read the field identifier from each field configuration parsing item and generate a field identifier sequence; S205, according to the order of each field configuration parsing item in the field configuration parsing data, read the column name data from each field configuration parsing item and generate the column name sequence.
[0061] In this embodiment, after the exported request data is deserialized, the ordered field configuration data and data query conditions are located according to the data node paths. The ordered field configuration data is read as a collection that maintains the element order, while the data query conditions are read as independent data objects, retaining parameter names, parameter values, and parameter combination relationships. Field configuration items are carried using array elements, sequential list nodes, or configuration nodes with positional data. During the reading process, the position of each field configuration item in the ordered field configuration data is recorded to avoid changes in the arrangement order caused by container conversion.
[0062] Each field configuration item is read sequentially according to its record position, and field identifiers and column name data are obtained from the same field configuration item. Field identifiers can be represented by field codes, attribute names, or field key names, while column name data is text content stored in pairs with the field identifiers. The read field identifiers, column name data, and field configuration item positions are written to the same field configuration parsing item, ensuring consistency between the source of the field identifiers and column name data. If a field configuration item lacks a field identifier or column name data, a parsing error flag can be recorded and the corresponding content can be stopped from being written to the sequence; alternatively, placeholder content can be written according to pre-configured missing data handling conditions.
[0063] Each field configuration parsing item is written into the field configuration parsing data according to its original arrangement. When using a sequential array, field configuration parsing items can be directly appended in the order of reading; when using an unordered set, the field configuration items can be stably arranged according to their positions, and the original reading order is maintained when the positions are the same. The field configuration parsing data thus retains the number of field configuration items, their arrangement, and the pairing relationship between field identifiers and column name data.
[0064] The field identifier sequence and column name sequence are generated using the same traversal. When traversing the field configuration parsing data, the field identifier from each field configuration parsing item is written to the current position in the field identifier sequence, and the column name data from the same field configuration parsing item is written to the same position in the column name sequence. Both sequences have the same number of elements and position numbers, and the field identifier and column name data at the same position originate from the same field configuration item. The sequences can be stored using arrays, sequential lists, or data structures with position indices; they are not sorted separately during generation.
[0065] This embodiment preserves the original arrangement of field configuration items when parsing the exported request data, associates field identifiers and column name data in the same field configuration parsing item, and then generates field identifier sequences and column name sequences in a unified order, so that elements in the same position in the two sequences remain stably paired, thereby reducing the misalignment of field identifiers and column name data caused by unordered reading, independent sorting or data structure conversion.
[0066] In one embodiment, such as Figure 5 As shown, step S30 above includes: S301, extract the data object identifier, filter condition data and query range data from the data query conditions; S302, determine the target data object from the data source based on the data object identifier; S303, Generate a data query instruction based on the target data object, the filtering condition data, and the query range data; S304, send the data query instruction to the data source, receive the records to be exported returned by the data source based on the data query instruction, and generate a set of records to be exported consisting of the records to be exported.
[0067] In this embodiment, after the data query conditions are read in a structured manner, data object identifiers, filter condition data, and query range data are extracted from the corresponding data nodes. The data object identifier points to a logical data object in the data source and can be represented by an object code, resource name, or mapping index, and can correspond to a data table, data set, retrieval index, or service resource. The filter condition data can include filter field identifiers, condition types, condition values, and combinations of multiple conditions, used to describe the data state that the records to be returned must meet. The query range data can include record location, record quantity, time boundary, or batch range, used to control the data range covered by a single query.
[0068] The data object identifier is matched against pre-configured data object mapping data to determine the target data object in the data source. The data object mapping data stores the correspondence between logical identifiers and actual storage locations, enabling the encoding of logical objects in the request to be converted into table names, collection names, index names, or service resource addresses. The matching process can also verify whether the data object identifier is within the allowed query range. If no target data object is found, the object location result is recorded to avoid sending filter data to the wrong data object.
[0069] The filter criteria data is converted into query condition items based on the field structure of the target data object. Filter field identifiers are mapped to field names or attribute paths in the target data object, condition types are mapped to equality, range, containment, or status judgment methods, and condition values are converted to data types recognizable by the target fields. Multiple query condition items are connected according to the combination relationships stored in the filter criteria data, and query range data is converted into record boundaries, page positions, or batch control parameters.
[0070] The target data object, the transformed query criteria, and the query range parameters are written into the same data query command. The data query command can be carried by parameterized query statements, structured retrieval objects, or service request data. The target data object determines the query location, the filter criteria limit the record content, and the query range parameters limit the return interval. When condition values and query structure are stored separately, they are written into the data query command through parameter binding relationships, reducing the likelihood of condition values altering the query structure.
[0071] After a data query command is sent to the data source, the data source returns data records that meet the conditions based on the target data object, filter criteria, and query range parameters. The returned results are read record by record according to their boundaries, and each record is saved as an independent record to be exported, and written into a collection container in the order returned by the data source. When data is returned in batches, each batch of records to be exported is written sequentially according to its batch position in the query range data; if no data records are returned, a collection without records to be exported is generated, thus forming the set of records to be exported.
[0072] This embodiment obtains the data object identifier, filter condition data, and query range data from the data query conditions, locates the target data object based on the data object identifier, and converts the filter requirements and query range into a unified data query instruction. This ensures that the returned records to be exported are consistent with the requested data object, filter content, and record range, reducing the number of incorrect data objects, irrelevant records, and data outside the query range entering the set of records to be exported.
[0073] In one embodiment, such as Figure 6 As shown, step S40 above includes: S401, for each record to be exported, read the record field identifier and the field value corresponding to each record field identifier in the record to be exported, and generate record field data corresponding to each record to be exported; S402, for the record field data corresponding to each record to be exported, match each field identifier in the field identifier sequence with each record field identifier in the record field data item by item to generate field matching data corresponding to each record to be exported; S403, based on the field matching data corresponding to each record to be exported, extract the field values corresponding to each field identifier from the record field data corresponding to the same record to be exported, and generate a group of field values corresponding to each record to be exported; S404, Arrange the field values in the field value group corresponding to the same record to be exported according to the order of the field identifiers in the field identifier sequence, and generate row data corresponding to each record to be exported; S405, according to the order of each record to be exported in the set of records to be exported, gather the row data corresponding to each record to be exported, and generate a row data set.
[0074] In this embodiment, the set of records to be exported is read one by one according to their order. Each record is retained as an independent data unit to avoid mixing fields and values from different records. During the reading process, the record field identifiers and their associated field values stored within the record are identified, and the record field identifiers, field values, and record positions are written into the same record field data. When the record to be exported uses a key-value structure, the record field identifier is obtained from the key name, and the field value is obtained from the corresponding key value; when the record to be exported uses an object structure, the record field identifier is obtained from the attribute name or field code, and the field value is obtained from the corresponding attribute content. Each set of record field data is associated with only one record to be exported.
[0075] Field identifiers in the field identifier sequence are read item by item according to their sequence position and matched against the record field identifiers in the current record's field data. Matching can be based on identifier content consistency or on a pre-defined field identifier mapping relationship. The field matching data record shows the position of the field identifier in the field identifier sequence, the matched record field identifier, and the record position of the corresponding record field data, ensuring that the matching result points to both the target field and its corresponding record. If no record field identifier is matched, the missing state can be recorded in the field matching data, while retaining the field identifier's position in the field identifier sequence.
[0076] Field values are read from the record field data corresponding to the same record to be exported based on field matching data, avoiding the retrieval of field values from other records. Each field value is associated with its position in the field identifier sequence and written to the corresponding field value group. When a field is missing, null placeholder data can be written at the corresponding position to ensure that the number of positions in the field value group is consistent with the number of fields in the field identifier sequence. The field value group only stores the field values of the current record to be exported that match the field identifier sequence, and does not write the content of fields not selected by the field identifier sequence.
[0077] The field value groups are rearranged according to the position of each field identifier in the field identifier sequence. When a field identifier is at the beginning of the field identifier sequence, the corresponding field value is written to the beginning of the row data; when a field identifier is at the end, the corresponding field value is written to the end. After all field values have been written, row data associated with the current record to be exported is generated. Different records to be exported use the same field identifier sequence to determine the field value positions, ensuring that each row of data has a consistent number of fields and field arrangement.
[0078] Each row of data is written into the collection container according to the order in which the corresponding record to be exported is arranged in the collection of records to be exported. The position of the record to be exported in the collection is used to determine the position of the corresponding row of data in the row data collection. One row of data is generated for each record to be exported. When reading the records to be exported in batches, the global position of each batch of records can be recorded, and the row data can be written according to the global position to avoid changes in the order of row data generated in different batches.
[0079] This embodiment maintains the association between the records to be exported and the field data of the records one by one. It matches and extracts the field values in the same record according to a unified field identifier sequence, and then arranges the field values according to the field identifier sequence and aggregates the row data. This can keep the same fields in different records in the same position, reduce the field value misalignment caused by field missing, record structure differences and reading order changes, and at the same time maintain the one-to-one correspondence between the records to be exported and the row data and the original arrangement order.
[0080] In one embodiment, such as Figure 7 As shown, step S50 above includes: S501, determine the column position corresponding to each column name data according to the order of each column name data in the column name sequence, and generate column position data; S502, Based on the column position data, determine the table header position corresponding to each column position, write the column name data into the corresponding table header position, and generate table header data; S503, determine the data row position corresponding to each row of data according to the arrangement order of each row of data in the row data set, and generate data row position data; S504, according to the arrangement position of each field value in the corresponding row data, determine the column position corresponding to each field value from the column position data, and determine the data row position corresponding to the row data to which the field value belongs from the data row position data, and generate cell position data based on the corresponding column position and data row position; S505, Write the values of each field into the corresponding cell positions according to the cell position data to generate data area data; S506, Generate output table data based on the header data and the data area data.
[0081] In this embodiment, the column name sequence is read item by item according to the order of the column name data, and a corresponding column position is assigned to each column name data. The column position can be represented by a sequence index, a consecutive position number, or table column coordinates. After establishing a one-to-one correspondence between each column name data and a column position, the column position data is written, so that the arrangement relationship in the column name sequence is converted into a column coordinate relationship that can be used for table writing.
[0082] The header position is determined by the preset header row and column positions. Based on the column position data, the header position corresponding to each column name is determined item by item, and the column name data is written to the corresponding position. The header data stores the column name data, the header position, and the correspondence between the two. Column name data in adjacent positions in the column name sequence are written to the adjacent column position. When the column name sequence changes, the column position in the header data changes accordingly.
[0083] The row data set is read item by item according to the order of the rows, and a corresponding data row position is determined for each row. The data row position can be set continuously after the header, or it can be determined by the row's position in the row data set and a preset row offset. After establishing the correspondence between each row and its data position, the data row position data is written, thus converting the record order in the row data set into the data row order in the table.
[0084] The position of a field value within its corresponding row of data determines its column position. The position of the field value within the row is determined by selecting the column position corresponding to the same position from the column position data. The row position corresponding to the field value is obtained from the row position data. The column position and row position together constitute the cell position of the field value, which is then written into the cell position data. When the row data contains null placeholder data, these null placeholders retain their corresponding positions to prevent subsequent field values from shifting forward.
[0085] Each field value is written to its corresponding cell position according to its cell location. Field values belonging to the same row are written to the same row position, and then to different columns based on their respective arrangement positions; field values belonging to different rows are written to separate rows based on their corresponding row positions. All field values and their cell positions are written to the data area, which stores the arrangement relationship of each row and the column position relationship of each field value.
[0086] The header data and data area data are merged according to a unified column position. The header data is located in the header area, and the data area data is located in the corresponding data row area. The column names in the same column position correspond vertically to the field values in each row, and the field values in the same data row position are arranged horizontally. This generates the output table data that includes the header area, the data area, and the row and column position relationships.
[0087] This embodiment determines the column position based on the column name sequence, determines the data row position based on the row data set, and generates the cell position by using the arrangement position of the field value in the row data. This ensures that the column name data and the field values of each row adopt a consistent column position relationship, and the header data and data area data can generate the output table data according to a unified row and column coordinate system. This reduces column name and field value misalignment, changes in row data order, and errors in cell writing position.
[0088] In one embodiment, such as Figure 8 As shown, step S60 above includes: S601, read file generation configuration data from the export request data, and read file format data and file name data from the file generation configuration data; S602, create table document data based on the file format data, and create worksheet data in the table document data; S603, Write the data to be output into the worksheet data to generate worksheet content data; S604, Write the worksheet content data into the table document data to generate file content data; S605, generate a table file based on the file content data and the file format data, and generate file output data based on the file name data and the table file; S606, write the file output data into the export response data, and send the export response data to the requesting end.
[0089] In this embodiment, the file generation configuration data in the export request data is read according to the configuration field path and remains associated with the current export request. The file generation configuration data carries at least file format data and file name data. The file format data is used to determine the document structure, encoding method, and file extension of the table file, while the file name data is used to identify the name used by the requesting end when receiving the file. During the reading process, a consistency check can be performed on the file format data and file name data to ensure that the file extension matches the actual encoding format.
[0090] When creating tabular document data based on file format data, select the document structure corresponding to the file format and create the document root node, worksheet directory, and format metadata. Worksheet data is created within the tabular document data and is used to store worksheet identifiers, row and column coordinates, and cell content. The tabular document data and worksheet data are linked through the worksheet identifier, allowing worksheet content to be written to specified document locations.
[0091] The data to be output is written to the worksheet item by item according to the row and column positions in the header and data areas. Column names are written to the corresponding column positions in the header rows, and field values are written to the corresponding data rows and column positions. When a cell is empty, its corresponding row and column position is retained, and other field values in the same row are not moved. After the data is written, the worksheet content data saves the cell positions, cell contents, and the arrangement relationship between each data row.
[0092] When worksheet content data is written to the table document data, the worksheet nodes in the table document data are updated to include both header and data content, and these worksheet nodes are then registered in the worksheet directory. After the worksheet content is associated, a file containing the document structure, worksheet structure, and cell content data is generated.
[0093] The file content data is converted into file byte content according to the encoding method corresponding to the file format data and then encapsulated into a table file. When using a compressed document structure, document nodes and worksheet nodes are encoded separately and then encapsulated into the same file container; when using a binary document structure, the file content data is written to the binary file according to the corresponding data segments. The file output data stores the correspondence between file name data and table files, so that the file content and download name are transmitted as the same output object.
[0094] When writing output data from a file to the export response data, the filename is written to the filename field in the response, and the table file is written to the response content. If the table file is stored as memory bytes, it can be written directly to the response content; if the table file is stored as a temporary file, it can be written sequentially to the response content via a file input stream. After the export response data is written, it is sent to the requesting end, allowing the requesting end to obtain the filename and the complete table file content.
[0095] This embodiment establishes a corresponding table document structure based on the file format data, writes the table data to be output into the worksheet according to the row and column positions, and completes the encoding and encapsulation according to the same file format. Then, the file name and table file are written together into the export response data, which can maintain the consistency between table content, file format and download name, and reduce the situation of file format mismatch, cell position change and incomplete response content.
[0096] In one embodiment, the transaction reconciliation page of the cross-border payment management platform needs to export transaction records within a specified settlement period. Business personnel select the transaction date range, account type, currency, settlement status, clearing batch, and risk assessment status on the front-end page, and set the page language to English. The page initially displays the transaction date, transaction serial number, paying account, receiving account, transaction amount, currency, settlement status, risk level, and creation time. The current user position does not have permission to export the paying account, so the business personnel also hide the risk level and use drag-and-drop to move the currency before the transaction amount. The front-end reads the display status and position of each field, filters the allowed-to-export field identifiers into a set of field identifiers, and generates field arrangement data based on the adjusted page position.
[0097] The front-end uses a Map (ordered mapping collection) to store field configurations. Each field configuration item includes a key and a value. The key contains the field identifier, and the value contains the display name in the target language. When the current language environment is English, the multilingual field name data provides column names such as Transaction Date, Transaction Number, Payee Account, Currency, Transaction Amount, Settlement Status, and Creation Time for each field identifier. The field configuration items are arranged sequentially according to their actual display position on the page, ensuring the field configuration collection simultaneously records the range, order, and English column names of the fields being exported. The front-end generates data query conditions based on the input in the query area and encapsulates the data query conditions, ordered field configuration data, file format, and file name configurations into export request data, which is then sent to the back-end export interface.
[0098] After receiving the export request data, the backend reads the ordered field configuration data and data query conditions according to the data nodes in the request data, maintaining the order of the field configuration items in the ordered Map. The backend reads each field configuration item sequentially, associating the field identifier and column name data within the same field configuration item as a field configuration parsing item, and then forming the field configuration parsing data according to the original order of the field configuration items. The backend reads the field identifier and column name data from each field configuration parsing item in the same order, obtaining a sequence of field identifiers and column names that correspond to each other. For example, the field identifier sequence points to the transaction date, transaction serial number, receiving account, currency, transaction amount, settlement status, and creation time in sequence, while the column name sequence stores the corresponding English column names in the same position, ensuring that the field identifier and column name data in the same position originate from the same field configuration item.
[0099] The data query conditions include the cross-border payment transaction data object identifier, transaction date range, account type, currency, settlement status, clearing batch, risk review status, and record range. Based on the data object identifier, the backend identifies the target data object from the data source to store cross-border payment transaction records. It then converts each filtering condition into query parameters recognizable by the target data object and sets the pagination position and return quantity according to the record range, generating a data query instruction. After the data query instruction is sent to the data source, the data source returns records that meet the conditions of transaction date, currency, settlement status, and risk review status, ready for export. When multiple batches are returned, the backend aggregates the records in pagination order to form a set of records to be exported.
[0100] The backend reads the record field identifiers and their corresponding values from each record to be exported, generating independent record field data for each transaction record. Each field identifier in the field identifier sequence is matched against the record field identifiers in the current transaction record. The matching results are used to locate the field values corresponding to the transaction date, transaction serial number, receiving account, currency, transaction amount, settlement status, and creation time. The backend extracts matching field values from the record field data of the same transaction record and forms field value groups according to the order of the field identifier sequence. For example, even if the transaction amount in the record returned by the data source precedes the currency, the generated field value groups are still arranged according to the order determined by the frontend: currency first, transaction amount second. When a transaction record lacks optional field values, an empty value is retained in the corresponding position to prevent subsequent field values from shifting. Each field value group forms a row of data, and all rows of data are aggregated into a row data set according to the record order in the set of records to be exported.
[0101] The backend determines the column position corresponding to each English column name based on the column name sequence and writes the column name data into the header row to form the header data. The data row position corresponding to each transaction record is determined according to the arrangement order in the row data set. Each data row below the header corresponds to one record to be exported. The position of the field value in the row data is used to determine the column position, and the row data to which the field value belongs is used to determine the data row position. The column position and the data row position together determine the cell position. Field values such as transaction date, transaction serial number, receiving account, currency, transaction amount, settlement status, and creation time are written into the data area according to their respective cell positions to form the data area data. The header data and the data area data are merged according to a unified column position to generate the output table data. The English column names in the header correspond vertically to the financial transaction field values in each row.
[0102] The file generation configuration data in the export request specifies the file names of the XLSX (spreadsheet file format) and the cross-border payment transaction reconciliation details. The backend creates the spreadsheet document data and worksheet data based on the file format data. It writes the header content and transaction records from the spreadsheet data to the worksheet, generating the worksheet content data, and then writes the worksheet content into the spreadsheet document data to form the file content data. The file content data is encoded and packaged according to the XLSX format to generate an Excel (spreadsheet) file. The file name data and the spreadsheet file together form the output file data and are written into the export response data. The backend sends the export response data to the frontend, which receives and downloads the file based on the file name. The currently exported file only contains the fields allowed to be exported by the page. The column order is consistent with the adjusted order on the page, and the column names directly use the English display names provided by the frontend according to the language environment. The backend export interface does not need to reset the fixed column names and fixed field order for this field adjustment or language switch.
[0103] In one embodiment, a data export device based on ordered field configuration is provided, which corresponds one-to-one with the data export method based on ordered field configuration described in the above embodiments. (Refer to...) Figure 9 , Figure 9 This is a schematic diagram of the functional modules of a preferred embodiment of the data export device based on ordered field configuration of the present invention. The data export device based on ordered field configuration includes: an export request receiving module 10, a field configuration parsing module 20, an export data acquisition module 30, a row data generation module 40, a table data construction module 50, and a table file output module 60. Detailed descriptions of each functional module are as follows: The export request receiving module 10 is used to receive export request data sent by the requesting end. The export request data includes data query conditions and ordered field configuration data. The ordered field configuration data includes field configuration items arranged in sequence. Each field configuration item includes a field identifier and column name data represented in the target language. The field configuration parsing module 20 is used to parse the ordered field configuration data and the data query conditions from the exported request data, and generate a field identifier sequence and a column name sequence based on the field identifier and column name data in each field configuration item, according to the arrangement order of each field configuration item in the ordered field configuration data. The data acquisition module 30 is used to acquire records to be exported that meet the data query conditions from the data source, and to form a set of records to be exported based on the records to be exported. The row data generation module 40 is used to extract field values corresponding to each field identifier from each record to be exported in the record to be exported set according to the field identifier sequence, arrange the field values according to the field identifier sequence, generate row data corresponding to each record to be exported, and collect the row data to generate a row data set. Table data construction module 50 is used to generate table data to be output based on the column name sequence and the row data set; The table file output module 60 is used to generate a table file based on the table data to be output, and send the table file to the requesting end.
[0104] In one embodiment, the export request receiving module 10 is specifically used for: The receiving end obtains a set of field identifiers based on the field display status of the interface to be exported. The set of field identifiers includes field identifiers whose field display status indicates that they are allowed to be exported. The receiving end generates field arrangement data based on the field display positions corresponding to each field identifier in the field identifier set; The system receives the target language determined by the requesting end based on the language environment data, and also receives the column name data selected by the requesting end from the multilingual field name data based on the target language. The receiving end generates ordered field configuration data based on the field identifier set, the column name data, and the field arrangement data. Each field configuration item in the ordered field configuration data includes corresponding field identifiers and column name data, and is arranged sequentially according to the field arrangement data. The receiving end generates data query conditions based on the query input data; The receiving end generates export request data based on the data query conditions and the ordered field configuration data.
[0105] In one embodiment, the field configuration parsing module 20 is specifically used for: From the ordered field configuration data in the export request data, each field configuration item is read item by item according to the order in which they are arranged in the ordered field configuration data, and data query conditions are read from the export request data; Extract field identifiers and column name data from each field configuration item, establish associations between the field identifiers and column name data in each field configuration item, and generate field configuration parsing items corresponding to each field configuration item; Arrange the corresponding field configuration parsing items according to the order of each field configuration item in the ordered field configuration data, and generate field configuration parsing data. According to the order of each field configuration parsing item in the field configuration parsing data, the field identifier is read from each field configuration parsing item to generate a field identifier sequence; According to the order in which the field configuration parsing items are arranged in the field configuration parsing data, the column name data is read from each field configuration parsing item to generate a column name sequence.
[0106] In one embodiment, the data acquisition module 30 is specifically used for: Extract data object identifiers, filter condition data, and query range data from the data query conditions; The target data object is determined from the data source based on the data object identifier; A data query instruction is generated based on the target data object, the filtering condition data, and the query range data. Send the data query instruction to the data source, receive the records to be exported returned by the data source based on the data query instruction, and generate a set of records to be exported consisting of the records to be exported.
[0107] In one embodiment, the row data generation module 40 is specifically used for: For each record to be exported, read the record field identifier and the field value corresponding to each record field identifier in the record to be exported, and generate the record field data corresponding to each record to be exported; For each record field data corresponding to a record to be exported, each field identifier in the field identifier sequence is matched with each record field identifier in the record field data to generate field matching data corresponding to each record to be exported. Based on the field matching data corresponding to each record to be exported, extract the field values corresponding to each field identifier from the record field data corresponding to the same record to be exported, and generate a group of field values corresponding to each record to be exported. According to the order of each field identifier in the field identifier sequence, the field values in the field value group corresponding to the same record to be exported are arranged to generate row data corresponding to each record to be exported; According to the order of each record to be exported in the set of records to be exported, the row data corresponding to each record to be exported is collected to generate a row data set.
[0108] In one embodiment, the table data construction module 50 is specifically used for: Determine the column position corresponding to each column name data according to the order of each column name data in the column name sequence, and generate column position data; Based on the column position data, determine the table header position corresponding to each column position, write the column name data into the corresponding table header position, and generate the table header data. Determine the data row position corresponding to each row of data according to the arrangement order of each row of data in the data set, and generate data row position data; Based on the arrangement position of each field value in the corresponding row data, determine the column position corresponding to each field value from the column position data, and determine the data row position corresponding to the row data to which the field value belongs from the data row position data, and generate cell position data based on the corresponding column position and data row position; Write the values of each field into the corresponding cell positions according to the cell position data to generate the data area data; The table data to be output is generated based on the header data and the data area data.
[0109] In one embodiment, the table file output module 60 is specifically used for: Read file generation configuration data from the export request data, and read file format data and file name data from the file generation configuration data; A table document is created based on the file format data, and worksheet data is created within the table document data; Write the data to be output into the worksheet data to generate the worksheet content data; Write the worksheet content data into the table document data to generate file content data; A table file is generated based on the file content data and the file format data, and file output data is generated based on the file name data and the table file; Write the file output data into the export response data, and send the export response data to the requesting end.
[0110] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 10 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile and / or volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface is used to communicate with external clients via a network connection. When executed by the processor, the computer program implements server-side functions or steps of a data export method based on ordered field configuration.
[0111] In one embodiment, a computer device is provided, which may be a client, and its internal structure diagram may be as follows: Figure 11 As shown, the computer device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The network interface is used to communicate with an external server via a network connection. When executed by the processor, the computer program implements client-side functions or steps of a data export method based on ordered field configuration.
[0112] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to perform the following steps: The system receives export request data sent by the requesting end. The export request data includes data query conditions and ordered field configuration data. The ordered field configuration data includes field configuration items arranged in sequence. Each field configuration item includes a field identifier and column name data represented in the target language. Parse the ordered field configuration data and the data query conditions from the exported request data, and generate a field identifier sequence and a column name sequence based on the field identifier and column name data in each field configuration item, according to the order of each field configuration item in the ordered field configuration data. Obtain records to be exported that meet the data query conditions from the data source, and construct a set of records to be exported based on the records to be exported; For each record to be exported in the set of records to be exported, the field values corresponding to each field identifier are extracted from each record to be exported according to the field identifier sequence, and the field values are arranged according to the field identifier sequence to generate row data corresponding to each record to be exported. The row data is then collected to generate a row data set. Generate the table data to be output based on the column name sequence and the row data set; A table file is generated based on the data to be output, and the table file is sent to the requesting end.
[0113] In one embodiment, a computer-readable storage medium is provided, which may be non-volatile or volatile, and a computer program is stored thereon, which, when executed by a processor, performs the following steps: The system receives export request data sent by the requesting end. The export request data includes data query conditions and ordered field configuration data. The ordered field configuration data includes field configuration items arranged in sequence. Each field configuration item includes a field identifier and column name data represented in the target language. Parse the ordered field configuration data and the data query conditions from the exported request data, and generate a field identifier sequence and a column name sequence based on the field identifier and column name data in each field configuration item, according to the order of each field configuration item in the ordered field configuration data. Obtain records to be exported that meet the data query conditions from the data source, and construct a set of records to be exported based on the records to be exported; For each record to be exported in the set of records to be exported, the field values corresponding to each field identifier are extracted from each record to be exported according to the field identifier sequence, and the field values are arranged according to the field identifier sequence to generate row data corresponding to each record to be exported. The row data is then collected to generate a row data set. Generate the table data to be output based on the column name sequence and the row data set; A table file is generated based on the data to be output, and the table file is sent to the requesting end.
[0114] It should be noted that the functions or steps that can be implemented by the computer-readable storage medium or computer device described above can be referred to the relevant descriptions on the server side and client side in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.
[0115] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0116] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0117] It should be noted that any AI models, software tools, or components not belonging to this company appearing in the embodiments of this application are merely illustrative examples and do not represent actual use. All user personal information involved in the embodiments of this application has been authorized (with the knowledge and consent) by the relevant parties or has been fully authorized by all parties, and the executing entity may obtain it through various legal and compliant means. The collection, storage, use, processing, transmission, provision, and disclosure of the information, data, and signals involved all comply with relevant laws and regulations and do not violate public order and good morals.
[0118] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A data export method based on ordered field configuration, characterized in that, Includes the following steps: The system receives export request data sent by the requesting end. The export request data includes data query conditions and ordered field configuration data. The ordered field configuration data includes field configuration items arranged in sequence. Each field configuration item includes a field identifier and column name data represented in the target language. Parse the ordered field configuration data and the data query conditions from the exported request data, and generate a field identifier sequence and a column name sequence based on the field identifier and column name data in each field configuration item, according to the order of each field configuration item in the ordered field configuration data. Obtain records to be exported that meet the data query conditions from the data source, and construct a set of records to be exported based on the records to be exported; For each record to be exported in the set of records to be exported, the field values corresponding to each field identifier are extracted from each record to be exported according to the field identifier sequence, and the field values are arranged according to the field identifier sequence to generate row data corresponding to each record to be exported. The row data is then collected to generate a row data set. Generate the table data to be output based on the column name sequence and the row data set; A table file is generated based on the data to be output, and the table file is sent to the requesting end.
2. The data export method based on ordered field configuration as described in claim 1, characterized in that, The system receives export request data sent by the requesting end. This export request data includes data query conditions and ordered field configuration data. The ordered field configuration data includes sequentially arranged field configuration items. Each field configuration item includes a field identifier and column name data represented in the target language, including: The receiving end obtains a set of field identifiers based on the field display status of the interface to be exported. The set of field identifiers includes field identifiers whose field display status indicates that they are allowed to be exported. The receiving end generates field arrangement data based on the field display positions corresponding to each field identifier in the field identifier set; The system receives the target language determined by the requesting end based on the language environment data, and also receives the column name data selected by the requesting end from the multilingual field name data based on the target language. The receiving end generates ordered field configuration data based on the field identifier set, the column name data, and the field arrangement data. Each field configuration item in the ordered field configuration data includes corresponding field identifiers and column name data, and is arranged sequentially according to the field arrangement data. The receiving end generates data query conditions based on the query input data; The receiving end generates export request data based on the data query conditions and the ordered field configuration data.
3. The data export method based on ordered field configuration as described in claim 1, characterized in that, Parse the ordered field configuration data and the data query conditions from the exported request data. Based on the field identifiers and column name data in each field configuration item, generate a field identifier sequence and a column name sequence according to the order of each field configuration item in the ordered field configuration data, including: From the ordered field configuration data in the export request data, each field configuration item is read item by item according to the order in which they are arranged in the ordered field configuration data, and data query conditions are read from the export request data; Extract field identifiers and column name data from each field configuration item, establish associations between the field identifiers and column name data in each field configuration item, and generate field configuration parsing items corresponding to each field configuration item; Arrange the corresponding field configuration parsing items according to the order of each field configuration item in the ordered field configuration data, and generate field configuration parsing data. According to the order of each field configuration parsing item in the field configuration parsing data, the field identifier is read from each field configuration parsing item to generate a field identifier sequence; According to the order in which the field configuration parsing items are arranged in the field configuration parsing data, the column name data is read from each field configuration parsing item to generate a column name sequence.
4. The data export method based on ordered field configuration as described in claim 1, characterized in that, Retrieve records that meet the data query conditions from the data source, and construct a set of records to be exported based on these records, including: Extract data object identifiers, filter condition data, and query range data from the data query conditions; The target data object is determined from the data source based on the data object identifier; A data query instruction is generated based on the target data object, the filtering condition data, and the query range data. Send the data query instruction to the data source, receive the records to be exported returned by the data source based on the data query instruction, and generate a set of records to be exported consisting of the records to be exported.
5. The data export method based on ordered field configuration as described in claim 1, characterized in that, For each record to be exported in the set of records to be exported, the field values corresponding to each field identifier are extracted from each record according to the field identifier sequence, and the field values are arranged according to the field identifier sequence to generate row data corresponding to each record to be exported. The row data is then collected to generate a row data set, including: For each record to be exported, read the record field identifier and the field value corresponding to each record field identifier in the record to be exported, and generate the record field data corresponding to each record to be exported; For each record field data corresponding to a record to be exported, each field identifier in the field identifier sequence is matched with each record field identifier in the record field data to generate field matching data corresponding to each record to be exported. Based on the field matching data corresponding to each record to be exported, extract the field values corresponding to each field identifier from the record field data corresponding to the same record to be exported, and generate a group of field values corresponding to each record to be exported. According to the order of each field identifier in the field identifier sequence, the field values in the field value group corresponding to the same record to be exported are arranged to generate row data corresponding to each record to be exported; According to the order of each record to be exported in the set of records to be exported, the row data corresponding to each record to be exported is collected to generate a row data set.
6. The data export method based on ordered field configuration as described in claim 1, characterized in that, The table data to be output is generated based on the column name sequence and the row data set, including: Determine the column position corresponding to each column name data according to the order of each column name data in the column name sequence, and generate column position data; Based on the column position data, determine the table header position corresponding to each column position, write the column name data into the corresponding table header position, and generate the table header data. Determine the data row position corresponding to each row of data according to the arrangement order of each row of data in the data set, and generate data row position data; Based on the arrangement position of each field value in the corresponding row data, determine the column position corresponding to each field value from the column position data, and determine the data row position corresponding to the row data to which the field value belongs from the data row position data, and generate cell position data based on the corresponding column position and data row position; Write the values of each field into the corresponding cell positions according to the cell position data to generate the data area data; The table data to be output is generated based on the header data and the data area data.
7. The data export method based on ordered field configuration as described in claim 1, characterized in that, Generating a table file based on the data to be output and sending the table file to the requesting client includes: Read file generation configuration data from the export request data, and read file format data and file name data from the file generation configuration data; A table document is created based on the file format data, and worksheet data is created within the table document data; Write the data to be output into the worksheet data to generate the worksheet content data; Write the worksheet content data into the table document data to generate file content data; A table file is generated based on the file content data and the file format data, and file output data is generated based on the file name data and the table file; Write the file output data into the export response data, and send the export response data to the requesting end.
8. A data export device based on ordered field configuration, characterized in that, The data export device based on ordered field configuration includes: The export request receiving module is used to receive export request data sent by the requesting end. The export request data includes data query conditions and ordered field configuration data. The ordered field configuration data includes field configuration items arranged in sequence. Each field configuration item includes a field identifier and column name data represented in the target language. The field configuration parsing module is used to parse the ordered field configuration data and the data query conditions from the exported request data, and generate a field identifier sequence and a column name sequence based on the field identifier and column name data in each field configuration item, according to the order of the field configuration items in the ordered field configuration data. The data acquisition module is used to acquire records to be exported that meet the data query conditions from the data source, and to form a set of records to be exported based on the records to be exported. The row data generation module is used to extract field values corresponding to each field identifier from each record to be exported in the record to be exported set according to the field identifier sequence, arrange the field values according to the field identifier sequence, generate row data corresponding to each record to be exported, and collect the row data to generate a row data set. The table data construction module is used to generate the table data to be output based on the column name sequence and the row data set; The table file output module is used to generate a table file based on the table data to be output, and send the table file to the requesting end.
9. A computer device, characterized in that, The computer device includes a memory, a processor, and a data export program based on ordered field configuration stored in the memory and executable on the processor, wherein the data export program based on ordered field configuration, when executed by the processor, implements the steps of the data export method based on ordered field configuration as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The storage medium stores a data export program based on ordered field configuration, which, when executed by a processor, implements the steps of the data export method based on ordered field configuration as described in any one of claims 1-7.
