Data exporting method based on Excel template

By using dynamic template parsing and intelligent field matching, combined with multi-source secure connections and multi-level verification alarms, the problems of low efficiency, poor adaptability, and weak security in Excel template data export are solved, achieving efficient and secure data export and operation and maintenance response.

CN120407652APending Publication Date: 2025-08-01WUXI RONGZHI TECH CO LTD +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510496660.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-21
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

Existing technologies for exporting data from Excel templates suffer from insufficient dynamic template adaptation capabilities, limited data validation rules, constraints on multi-source data connections, and weak error handling mechanisms, resulting in low efficiency, poor adaptability, and weak security.

Method used

It employs dynamic template parsing, intelligent field matching, multi-source secure connection, and multi-level verification and alarm mechanisms. It parses Excel templates using the Apache POI library, processes CSV format using OpenCSV, calculates field name similarity using Levenshtein distance, achieves high-precision data mapping and cleaning transformation, and uses hash function encryption during data transmission, providing a multi-level error alarm mechanism.

Benefits of technology

It improves data export efficiency and accuracy, enhances system adaptability and security, and provides precision in multi-level error handling and operational response efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120407652A_ABST
    Figure CN120407652A_ABST
Patent Text Reader

Abstract

The invention discloses a data exporting method based on an Excel template. The data exporting method comprises the following steps: S1, configuring a user template; s2, dynamic data source connection; s3, extracting and mapping data; s4, intelligent field matching domain; s5, data cleaning and conversion; s6, file generation and distribution; through dynamic template analysis, intelligent field matching, multi-source secure connection and a multi-level verification alarm mechanism, three core problems of low efficiency, poor adaptability and weak security in a traditional data export technology are solved; the method comprises the following steps: by integrating an Apache POI library and an OpenCSV tool, covering a mainstream Excel file type; the template analysis engine ensures that the format of the exported file is completely consistent with the preset template; field similarity calculation based on the Levenshtein distance is combined with a historical use frequency weight, so that the matching accuracy is improved; and the operation and maintenance response efficiency is improved by a multi-dimensional verification and intelligent alarm system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and more specifically, to a method for exporting data based on an Excel template. Background Art

[0002] Data export refers to migrating or copying data from a certain data source to another data storage format or tool. In Excel, data export usually involves converting the data in an Excel file into other formats, such as CSV, PDF, or HTML, etc. This helps with data sharing, storage, or further processing.

[0003] Data export allows users to simplify complex data structures into formats that are easier to process. It plays an important role in data sharing, migration, backup, and analysis. In addition, exporting data can conveniently transfer data from one platform to another, such as from Excel to a database or from Excel to a web page.

[0004] In the traditional field of data export, the export method based on an Excel template is widely used in scenarios such as enterprise data report generation and cross-system data migration. However, the existing technologies have the following significant defects.

[0005] Insufficient dynamic adaptation ability of the template: Existing solutions mostly rely on manual matching of data source fields and template placeholders. Especially when the data source structure changes frequently or there are differences in field naming, the template needs to be adjusted repeatedly, resulting in low efficiency and easy errors.

[0006] Simplification of data verification rules: Traditional methods usually only support basic data type validations (such as numeric type, date type), and lack support for complex business rules (such as cross-field logical consistency, dynamic range thresholds).

[0007] Limitations in connecting multi-source data: Existing technologies are mostly designed for a single data source (such as a database or a local file), lacking a unified connection management mechanism. For heterogeneous data sources such as API endpoints, encrypted compressed files, and cloud storage, different interfaces need to be custom-developed, resulting in poor system scalability and inability to guarantee the security of data transmission.

[0008] Weak error handling and feedback mechanism: Existing technologies mostly adopt a simple binary feedback of "success / failure", lacking fine-grained error classification (such as fatal errors, logical warnings) and accurate positioning capabilities. It is difficult for users to obtain "field-level error details" or "repair suggestions" in a timely manner, and there is a lack of multi-channel alarms (such as emails, instant messaging tools), resulting in a lag in operation and maintenance response. Summary of the Invention

