Spreadsheet importing method and computing device

By automatically analyzing the header structure and cell information using computing devices, generating data mapping results, and importing them into the database, the problem of low import efficiency caused by manual analysis in existing technologies is solved, achieving efficient and accurate spreadsheet import.

CN122019646APending Publication Date: 2026-05-12HENAN QINWEI DIGITAL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HENAN QINWEI DIGITAL TECHNOLOGY CO LTD
Filing Date
2025-12-29
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

In existing technologies, importing spreadsheets into databases requires manual analysis of structural information, resulting in low import efficiency.

Method used

The computer automatically analyzes the header structure and cell information of spreadsheets, generates data mapping results, and imports them into the database, reducing manual intervention.

Benefits of technology

It improves the efficiency of spreadsheet import, lowers the import threshold, and enhances the accuracy and efficiency of import.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122019646A_ABST
    Figure CN122019646A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a spreadsheet importing method and computing equipment. The method comprises the following steps: acquiring a spreadsheet; the spreadsheet comprises a plurality of cells; the plurality of cells comprise a plurality of header cells and a plurality of service data cells; determining a header structure according to the cell information of the plurality of header cells; the cell information of the header cell comprises a header and a cell position of the header; the header structure indicates a hierarchical relationship among the plurality of headers; converting the spreadsheet into a data mapping result according to the header structure, the cell information of the plurality of header 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 a header structure and a first mapping relation; the first mapping relationship indicates a mapping relationship between the service data and the header; and importing the data mapping result into the target database. And the importing efficiency of the spreadsheet is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computing device technology, and in particular to a method for importing spreadsheets and a computing device. Background Technology

[0002] In modern information management, spreadsheets (Excel files) have become an important data carrier due to their flexibility and widespread use. To further process spreadsheets, they can be imported into the corresponding database of the software system.

[0003] In related technologies, it is necessary to manually analyze the structural information of the spreadsheet, and then convert the spreadsheet based on the manually analyzed structural information in order to import the converted spreadsheet into the corresponding database of the software system.

[0004] However, the methods in related technologies require manual analysis of spreadsheets for each structure to obtain the corresponding structural information, which leads to low import efficiency. Summary of the Invention

[0005] This application provides a method and computing device for importing spreadsheets, which improves the efficiency of importing spreadsheets.

[0006] In a first aspect, embodiments of this application provide a method for importing a spreadsheet, including:

[0007] Get the spreadsheet; the spreadsheet contains multiple cells; the multiple cells include multiple header cells and multiple business data cells;

[0008] The header structure is determined based on the cell information of multiple header cells; the cell information of the header cells includes the header itself and the position of the header cell; the header structure indicates the hierarchical relationship between multiple headers;

[0009] Based on the header structure, cell information of multiple header cells, and cell information of multiple business data cells, the spreadsheet is converted into a data mapping result; the cell information of the business data cells includes the business data and the cell position of the business data; the data mapping result indicates the header structure and the first mapping relationship; the first mapping relationship indicates the mapping relationship between the business data and the header;

[0010] Import the data mapping results into the target database.

[0011] In this solution, the computing device can acquire a spreadsheet containing multiple cells, including header cells and business data cells. The computing device can determine the header structure based on the information in the header cells; the header cell information includes the header itself and its cell location; the header structure indicates the hierarchical relationship between the header cells. Based on the header structure, the information in the header cells, and the information in the business data cells, the computing device can convert the spreadsheet into a data mapping result; the business data cell information includes the business data itself and its cell location; the data mapping result indicates the header structure and a first mapping relationship; the first mapping relationship indicates the mapping relationship between the business data and the header cells. The computing device can then import the data mapping result into a target database. By using the aforementioned computing device to analyze the header structure based on the cell information of multiple header cells, and then using the header structure, the cell information of multiple header cells, and the cell information of multiple business data cells, the spreadsheet is converted into a data mapping result. This eliminates the need for manual acquisition of structural information and manual conversion of the spreadsheet based on personal expertise, thus lowering the threshold for importing spreadsheets and improving the efficiency of importing spreadsheets.

[0012] In one implementation, based on the header structure, cell information of multiple header cells, and cell information of multiple business data cells, the spreadsheet is converted into a data mapping result, including:

[0013] Based on the cell information of multiple header cells and multiple business data cells, a second mapping relationship is determined; the second mapping relationship indicates the mapping relationship between the cell positions of business data and the header cells.

[0014] For any given business data, determine the corresponding table header based on the cell position of the business data and the mapping relationship between the cell position of the business data and the table header as indicated by the second mapping relationship;

[0015] Based on the business data and the corresponding table headers, construct the first mapping relationship;

[0016] Based on the mapping relationship between the business data and the table header indicated by the first mapping relationship, the business data is added to the table header in the table header structure to obtain the data mapping result.

[0017] In this scheme, the computing device can determine a second mapping relationship based on the cell information of multiple header cells and multiple business data cells. This second mapping relationship indicates the mapping relationship between the cell positions of the business data and the headers. For any given business data, the computing device can determine the corresponding header based on the cell position of the business data and the mapping relationship between the cell positions and headers indicated by the second mapping relationship. The computing device can then construct a first mapping relationship based on the business data and its corresponding header. Finally, the computing device can add the business data to the header structure based on the mapping relationship between the business data and its corresponding header, thus obtaining the data mapping result. This method eliminates the need for manual acquisition of data mapping rules (header structure and second mapping relationship) based on individual expertise, lowering the barrier to entry for obtaining the header structure and second mapping relationship, thereby reducing the import barrier for spreadsheets and improving import efficiency.

[0018] In one implementation, the cell position includes both column and row positions; based on the cell information of multiple header cells and multiple business data cells, a second mapping relationship is determined, including:

[0019] For any given business data cell, determine the target header cell from among the multiple header cells based on the column position of the business data cell and the column positions of the multiple header cells; wherein the column position of the target header cell matches the column position of the business data cell.

[0020] A second mapping relationship is constructed based on the cell position of the business data cell and the header in the target header cell.

[0021] In this scheme, for any given business data cell, the computing device can determine the target header cell from multiple header cells based on the column position of the business data cell and the column positions of multiple header cells; wherein the column position of the target header cell matches the column position of the business data cell. The computing device can then construct a second mapping relationship based on the cell position of the business data cell and the header in the target header cell. This method improves the efficiency and accuracy of determining the second mapping relationship.

[0022] In one implementation, cell position includes column position and row position; the header structure is determined based on the cell information of multiple header cells, including:

[0023] For the first header cell, determine the level corresponding to the first header based on the row position of the first header cell; the first header cell can be any header cell among multiple header cells; the first header is the header in the first header cell;

[0024] Determine whether the first header is the initial header based on the level corresponding to the first header;

[0025] If it is determined that the first header is not the initial header, the parent header of the first header is determined according to the level of the header in each header cell and the column position of each header cell.

[0026] Determine the header structure based on the parent header of at least one header.

[0027] In this scheme, for the first header cell, the computing device can determine the level corresponding to the first header based on its row position. The first header cell can be any header cell among multiple header cells; the first header is the header within the first header cell. The computing device can determine whether the first header is the initial header based on its level. If the first header is not the initial header, the computing device can determine the parent header of the first header based on the level of the headers in each header cell and the column position of each header cell. The computing device can determine the header structure based on the parent header of at least one header. Through this method, the parent header of the first header can be determined, thus allowing the determination of the hierarchical relationship between multiple headers based on the parent header of at least one header (not the initial header), improving the accuracy and efficiency of header structure acquisition.

[0028] In one implementation, before determining the header structure based on the cell information of multiple header cells, the method further includes:

[0029] Get the header row number information of a spreadsheet;

[0030] Based on the number of header rows and the cell positions of multiple cells, determine multiple header cells and multiple business data cells within the multiple cells.

[0031] In this solution, the computing device can directly determine multiple header cells and multiple business data cells within a set of cells based on the header row count information (indicating the total number of header rows, i.e., how many rows of cells are header cells) and the cell positions of multiple cells. This improves the accuracy of determining header cells and business data cells.

