Search

CN-122019646-A - Electronic form importing method and computing device

CN122019646ACN 122019646 ACN122019646 ACN 122019646ACN-122019646-A

Abstract

The embodiment of the application provides an importing method of an electronic form and computing equipment. The method comprises the steps of obtaining an electronic table, wherein the electronic table comprises a plurality of cells, the plurality of cells comprise a plurality of table head cells and a plurality of service data cells, determining a table head structure according to cell information of the plurality of table head cells, wherein the cell information of the table head cells comprises table heads and cell positions of the table heads, the table head structure indicates a hierarchical relationship among the plurality of table heads, converting the electronic table into a data mapping result according to the table head structure, the cell information of the plurality of table head cells and the cell information of the plurality of service data cells, the cell information of the service data cells comprises service data and cell positions of the service data, the data mapping result indicates the table head structure and a first mapping relationship, the first mapping relationship indicates a mapping relationship between the service data and the table heads, and importing the data mapping result into a target database. The importing efficiency of the electronic table is improved.

Inventors

  • WU YANG
  • MA JUNJIE

Assignees

  • 河南秦尉数字技术有限公司

Dates

Publication Date
20260512
Application Date
20251229

Claims (10)

  1. 1. A method for importing a spreadsheet, comprising: the method comprises the steps of obtaining a spreadsheet, wherein the spreadsheet comprises a plurality of cells, and the plurality of cells comprise a plurality of header cells and a plurality of business data cells; Determining a header structure according to cell information of a plurality of header cells, wherein the cell information of the header cells comprises a header and cell positions of the header; Converting the electronic form into a data mapping result according to the header structure, cell information of a plurality of header cells and cell information of a plurality of service data cells, wherein the cell information of the service data cells comprises service data and cell positions of the service data; And importing the data mapping result into a target database.
  2. 2. The method of claim 1, wherein converting the electronic form into a data mapping result based on the header structure, the plurality of header cell information, and the cell information of the plurality of business data cells comprises: Determining a second mapping relation according to cell information of a plurality of table head cells and cell information of a plurality of service data cells, wherein the second mapping relation indicates the mapping relation between the cell positions of the service data and the table heads; For any business data, determining a header corresponding to the business data according to the cell position of the business data and the mapping relation between the cell position of the business data indicated by the second mapping relation and the header; Constructing the first mapping relation according to the service data and the header corresponding to the service data; And adding the service data under the header in the header structure according to the mapping relation between the service data and the header indicated by the first mapping relation to obtain the data mapping result.
  3. 3. The method of claim 1 or 2, wherein the cell locations include column locations and row locations, wherein determining the header structure based on the cell information of the plurality of header cells comprises: Determining a level corresponding to a first header according to the row position of the first header cell, wherein the first header cell is any header cell in a plurality of header cells; Determining whether the first header is an initial header according to the level corresponding to the first header; under the condition that the first header is not the primary header, determining a father header of the first header according to the level corresponding to the header in each header cell and the column position of each header cell; And determining the header structure according to the father header of at least one header.
  4. 4. A method according to any one of claims 1-3, wherein prior to determining the header structure from the cell information of the plurality of header cells, the method further comprises: acquiring header line number information of the electronic form; And determining a plurality of header cells and a plurality of service data cells in the cells according to the header line number information and the cell positions of the cells.
  5. 5. The method of any of claims 1-4, wherein converting the spreadsheet into a data mapping result based on the header structure, cell locations of a plurality of header cells, and cell information of a plurality of business data cells, comprises: According to the header configuration rules in the configuration rules, adjusting the header structure to obtain an adjusted header structure; And converting the electronic form into the data mapping result according to the adjusted header structure, the cell positions of the plurality of header cells and the cell information of the plurality of service data cells.
  6. 6. The method of claim 5, wherein importing the data mapping result to a target database comprises: According to the verification rules in the configuration rules, verifying the data mapping result to obtain a verification result; Importing the data mapping result to the target database in case the check result indicates that the check is passed, or And under the condition that the verification result indicates that the verification is not passed, rollback processing is carried out on the target database, and alarm information is generated.
  7. 7. The method according to claim 5 or 6, wherein the adjusting the header structure according to the header configuration rule in the configuration rule to obtain an adjusted header structure includes: Determining whether the computing device stores the configuration rule; and under the condition that the computing equipment is determined to store the configuration rule, adjusting the header structure according to the header configuration rule in the configuration rule to obtain the adjusted header structure.
  8. 8. The method according to any one of claims 5-7, wherein before performing an adjustment process on the header structure according to a header configuration rule in the configuration rule to obtain an adjusted header structure, the method further comprises: acquiring the configuration rule sent by the terminal equipment; storing the configuration rule; The configuration rule comprises header levels of a plurality of headers and attribute information corresponding to each header, a configuration interface displayed by the terminal equipment comprises header adding controls of each level and attribute information setting controls, and the configuration rule is obtained by responding to the operation of a user on the header adding controls of each level and the attribute information setting controls of the terminal equipment.
  9. 9. The method of claim 8, wherein the method further comprises: Acquiring a display request of the terminal equipment; And responding to the display request, and sending the data mapping result and attribute information corresponding to each header to the terminal equipment so that the terminal equipment can display the data mapping result according to the attribute information corresponding to each header.
  10. 10. A computing device, comprising: A processor, and a memory communicatively coupled to the processor; The memory is used for storing computer execution instructions; The processor is configured to execute computer-executable instructions stored in the memory to implement the method of any one of claims 1-9.

