Universal table data importing method and system, storage medium and electronic equipment

By obtaining the matching relationship definition information of the target table, performing data validation and node creation, the flexibility problem of importing data from Excel spreadsheets is solved, and the effective import of diverse data is realized.

CN121071017APending Publication Date: 2025-12-05BEIJING JINGWEI HIRAIN TECH CO INC
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing technologies cannot flexibly handle diverse Excel spreadsheet data import needs, leading to problems such as data structure mismatch and data loss.

Method used

By obtaining the target table, it is determined whether there is matching relationship definition information. If so, data validation and node creation are performed, including the association of data nodes, relationship nodes and attribute nodes, to achieve comprehensive data transformation and persistence to the database.

Benefits of technology

It enables flexible import of diverse Excel spreadsheet data, avoiding data mismatch and loss, and meeting diverse data import needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121071017A_ABST
    Figure CN121071017A_ABST
Patent Text Reader

Abstract

The invention discloses a universal table data importing method and system, a storage medium and electronic equipment. The method comprises the steps that a current to-be-imported target table is acquired; judging whether coincident matching relation definition information exists or not; wherein the matching relation definition information comprises relation definition information of nodes in the model structure tree and data in the table and attribute definition information of the nodes; if yes, verifying the data in the target table based on the matching relation definition information conforming to the target table; according to data type matching relation information in the matching relation definition information, creating a data node by using data in the target table; matching relation information according to a relation type in the matching relation definition information, and creating a relation node by utilizing data in the target table; creating attribute nodes according to attribute definition information in the matching relation definition information, associating the attribute nodes with the corresponding data nodes or relation nodes to obtain import data corresponding to the target table, and persisting the import data into a database.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data import, in particular to a universal table data import method and system, a storage medium and an electronic device. BACKGROUND

[0002] In today's data-driven era, the types and functions of data management tools are increasingly diverse, and their applications in various fields are also increasingly widespread. As a widely used data processing software, the data exchange capability of Excel, that is, the ability to import different tools, is crucial to improving work efficiency and meeting user needs.

[0003] The current Excel table import method mainly designs a standardized Excel template according to business needs and common table data in the business. Subsequently, the designed standardized Excel template is required to convert the Excel table data so that it meets the standardized Excel template, thereby realizing the import of the Excel table data.

[0004] However, in the context of frequent changes in business needs and increasingly complex Excel individual needs, this fixed template method is particularly inadequate, as it cannot flexibly respond to the growing and diversified data import needs. Therefore, there may be a mismatch between the user's data structure and the Excel template, resulting in the inability to import data and data loss. SUMMARY

[0005] Based on the deficiencies of the prior art, the present application provides a universal table data import method and system, a storage medium and an electronic device to solve the problem that the prior art cannot flexibly respond to diverse table data import.

[0006] To achieve the above purpose, the present application provides the following technical solutions:

[0007] The first aspect of the present application provides a universal table data import method, comprising:

[0008] Obtaining a target table to be imported;

[0009] Determining whether there is matching relationship definition information that meets the target table; wherein the matching relationship definition information is the relationship definition information between the nodes in the model structure tree and the data in the table, and the attribute definition information of the nodes;

[0010] If it is determined that there is matching relationship definition information that meets the target table, then the data in the target table is verified based on the matching relationship definition information that meets the target table;

[0011] If the data in the target table is verified, according to the data type matching relationship information in the matching relationship definition information, a corresponding data node is created by using the data in the target table;

[0012] According to the relationship type matching relationship information in the matching relationship definition information, a relationship node connected with each data node is created by using the data in the target table;

[0013] According to the attribute definition information in the matching relationship definition information, an attribute node is created;

[0014] Each attribute node is associated with a corresponding data node or relationship node, and the imported data corresponding to the target table is obtained;

[0015] The imported data corresponding to the target table is persisted in the database.

[0016] Optionally, in the universal table data import method, after judging whether the matching relationship definition information corresponding to the target table exists, the method further includes:

[0017] If the matching relationship definition information corresponding to the target table does not exist, the user-specified data node is taken as an import top node in response to a data node specifying operation of the user;

[0018] A model structure tree under the import top node is loaded and rendered;

[0019] Each data type node and each relationship type node in the model structure tree are defined with the matching relationship of the data in the target table, and the data type matching relationship information and the relationship type matching relationship information are obtained;

[0020] In response to an attribute definition operation of the user on any one data type node or relationship type node, attribute definition information of the data type node or relationship type node is generated.

[0021] Optionally, in the universal table data import method, the definition of each data type node and each relationship type node in the model structure tree with the matching relationship of the data in the target table, and the obtaining of the data type matching relationship information and the relationship type matching relationship information, include:

[0022] sequentially for each to-be-defined node in the model structure tree, if data of the to-be-defined node is derived from the target table, performing a first source type definition on the to-be-defined node; wherein the to-be-defined node is the data type node and the relationship type node which are not defined; the first source type refers to that data is derived from a column in a table; definition information of the data type node is the data type matching relationship information; definition information of the relationship type node is the relationship type matching relationship information;

[0023] if data of the to-be-defined node is derived from any one of the defined nodes, performing a second source type definition on the to-be-defined node; wherein the second source type refers to that data is derived from a defined node with consistent data source;

[0024] if data of the to-be-defined node is derived from intermediate data, performing a third source type definition on the to-be-defined node; wherein the third source type refers to that data is derived from intermediate data generated according to definition of upstream and downstream nodes;

[0025] if data of the to-be-defined node does not exist in the target table, performing a fourth source type definition on the to-be-defined node; wherein the fourth source type is used to represent that there is no data source.