[0032] In one implementation, based on the header structure, the cell positions of multiple header cells, and the cell information of multiple business data cells, the spreadsheet is converted into a data mapping result, including:

[0033] Based on the header configuration rules in the configuration rules, the header structure is adjusted to obtain the adjusted header structure;

[0034] Based on the adjusted header structure, the cell positions of multiple header cells, and the cell information of multiple business data cells, the spreadsheet is converted into a data mapping result.

[0035] In this scheme, the computing device can adjust the header structure according to the header configuration rules in the configuration rules to obtain the adjusted header structure. Based on the adjusted header structure, the cell positions of multiple header cells, and the cell information of multiple business data cells, the computing device can convert the spreadsheet into a data mapping result. Through this method, the computing device can adjust the header structure based on the user-configured header rules, thereby improving the accuracy of data mapping result acquisition.

[0036] In one implementation, importing the data mapping result into the target database includes:

[0037] The data mapping result is validated according to the validation rules in the configuration rules to obtain the validation result;

[0038] If the verification result indicates that the verification passed, the data mapping result is imported into the target database; or,

[0039] If the verification result indicates that the verification failed, the target database is rolled back and an alarm message is generated.

[0040] In this scheme, the computing device can verify the data mapping results according to the verification rules in the configuration rules, and obtain the verification results. If the verification result indicates that the verification passed, the computing device can import the data mapping results into the target database; alternatively, if the verification result indicates that the verification failed, the computing device can roll back the target database and generate alarm information. By using this real-time dynamic verification method for data mapping results, anomalies in the data mapping results can be detected promptly, reducing the failure rate of the computing device and improving the integrity, accuracy, and matching of the data mapping results with the configuration rules stored in the target database.

[0041] In one implementation, the header structure is adjusted according to the header configuration rules in the configuration rules to obtain the adjusted header structure, including:

[0042] Determine whether the computing device stores configuration rules;

[0043] Once the storage configuration rules for the computing device are determined, the header structure is adjusted according to the header configuration rules in the configuration rules to obtain the adjusted header structure.

[0044] In this scheme, the computing device can determine whether it stores configuration rules. If it does, the computing device can adjust the header structure according to the header configuration rules within those rules, resulting in an adjusted header structure. This method allows the computing device to adjust the header structure based on the header configuration rules even when the user has pre-configured settings. This improves the accuracy of the header structure, thereby enhancing the matching accuracy between the data mapping results obtained based on the header structure and the spreadsheet.

[0045] In one implementation, before adjusting the header structure according to the header configuration rules in the configuration rules to obtain the adjusted header structure, the method further includes:

[0046] Obtain the configuration rules sent by the terminal device;

[0047] The configuration rules are stored.

[0048] The configuration rules include multiple header levels and corresponding attribute information for each header; the configuration interface displayed on the terminal device includes controls for adding headers at each level and controls for setting attribute information; the configuration rules are obtained by the terminal device in response to the user's operations on adding controls and setting attribute information for headers at each level.

[0049] In this scheme, the computing device can obtain and store the configuration rules sent by the terminal device. The configuration rules include multiple header levels and corresponding attribute information for each header. The configuration interface displayed on the terminal device includes controls for adding headers at each level and controls for setting attribute information. The configuration rules are obtained by the terminal device in response to user operations on adding controls and setting attribute information at each level of header. By providing a configuration interface, users can construct configuration rules, improving validation flexibility and user controllability.

[0050] In one implementation, the method also includes:

[0051] Obtain the display request from the terminal device;

[0052] In response to a display request, the system sends the data mapping results and the attribute information corresponding to each table header to the terminal device, so that the terminal device can process the data mapping results for display based on the attribute information corresponding to each table header.

[0053] In this scheme, the computing device can respond to a display request sent by a user through a terminal device by sending the data mapping results and the attribute information corresponding to each table header to the terminal device. The terminal device can then process the data mapping results for display based on the attribute information corresponding to each table header. Through this method, accurate display of the data mapping results can be achieved.

[0054] Secondly, embodiments of this application provide a spreadsheet import device, comprising:

[0055] The acquisition module is used to acquire a spreadsheet; the spreadsheet includes multiple cells; the multiple cells include multiple header cells and multiple business data cells.

[0056] The data parsing module is used to determine the header structure based on the cell information of multiple header cells; the cell information of the header cells includes the header itself and the position of the header cell; the header structure indicates the hierarchical relationship between multiple headers;

[0057] The data parsing module is also used to convert the spreadsheet into a data mapping result based on the header structure, cell information of multiple header cells, and cell information of multiple business data cells; the cell information of the business data cells includes the business data and the cell position of the business data; the data mapping result indicates the header structure and the first mapping relationship; the first mapping relationship indicates the mapping relationship between the business data and the header;

[0058] The verification and feedback module is used to import the data mapping results into the target database.

[0059] The spreadsheet import device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.

[0060] In one implementation, the data parsing module is specifically used for:

[0061] Based on the cell information of multiple header cells and multiple business data cells, a second mapping relationship is determined; the second mapping relationship indicates the mapping relationship between the cell positions of business data and the header cells.

[0062] For any given business data, determine the corresponding table header based on the cell position of the business data and the mapping relationship between the cell position of the business data and the table header as indicated by the second mapping relationship;

[0063] Based on the business data and the corresponding table headers, construct the first mapping relationship;

[0064] Based on the mapping relationship between the business data and the table header indicated by the first mapping relationship, the business data is added to the table header in the table header structure to obtain the data mapping result.

[0065] The spreadsheet import device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.

[0066] In one implementation, cell position includes column position and row position; the data parsing module is specifically used for:

[0067] For any given business data cell, determine the target header cell from among the multiple header cells based on the column position of the business data cell and the column positions of the multiple header cells; wherein the column position of the target header cell matches the column position of the business data cell.

[0068] A second mapping relationship is constructed based on the cell position of the business data cell and the header in the target header cell.

[0069] The spreadsheet import device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.

[0070] In one implementation, cell position includes column position and row position; the data parsing module is specifically used for:

[0071] For the first header cell, determine the level corresponding to the first header based on the row position of the first header cell; the first header cell can be any header cell among multiple header cells; the first header is the header in the first header cell;

[0072] Determine whether the first header is the initial header based on the level corresponding to the first header;

[0073] If it is determined that the first header is not the initial header, the parent header of the first header is determined according to the level of the header in each header cell and the column position of each header cell.

[0074] Determine the header structure based on the parent header of at least one header.

[0075] The spreadsheet import device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.

[0076] In one implementation, before determining the header structure based on the cell information of multiple header cells, the data parsing module is also used for:

[0077] Get the header row number information of a spreadsheet;

[0078] Based on the number of header rows and the cell positions of multiple cells, determine multiple header cells and multiple business data cells within the multiple cells.

[0079] The spreadsheet import device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.

[0080] In one implementation, the data parsing module is specifically used for:

[0081] Based on the header configuration rules in the configuration rules, the header structure is adjusted to obtain the adjusted header structure;

[0082] Based on the adjusted header structure, the cell positions of multiple header cells, and the cell information of multiple business data cells, the spreadsheet is converted into a data mapping result.

[0083] The spreadsheet import device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.

[0084] In one implementation, the verification and feedback module is specifically used for:

[0085] The data mapping result is validated according to the validation rules in the configuration rules to obtain the validation result;

[0086] If the verification result indicates that the verification passed, the data mapping result is imported into the target database; or,

[0087] If the verification result indicates that the verification failed, the target database is rolled back and an alarm message is generated.

[0088] The spreadsheet import device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.

[0089] In one implementation, the data parsing module is specifically used for:

[0090] Determine whether the computing device stores configuration rules;

[0091] Once the storage configuration rules for the computing device are determined, the header structure is adjusted according to the header configuration rules in the configuration rules to obtain the adjusted header structure.

[0092] The spreadsheet import device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.

[0093] In one implementation, the rule configuration module is used for:

[0094] Obtain the configuration rules sent by the terminal device;

[0095] The configuration rules are stored.