Description

Electronic form importing method and computing device Technical Field The present application relates to the field of computing devices, and in particular, to a method for importing an electronic form and a computing device. Background In modern informative management, electronic forms (Excel files) are important data carriers for their flexibility and widespread use. For further processing of the electronic forms, the electronic forms may be imported into a database corresponding to the software system. In the related art, it is necessary to manually analyze structural information of the electronic form, and then convert the electronic form based on the structural information obtained by manual analysis, so as to import the converted electronic form into a database corresponding to the software system. However, the method in the related art needs to manually analyze the electronic forms of each structure to obtain the structure information corresponding to the electronic forms of each structure, which results in the problem of low importing efficiency in the method in the related art. Disclosure of Invention The embodiment of the application provides a method for importing a spreadsheet and a computing device, which improves the importing efficiency of the spreadsheet. In a first aspect, an embodiment of the present application provides a method for importing a spreadsheet, including: the method comprises the steps of acquiring a spreadsheet, wherein the spreadsheet comprises a plurality of cells, and the plurality of cells comprise a plurality of header cells and a plurality of business data cells; Determining a header structure according to cell information of a plurality of header cells, wherein the cell information of the header cells comprises headers and cell positions of the headers; Converting the electronic form into a data mapping result according to the cell information of a plurality of table head cells and the cell information of a plurality of service data cells, wherein the cell information of the service data cells comprises service data and cell positions of the service data; And importing the data mapping result into a target database. In the scheme, the computing device can acquire a spreadsheet, wherein the spreadsheet comprises a plurality of cells, and the plurality of cells comprise a plurality of header cells and a plurality of business data cells. The computing device may determine a header structure from cell information of the plurality of header cells, the cell information of the header cells including headers and cell locations of the headers, the header structure indicating a hierarchical relationship between the plurality of headers. The computing device may convert the electronic form into a data mapping result according to the header structure, cell information of the plurality of header cells, and cell information of the plurality of service data cells, where the cell information of the service data cells includes service data and cell positions of the service data, the data mapping result indicates the header structure and a first mapping relationship, and the first mapping relationship indicates a mapping relationship between the service data and the header. The computing device may import the data mapping results to the target database. According to the method, the computing equipment analyzes and obtains the header structure based on the cell information of the plurality of header cells, and then converts the electronic form into the data mapping result based on the header structure, the cell information of the plurality of header cells and the cell information of the plurality of service data cells, so that the manual acquisition of the structure information and the manual conversion of the electronic form based on the structure information are not needed, the importing threshold of the electronic form is reduced, and the importing efficiency of the electronic form is improved. In one implementation, converting a spreadsheet into a data mapping result based on header structure, cell information for a plurality of header cells, and cell information for a plurality of business data cells, includes: Determining a second mapping relation according to cell information of the plurality of table head cells and cell information of the plurality of service data cells, wherein the second mapping relation indicates the mapping relation between the cell positions of the service data and the table heads; for any business data, determining a header corresponding to the business data according to the cell position of the business data and the mapping relation between the cell position of the business data and the header indicated by the second mapping relation; Constructing a first mapping relation according to the service data and the table header corresponding to the service data; and adding the service data under the header in the header structure according to the mapping relatio