[0026] Optionally, in the universal table data import method, creating a corresponding data node by using data in the target table according to the data type matching relationship information in the matching relationship definition information comprises:

[0027] sequentially analyzing each piece of the data type matching relationship information in the matching relationship definition information;

[0028] if the data type matching relationship information is analyzed to belong to the first source type, reading data of a column in the defined target table, and creating a corresponding data node by using the read data;

[0029] if the data type matching relationship information is analyzed to belong to the second source type, mapping a referenced data node to a corresponding node of the model structure tree;

[0030] if the data type matching relationship information is analyzed to belong to the third source type, creating a data node according to a number of downstream nodes, and generating information of the data node according to a defined rule;

[0031] if the definition information is analyzed to have the fourth type of data source, skipping processing.

[0032] Optionally, in the universal table data import method, the creating, according to the relationship type matching relationship information in the matching relationship definition information, of relationship nodes connected with each data node by using data in the target table comprises:

[0033] The relationship type matching relationship information in the matching relationship definition information is parsed respectively;

[0034] If the relationship type matching relationship information is parsed as belonging to the first source type, a corresponding relationship node is generated, and upstream and downstream information of the relationship node is filled according to the definition;

[0035] If the relationship type matching relationship information is parsed as belonging to the third source type, a corresponding relationship node is generated according to the number of downstream nodes and the defined rule, and upstream and downstream information of the relationship node is filled.

[0036] Optionally, in the universal table data import method, the creating, according to the attribute definition information in the matching relationship definition information, of attribute nodes comprises:

[0037] The attribute definition information in the matching relationship definition information is read, and is mapped to data in a column of the defined target table to generate an attribute node.

[0038] Optionally, in the universal table data import method, the verifying, based on the matching relationship definition information conforming to the target table, of data in the target table comprises:

[0039] Based on the matching relationship definition information conforming to the target table, it is determined whether each item of data in the target table conforms to a corresponding matching model format;

[0040] If it is determined that each item of data in the target table conforms to the corresponding matching model format, based on the matching relationship definition information conforming to the target table, a virtual data node of each item of data in the target table is constructed, and an association relationship of each virtual data node is constructed;

[0041] By analyzing whether a link of the association relationship of each virtual data node is complete, the integrity of the data in the target table is determined.

[0042] The second aspect of the present application provides a universal table data import system, comprising:

[0043] An acquisition unit is configured to acquire a target table to be imported;

[0044] An information judging unit is configured to judge whether there is matching relationship definition information that matches the target table; wherein the matching relationship definition information is relationship definition information between a node in a model structure tree and data in a table, and attribute definition information of the node;

[0045] A checking unit is configured to, when it is judged that there is matching relationship definition information that matches the target table, check data in the target table based on the matching relationship definition information that matches the target table;

[0046] A data creating unit is configured to, if the data in the target table passes the check, create corresponding data nodes by using the data in the target table according to data type matching relationship information in the matching relationship definition information;

[0047] A relationship creating unit is configured to create relationship nodes connected with the data nodes by using the data in the target table according to relationship type matching relationship information in the matching relationship definition information;

[0048] An attribute creating unit is configured to create attribute nodes according to the attribute definition information in the matching relationship definition information;

[0049] An association unit is configured to associate each attribute node with corresponding data nodes or relationship nodes to obtain imported data corresponding to the target table;

[0050] A storage unit is configured to persist the imported data corresponding to the target table into a database.

[0051] Optionally, in the universal table data import system, the system further comprises:

[0052] A node selecting unit is configured to, if there is no matching relationship definition information that matches the target table, respond to a data node specifying operation of a user to select the data node specified by the user as an import top node;

[0053] A loading unit is configured to load and render a model structure tree under the import top node;

[0054] A defining unit is configured to define matching relationships between each data type node and each relationship type node in the model structure tree and data in the target table to obtain data type matching relationship information and relationship type matching relationship information;

[0055] An attribute information generating unit is configured to, in response to an attribute defining operation of the user on any one of the data type nodes or the relationship type nodes, generate attribute definition information of the data type node or the relationship type node.

[0056] Optionally, in the universal table data import system, the definition information comprises:

[0057] a first definition unit, configured to sequentially define each to-be-defined node in the model structure tree, if data of the to-be-defined node is from the target table, as a first source type; wherein the to-be-defined node is the data type node and the relationship type node which are not defined; the first source type refers to data from a column in a table; the definition information of the data type node is the data type matching relationship information; the definition information of the relationship type node is the relationship type matching relationship information;

[0058] a second definition unit, configured to define the to-be-defined node as a second source type when data of the to-be-defined node is from any one of the defined nodes; wherein the second source type refers to data from a defined node with the same data source;

[0059] a third definition unit, configured to define the to-be-defined node as a third source type when data of the to-be-defined node is from intermediate data; wherein the third source type refers to data from intermediate data generated according to definition of upstream and downstream nodes;

[0060] a fourth definition unit, configured to define the to-be-defined node as a fourth source type when data of the to-be-defined node does not exist in the target table; wherein the fourth source type is used to represent no data source.

[0061] Optionally, in the universal table data import system, the data creation unit comprises:

[0062] a data information analysis unit, configured to sequentially analyze each piece of the data type matching relationship information in the matching relationship definition information;

[0063] a first creation unit, configured to read data of a column in the defined target table when the data type matching relationship information is determined to belong to the first source type, and create a corresponding data node by using the read data;

[0064] a second creation unit, configured to map a defined referenced data node to a corresponding node of the model structure tree when the data type matching relationship information is determined to belong to the second source type;