[0096] The configuration rules include multiple header levels and corresponding attribute information for each header; the configuration interface displayed on the terminal device includes controls for adding headers at each level and controls for setting attribute information; the configuration rules are obtained by the terminal device in response to the user's operations on adding controls and setting attribute information for headers at each level.

[0097] The spreadsheet import device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.

[0098] In one implementation, the rule configuration module is also used for:

[0099] Obtain the display request from the terminal device;

[0100] In response to a display request, the system sends the data mapping results and the attribute information corresponding to each table header to the terminal device, so that the terminal device can process the data mapping results for display based on the attribute information corresponding to each table header.

[0101] The spreadsheet import device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.

[0102] Thirdly, embodiments of this application provide a computing device, including:

[0103] The processor, and the memory that is in communication with the processor;

[0104] Memory is used to store instructions that the computer executes;

[0105] The processor is used to execute computer execution instructions stored in memory to implement the method of the first aspect.

[0106] The computing device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be repeated here.

[0107] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method of the first aspect.

[0108] When the computer-executable instructions in the computer-readable storage medium provided in this application are executed by a processor, the technical solutions shown in the above method embodiments can be implemented. The implementation principle and beneficial effects are similar, and will not be repeated here.

[0109] Fifthly, embodiments of this application provide a computer program product, including a computer program, which, when executed by a processor, is used to implement the method of the first aspect.

[0110] When the computer program in the computer program product provided in this application embodiment is executed by the processor, it can implement the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be repeated here. Attached Figure Description

[0111] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0112] Figure 1a A schematic diagram illustrating a method for importing a spreadsheet according to an embodiment of this application;

[0113] Figure 1b A schematic diagram illustrating a terminal device acquiring user-input spreadsheets, provided as an embodiment of this application;

[0114] Figure 1c A schematic diagram illustrating a triggered display provided in an embodiment of this application;

[0115] Figure 1d A schematic diagram illustrating a query triggering method provided in an embodiment of this application;

[0116] Figure 2a A flowchart illustrating an embodiment of a spreadsheet import method provided in this application;

[0117] Figure 2b A panoramic view of a project dashboard design provided in this application embodiment;

[0118] Figure 2c A schematic diagram illustrating a data mapping result provided in an embodiment of this application;

[0119] Figure 2d A schematic diagram of the database table structure of a target database provided in an embodiment of this application;

[0120] Figure 3 A flowchart illustrating a second embodiment of a spreadsheet import method provided in this application;

[0121] Figure 4a A flowchart illustrating a third embodiment of a spreadsheet import method provided in this application;

[0122] Figure 4b A schematic diagram of a configuration interface provided in an embodiment of this application;

[0123] Figure 4c A schematic diagram of a verification process provided in an embodiment of this application;

[0124] Figure 5 A schematic diagram of the structure of a spreadsheet import device provided in an embodiment of this application;

[0125] Figure 6 This is a schematic diagram of the structure of a computing device provided in an embodiment of this application. Detailed Implementation

[0126] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments made by those skilled in the art under the guidance of these embodiments are within the scope of protection of this application.

[0127] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0128] This application provides a method for importing a spreadsheet. A computing device can acquire a spreadsheet, which includes multiple cells, including multiple header cells and multiple business data cells. The computing device can determine the header structure based on the cell information of the header cells. The header cell information includes the header itself and its cell position. The header structure indicates the hierarchical relationship between the header cells. Based on the header structure and the cell information of the business data cells, the computing device can convert the spreadsheet into a data mapping result. The business data cell information includes the business data itself and its cell position. The computing device can then import the data mapping result into a target database.

[0129] The above methods improve the efficiency of importing spreadsheets.

[0130] The following is a detailed description of the spreadsheet import method according to an embodiment of this application.

[0131] Below, to facilitate understanding of the spreadsheet import method provided in the embodiments of this application, in conjunction with... Figure 1a , Figure 1b , Figure 1c as well as Figure 1d The application scenarios involved in the embodiments of this application will be introduced.

[0132] Figure 1a This is a schematic diagram illustrating a scenario for importing a spreadsheet according to an embodiment of this application. Figure 1a As shown, the scenario includes a computing device 10, a database device 20, and a terminal device 30.

[0133] The computing device 10 can be a server or a server cluster. When the computing device 10 is a server, from an architectural perspective, the server can be a rack server, a high-density server, a tower server, or a full rack server; from a functional perspective, the server can be a general-purpose server or an artificial intelligence (AI) server, for example, an artificial intelligence server can be an image processing server (GPU (graphics processing unit) server).

[0134] Database device 20 can be a server or a server cluster.

[0135] Terminal device 30 may be, but is not limited to, various personal computers, laptops, smartphones, and tablets.

[0136] In this scenario:

[0137] The computing device 10 can acquire a spreadsheet. The spreadsheet includes multiple cells; these cells include multiple header cells and multiple business data cells. In one implementation, the spreadsheet can be sent by the terminal device 30. In another implementation, the spreadsheet can be input by a user. For example, Figure 1b This is a schematic diagram illustrating how a terminal device acquires user-input spreadsheets, as provided in an embodiment of this application.

[0138] The computing device 10 can determine the header structure based on the cell information of multiple header cells. The cell information of the header cells includes the header itself and the position of the header cell. The header structure indicates the hierarchical relationship between multiple headers.

[0139] The computing device 10 can convert a spreadsheet into a data mapping result based on the header structure, cell information of multiple header cells, and cell information of multiple business data cells. The cell information of the business data cells includes the business data and its cell position.

[0140] The computing device 10 can import the data mapping results into a target database. In one implementation, the computing device 10 can import the data mapping results into a target database in the database device 20.

[0141] It should be noted that the computing device 10 can also obtain display requests sent by the terminal device 20. Figure 1c This is a schematic diagram illustrating a triggered display provided in an embodiment of this application. For example... Figure 1c As shown, the display interface of terminal device 20 may include display controls. Terminal device 20 can generate a display request in response to user actions on the display controls.

[0142] In response to a display request, computing device 10 can send the data mapping results and the attribute information corresponding to each table header to terminal device 20. It should be noted that the attribute information corresponding to each table header belongs to the configuration rules.

[0143] Terminal device 20 can display the data mapping results based on the attribute information corresponding to each table header. In one implementation, the attribute information corresponding to the table header may include filter type, column width, fixed information, and display order. Terminal device 20 can then display the data mapping results based on the filter type, column width, fixed information, and display order corresponding to each table header.

[0144] In addition, the computing device 10 can also obtain query requests sent by the terminal device 10. Figure 1d This is a schematic diagram illustrating a query triggering method provided in an embodiment of this application. For example... Figure 1dAs shown, the query interface of terminal device 10 may include query controls. Terminal device 10 may generate a query request in response to user actions on the query controls (such as input). In one implementation, the query request may include a target table header. In another implementation, the query request may include target business data.

[0145] The computing device 20 can query the data mapping results according to the query request and obtain the query results. In one implementation, the query results include the business data corresponding to the target table header. In another implementation, the query results include related business data. It should be noted that related business data refers to business data that is in the same row position as the business data cell containing the target business data.

[0146] The computing device 10 can send query results to the terminal device 20.

[0147] Terminal device 20 can display and process the query results.

[0148] It should be noted that, Figure 1a This is a schematic diagram of a scenario provided in an embodiment of this application. This embodiment of the application does not necessarily represent... Figure 1a The document does not limit the actual form of the various devices included, nor does it specify the form of the devices. Figure 1a The interaction methods between devices are limited, and can be set according to actual needs when applying the solution.

[0149] The technical solution of this application will now be described in detail through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0150] Figure 2a This is a flowchart illustrating an embodiment of a spreadsheet import method provided in this application. See also... Figure 2a The method specifically includes the following steps:

[0151] S201: Obtain a spreadsheet.

[0152] In this embodiment, the computing device can access a spreadsheet. For example, the spreadsheet can be an Excel file.

[0153] A spreadsheet can include multiple cells. It should be noted that these multiple cells can include multiple header cells and multiple data cells.

[0154] For example, Table 1 is a spreadsheet. As shown in Table 1, the spreadsheet may include multiple cells, which may include five header cells and eight business data cells.