[0009] An object of the present invention is to provide a new technical solution for a data export method based on an Excel template.

[0010] According to a first aspect of the present invention, there is provided a data export method based on an Excel template, comprising the following steps:

[0011] S1. User template configuration: An Excel template file with structured field identifiers is predefined in the front-end interaction interface, and the Excel template file is parsed by a template parsing engine;

[0012] S2. Dynamic data source connection: Parse the API endpoint URL, database connection string or local file path input by the user to establish a secure communication channel;

[0013] S3. Extract and map data: Dynamically load heterogeneous data sources and extract the data to be exported from the heterogeneous data sources;

[0014] S4. Intelligent field matching: Parse the Excel template file and dynamically map the data to the corresponding area of the template according to the field identifiers;

[0015] S5. Data cleaning and transformation: Identify the data columns to be exported and the corresponding data source fields, then extract the corresponding data from the data source, and map the data to the placeholders in the template;

[0016] S6. File generation and distribution: Inject the processed data according to the template layout, generate a target Excel file that conforms to the template format and export it to the specified path.

[0017] Preferably, the template parsing engine in S1 parses the Excel template through the Apache POI library. The formats adopted by the Excel template include the xls format and the xlsx format, and OpenCSV is used to process the csv format;

[0018] And the template parsing engine automatically copies the cell styles defined in the Excel template file to the newly generated data rows, including merged cells and conditional formatting.

[0019] Preferably, the structured field identifiers of the Excel template file in S1 include the exported data table headers, data columns, as well as the styles, format requirements and data validation rules of the data;

[0020] The data table headers and the data columns use specific syntax to mark dynamic data columns, and the threshold of the set character is Y = 6;

[0021] The styles and format requirements of the data are used to set the font, color and format of the data information;

[0022] The data verification rules are used to verify the legality of the data.

[0023] Preferably, the calculation of the secure communication channel in S2 is as follows:

[0024] Parse the API endpoint URL, database connection string, or local file path. After parsing, extract a random string from the address information and add a timestamp for hash function calculation to generate a secret key. When sending a request, the secret key is sent as part of the request, added to the request header or URL parameters, and the secret key is stored in an encrypted form. When connecting to a dynamic data source, the transmitted secret key will be verified. Compare the secret key in the request with the stored secret key. If the match is successful, access is allowed; if the match fails, an error is returned.

[0025] Preferably, after the heterogeneous data source in S3 is loaded, convert the format of the heterogeneous data source into an XML format data source;

[0026] Then convert the XML format data source into a data set. First, identify and extract the data table headers, data columns, data styles, format requirements, and data verification rules in the XML format data source according to the results calculated by the fuzzy matching algorithm. Then, process the identified and extracted data information according to data cleaning and conversion to generate a list form. Finally, generate the data set form from the data information in the list in the original order.

[0027] The form of the generated data set is as follows:

[0028]

[0029] Preferably, the intelligent field matching in S4 uses a fuzzy matching algorithm for calculation and analysis;

[0030] The fuzzy matching algorithm calculates the similarity of field names based on the Levenshtein distance and provides a list of candidate field suggestions;

[0031] Given strings s and t with lengths m and n respectively, construct a two-dimensional matrix d[m + 1][n + 1],

[0032]

[0033] cost = 0 when s[i - 1] = [j - 1], otherwise, cost = 1;

[0034] Among them, d[i][j] represents the minimum number of editing operations for converting the substring s[0..i-1] to s[0..j-1]. The boundary conditions are d[i][0] = i (0 ≤ i ≤ m) and d[0][j] = j (0 ≤ j ≤ n). The meaning is as follows: To convert a string of length i to an empty string, i deletion operations are required; to convert an empty string to a string of length j, j insertion operations are required.

[0035]

[0036] Among them, the Levenshtein distance is expressed as the actual editing distance, the minimum number of operations, and max(m,n) represents the maximum value of the lengths of the two strings, which is used for normalization. The result range is from 0 to 1, and the larger the value, the higher the similarity.