[0065] The third creating unit is configured to create a data node according to the number of downstream nodes and generate information of the data node according to a defined rule when it is determined that the data type matching relationship information belongs to the third source type.

[0066] The skipping unit is configured to skip the processing when it is determined that the data source of the definition information is the fourth type.

[0067] Optionally, in the universal table data import system, the relationship creating unit comprises:

[0068] The relationship information analyzing unit is configured to analyze each piece of the relationship type matching relationship information in the matching relationship definition information respectively.

[0069] The fourth creating unit is configured to generate a corresponding relationship node and fill in upstream and downstream information of the relationship node according to a definition when it is determined that the relationship type matching relationship information belongs to the first source type.

[0070] The fifth creating unit is configured to create a data node according to the number of downstream nodes and generate a corresponding relationship node and fill in upstream and downstream information of the relationship node according to a defined rule when it is determined that the relationship type matching relationship information belongs to the third source type.

[0071] Optionally, in the universal table data import system, the attribute creating unit comprises:

[0072] The attribute creating sub-unit is configured to read the attribute definition information in the matching relationship definition information, map data in a column of the defined target table, and generate an attribute node.

[0073] Optionally, in the universal table data import system, the checking unit comprises:

[0074] The normative checking unit is configured to determine whether each piece of data of the target table conforms to a corresponding matching model format based on the matching relationship definition information conforming to the target table.

[0075] The virtual node constructing unit is configured to construct a virtual data node of each piece of data of the target table and construct an association relationship of each virtual data node based on the matching relationship definition information conforming to the target table when it is determined that each piece of data of the target table conforms to a corresponding matching model format.

[0076] The integrity checking unit is configured to determine the integrity of the data in the target table by analyzing whether a link of the association relationship of each virtual data node is complete.

[0077] The third aspect of the present application provides an electronic device, comprising:

[0078] a memory and a processor;

[0079] The memory is configured to store a program.

[0080] The processor is configured to execute the program, and the program, when executed, is specifically configured to implement the general table data import method according to any one of the preceding aspects.

[0081] The fourth aspect of the present application provides a computer storage medium for storing a computer program, and the computer program, when executed by a processor, is configured to implement the general table data import method according to any one of the preceding aspects.

[0082] The present application provides a general table data import method, which defines the matching relationship definition information and the attribute definition information of the nodes in the model structure tree and the data in the table, so as to obtain the matching relationship definition information. When the table data import is needed, the target table to be imported is obtained. Then it is judged whether there is matching relationship definition information conforming to the target table. If it is judged that there is matching relationship definition information conforming to the target table, the data in the target table is checked based on the matching relationship definition information conforming to the target table, so as to avoid the influence of the data due to mismatching or missing on the normal import of the data. If the data in the target table passes the check, the corresponding data nodes are created by using the data in the target table according to the data type matching relationship information in the matching relationship definition information. The relationship nodes connecting the data nodes are created by using the data in the target table according to the relationship type matching relationship information in the matching relationship definition information. The attribute nodes are created according to the attribute definition information in the matching relationship definition information, and each attribute node is associated with the corresponding data node or relationship node, so as to obtain the import data corresponding to the target table. Thus, according to the matching relationship definition of the model and the table data, the corresponding data of the table, the relationship between the data and the corresponding attributes are created, the comprehensive conversion of the table data is realized, and the import data corresponding to the target table is persisted in the database, so as to realize the import of the data. Thus, through the matching relationship definition of the model structure tree and the table data, the import of the data can be met, and the corresponding definition can be made according to the demand, which is no longer limited to the standardized Excel template, so as to meet the import demand of various table data. BRIEF DESCRIPTION OF DRAWINGS

[0083] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description only represent some embodiments of the present application, and for those skilled in the field, other drawings can be obtained without creative effort based on the provided drawings.

[0084] Figure 1 A flow chart of a general table data import method provided by the embodiments of the present application;

[0085] Figure 2 A flow chart of a definition method of matching relationship between a model structure tree and a table provided by the embodiments of the present application;

[0086] Figure 3 A schematic diagram of an example of matching relationship between a model book and table data provided by the embodiments of the present application;

[0087] Figure 4 A flow chart of a method for checking table data provided by the embodiments of the present application;

[0088] Figure 5 An architecture schematic diagram of a general table data import system provided by the embodiments of the present application;

[0089] Figure 6 An architecture schematic diagram of an electronic device provided by the embodiments of the present application. DETAILED DESCRIPTION

[0090] The technical solutions in the embodiments of the present application will be described clearly and completely below with the drawings in the embodiments of the present application. Obviously, the described embodiments only represent some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative effort belong to the scope of protection of the present application.

[0091] In the present application, the relationship terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the terms “include”, “contain” or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitation, the element defined by the statement “including a…”, does not exclude the presence of other identical elements in the process, method, article or device including the element.

[0092] The embodiment of the present application provides a general table data import method, as shown in the following table, which comprises the following steps: Figure 1

[0093] S101, obtaining a target table to be imported.

[0094] Optionally, a user can upload a table to be imported through an interactive interface, and the uploaded table is taken as the target table for import processing.

[0095] S102, judging whether there is matching relationship definition information conforming to the target table.

[0096] The matching relationship definition information is relationship definition information between nodes in a model structure tree and data in a table, and attribute definition information of the nodes. That is, in the embodiment of the present application, the flexibility of data import is realized by using accurate matching and definition between the model structure tree and data of a certain type of table, so as to meet diversified data import requirements. The matching relationship between the model structure tree and the table data is defined, and the matching relationship definition information is obtained accordingly. The generated matching relationship definition information can be reused for the same type of table.