[0155] spreadsheet

[0156]

[0157] In one implementation:

[0158] The terminal device can obtain the user's import request (also known as an entry request). The import request may include a spreadsheet (such as an Excel file). In one implementation, the import request may also include a user identifier. For example, the terminal device can obtain a user's request to enter the latest planning data into a wide table for sorting items.

[0159] Terminal devices can call the Application Programming Interface (API) to send import requests to computing devices.

[0160] Accordingly, the computing device can receive import requests sent by the terminal device. In one implementation, the computing device can run a listener (such as AnalysisEventListener) to retrieve the spreadsheet in the import request.

[0161] The following is an example illustrating a scenario where a terminal device obtains a user's import request.

[0162] Figure 2b This is a panoramic view of a project dashboard design provided for an embodiment of this application.

[0163] like Figure 2b As shown, the project dashboard includes a project overview module, a project details module, a barometer module, an investment retrospective module, and system function modules.

[0164] Project dashboards require data viewing and statistical analysis across multiple dimensions, including milestone progress, human resource management information, and cost information.

[0165] Milestone progress includes the most recently passed milestone, actual completion time, deviation rate, milestones to be completed, baseline time, and number of days overdue.

[0166] Human resource management information includes annual human resource budget, annual human resource accounting, execution deviation, and cumulative execution rate.

[0167] Cost monitoring information includes cost budget information, annual cost accounting information, execution deviations, and cumulative execution rate.

[0168] Users can organize all the information from the project dashboard into a single spreadsheet. This spreadsheet has multi-level headers.

[0169] The terminal device can obtain the user's import request. The import request includes the spreadsheet.

[0170] The following describes the process by which a computing device, upon acquiring a spreadsheet, determines multiple header cells and multiple business data cells within a larger set of cells.

[0171] In one implementation:

[0172] Computing devices can obtain information about the number of header rows in a spreadsheet.

[0173] The computing device can determine multiple header cells and multiple business data cells within multiple cells based on the header row number information and the cell positions of multiple cells.

[0174] The following describes the process by which the computing device determines multiple header cells and multiple business data cells from multiple cells based on the header row number information and the cell positions of multiple cells.

[0175] In one implementation:

[0176] It's important to note that cell position can include both row position (also known as row index) and column position (also known as column index). Furthermore, in one implementation, when a cell is a merged cell (a cell formed by merging multiple cells), its row position includes the row positions of all the merged cells. For example, cell 1 has row position 1 and column position 1, cell 2 has row position 1 and column position 2. The merged cell (cells 1 and 2) has row position 1 and column positions 1 and 2.

[0177] For any cell among multiple cells, the computing device determines whether the row position of that cell matches the header row number information. In one implementation, the computing device determines whether the row position of that cell is less than or equal to the header row number information (including the header row number). The computing device can determine that the row position of the cell matches the header row number if it determines that the row position of the cell is less than or equal to the header row number information. Alternatively, the computing device can determine that the row position of the cell does not match the header row number if it determines that the row position of the cell is greater than the header row number information.

[0178] The computing device can determine that a cell is a header cell if it finds that the row position of the cell matches the header row number information.

[0179] In addition, the computing device can determine that a cell is a business data cell if it finds that the row position of the cell does not match the number of rows in the table header.

[0180] S202: Determine the header structure based on the cell information of multiple header cells.

[0181] In this embodiment, the cell information of the header cell includes the header and the position of the header cell.

[0182] The computing device can determine the header structure based on the cell information of multiple header cells. The header structure indicates the hierarchical relationship between the multiple headers.

[0183] The following section explains the process by which the computing device determines the header structure based on the cell information of multiple header cells.

[0184] In one implementation:

[0185] The cell information for the header cell includes the header itself and the position of the header cell.

[0186] Cell position includes column position and row position.

[0187] The first header cell can be any one of multiple header cells.

[0188] The first header is the header cell in the first header cell.

[0189] For the first header cell, the computing device can determine the level corresponding to the first header based on the row position of the first header cell. For example, if the row position of the first header cell is 1, the computing device can determine that the level corresponding to the first header is level one. As another example, if the row position of the first header cell is 2, the computing device can determine that the level corresponding to the first header is level two.

[0190] The computing device can determine whether a first table header is an initial table header based on the level corresponding to that first table header. In one implementation, the computing device can determine whether the level corresponding to the first table header is level one. If the computing device determines that the level corresponding to the first table header is level one, it can determine that the first table header is an initial table header. Alternatively, if the computing device determines that the level corresponding to the first table header is not level one, it can determine that the first table header is not an initial table header.

[0191] The computing device can determine the parent header of the first header, based on the level of each header cell and the column position of each header cell, if it is determined that the first header is not the initial header. It should be noted that in one implementation, the parent header's level is the level above the first header, and the column position of the parent header's cell is the same as the column position of the first header's cell (the first header cell). For example, if the first header's level is 3, its parent header's level is 2.

[0192] The computing device can determine the header structure based on at least one parent header of the table. For example, Figure 2c This is a schematic diagram illustrating a data mapping result provided in an embodiment of this application. For example... Figure 2c As shown, "Example Level 1 Header" is the parent header of "Example Level 2 Header 1", meaning that the parent header's identifier (parentfieldId) is "1". "Example Level 1 Header" is the parent header of "Example Level 2 Header 2", meaning that the parent header's identifier (parentfieldId) is "1".

[0193] S203: Based on the header structure, cell information of multiple header cells, and cell information of multiple business data cells, convert the spreadsheet into a data mapping result.

[0194] In this embodiment, the computing device can convert a spreadsheet into a data mapping result based on the header structure, cell information of multiple header cells, and cell information of multiple business data cells. The data mapping result indicates the header structure and a first mapping relationship. The first mapping relationship indicates the mapping relationship between business data and the header.

[0195] The cell information for the business data cell includes the business data and the cell location of the business data.

[0196] The header cell information includes the header itself and its cell location.

[0197] The following section explains the process by which a computing device converts a spreadsheet into a data mapping result based on the header structure, the cell information of multiple header cells, and the cell information of multiple business data cells.

[0198] In one implementation:

[0199] The computing device can determine a second mapping relationship based on the cell information of multiple header cells and multiple business data cells. This second mapping relationship indicates the mapping relationship between the cell positions of the business data and the header cells.

[0200] Intuitively, the second mapping relationship can be understood as a mapping between the location and function of business data. Here, location refers to the cell position, and function refers to the table header corresponding to the business data. It should be noted that the table header in the second mapping relationship can be represented by its ID. For example, the ID of "Example Second-Level Table Header 1" could be 4.

[0201] It should be noted that in one implementation, the second mapping relationship indicates the mapping relationship between the cell position of business data and the last-level header. It should also be noted that the last-level header refers to a header among multiple headers that does not have a lower-level header.

[0202] In one implementation, the second mapping indicates the mapping between the cell position of business data and at least one table header (including a bottom-level header). For example, for business data "text1", the first mapping indicates the mapping between the cell position (3,1) of this business data and "example first-level header" and "example second-level header 1". Here, (3,1) represents row position 3 and column position 1, that is, the business data cell is located in the third row and the first column.

[0203] For any given set of business data, the computing device can determine the corresponding table header based on the cell position of the business data and the mapping relationship between the cell position of the business data and the table header indicated by the second mapping relationship. It can be understood that the business data refers to the business data included in the cell information to which the cell position of the business data belongs.

[0204] The computing device can construct a first mapping relationship based on the business data and the corresponding table headers.

[0205] The computing device can add business data to the header in the header structure according to the mapping relationship between the business data indicated by the first mapping relationship and the corresponding header of the business data, and obtain the data mapping result.

[0206] For example, Figure 2c This is a schematic diagram of a data mapping result provided in an embodiment of this application.

[0207] In another implementation, the computing device can store the data mapping result after obtaining it. In this implementation, the computing device can call a data storage method (saveData method). This data storage method is used to store the data mapping result, thereby achieving data mapping persistence.