[0037] Preferably, the candidate field screening strategy of the fuzzy matching algorithm is as follows:

[0038] Threshold filtering: By comparing the similarity with a set threshold, only the candidate fields with similarity ≥ 0.7 are retained.

[0039] Top-N ranking comparison: Select the top 3 candidate fields with the highest similarity.

[0040] Combined weight acquisition: Multiply the similarity by the weight of the field usage frequency. The calculation formula is as follows:

[0041]

[0042] Among them, G represents the selected value, and w r represents the weights of the top 3 candidate fields with the highest similarity, and the candidate field with the highest output value is output as the final candidate field.

[0043] Preferably, the data cleaning and conversion perform type conversion and sensitive data desensitization on the extracted candidate fields according to the format rules defined by the template.

[0044] The type conversion includes converting strings to dates and truncating numerical precision.

[0045] The sensitive data desensitization is used to partially hide the mobile phone number, that is, to hide or perform binary conversion processing on the confidential data.

[0046] Preferably, the data verification rules include data type matching verification, numerical range threshold verification, mandatory field integrity verification, and cross-field logical consistency verification. Alarms are triggered when the verification fails.

[0047] The level of the triggered alarm:

[0048] Trigger language: FATAL, trigger conditions: fatal errors such as connection failure and primary key duplication, handling conditions: terminate the task and notify the administrator by email;

[0049] Trigger language: ERROR, trigger conditions: data type mismatch, missing required fields, handling conditions: skip the current row and record error logs;

[0050] Trigger language: WARN, trigger conditions: warning for non-keyword field format, handling conditions: mark and continue execution, and pop up a prompt on the interface.

[0051] Preferably, the specified path for Excel file export in S5 includes direct browser download, upload to cloud storage path, and sending as email attachment;

[0052] And a multi-dimensional analysis report is automatically generated when exporting the Excel file. The multi-dimensional analysis report includes data volume statistics, details of verification exceptions, export time consumption, and file access permission configuration information.

[0053] Advantages of the present invention:

[0054] The present invention solves the three core problems of low efficiency, poor adaptability, and weak security in traditional data export technology through dynamic template parsing, intelligent field matching, multi-source secure connection, and multi-level verification and warning mechanism;

[0055] Improvement of dynamic template parsing and intelligent adaptation ability: By integrating the Apache POI library and OpenCSV tool, the system can seamlessly parse multiple format templates, covering mainstream Excel file types; and the template parsing engine automatically copies and merges complex styles such as merged cells and conditional formatting to the newly generated data rows to ensure that the exported file format is exactly the same as the preset template;

[0056] High-precision data mapping and cleaning and conversion: Based on the field similarity calculation using the Levenshtein distance and combined with the historical usage frequency weight, the matching accuracy is improved; support for type conversion, null value filling, and sensitive data desensitization to reduce dirty data in the data;

[0057] Multi-dimensional verification and intelligent warning system: Adopt strategies such as terminating the task, skipping error rows, or popping up a prompt according to the error level to improve the operation and maintenance response efficiency.

[0058] Through the following detailed description of the exemplary embodiments of the present invention with reference to the accompanying drawings, other features and advantages of the present invention will become clear. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] The drawings incorporated in the specification and constituting a part of the specification illustrate embodiments of the present invention and, together with the description, are used to explain the principles of the present invention.

[0060] Figure 1 It is a schematic diagram of the step flow of a data export method based on an Excel template in an embodiment. Specific embodiments

[0061] Now, various exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings. It should be noted that: unless otherwise specifically stated, the relative arrangements of components and steps, numerical expressions and values set forth in these embodiments do not limit the scope of the present invention.

[0062] The following description of at least one exemplary embodiment is merely illustrative in nature and in no way limits the present invention, its application, or its use.

[0063] Technologies, methods, and devices known to those of ordinary skill in the relevant art may not be discussed in detail, but where appropriate, such technologies, methods, and devices should be considered as part of the specification.

[0064] In all the examples shown and discussed here, any specific values should be construed as merely exemplary and not as a limitation. Thus, other examples of the exemplary embodiments may have different values.