[0097] Therefore, when the target table to be imported is needed to be imported, it can be judged whether there is reusable matching relationship definition information, that is, whether there is matching relationship definition information conforming to the target table. If it is judged that there is matching relationship definition information conforming to the target table, step S103 can be executed.

[0098] Optionally, whether there is matching relationship definition information conforming to the target table can be judged according to one or more of the name, structure and data of the target table. Of course, the user can also select from the configured multiple matching relationship definition information. If the user selects the matching relationship definition information, it is determined that there is matching relationship definition information conforming to the target table. The matching relationship definition information selected by the user is the matching relationship definition information conforming to the target table.

[0099] Optionally, in another embodiment of the present application, it is judged that there is no matching relationship definition information conforming to the target table, and the matching relationship between the model structure tree and the table needs to be defined. As shown in the following table, the embodiment of the present application provides a definition method of the matching relationship between the model structure tree and the table, which comprises the following steps: Figure 2

[0100] S201, in response to a data node designation operation of a user, taking a data node designated by the user as an import top node.

[0101] ​​It should be noted that in the embodiments of the present application, a large model structure tree is constructed in the system, and only part of the model structure tree is needed when defining for a table, so the user needs to specify a data node as the import top node when defining, so as to start matching relationship definition from the import top node. In addition, the model structure tree can be adjusted according to the needs, so as to meet the definition of the matching relationship of new needs.

[0102] S202, load the model structure tree under the import top node and render.

[0103] Specifically, after the import top node is selected, the model structure tree below the import top node is loaded, and the data in the subsequent table import process will be limited under the model structure tree of the import top node. For example, as shown in the model structure tree and the matching relationship diagram of the table, the user selects "ECU" as the import top node, and the model structure tree under the "ECU" node is loaded. Then the loaded model structure tree is selected, so as to facilitate the user to define the matching relationship between the model structure tree and the data in the table on the model structure tree. Figure 3

[0104] S203, respectively, define the matching relationship between each data type node and each relationship type node in the model structure tree and the data in the target table, to obtain data type matching relationship information and relationship type matching relationship information.

[0105] It should be noted that, as shown in the model structure tree in Figure 3 , the model structure tree mainly includes two kinds of nodes: one is the data type node represented by the solid line box in the figure, which is used to match the data in the table. The other is the relationship type node represented by the dashed line box in the figure, and the data type nodes are connected through the relationship type nodes, so the relationship between the data type nodes and the data in the table is matched. Therefore, when defining the matching relationship between the model structure tree and the data in the table, the matching relationship between each data type node and the data in the target table needs to be defined, and the matching relationship between each relationship type node and the data in the target table needs to be defined.

[0106] Optionally, in another embodiment of the present application, one specific implementation of step S203 includes:

[0107] In turn, for each to-be-defined node in the model structure tree, if the data of the to-be-defined node comes from the target table, the to-be-defined node is defined as the first source type.

[0108] ​Wherein, the to-be-defined node is an undefined data type node and a relationship type node. The definition information of the data type node is data type matching relationship information. The definition information of the relationship type node is relationship type matching relationship information.

[0109] It should be noted that the definition of the matching relationship between the node in the model structure tree and the data in the table is to define the data source of the node in the model structure tree based on the data in the table, that is, which data or relationship between which data in the table. In the embodiment of the present application, the data source is divided into four types: "table", "reference", "automatic", and "ignore".

[0110] Wherein, the first source type is "table", which is mainly used to define the data type node, and is used to indicate that the data is from a column in the table. Therefore, for this data source type, the user selects a column in the table as the source of the to-be-defined node according to the user's own needs. For example, as shown in Figure 3 , for the data source of the ECU data type node in the model structure tree, the first column in the right table in Figure 3 , that is, the ECU data column, is selected as the data source, so that when importing data, each ECU data node will be generated according to the matching of this type of data for this node, realizing the import of each ECU data.

[0111] If the data source of the to-be-defined node is consistent with the data source of any one of the defined nodes, the second source type is defined for the to-be-defined node.

[0112] Wherein, the second source type is "reference", which is used to indicate that the data is from a defined node with the same data source, that is, the same type of row data can be referenced, so that repeated definition is not needed. For example, Figure 3 , there are two data type nodes in the model structure tree, both of which are Signal type. If the data source of the data type node Signal under the relationship type node SendSignal is defined as the table Signal column, that is, the data source has been defined. Then the data source of the data type node Signal under the relationship type node ReceiveSignal can be defined as reference. That is, directly reference the matching relationship defined by the data type node Signal under the relationship type node SendSignal. At this time, the same Signal data of the Signal column will only generate the same data node, indicating that the sending and receiving are the same Signal.

[0113] If the data source of the to-be-defined node is from the intermediate data, the third source type is defined for the to-be-defined node.

[0114] The third source type is automatic, which means that the data is generated from the intermediate data defined according to the upstream and downstream nodes. That is, according to the data type nodes defined in the upstream and downstream of the model structure tree, the intermediate data is generated one by one, which can be used in the scenario that the Excel table data is incomplete and the model data cannot be matched in the table, to ensure the integrity of the imported data. That is, in order to use some data or data relationship according to the model structure, but the table does not include these data, so when importing data, the corresponding data is automatically generated to ensure the integrity of the data. For example, as shown in FIG. 8, there is no column in the table that can match the Signal Section of the model structure tree, but the data needs to rely on the related definition of the model structure tree during data generation, so the Signal Section data is automatically generated to ensure the integrity of the data chain. Figure 3

[0115] If the data source of the to-be-defined node does not exist in the target table, the fourth source type definition is performed on the to-be-defined node.