[0208] In one implementation, the computing device can send the data mapping result to the terminal device after obtaining it. The terminal device can display the data mapping result and obtain adjustment requests from the user. Based on the adjustment requests, the terminal device can adjust the data mapping result and send the adjusted data mapping result to the computing device. The computing device can store the adjusted data mapping result.

[0209] S204: Import the data mapping results into the target database.

[0210] In this embodiment, the computing device can import the data mapping results into the target database.

[0211] Additionally, it should be noted that the computing device can invoke the doAfterAllAnalysed method after importing the data mapping results into the target database. This post-analysis method is used to perform post-processing tasks. For example, post-processing tasks may include releasing resources (such as memory resources) and closing data streams.

[0212] It should be noted that the target database is the database corresponding to the software system. The target database can be a database in a database device.

[0213] In one implementation, where the computing device stores the data mapping results, the computing device can import the stored data mapping results into the target database. For example, Figure 2d This is a schematic diagram of the table structure of a target database provided in an embodiment of this application. It can be understood that the data mapping results imported from the computing device into the target database can be stored using the table structure of the target database.

[0214] In one implementation, if the computing device stores the adjusted data mapping result, the computing device can import the adjusted data mapping result into the target database.

[0215] The following section explains the process by which the computing device imports the data mapping results into the target database.

[0216] In one implementation:

[0217] The computing device can perform verification processing on the data mapping results according to the verification rules in the configuration rules, and obtain the verification results.

[0218] The computing device can import the data mapping result into the target database if the verification result indicates that the verification passed. Alternatively,

[0219] The computing device can roll back the target database and generate an alarm message if the verification result indicates that the verification failed. In one implementation, the computing device can send the alarm message to the terminal device for display and processing.

[0220] The beneficial effects of this embodiment are as follows: In this embodiment, the computing device can acquire a spreadsheet; wherein the spreadsheet includes multiple cells; the multiple cells include multiple header cells and multiple business data cells. The computing device can determine the header structure based on the cell information of the multiple header cells; the cell information of the header cells includes the header and the position of the header cell; the header structure indicates the hierarchical relationship between the multiple headers. The computing device can convert the spreadsheet into a data mapping result based on the header structure, the cell information of the multiple header cells, and the cell information of the multiple business data cells; the cell information of the business data cells includes the business data and the position of the business data cell. The computing device can import the data mapping result into a target database. By analyzing the header structure based on the cell information of the multiple header cells, and then converting the spreadsheet into a data mapping result based on the header structure, the cell information of the multiple header cells, and the cell information of the multiple business data cells, the computing device eliminates the need for manual analysis of the spreadsheet's structure information based on personal expertise, and the conversion of the spreadsheet based on the structure information. This lowers the threshold for constructing the header structure, thereby lowering the threshold for importing the spreadsheet and improving the import efficiency of the spreadsheet. In addition, by directly analyzing the spreadsheet as described above, even if the structure of the spreadsheet changes dynamically, the computing device can still obtain the data mapping results converted from the spreadsheet, which improves the efficiency of obtaining the data mapping results and thus improves the import efficiency.

[0221] Figure 3 This is a flowchart illustrating a second embodiment of a spreadsheet import method provided in this application. See also... Figure 3 The method specifically includes the following steps:

[0222] S301: Obtain a spreadsheet.

[0223] In this embodiment, the computing device can access spreadsheets.

[0224] A spreadsheet can include multiple cells. These cells include multiple header cells and multiple business data cells.

[0225] The specific implementation process is the same as that of S201, and will not be described in detail here.

[0226] S302: Determine the header structure based on the cell information of multiple header cells.

[0227] In this embodiment, the computing device can determine the header structure based on the cell information of multiple header cells.

[0228] The header structure indicates the hierarchical relationship between multiple headers.

[0229] The specific implementation process is the same as that of S202, and will not be described in detail here.

[0230] S303: Determine the second mapping relationship based on the cell information of multiple header cells and multiple business data cells.

[0231] In this embodiment, the computing device can determine the second mapping relationship based on the cell information of multiple header cells and the cell information of multiple business data cells.

[0232] The second mapping relationship indicates the mapping between the cell position of business data and the table header. Understandably, in one implementation, the second mapping relationship can exist in the form of key-value pairs.

[0233] The following section explains the process by which the computing device determines the second mapping relationship based on the cell information of multiple header cells and multiple business data cells.

[0234] In one implementation:

[0235] The header cell information includes the header itself and its position within the header cell. The cell position includes both column and row positions.

[0236] The cell information for business data includes the business data itself, as well as the cell's position. The cell position includes both column and row positions.

[0237] For any given business data cell, the computing device can determine the target header cell from multiple header cells based on the column position of the business data cell and the column positions of multiple header cells. The column position of the target header cell matches the column position of the business data cell. It should be noted that in one implementation, if the column position of the target header cell includes multiple values, one of those values ​​matches the column position of the business data cell. In another implementation, the computing device can determine the target header cell as the header cell whose column position matches the column position of the business data cell and whose header is the last header. It should also be noted that for any given header cell, the computing device can determine the level of the header within that header cell based on its row position, and then determine whether the header is a last-level header based on that level.

[0238] The computing device can construct a second mapping relationship based on the cell position of the business data cell and the header in the target header cell. This second mapping relationship indicates the mapping relationship between the cell position of the business data and the header. In one implementation, the header in the target header cell can be a last-level header. That is, the second mapping relationship can indicate the mapping relationship between the cell position of the business data and the last-level header. It should be noted that a last-level header refers to a header that does not have a lower-level header among multiple headers. Additionally, it should be noted that a primary header refers to a header that does not have a parent header among multiple headers. Furthermore, a header can be both a primary header and a last-level header. For example, "Example Header 2" is both a primary header and a last-level header.

[0239] S304: For any business data, determine the corresponding table header based on the cell position of the business data and the mapping relationship between the cell position of the business data and the table header indicated by the second mapping relationship.

[0240] In this embodiment, for any business data, the computing device can determine the corresponding table header based on the cell position of the business data and the mapping relationship between the cell position of the business data and the table header indicated by the second mapping relationship.

[0241] Understandably, for any business data cell, the computing device can determine the corresponding table header based on the cell position in the cell information of that business data cell and the mapping relationship between the cell position of the business data and the table header indicated by the second mapping relationship.

[0242] S305: Based on the business data and the corresponding table headers, construct the first mapping relationship.

[0243] In this embodiment, the computing device can construct a first mapping relationship based on the business data and the corresponding table headers.

[0244] The first mapping relationship indicates the mapping relationship between business data and table headers. In one implementation, the first mapping relationship can indicate the mapping relationship between business data and the identifier of the table header. For example, the identifier of "Example Level 1 Table Header" is 1, the identifier of "Example Level 2 Table Header 1" is 4, the identifier of "Example Level 2 Table Header 2" is 5, the identifier of "Example Table Header 2" is 2, and the identifier of "Example Table Header 3" is 3.

[0245] It should be noted that, in one implementation, the first mapping relationship may include at least one sub-mapping relationship corresponding to a row position (multiple data rows). The sub-mapping relationship corresponding to a row position indicates the mapping relationship between business data (the row position is consistent with the row position of the business data cell where the business data is located) and the table header (the identifier of the table header).

[0246] Understandably, the data mapping result indicates the header structure and the first mapping relationship. For example, such as... Figure 2c As shown, the first mapping relationship in the data mapping result can include sub-mapping relationships corresponding to two row positions (two data rows). Specifically, the sub-mapping relationships corresponding to one row position (data row 1) include: the mapping relationship between "4" and "text 1", the mapping relationship between "5" and "text 2", the mapping relationship between "2" and "text 3", and the mapping relationship between "3" and "text 4". The sub-mapping relationships corresponding to the other row position (data row 2) include: the mapping relationship between "4" and "text 5", the mapping relationship between "5" and "text 6", the mapping relationship between "2" and "text 7", and the mapping relationship between "3" and "text 8".

[0247] S306: Based on the mapping relationship between the business data indicated by the first mapping relationship and the corresponding table header, add the business data to the table header structure to obtain the data mapping result.

[0248] In this embodiment, the computing device can add business data to the header in the header structure according to the mapping relationship between the business data indicated by the first mapping relationship and the corresponding header of the business data, thereby obtaining the data mapping result.