[0065] As Figure 1 shown, a data export method based on an Excel template includes the following steps:

[0066] S1. User template configuration: A front-end interaction interface predefines an Excel template file with structured field identifiers, and parses the Excel template file through a template parsing engine;

[0067] S2. Dynamic data source connection: Parse the API endpoint URL, database connection string, or local file path input by the user to establish a secure communication channel;

[0068] S3. Extract and map data: Dynamically load heterogeneous data sources and extract the data to be exported from the heterogeneous data sources;

[0069] S4. Intelligent field matching: Parse the Excel template file and dynamically map the data to the corresponding areas of the template according to the field identifiers;

[0070] S5. Data cleaning and transformation: Identify the data columns to be exported and the corresponding data source fields, then extract the corresponding data from the data source, and map the data to the placeholders in the template;

[0071] S6. File generation and distribution: Inject the processed data according to the template layout, generate a target Excel file that conforms to the template format, and export it to the specified path.

[0072] In this embodiment, preferably, the template parsing engine in S1 parses the Excel template through the Apache POI library. The formats adopted by the Excel template include the xls format and the xlsx format, and OpenCSV is used to process the csv format;

[0073] And the template parsing engine automatically copies the cell styles defined in the Excel template file to the newly generated data rows, including merged cells and conditional formatting;

[0074] It should be noted that by integrating the Apache POI library and the OpenCSV tool, the system can seamlessly parse multiple format templates, covering mainstream Excel file types; and the template parsing engine automatically copies complex styles such as merged cells and conditional formatting to the newly generated data rows, ensuring that the exported file format is exactly the same as the preset template.

[0075] In this embodiment, preferably, the structured field identifiers of the Excel template file in S1 include the exported data table headers, data columns, as well as the styles, format requirements, and data validation rules of the data;

[0076] The data table headers and the data columns use specific syntax markers to mark dynamic data columns, and the threshold of the set character is Y = 6;

[0077] The styles and format requirements of the data are used to set the font, color, and format of the data information;

[0078] The data validation rules are used to verify the data legality;

[0079] It should be noted that through the structured field identifiers, style automatic inheritance, and data validation rules, a leapfrog improvement is achieved in data export efficiency, accuracy, and usability.

[0080] In this embodiment, preferably, the calculation of the secure communication channel in S2 is as follows:

[0081] Parse and process the API endpoint URL, database connection string, or local file path. After parsing, extract a random string from the address information and add a timestamp for hash function calculation to generate a secret key. When sending a request, the secret key is sent as part of the request and added to the request header or URL parameters. And the secret key is stored in an encrypted form. When connecting to a dynamic data source, it will be verified according to the transmitted secret key. Compare the secret key in the request with the stored secret key. If the match is successful, access is allowed; if the match fails, an error is returned;

[0082] It should be noted that by establishing a secure communication channel, the security of data information transmission is improved, data information loss or attacks are prevented, and a secret key is generated using a string and a timestamp, which facilitates the identification of the secret key when requesting data and enhances the security of data transmission.

[0083] In this embodiment, preferably, after the heterogeneous data source in S3 is loaded, the heterogeneous data source is converted into a data source in XML format.

[0084] Then, the XML format data source is converted into a data set. First, the data table headers, data columns, data styles, format requirements, and data verification rules in the XML format data source are identified and extracted according to the results calculated by the fuzzy matching algorithm. Then, the identified and extracted data information is processed through data cleaning and transformation to generate a list form. Finally, the data information in the list is generated into a data set form in the original order.

[0085] The form of the generated data set is as follows:

[0086]

[0087] It should be noted that by processing the heterogeneous data source, a data source in XML format is generated, and the data styles and formats are identified and extracted through the fuzzy matching algorithm, and the data is processed through data cleaning and transformation, which facilitates the matching of the data set with the preset template.

[0088] In this embodiment, preferably, the intelligent field matching in S4 uses the fuzzy matching algorithm for calculation and analysis.