[0116] The fourth source type is "ignore", which means that there is no data source, and some data that does not need to be imported can be ignored. That is, no data matching is performed during the import process, and no corresponding data is generated. In order to facilitate operation, one-key ignore, batch ignore and other functions are designed on the interactive interface.

[0117] S204, in response to the attribute definition operation of the user for any one data type node or relationship type node, attribute definition information of the data type node or the relationship type node is generated.

[0118] It should be noted that in the embodiments of the present application, when defining the data type node and the relationship type node, the attributes of the data can also be defined at the same time, thereby importing more additional information for data import. When defining the attributes of the data type node, the user can select a certain attribute type in the system attribute library and select a certain column data in the table as the data source, that is, the column can be imported into the system as the attribute of the data. Moreover, multiple attributes can be defined for a certain data type or relationship type.

[0119] S103, based on the matching relationship definition information conforming to the target table, the data in the target table is checked.

[0120] In order to avoid the situation that the data cannot be accurately imported due to the mismatching of the data type and the missing of the data, in the embodiments of the present application, the requirements of each item of data in the target table are determined based on the matching relationship definition information conforming to the target table, and then the data in each target table is subjected to standardization checking and integrity checking according to the requirements of each item of data.

[0121] ​Optionally, in another embodiment of the present application, a specific implementation of step S103 includes: Figure 4

[0122] S401, based on the matching relationship definition information conforming to the target table, determine whether each item of data of the target table conforms to the corresponding matching model format.

[0123] Specifically, according to the matching relationship definition information conforming to the target table, the data in the cell is extracted for verification. The consistency of the data in the target table with the corresponding model definition is verified. For example, type error, date format, numerical range, text length, etc. are verified to ensure that all data items conform to the format of the matching model, avoiding errors caused by data type mismatch. For example, if a column is used as a numerical type attribute, it must be a number. If a column is used as the name of data, the name length cannot exceed 50 characters, etc. In addition, for system internal specific type data, regular expressions are used for accurate matching to ensure the standardization of imported data.

[0124] If it is determined that each item of data of the target table conforms to the corresponding matching model format, data integrity verification is performed, i.e., step S302 is executed.

[0125] S402, based on the matching relationship definition information conforming to the target table, constructing virtual data nodes of each item of data of the target table, and constructing the association relationship of each virtual data node.

[0126] It should be noted that the correspondence between Excel data and model structure can be materialized by constructing a relationship object network. These relationships represent the logical relationship between data, and by comparing the actual association between these objects with the association defined by the model, it can be ensured that the dependency relationship between data is satisfied.

[0127] Therefore, according to the definition of the data type node, a temporary virtual data node is generated in the memory, and then according to the definition of the relationship type node, a virtual relationship node is generated to build a virtual association relationship between the virtual data nodes.

[0128] S403, by analyzing whether the link of the association relationship of each virtual data node is complete, determine the integrity of the data in the target table.

[0129] Optionally, when the link of the association relationship is missing or incomplete, the corresponding row of data is reported as an error and collected into an error log. The user can modify the table content through the error log. This series of verification ensures that the data conforms to the specification before import, and guarantees the integrity and consistency of the data. If it is determined that the target.

[0130] ​S104, judging whether the data in the target table passes the verification.

[0131] If the data in the target table passes the specification verification and the integrity verification, it is determined that the data in the target table passes the verification, and step S105 is performed.

[0132] S105, creating a corresponding data node by using the data in the target table according to the data type matching relationship information in the matching relationship definition information.

[0133] It should be noted that each piece of data type matching relationship information in the matching relationship definition information is definition information of a matching relationship between a data node of the model structure tree and data of a table, so based on the data type matching relationship information, the data in the target table can be created as a data node corresponding to the model structure data.

[0134] Optionally, in another embodiment of the present application, when the defined data source includes "table", "reference", "automatic", and "ignore", one specific implementation of step S105 includes:

[0135] The pieces of data type matching relationship information in the matching relationship definition information are parsed in sequence.

[0136] If the parsed data type matching relationship information belongs to the first source type, the data of the column in the defined target table is read, and a corresponding data node is created by using the read data.

[0137] That is, when the data source is "table", the data of the column in the target table defined according to the matching is read, the corresponding model data information in the system is read, and the data object to be imported is generated. For example, as shown in Figure 3 , for the data type node "ECU" in the model structure tree, the data of the "ECU" column in the table in Figure 3 is read for data node generation. Each data in the column data is used to generate a corresponding data node.

[0138] If the parsed data type matching relationship information belongs to the second source type, the data node defined by reference is mapped to the corresponding node of the model structure tree.

[0139] That is, when the data source is "reference", the data is not generated according to the direct matching relationship, but the generated data corresponding to the reference column is mapped to the model node, so as to avoid repeated creation of data and meet the reuse scenario of the same data in different positions of the model structure tree.

[0140] If the data type matching relationship information is parsed as belonging to the third source type, data nodes are created according to the number of downstream nodes, and information of the data nodes is generated according to defined rules.

[0141] That is, when the data source is "automatic", data nodes of the data type are automatically created according to the number of downstream data nodes in the model structure tree, and key information such as names is automatically generated according to some self-defined rules. That is, according to the number of data nodes of the nodes to be generated in the model structure tree, data nodes of the same number are generated, and then names of the data nodes are generated according to some self-defined rules.

[0142] If the data source of the definition information is parsed as the fourth type, the processing is skipped.

[0143] That is, when the data source is "ignore", no processing is needed.