[0249] In other words, for any given business data, the computing device can determine the corresponding table header based on the mapping relationship between the business data and the table header indicated by the first mapping relationship. The computing device can then add the business data to the corresponding table header in the table header structure to obtain the data mapping result.

[0250] For example, for the business data "text 3", the computing device can query the first mapping relationship to determine that the corresponding table header for this business data is "example table header 2". The computing device can then add "text 3" to "example table header 2" in the table header structure to obtain the data mapping result.

[0251] It should be noted that, in one implementation, the table headers in the data mapping result can be represented by header identifiers. Accordingly, the computing device can add business data to the header identifier in the header structure based on the mapping relationship between the business data indicated by the first mapping relationship and the corresponding table header, thus obtaining the data mapping result. For example, for the business data "text 3", the computing device can query the first mapping relationship to determine that the corresponding table header is "example header 2". Based on the identifier "2" of "example header 2", the computing device can add "text 3" to the identifier "2" of "example header 2" in the header structure, thus obtaining the data mapping result.

[0252] S307: Import the data mapping results into the target database.

[0253] In this embodiment, the electronic device can import the data mapping results into the target database.

[0254] The target database is the database corresponding to the software system. The target database can be a database located in a database device.

[0255] The specific implementation process is the same as that of S204, and will not be described in detail here.

[0256] The beneficial effects of this embodiment are as follows: In this embodiment, the computing device can acquire a spreadsheet; wherein the spreadsheet includes multiple cells; the multiple cells include multiple header cells and multiple business data cells. The computing device can determine the header structure based on the cell information of the multiple header cells; the cell information of the header cells includes the header and the cell position of the header; wherein the header structure indicates the hierarchical relationship between the multiple headers. The computing device can determine a second mapping relationship based on the cell information of the multiple header cells and the cell information of the multiple business data cells; the second mapping relationship indicates the mapping relationship between the cell position of the business data and the header. For any business data, the computing device can determine the corresponding header of the business data based on the cell position of the business data and the mapping relationship between the cell position of the business data and the header indicated by the second mapping relationship. The computing device can construct a first mapping relationship based on the business data and the corresponding header of the business data. The computing device can add the business data to the header in the header structure based on the mapping relationship between the business data indicated by the first mapping relationship and the corresponding header of the business data, and obtain the data mapping result. The computing device can import the data mapping result into the target database. The method described above, which determines the second mapping relationship, then the first mapping relationship based on the second mapping relationship, and finally merges the header structure and the first mapping relationship to obtain the data mapping result, eliminates the need for manual acquisition of spreadsheet structure information based on personal expertise, and subsequent conversion of the spreadsheet based on the structure information. This lowers the barrier to obtaining structure information (second mapping relationship and header structure), thereby lowering the barrier to constructing the data mapping result, and ultimately lowering the barrier to importing the spreadsheet, thus improving the efficiency of spreadsheet import.

[0257] Figure 4a This is a flowchart illustrating a third embodiment of a spreadsheet import method provided in this application. See also... Figure 4a The method specifically includes the following steps:

[0258] S401: Get the spreadsheet.

[0259] In this embodiment, the computing device can access spreadsheets.

[0260] The spreadsheet contains multiple cells; these cells include multiple header cells and multiple business data cells.

[0261] The specific implementation process is the same as that of S201, and will not be described in detail here.

[0262] S402: Determine the header structure based on the cell information of multiple header cells.

[0263] In this embodiment, the electronic device can determine the header structure based on the cell information of multiple header cells.

[0264] The header cell information includes the header itself and its cell location.

[0265] The header structure indicates the hierarchical relationship between multiple headers.

[0266] The specific implementation process is the same as that of S202, and will not be described in detail here.

[0267] S403: Adjust the header structure according to the header configuration rules in the configuration rules to obtain the adjusted header structure.

[0268] In this embodiment, the computing device can adjust the header structure according to the header configuration rules in the configuration rules to obtain the adjusted header structure. The header configuration rules include multiple header levels.

[0269] In one implementation:

[0270] The computing device can determine whether it stores configuration rules. In one implementation, if the import request includes a user identifier, the computing device can determine whether it stores the configuration rule corresponding to the user identifier. In another implementation, during the verification process, the computing device can call the `getUserShowField` method based on the user identifier. This method is used to determine whether the computing device stores configuration rules. Understandably, if the computing device calls the `getUserShowField` method based on the user identifier and obtains the configuration rule returned by the `getUserShowField` method, it determines that the computing device stores the configuration rule.

[0271] Once the computing device has determined its storage configuration rules, it adjusts the header structure according to the header configuration rules within those rules to obtain the adjusted header structure. In other words, the computing device can adjust the header structure based on the header levels of multiple headers within the configuration rules, given the established storage configuration rules, to obtain the adjusted header structure.

[0272] Additionally, it should be noted that, even if the computing device determines that it does not store configuration rules, it can directly convert the spreadsheet into a data mapping result based on the header structure and cell information of multiple business data cells.

[0273] The following section describes the process by which a computing device acquires and stores configuration rules.

[0274] In one implementation:

[0275] The computing device can obtain the configuration rules sent by the terminal device.

[0276] The computing device can store and process the configuration rules.

[0277] It should be noted that the configuration rules include the header level of multiple headers and the attribute information corresponding to each header.

[0278] The attribute information corresponding to the table header includes at least one or more of the following:

[0279] Field type: The field type of the business data corresponding to the table header. For example, the field type can be text.

[0280] Filter type: The filter type for the business data corresponding to the table header. For example, the filter type can be a drop-down radio button.

[0281] Column width: The column width corresponding to the table header;

[0282] NOT NULL information: Whether the business data corresponding to the table header is allowed to be empty;

[0283] Fixed information: Whether to fix the table header;

[0284] Display order: The order in which table headers are displayed among table headers at the same level;

[0285] Data row uniqueness verification information: Whether the data row containing the business data corresponding to the table header is unique.

[0286] It should also be noted that the configuration interface (visual interface) displayed on the terminal device includes controls for adding headers at various levels, as well as controls for setting attribute information. For example, Figure 4b This is a schematic diagram of a configuration interface provided in an embodiment of this application. Figure 4b As shown, the configuration interface may include controls for adding first-level table headers, controls for adding second-level table headers, controls for setting field types, controls for setting filter types, controls for setting column widths, and controls for setting non-empty information (whether empty fields are allowed).

[0287] The configuration rules are obtained by the terminal device in response to the user's operations of adding controls to the headers of various levels and setting the attribute information of controls.

[0288] Understandably, the header configuration rules in the configuration rules are obtained by the terminal device in response to the user's actions of adding controls to the headers at various levels. The validation rules in the configuration rules are obtained by the terminal device in response to the user's actions of setting controls for attribute information.

[0289] S404: Based on the adjusted header structure, the cell positions of multiple header cells, and the cell information of multiple business data cells, convert the spreadsheet into a data mapping result.

[0290] In this embodiment, the computing device can convert a spreadsheet into a data mapping result based on the adjusted header structure, the cell positions of multiple header cells, and the cell information of multiple business data cells.

[0291] S405: Import the data mapping results into the target database.

[0292] In this embodiment, the computing device can import the data mapping results into the target database.

[0293] In one implementation:

[0294] The computing device can perform validation processing on the data mapping results according to the validation rules in the configuration rules, and obtain the validation result. In one implementation, the computing device can call the user field import check method (checkUserFieldImportFields method). This method is used to perform validation processing on the data mapping results according to the validation rules in the configuration rules, and obtain the validation result.

[0295] The computing device can import the data mapping result into the target database if the verification result indicates that the verification has passed. Alternatively, if the verification result indicates that the verification has failed, the computing device can roll back the target database and generate an alarm message.

[0296] The following section describes the process by which the computing device verifies the data mapping results according to the verification rules in the configuration rules, and obtains the verification results.

[0297] In one implementation:

[0298] The first header is any one of the multiple headers in the data mapping result.