[0089] The fuzzy matching algorithm calculates the similarity of field names based on the Levenshtein distance and provides a list of candidate field suggestions.

[0090] Given strings s and t with lengths m and n respectively, construct a two-dimensional matrix d[m + 1][n + 1].

[0091]

[0092] Among them, d[i][j] represents the minimum number of edit operations to convert the substring s[0..i - 1] to s[0..j - 1]. The boundary conditions are d[i][0] = i (0 ≤ i ≤ m) and d[0][j] = j (0 ≤ j ≤ n). The meaning is that to convert a string of length i to an empty string, i delete operations are required; to convert an empty string to a string of length j, j insert operations are required.

[0093]

[0094] Among them, the Levenshtein distance is expressed as the actual edit distance, the minimum number of operations, and max(m,n) represents the maximum value of the lengths of the two strings, which is used for normalization. The result range is from 0 to 1, and the larger the value, the higher the similarity;

[0095] It should be noted that the Levenshtein distance is a classic metric for measuring the difference between two strings, defined as the minimum number of single-character edit operations required to convert a given string into a template string. It still provides accurate suggestions under the difference of field names, greatly reducing the manual mapping cost;

[0096] And It is expressed as a recurrence formula. Among them, deleting d[i - 1][j]+1 means deleting the i-th character of s, and the remaining i - 1 characters need to be converted into j characters; inserting d[i][j - 1]+1 means inserting the j-th character of t into s, and the remaining j - 1 characters need to be converted; replacing d[i - 1][j - 1]+cost means replacing the i-th character of s with the j-th character of t;

[0097] The rule of the cost value:

[0098]

[0099] It means that when the characters are the same, no replacement is needed, and the cost is cost = 0. Otherwise, one replacement operation is needed, and the cost is cost = 1.

[0100] In this embodiment, preferably, the candidate field screening strategy of the fuzzy matching algorithm:

[0101] Threshold filtering, by comparing the similarity with a set threshold, only the candidate fields with similarity ≥ 0.7 are retained;

[0102] Top-N ranking comparison, taking the top 3 candidate fields with the highest similarity;

[0103] Combined weight acquisition, by multiplying the similarity by the weight of the field usage frequency, the calculation formula is as follows:

[0104]

[0105] Among them, G represents the selected value, w i represents the weights of the top 3 candidate fields with the highest similarity, and the candidate field with the highest output value is output as the final candidate field;

[0106] It should be noted that threshold filtering is used to efficiently exclude low-quality candidates and improve the matching accuracy. Top-N ranking is used to optimize the recommendation efficiency and user experience. The combination weight acquisition is used to integrate historical data and real-time matching to enhance the business compliance. The three-level screening strategy can improve the accurate and efficient matching, optimize resource consumption, and enhance the adaptive learning ability.

[0107] In this embodiment, preferably, the data cleaning and transformation performs type conversion and sensitive data desensitization on the extracted candidate fields according to the format rules defined by the template.

[0108] The type conversion includes string-to-date conversion and numerical precision truncation.

[0109] The sensitive data desensitization is used to partially hide the mobile phone number, that is, to hide or perform binary conversion processing on the confidential data.

[0110] It should be noted that data type conversion is used to ensure data standardization and business compliance. Sensitive data desensitization is used to strengthen privacy protection and compliance. Format rule-driven automated cleaning is used to improve efficiency and consistency. Through accurate type conversion and dynamic desensitization mechanisms, a leap in data quality, an upgrade in privacy protection, and an improvement in processing efficiency are achieved.

[0111] In this embodiment, preferably, the data verification rules include data type matching verification, numerical range threshold verification, mandatory field integrity verification, and cross-field logical consistency verification. An alarm is triggered when the verification fails.

[0112] Levels of triggered alarms:

[0113] Triggering language: FATAL, Triggering conditions: Fatal errors such as connection failure, primary key duplication, etc. Handling conditions: Terminate the task and notify the administrator by email.

[0114] Triggering language: ERROR, Triggering conditions: Data type mismatch, missing mandatory fields. Handling conditions: Skip the current row and record the error log.