[0144] S106, according to the relationship type matching relationship information in the matching relationship definition information, data in the target table is used to create relationship nodes connecting each data node.

[0145] Similarly, the relationship type matching relationship information is the definition information of the matching relationship between the node relationship in the model structure tree and the data in the table. The data node is the node of the data in the table, so according to the relationship type matching relationship information in the matching relationship definition information, the corresponding relationship node is generated, and then it is connected with the data node of the corresponding relationship.

[0146] Optionally, in another embodiment of the present application, the source of the relationship type node mainly includes the first source type and the third source type, and one specific implementation of step S106 includes:

[0147] Each piece of relationship type matching relationship information in the matching relationship definition information is parsed.

[0148] If the relationship type matching relationship information is parsed as belonging to the first source type, the corresponding relationship node is generated, and upstream and downstream information of the relationship node is filled according to the definition.

[0149] That is, when the data source is "table", the corresponding relationship node can be directly generated using the relationship data in the table, and the information of the upstream and downstream data nodes is filled in the relationship node according to the definition of which data the relationship belongs to, so as to connect the relationship node with the corresponding data node.

[0150] If the relationship type matching relationship information is parsed as belonging to the third source type, data nodes are created according to the number of downstream nodes, and the corresponding relationship node is generated and filled with upstream and downstream information of the relationship node according to the defined rules.

[0151] That is, for the data source is "automatic", then according to the number of downstream nodes need to use the relationship and custom rules, the same number of nodes of the relationship is generated, and the upstream and downstream information of using the relationship is filled, that is, the information of the upstream and downstream data nodes, and the upstream and downstream data nodes are connected.

[0152] S107, create attribute nodes according to attribute definition information in matching relationship definition information.

[0153] It should be noted that the attribute definition information in the matching relationship definition information is the attribute defined for the data and relationship in the table, so the corresponding attribute nodes are directly created using the attribute definition information.

[0154] Optionally, in another embodiment of the present application, a specific implementation of step S107 includes:

[0155] Read the attribute definition information in the matching relationship definition information, map to the data in the column of the defined target table, and generate attribute nodes.

[0156] S108, associate each attribute node with the corresponding data node or relationship node to obtain the import data corresponding to the target table.

[0157] Specifically, according to the defined relationship in the attribute definition information, the attribute nodes generated according to the attribute definition information are associated with the corresponding data nodes or attribute nodes.

[0158] It should be noted that after associating each attribute node with the corresponding data node or relationship node, not only the nodes of the table data are generated, but also the data nodes are connected using the relationship nodes according to the relationship of the data, and finally the corresponding attributes are added. Therefore, the data of the table has been converted according to the model structure tree, and thus the import data corresponding to the target table is obtained, that is, the data that can be imported is obtained.

[0159] S109, persist the import data corresponding to the target table to the database.

[0160] Optionally, after the import data corresponding to the target table is persisted to the database, a transaction management mechanism is also introduced. Once any exception is detected during the import process, the system will automatically perform a rollback operation to undo all incomplete operations, thereby ensuring the accuracy of the database state and the consistency of the data are not damaged.

[0161] The embodiment of the application provides a general table data import method, and a matching relationship definition and attribute definition information of a node in a model structure tree and data in a table are obtained, so that the matching relationship definition information is obtained. When table data import is needed, a target table to be imported is obtained. Then, it is judged whether the matching relationship definition information corresponding to the target table exists. If it is judged that the matching relationship definition information corresponding to the target table exists, the data in the target table is checked based on the matching relationship definition information corresponding to the target table, so that the normal import of the data is not affected due to the mismatching or missing of the data. If the data in the target table passes the check, corresponding data nodes are created by using the data in the target table according to the data type matching relationship information in the matching relationship definition information. Relationship nodes connected with the data nodes are created by using the data in the target table according to the relationship type matching relationship information in the matching relationship definition information. Attribute nodes are created according to the attribute definition information in the matching relationship definition information, and the attribute nodes are associated with the corresponding data nodes or relationship nodes, so that the import data corresponding to the target table is obtained, so that the corresponding data of the table, the relationship between the data and the corresponding attribute are created according to the matching relationship definition of the model and the table data, and the comprehensive conversion of the table data is realized. Finally, the import data corresponding to the target table is persisted in a database, so that the data import is realized. Therefore, the matching relationship definition of the model structure tree and the table data can meet the data import, and the corresponding definition can be made according to the demand, so that the standardized Excel template is no longer limited, and the import demand of various table data is met.

[0162] Another embodiment of the application provides a general table data import system, as shown in the following table data import system. Figure 5 The system comprises the following units.

[0163] The obtaining unit 501 is used for obtaining a target table to be imported.

[0164] The information judging unit 502 is used for judging whether the matching relationship definition information corresponding to the target table exists. The matching relationship definition information is relationship definition information of a node in a model structure tree and data in a table, and attribute definition information of the node.

[0165] The checking unit 503 is used for checking the data in the target table based on the matching relationship definition information corresponding to the target table when it is judged that the matching relationship definition information corresponding to the target table exists.

[0166] The data creating unit 504 is used for creating corresponding data nodes by using the data in the target table according to the data type matching relationship information in the matching relationship definition information when the data in the target table passes the check.

[0167] The relationship creating unit 505 is configured to create a relationship node connecting each data node according to the relationship type matching relationship information in the matching relationship definition information and the data in the target table.

[0168] The attribute creating unit 506 is configured to create an attribute node according to the attribute definition information in the matching relationship definition information.

[0169] The association unit 507 is configured to associate each attribute node with a corresponding data node or relationship node to obtain imported data corresponding to the target table.