[0299] Figure 4c This is a schematic diagram of a verification process provided for an embodiment of this application. Figure 4cAs shown, in one implementation, the computing device can determine whether there exists a header among the multiple headers included in the validation rule that is identical to the first header (identical to the name (fieldNname) of the first header). If the computing device determines that no header identical to the first header exists, it can determine that the validation result indicates validation failure. It should be noted that, in one implementation, the computing device can call the user field import check method (checkUserFieldImportFields method). This method is used to determine whether there exists a header among the multiple headers included in the validation rule that is identical to the first header (identical to the name (fieldNname) of the first header).

[0300] like Figure 4c As shown, in one implementation, when the verification rules include uniqueness verification information for the data rows corresponding to the table header, the computing device can determine whether the data row containing the business data corresponding to the table header (including at least one piece of business data) is a unique data row among multiple data rows. If the computing device determines that the data row containing the business data corresponding to the table header is not a unique data row among multiple data rows, it can indicate that the verification result indicates a failure. It should be noted that in one implementation, the computing device can call the data uniqueness verification method (checkDataVerifyUniqueness method). This method is used to determine whether the data row containing the business data corresponding to the table header is a unique data row among multiple data rows.

[0301] like Figure 4c As shown, in one implementation, if the verification rule includes non-empty information corresponding to the table header indicating that the business data corresponding to the table header is not allowed to be empty, the computing device can determine whether the data mapping result includes the business data corresponding to the table header. If the computing device determines that the data mapping result does not include the business data corresponding to the table header, it can determine that the verification result indicates that the verification failed.

[0302] The computing device can import the data mapping results into the target database if the verification result indicates that the verification has passed.

[0303] It should also be noted that in one implementation:

[0304] Import requests include import types. Import types can be either incremental or non-incremental.

[0305] The computing device can obtain the import type in the import request.

[0306] In one implementation, when the import type is a non-incremental import type, the computing device can directly import the data mapping results into the target database.

[0307] In one implementation, when the import type is incremental, for any given business data, the computing device can determine whether the first stored business data exists in the target database. In another implementation, the computing device can invoke a data existence check method (checkDataIsExsits method), which is used to determine whether the first stored business data exists in the target database. The table header corresponding to the first stored business data is the same as the table header corresponding to that business data.

[0308] In one implementation, if the target database does not contain any previously stored business data, the computing device can determine that the data type of the business data is a newly added type. For example... Figure 4c As shown, when the data type of the business data is "new", the computing device can call the `handleImportAdd` method. This method is used to import the business data from the data mapping result into the target database.

[0309] In one implementation, if the first stored business data exists in the target database, the computing device can determine that the data type of the business data is a modification type. For example... Figure 4c As shown, when the data type of the business data is modified, the computing device can call the handleImportEdit method. This method is used to modify the business data in the target database based on the business data in the data mapping result.

[0310] Furthermore, for any stored business data in the target database, the computing device can determine whether the target business data exists in the data mapping result. The table header corresponding to the target business data is the same as the table header corresponding to the stored business data. If the computing device determines that the target business data does not exist in the data mapping result, it can determine that the data type of the stored business data is a deletion type. For example... Figure 4c As shown, when the data type of the stored business data is of the deletion type, the computing device can call the handleImportDelete method. This method is used to delete the stored business data from the target database.

[0311] In addition, the process of displaying the data mapping results will be explained below.

[0312] In one implementation:

[0313] The computing device can receive display requests sent by the terminal device.

[0314] The computing device can respond to a display request by sending the data mapping results and the attribute information corresponding to each table header to the terminal device. It should be noted that the attribute information corresponding to each table header is part of the configuration rules.

[0315] Terminal devices can display and process data mapping results based on the attribute information corresponding to each header.

[0316] The attribute information corresponding to the table header may include at least one or more of the following: field type, filter type, column width, non-null information, fixed information, and display order.

[0317] In one implementation, the terminal device can process the data mapping results based on the filter type, column width, fixed information, and display order corresponding to each table header. Understandably, the terminal device can control the display interface to process the data mapping results.

[0318] In addition, the query process for the data mapping results will be explained below.

[0319] In one implementation:

[0320] The computing device can obtain query requests sent by the terminal device. In one implementation, the query request may include a target table header. In another implementation, the query request may include target business data.

[0321] The computing device can retrieve the data mapping results based on the query request and obtain the query results.

[0322] In one implementation, when the query request includes a target table header, the computing device can query the data mapping results based on the target table header to obtain the business data corresponding to the target table header. The computing device can determine that the query result includes the business data corresponding to the target table header.

[0323] In one implementation, when the query request includes target business data, the computing device can query the data mapping results based on the target business data to obtain related business data. The computing device can determine that the query results include related business data. It should be noted that related business data refers to business data that is in the same row position as the business data cell containing the target business data.

[0324] The computing device can send query results to the terminal device.

[0325] The terminal device can display and process the query results. Understandably, the terminal device can control the display of query results on the query interface.

[0326] The beneficial effects of this embodiment are as follows: In this embodiment, the computing device can acquire a spreadsheet; wherein the spreadsheet includes multiple cells; the multiple cells include multiple header cells and multiple business data cells. The computing device can determine the header structure based on the cell information of the multiple header cells; the cell information of the header cells includes the header and the position of the header cell; the header structure indicates the hierarchical relationship between the multiple headers. The computing device can adjust the header structure according to the header configuration rules in the configuration rules to obtain the adjusted header structure. The computing device can convert the spreadsheet into a data mapping result based on the adjusted header structure, the position of the multiple header cells, and the cell information of the multiple business data cells. The cell information of the business data cells includes the business data and the position of the business data cell. The computing device can import the data mapping result into the target database. By providing user-configurable header configuration rules to adjust the header structure, the accuracy of obtaining the header structure can be improved, thereby improving the accuracy of converting the spreadsheet based on the header structure, reducing the failure rate of importing the spreadsheet, and improving the integrity and accuracy of the data mapping result stored in the target database.

[0327] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.

[0328] Figure 5 This is a schematic diagram of the structure of a spreadsheet import device provided in an embodiment of this application. Figure 5 As shown, the spreadsheet import device 50 includes an acquisition module 51, a data parsing module (also known as a data parsing engine) 52, a validation and feedback module 53, and a rule configuration module 54.

[0329] Module 51 is used to retrieve a spreadsheet; the spreadsheet includes multiple cells; the multiple cells include multiple header cells and multiple business data cells;

[0330] The data parsing module 52 is used to determine the header structure based on the cell information of multiple header cells; the cell information of the header cells includes the header and the position of the header cell; the header structure indicates the hierarchical relationship between multiple headers;

[0331] The data parsing module 52 is also used to convert the spreadsheet into a data mapping result based on the header structure, the cell information of multiple header cells, and the cell information of multiple business data cells; the cell information of the business data cells includes the business data and the cell position of the business data; the data mapping result indicates the header structure and the first mapping relationship; the first mapping relationship indicates the mapping relationship between the business data and the header.

[0332] The verification and feedback module 53 is used to import the data mapping results into the target database.

[0333] The spreadsheet import device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.

[0334] In one implementation, the data parsing module 52 is specifically used for:

[0335] Based on the cell information of multiple header cells and multiple business data cells, a second mapping relationship is determined; the second mapping relationship indicates the mapping relationship between the cell positions of business data and the header cells.

[0336] For any given business data, determine the corresponding table header based on the cell position of the business data and the mapping relationship between the cell position of the business data and the table header as indicated by the second mapping relationship;

[0337] Based on the business data and the corresponding table headers, construct the first mapping relationship;

[0338] Based on the mapping relationship between the business data and the table header indicated by the first mapping relationship, the business data is added to the table header in the table header structure to obtain the data mapping result.

[0339] The spreadsheet import device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.

[0340] In one implementation, the cell position includes both column and row positions; the data parsing module 52 is specifically used for:

[0341] For any given business data cell, determine the target header cell from among the multiple header cells based on the column position of the business data cell and the column positions of the multiple header cells; wherein the column position of the target header cell matches the column position of the business data cell.

[0342] A second mapping relationship is constructed based on the cell position of the business data cell and the header in the target header cell.