[0115] Triggering language: WARN, Triggering conditions: Warning for non-keyword field format. Handling conditions: Mark but continue to execute, and pop up a prompt on the interface.

[0116] It should be noted that the multi-dimensional verification and intelligent alarm system: According to the error level, strategies such as terminating the task, skipping the error row, or popping up a prompt are adopted to improve the operation and maintenance response efficiency.

[0117] In this embodiment, preferably, the specified path for Excel file export in S5 includes direct browser download, cloud storage path upload, and email attachment sending.

[0118] And when exporting to an Excel file, a multi-dimensional analysis report is automatically generated, and the multi-dimensional analysis report includes data volume statistics, verification exception details, export time consumption, and file access permission configuration information;

[0119] It should be noted that multi-channel seamless distribution is used to improve data transfer efficiency and scenario adaptability, and the multi-dimensional analysis report is used to drive data governance and decision-making optimization.

[0120] The specific steps of this application are as follows:

[0121] Step 1. User template configuration: The front-end interaction interface predefines an Excel template file with structured field identifiers, and the Excel template file is parsed by a template parsing engine;

[0122] Step 2. Dynamic data source connection: Parse the API endpoint URL, database connection string, or local file path input by the user to establish a secure communication channel;

[0123] Step 3. Extract and map data: Dynamically load heterogeneous data sources and extract data to be exported from the heterogeneous data sources;

[0124] Step 4. Intelligent field matching: Parse the Excel template file and dynamically map the data to the corresponding area of the template according to the field identifier;

[0125] Step 5. Data cleaning and transformation: Identify the data columns to be exported and the corresponding data source fields, then extract the corresponding data from the data source, and map the data to the placeholders in the template;

[0126] Step 6. File generation and distribution: Inject the processed data according to the template layout, generate a target Excel file that conforms to the template format, and export it to the specified path.

[0127] Although some specific embodiments of the present invention have been described in detail by way of examples, those skilled in the art should understand that the above examples are only for illustration and not for limiting the scope of the present invention. Those skilled in the art should understand that the above embodiments can be modified without departing from the scope and spirit of the present invention. The scope of the present invention is defined by the appended claims.

Claims

1. A data export method based on an Excel template, characterized in that It includes the following steps: S1. User template configuration: The front-end interaction interface predefines an Excel template file with structured field identifiers, and parses the Excel template file through a template parsing engine; S2. Dynamic data source connection: Parse the API endpoint URL, database connection string or local file path input by the user to establish a secure communication channel; S3. Extract and map data: Dynamically load heterogeneous data sources and extract the data to be exported from the heterogeneous data sources; S4. Intelligent field matching: Parse the Excel template file and dynamically map the data to the corresponding areas of the template according to the field identifiers; S5. Data cleaning and transformation: Identify the data columns to be exported and the corresponding data source fields, then extract the corresponding data from the data source, and map the data to the placeholders in the template; S6. File generation and distribution: Inject the processed data according to the template layout, generate a target Excel file that conforms to the template format and export it to the specified path.

2. The data export method based on an Excel template according to claim 1, wherein: The template parsing engine in S1 parses the Excel template through the Apache POI library. The formats adopted by the Excel template include the xls format and the xlsx format, and OpenCSV is used to process the csv format; And the template parsing engine automatically copies the cell styles defined in the Excel template file to the newly generated data rows, including merged cells and conditional formatting.

3. The data export method based on an Excel template according to claim 1, characterized in that: The structured field identifiers of the Excel template file in S1 include the exported data headers, data columns, as well as the styles, format requirements and data validation rules of the data; The data headers and the data columns use specific syntax markers to mark dynamic data columns, and the threshold of the set character is Y = 6; The styles and format requirements of the data are used to set the font, color and format of the data information; The data validation rules are used to verify the legality of the data.