[0170] The storage unit 508 is configured to persist the imported data corresponding to the target table in the database.

[0171] Optionally, in the universal table data import system provided in another embodiment of the present application, the system further includes:

[0172] The node selecting unit is configured to, if there is no matching relationship definition information corresponding to the target table, select a data node specified by a user as an import top node in response to a data node specifying operation of the user.

[0173] The loading unit is configured to load and render a model structure tree under the import top node.

[0174] The defining unit is configured to define a matching relationship between each data type node and each relationship type node in the model structure tree and the data in the target table to obtain data type matching relationship information and relationship type matching relationship information.

[0175] The attribute information generating unit is configured to generate attribute definition information of a data type node or a relationship type node in response to an attribute defining operation of a user on the data type node or the relationship type node.

[0176] Optionally, in the universal table data import system provided in another embodiment of the present application, the definition information includes:

[0177] The first defining unit is configured to sequentially define each to-be-defined node in the model structure tree, if the data of the to-be-defined node is from the target table, as a first source type. The to-be-defined node is a data type node and a relationship type node that have not been defined. The first source type indicates that the data is from a column in the table. The definition information of the data type node is the data type matching relationship information. The definition information of the relationship type node is the relationship type matching relationship information.

[0178] The second definition unit is used to define a second source type for the node to be defined when the data source of the node to be defined is consistent with the data source of any already defined node. Here, the second source type refers to data originating from a reference to an already defined node whose data source is consistent with its own.

[0179] The third definition unit is used to define a third source type for a node when its data originates from intermediate data. Here, the third source type refers to intermediate data generated based on data defined from its upstream and downstream nodes.

[0180] The fourth definition unit is used to define a fourth source type for the node to be defined when the data source of the node to be defined does not exist in the target table. Here, the fourth source type indicates that there is no data source.

[0181] Optionally, in another embodiment of the general tabular data import system provided in this application, the data creation unit includes:

[0182] The data information parsing unit is used to parse each data type matching relationship information in the matching relationship definition information in turn.

[0183] The first creation unit is used to read the data of the columns in the defined target table when the data type matching relationship information is parsed and belongs to the first source type, and to create the corresponding data node using the read data.

[0184] The second creation unit is used to map the defined referenced data node to the corresponding node in the model structure tree when the data type matching relationship information is parsed as belonging to the second source type.

[0185] The third creation unit is used to create data nodes based on the number of downstream nodes when the parsed data type matching relationship information belongs to the third source type, and to generate data node information according to the defined rules.

[0186] The skip unit is used to skip processing when the data source of the parsed definition information is of type four.

[0187] Optionally, in another embodiment of the general tabular data import system provided in this application, the relationship creation unit includes:

[0188] The relation information parsing unit is used to parse the relation type matching relation information in the matching relation definition information.

[0189] The fourth creation unit is used to generate the corresponding relationship node when the relationship type matching relationship information is parsed and belongs to the first source type, and to fill in the upstream and downstream information of the relationship node according to the definition.

[0190] The fifth creating unit is configured to create a data node and a defined rule according to the number of downstream nodes, generate a corresponding relationship node, and fill in the upstream and downstream information of the relationship node when it is determined that the relationship type matching relationship information belongs to the third source type.

[0191] Optionally, in the universal table data import system provided by another embodiment of the present application, the attribute creating unit comprises:

[0192] The attribute creating sub-unit is configured to read the attribute definition information in the matching relationship definition information, map the data in the column of the defined target table, and generate an attribute node.

[0193] Optionally, in the universal table data import system provided by another embodiment of the present application, the verification unit comprises:

[0194] The normative verification unit is configured to determine whether the data of the target table conforms to the corresponding matching model format based on the matching relationship definition information of the target table.

[0195] The virtual node constructing unit is configured to construct a virtual data node of the data of the target table and an association relationship of each virtual data node based on the matching relationship definition information of the target table when it is determined that the data of the target table conforms to the corresponding matching model format.

[0196] The integrity verification unit is configured to determine the integrity of the data in the target table by analyzing whether the link of the association relationship of each virtual data node is complete.

[0197] It should be noted that the specific working processes of each unit provided by the above embodiments of the present application can be correspondingly referred to the implementation processes of the corresponding steps in the above method embodiments, which will not be described here.

[0198] Another embodiment of the present application provides an electronic device, as shown in the figure, comprising: Figure 6 as shown in the figure, comprising:

[0199] The memory 601 and the processor 602.

[0200] The memory 601 is configured to store a program.

[0201] The processor 602 is configured to execute the program stored in the memory 601, and the program is executed to specifically implement the universal table data import method provided by any one of the above embodiments.

[0202] Another embodiment of the present application provides a computer storage medium for storing a computer program, which is executed by a processor to implement the universal table data import method provided by any one of the above embodiments.

[0203] Computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disks (DVDs) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information for access by a computing device. According to the definitions provided herein, computer readable media does not include transitory computer readable medium, such as a modulated data signal and a carrier wave.

[0204] Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the embodiments disclosed herein can be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality, without reference to a specific sequence of operations for implementing the functions, and / or without reference to a specific coupling of

[0205] The above description of disclosed embodiments provides information sufficient to understand how to make and use the application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein can be applied to other embodiments without the use of the innovation falling outside the scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A generic tabular data import method, characterized by, The method comprises the following steps: obtaining a target table to be imported; determining whether there is matching relationship definition information corresponding to the target table; wherein the matching relationship definition information is relationship definition information between nodes in a model structure tree and data in a table, and attribute definition information of the nodes; if it is determined that there is matching relationship definition information corresponding to the target table, verifying the data in the target table based on the matching relationship definition information corresponding to the target table; if the data in the target table passes the verification, creating corresponding data nodes using the data in the target table according to data type matching relationship information in the matching relationship definition information; creating relationship nodes connected to each of the data nodes using the data in the target table according to relationship type matching relationship information in the matching relationship definition information; creating attribute nodes according to the attribute definition information in the matching relationship definition information; associating each of the attribute nodes with a corresponding data node or relationship node to obtain import data corresponding to the target table; persisting the import data corresponding to the target table to a database.