[0343] The spreadsheet import device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.

[0344] In one implementation, the cell position includes both column and row positions; the data parsing module 52 is specifically used for:

[0345] For the first header cell, determine the level corresponding to the first header based on the row position of the first header cell; the first header cell can be any header cell among multiple header cells; the first header is the header in the first header cell;

[0346] Determine whether the first header is the initial header based on the level corresponding to the first header;

[0347] If it is determined that the first header is not the initial header, the parent header of the first header is determined according to the level of the header in each header cell and the column position of each header cell.

[0348] Determine the header structure based on the parent header of at least one header.

[0349] The spreadsheet import device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.

[0350] In one implementation, before determining the header structure based on the cell information of multiple header cells, the data parsing module 52 is also used for:

[0351] Get the header row number information of a spreadsheet;

[0352] Based on the number of header rows and the cell positions of multiple cells, determine multiple header cells and multiple business data cells within the multiple cells.

[0353] The spreadsheet import device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.

[0354] In one implementation, the data parsing module 52 is specifically used for:

[0355] Based on the header configuration rules in the configuration rules, the header structure is adjusted to obtain the adjusted header structure;

[0356] Based on the adjusted header structure, the cell positions of multiple header cells, and the cell information of multiple business data cells, the spreadsheet is converted into a data mapping result.

[0357] The spreadsheet import device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.

[0358] In one implementation, the verification and feedback module 53 is specifically used for:

[0359] The data mapping result is validated according to the validation rules in the configuration rules to obtain the validation result;

[0360] If the verification result indicates that the verification passed, the data mapping result is imported into the target database; or,

[0361] If the verification result indicates that the verification failed, the target database is rolled back and an alarm message is generated.

[0362] The spreadsheet import device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.

[0363] In one implementation, the data parsing module 52 is specifically used for:

[0364] Determine whether the computing device stores configuration rules;

[0365] Once the storage configuration rules for the computing device are determined, the header structure is adjusted according to the header configuration rules in the configuration rules to obtain the adjusted header structure.

[0366] The spreadsheet import device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.

[0367] In one implementation, the rule configuration module 54 is used for:

[0368] Obtain the configuration rules sent by the terminal device;

[0369] The configuration rules are stored.

[0370] The configuration rules include multiple header levels and corresponding attribute information for each header; the configuration interface displayed on the terminal device includes controls for adding headers at each level and controls for setting attribute information; the configuration rules are obtained by the terminal device in response to the user's operations on adding controls and setting attribute information for headers at each level.

[0371] The spreadsheet import device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.

[0372] In one implementation, the rule configuration module 54 is also used for:

[0373] Obtain the display request from the terminal device;

[0374] In response to a display request, the system sends the data mapping results and the attribute information corresponding to each table header to the terminal device, so that the terminal device can process the data mapping results for display based on the attribute information corresponding to each table header.

[0375] The spreadsheet import device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.

[0376] Figure 6 This is a schematic diagram of the structure of a computing device provided in an embodiment of this application. Figure 6 As shown, the computing device 60 includes a processor 61 and a memory 62; wherein the processor 61 is coupled to the memory 62, and the memory 62 is used to store computer instructions; the processor 61 is used to execute the computer instructions to cause the computing device 60 to perform the technical solutions in the aforementioned method embodiments.

[0377] Optionally, the memory 62 can be either standalone or integrated with the processor 61. Optionally, when the memory 62 is a device independent of the processor 61, the computing device 60 may further include a bus 63 for connecting the aforementioned devices.

[0378] The processor is used to execute the technical solutions in the aforementioned method embodiments. Its implementation principle and technical effect are similar, and will not be described again here.

[0379] This application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the technical solutions provided in the aforementioned method embodiments.

[0380] This application provides a computer program product, including a computer program, which, when executed by a processor, is used to implement the technical solutions provided in the aforementioned method embodiments.

[0381] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as volatile memory and non-volatile memory.

[0382] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application 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 or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A method for importing data from a spreadsheet, characterized in that, include: Get the spreadsheet; The spreadsheet includes multiple cells; the multiple cells include multiple header cells and multiple business data cells; Determine the header structure based on the cell information of multiple header cells; The cell information of the header cell includes the header and the position of the header cell; The header structure indicates the hierarchical relationship between multiple headers; Based on the header structure, the cell information of multiple header cells, and the cell information of multiple business data cells, the spreadsheet is converted into a data mapping result; The cell information of the business data cell includes the business data and the cell position of the business data; the data mapping result indicates the header structure and the first mapping relationship; The first mapping relationship indicates the mapping relationship between business data and table headers; Import the data mapping results into the target database.

2. The method according to claim 1, characterized in that, The step of converting the spreadsheet into a data mapping result based on the header structure, multiple header cell information, and multiple business data cell information includes: A second mapping relationship is determined based on the cell information of multiple header cells and multiple business data cells; the second mapping relationship indicates the mapping relationship between the cell positions of business data and the header cells. For any given business data, the corresponding table header is determined based on the cell position of the business data and the mapping relationship between the cell position of the business data and the table header indicated by the second mapping relationship. Based on the business data and the corresponding table headers, construct the first mapping relationship; Based on the mapping relationship between the business data and the table header indicated by the first mapping relationship, the business data is added to the table header in the table header structure to obtain the data mapping result.

3. The method according to claim 1 or 2, characterized in that, The cell position includes column position and row position; The step of determining the header structure based on cell information from multiple header cells includes: For the first header cell, determine the level corresponding to the first header based on the row position of the first header cell; the first header cell can be any header cell among multiple header cells; the first header is the header in the first header cell; Based on the level corresponding to the first header, determine whether the first header is the initial header; If it is determined that the first header is not the initial header, the parent header of the first header is determined according to the level corresponding to the header in each header cell and the column position of each header cell. The header structure is determined based on the parent header of at least one header.

4. The method according to any one of claims 1-3, characterized in that, Before determining the header structure based on the cell information of multiple header cells, the method further includes: Obtain the header row number information of the spreadsheet; Based on the number of header rows and the cell positions of multiple cells, determine multiple header cells and multiple business data cells among the multiple cells.

5. The method according to any one of claims 1-4, characterized in that, The step of converting the spreadsheet into a data mapping result based on the header structure, the cell positions of multiple header cells, and the cell information of multiple business data cells includes: According to the header configuration rules in the configuration rules, the header structure is adjusted to obtain the adjusted header structure; Based on the adjusted header structure, the cell positions of multiple header cells, and the cell information of multiple business data cells, the spreadsheet is converted into the data mapping result.

6. The method according to claim 5, characterized in that, The step of importing the data mapping result into the target database includes: According to the verification rules in the configuration rules, the data mapping result is verified to obtain the verification result; If the verification result indicates that the verification passed, the data mapping result is imported into the target database; or, If the verification result indicates that the verification failed, the target database is rolled back and an alarm message is generated.

7. The method according to claim 5 or 6, characterized in that, The step of adjusting the header structure according to the header configuration rules in the configuration rules to obtain the adjusted header structure includes: Determine whether the computing device stores the configuration rules; If it is determined that the computing device stores the configuration rules, the header structure is adjusted according to the header configuration rules in the configuration rules to obtain the adjusted header structure.

8. The method according to any one of claims 5-7, characterized in that, Before adjusting the header structure according to the header configuration rules in the configuration rules to obtain the adjusted header structure, the method further includes: Obtain the configuration rules sent by the terminal device; The configuration rules are stored. The configuration rules include multiple header levels and corresponding attribute information for each header; the configuration interface displayed on the terminal device includes header addition controls for each level and attribute information setting controls; the configuration rules are obtained by the terminal device in response to user operations on adding controls and setting attribute information for headers at each level.

9. The method according to claim 8, characterized in that, The method further includes: Obtain the display request from the terminal device; In response to the display request, the data mapping result and the attribute information corresponding to each table header are sent to the terminal device so that the terminal device can display the data mapping result according to the attribute information corresponding to each table header.

10. A computing device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory is used to store computer-executed instructions; The processor is configured to execute computer execution instructions stored in the memory to implement the method according to any one of claims 1-9.