4. A data export method based on an Excel template according to claim 1, characterized in that: The calculation of the secure communication channel in S2 is as follows: Parse and process the API endpoint URL, database connection string or local file path. After parsing, extract a random string from the address information and add a timestamp for hash function calculation to generate a secret key. When sending a request, the secret key is sent as a part of the request and added to the request header or URL parameters. And the secret key is stored in an encrypted form. When connecting to the dynamic data source, it will be verified according to the transmitted secret key. Compare the secret key in the request with the stored secret key. If the match is successful, access is allowed; if the match fails, an error is returned.

5. A data export method based on an Excel template according to claim 1, characterized in that: After the heterogeneous data source in S3 is loaded, the format of the heterogeneous data source is converted into a data source in XML format; Then convert the XML format data source into a data set. First, identify and extract the data headers, data columns, as well as the styles, format requirements and data validation rules in the XML format data source according to the results calculated by the fuzzy matching algorithm. Then, process the identified and extracted data information according to the data cleaning and transformation to generate a list form. Finally, generate the data information in the list into a data set form in the original order; The generated data set is in the following form:

6. A data export method based on an Excel template according to claim 1, wherein: In S4, the intelligent field matching uses a fuzzy matching algorithm for calculation and analysis; The fuzzy matching algorithm calculates the field name similarity based on the Levenshtein distance and provides a list of candidate field suggestions; Given strings s and t with lengths m and n respectively, construct a two-dimensional matrix d[m+1][n+1], cost = 0 when s[i-1] = [j-1], otherwise, cost = 1; Among them, d[i][j] represents the minimum number of edit operations to convert the substring s[0..i-1] to s[0..j-1]. The boundary conditions are d[i][0] = i (0 ≤ i ≤ m), d[0][j] = j (0 ≤ j ≤ n). The meaning is: to convert a string of length i to an empty string, i deletion operations are required; to convert an empty string to a string of length j, j insertion operations are required; Among them, the Levenshtein distance is expressed as the actual edit distance, the minimum number of operations, and max(m,n) is expressed as the maximum value of the lengths of the two strings, which is used for normalization. The result range is from 0 to 1, and the larger the value, the higher the similarity.

7. A data export method based on an Excel template according to claim 6, characterized in that: The candidate field screening strategy of the fuzzy matching algorithm: Threshold filtering, by comparing the similarity with a set threshold, only retain candidate fields with similarity ≥ 0.7; Top-N ranking comparison, take the top 3 candidate fields with the highest similarity; Combined weight acquisition, by multiplying the similarity by the weight of the field usage frequency, the calculation formula is as follows: Among them, G represents the evaluation value, and w r represents the weights of the top 3 candidate fields with the highest similarity. The candidate field with the highest output value is output as the final candidate field.

8. A data export method based on an Excel template according to claim 1, characterized in that: The data cleaning and conversion performs type conversion and sensitive data desensitization on the extracted candidate fields according to the format rules defined by the template; The type conversion includes converting strings to dates and truncating numerical precision; The sensitive data desensitization is used to partially hide the mobile phone number, that is, to hide or perform binary conversion processing on the confidential data.

9. A data export method based on an Excel template according to claim 3, characterized in that: The data verification rules include data type matching verification, numerical range threshold verification, mandatory field integrity verification, and cross-field logical consistency verification. An alarm is triggered when the verification fails; The level of triggering the alarm: Triggering language: FATAL, triggering conditions: fatal errors such as connection failure, primary key duplication, handling conditions: terminate the task, email the administrator; Triggering language: ERROR, triggering conditions: data type mismatch, missing mandatory fields, handling conditions: skip the current line, record the error log; Triggering language: WARN, triggering conditions: non-keyword field format warning, handling conditions: mark but continue to execute, pop-up a prompt on the interface.

10. A data export method based on an Excel template according to claim 1, characterized in that: The specified path for Excel file export in S5 includes direct download by the browser, upload to the cloud storage path, and sending as an email attachment; And a multi-dimensional analysis report is automatically generated when the Excel file is exported. The multi-dimensional analysis report includes data volume statistics, details of verification exceptions, export time consumption, and file access permission configuration information.

Citation Information

Cited By

  • Format conversion method and device for heterogeneous data and medium

    CN121092506A