2. The method of claim 1, wherein, After the step of determining whether there is matching relationship definition information corresponding to the target table, the method further comprises the following steps: if there is no matching relationship definition information corresponding to the target table, responding to a data node designation operation of a user to designate the data node designated by the user as an import top node; loading and rendering a model structure tree under the import top node; defining matching relationships between each data type node and each relationship type node in the model structure tree and data in the target table to obtain data type matching relationship information and relationship type matching relationship information; responding to an attribute definition operation of the user on any one of the data type nodes or the relationship type nodes to generate attribute definition information of the data type node or the relationship type node.

3. The method of claim 2, wherein, The step of defining matching relationships between each data type node and each relationship type node in the model structure tree and data in the target table to obtain data type matching relationship information and relationship type matching relationship information comprises the following steps: for each to-be-defined node in the model structure tree, if data of the to-be-defined node comes from the target table, defining the to-be-defined node in a first source type; wherein the to-be-defined node is an undefined data type node or relationship type node; the first source type indicates that data comes from a column in a table; definition information of the data type node is the data type matching relationship information; definition information of the relationship type node is the relationship type matching relationship information; if data of the to-be-defined node comes from the same source as data of any one of the defined nodes, defining the to-be-defined node in a second source type; wherein the second source type indicates that data comes from a defined node with the same data source. If the data of the node to be defined is derived from intermediate data, the node to be defined is defined in a third source type; wherein the third source type refers to data derived from data defined according to upstream and downstream nodes, and intermediate data generated; If the data source of the node to be defined does not exist in the target table, the node to be defined is defined in a fourth source type; wherein the fourth source type is used to indicate that there is no data source.

4. The method of claim 3, wherein, The data type matching relationship information in the matching relationship definition information is used to create corresponding data nodes by using the data in the target table, including: The data type matching relationship information in the matching relationship definition information is parsed in sequence; If the data type matching relationship information is parsed as belonging to the first source type, the data of the column in the target table to be defined is read, and corresponding data nodes are created by using the read data; If the data type matching relationship information is parsed as belonging to the second source type, the referenced data node is mapped to the node of the corresponding model structure tree; If the data type matching relationship information is parsed as belonging to the third source type, the data node is created according to the number of downstream nodes, and the information of the data node is generated according to the defined rules; If the data source of the definition information is the fourth type, the processing is skipped.

5. The method of claim 3, wherein, The relationship type matching relationship information in the matching relationship definition information is used to create relationship nodes connected with each data node by using the data in the target table, including: The relationship type matching relationship information in the matching relationship definition information is parsed respectively; If the relationship type matching relationship information is parsed as belonging to the first source type, the corresponding relationship node is generated, and the upstream and downstream information of the relationship node is filled according to the definition; If the relationship type matching relationship information is parsed as belonging to the third source type, the data node is created according to the number of downstream nodes, and the corresponding relationship node is generated according to the defined rules and the upstream and downstream information of the relationship node is filled.

6. The method of claim 1, wherein, The attribute definition information in the matching relationship definition information is used to create attribute nodes, including: The attribute definition information in the matching relationship definition information is read, and the data in the column of the defined target table is mapped to generate attribute nodes.

7. The method of claim 1, wherein, Based on the matching relationship definition information conforming to the target table, the data in the target table is verified, including: Based on the matching relationship definition information conforming to the target table, it is determined whether the data of the target table conforms to the corresponding matching model format; If it is determined that the data of the target table conforms to the corresponding matching model format, based on the matching relationship definition information conforming to the target table, the virtual data nodes of the data of the target table are constructed, and the association relationship of each virtual data node is constructed; The completeness of the data in the target table is determined by analyzing whether the link of the association relationship of each virtual data node is complete.

8. A universal tabular data import system, characterized by, including: An acquisition unit is configured to acquire a target table to be imported currently; An information judging unit is configured to judge whether there is matching relationship definition information conforming to the target table; wherein the matching relationship definition information is relationship definition information of a node in a model structure tree and data in a table, and attribute definition information of the node; A checking unit is configured to, when it is judged that there is matching relationship definition information conforming to the target table, check data in the target table based on the matching relationship definition information conforming to the target table; A data creating unit is configured to, if the data in the target table passes the check, create corresponding data nodes by using the data in the target table according to data type matching relationship information in the matching relationship definition information; A relationship creating unit is configured to create relationship nodes connecting the data nodes by using the data in the target table according to relationship type matching relationship information in the matching relationship definition information; An attribute creating unit is configured to create attribute nodes according to the attribute definition information in the matching relationship definition information; An association unit is configured to associate each attribute node with corresponding data nodes or relationship nodes to obtain imported data corresponding to the target table; A storage unit is configured to persist the imported data corresponding to the target table into a database.

9. An electronic device, comprising: comprise: a memory and a processor; wherein the memory is configured to store a program; the processor is configured to execute the program, and the program, when executed, is specifically configured to implement the general table data import method in any one of claims 1 to 7.

10. A computer storage medium, characterized in that, a computer program is stored, and the computer program, when executed by a processor, is configured to implement the general table data import method in any one of claims 1 to 7.