Document processing method, query method, system, device and medium

CN114328524BActive Publication Date: 2025-08-12SHANGHAI JUJUN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111616959.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-27
Publication Date
2025-08-12
Estimated Expiration
2041-12-27

Smart Images

  • Figure CN114328524B_ABST
    Figure CN114328524B_ABST
Patent Text Reader

Abstract

The present invention discloses a document processing method, query method, system, device, and medium. The knowledge graph-based document processing method includes: using a clustering algorithm to cluster several initial data columns to obtain several data column clusters to be processed, wherein the several data columns are from at least two data tables of a relational database; calculating the similarity between the data column clusters to be processed, and merging the two data column clusters with the highest similarity into a target data column cluster; if any two data columns in the target data column cluster are from different data tables, obtaining the two data tables corresponding to the two data columns, and generating an association relationship between the nodes of the two data tables in a graph database. The present invention reduces personnel intervention and shortens the project cycle.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a document processing method, query method, system, device and medium. Background Art

[0002] In the field of industrial finance, financial companies, or the technology companies that serve them, often seek to verify the authenticity of assets and identify potential risks by performing various document penetration tests to trace the transaction process. Specifically, document penetration—the process of gaining insight into the essence of asset-related documents—is a means for financial institutions to conduct verification and mitigate risks. However, document querying often requires large-scale integration with diverse systems across various industry entities (such as enterprise resource planning systems and warehouse management systems) as well as third-party verification platforms (such as provincial pharmaceutical procurement platforms and invoice verification platforms in the pharmaceutical industry). Furthermore, due to significant differences in table structures and data relationships across these systems, even with unified data interfaces, subsequent penetration queries can be difficult to perform according to unified processing logic due to missing data or logical discrepancies (for example, some business logic links accounts receivable by order number, while others link by sales invoice number).

[0003] In the existing technology, technical developers usually figure out the corresponding logic of each table storing docking data, and then manually establish a routing table that records the table names of the original table and the target table, as well as the associated field names of the original table and the associated field names of the target table. Then, when performing a penetration query, they first find the corresponding relationship between the tables from the routing table, and then query according to the corresponding relationship. However, this manual method of establishing corresponding relationships requires a lot of time to analyze the logic of the docking system, which is time-consuming and inefficient, and limits the rapid expansion of the business. Secondly, in large-scale penetration queries, if the depth of the relationship network reaches 4-5 degrees, the query performance of the relational database will also drop sharply. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to overcome the defects of the prior art in which manual establishment of a relational routing table is required when conducting a penetration query on a business document, resulting in low efficiency, high cost, and poor effect of the relational database when conducting large-scale penetration queries, and to provide a document processing method, query method, system, device and medium.

[0005] The present invention solves the above technical problems through the following technical solutions:

[0006] The present invention provides a document processing method based on a knowledge graph, the document processing method based on a knowledge graph comprising:

[0007] Clustering a number of initial data columns using a clustering algorithm to obtain a number of data column clusters to be processed, wherein the number of data columns are from at least two data tables of a relational database;

[0008] Calculating the similarity between the data column clusters to be processed, and merging the two data column clusters to be processed with the highest similarity into a target data column cluster;

[0009] If any two data columns in the target data column cluster come from different data tables, two data tables corresponding to the two data columns are obtained, and an association relationship between the nodes of the two data tables is generated in a graph database.

[0010] Preferably, the method further comprises:

[0011] Get several data tables to be processed;

[0012] Writing the plurality of to-be-processed data tables into the relational database;

[0013] The to-be-processed data table is associated with at least one business document.

[0014] Preferably, the method further comprises:

[0015] Based on the association relationship, the two data tables are generated into nodes and attributes in the form of a graph data model, and written into a graph database;

[0016] Wherein, the label of the node of the graph data model is set to the name of the corresponding business document;

[0017] The attribute of the node is set to the column value of the data column corresponding to the business document corresponding to the node in the to-be-processed data table.

[0018] Preferably, before the step of clustering the plurality of data columns using a clustering algorithm, the method further includes:

[0019] Acquire a data column of the target data type from the data table to be processed as a disabled column;

[0020] The other data columns except the disabled columns in the to-be-processed data table are used as the initial data columns.

[0021] Preferably, the step of clustering the plurality of data columns using a clustering algorithm further includes:

[0022] If the number of data tables corresponding to the data columns to be processed in the data column cluster to be processed is less than or equal to a preset threshold, clustering is stopped and the step of calculating the similarity between the data column clusters to be processed is performed.

[0023] The present invention also provides a document processing system based on a knowledge graph, the document processing system based on a knowledge graph comprising:

[0024] A clustering module, configured to cluster a plurality of data columns using a clustering algorithm to obtain a plurality of data column clusters to be processed, wherein the plurality of data columns are from at least two data tables of a relational database;

[0025] A similarity calculation module is used to calculate the similarity between the data column clusters to be processed, and merge the two data column clusters to be processed with the highest similarity into a target data column cluster;

[0026] The form association module is used to obtain two data tables corresponding to any two data columns in the target data column cluster when the two data columns come from different data tables, and generate an association relationship between the nodes of the two data tables in a graph database.

[0027] The present invention also provides a method for querying a business document, the method comprising:

[0028] Enter the name and target field of the business document, where the target field corresponds to the association relationship in the graph database, and the association relationship is generated based on the aforementioned knowledge graph-based data processing method;

[0029] The name and target field encoding is processed into a graph database query language to request a data table corresponding to the business document from the graph database.

[0030] The present invention also provides a business document query system, the business document query system comprising:

[0031] An information input module, for inputting the name and target field of a business document, wherein the target field corresponds to an association relationship in the graph database, and the association relationship is generated based on the aforementioned knowledge graph-based data processing method;

[0032] The form query module is used to process the name and target field encoding into a graph database query language to request to obtain a data table corresponding to the business document from the graph database.

[0033] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the processor executes the computer program, it implements the document processing method based on the knowledge graph as described above, or the business document query method as described above.

[0034] The present invention also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it implements the document processing method based on the knowledge graph as described above, or the business document query method as described above.

[0035] The positive progress of the present invention is that the document processing method based on knowledge graph of the present invention uses a clustering algorithm to obtain the similarity between data columns of the data table, and establishes the relationship between data tables in the graph database based on the above similarity. Compared with the existing technology, it reduces personnel intervention and shortens the project cycle; in addition, in terms of storage method, the data and its corresponding relationships are stored in the form of knowledge graph in the graph database, so that when performing penetrating queries on business data, the multi-table joint query of the relational database is changed to the sub-graph search of the graph database, and better results can be obtained even when performing deep queries, which greatly improves the query performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 This is a first flow chart of a document processing method based on a knowledge graph according to embodiment 1 of the present invention;

[0037] Figure 2 This is a second flow chart of the document processing method based on knowledge graph according to embodiment 1 of the present invention;

[0038] Figure 3 This is a flowchart of a method for querying business documents according to embodiment 2 of the present invention;

[0039] Figure 4 This is a module diagram of a document processing system based on knowledge graph according to Example 3 of the present invention;

[0040] Figure 5 This is a module diagram of a business document query system according to Example 4 of the present invention;

[0041] Figure 6 This is a schematic structural diagram of an electronic device according to embodiment 5 of the present invention. DETAILED DESCRIPTION

[0042] The present invention is further described below by way of examples, but the present invention is not limited to the scope of the examples.

[0043] Example 1

[0044] like Figure 1 As shown, this embodiment discloses a document processing method based on a knowledge graph, and the document processing method based on a knowledge graph includes:

[0045] Step S101: Clustering a number of initial data columns using a clustering algorithm to obtain a number of data column clusters to be processed. The data columns are from at least two tables in a relational database; each data column is a cluster class. Clustering is the process of dividing a collection of physical or abstract objects into multiple classes consisting of similar objects.

[0046] Specifically, when clustering several initial data columns using a clustering algorithm, the TF-IDF statistical method is introduced to evaluate the importance of a column value in a business data table to the entire column value.

[0047] The formula for calculating TF is as follows:

[0048]

[0049] The numerator is the column value t i Throughout the column value d j The denominator is the entire column value d j The sum of the number of times all column values appear in .

[0050] The formula for calculating IDF is as follows:

[0051]

[0052] The numerator of the logarithm is the total number of columns, and the denominator is the number of columns containing the values t i If the column value does not exist, the denominator will be zero, so 1+|{j:t i ∈d j}| as the denominator.

[0053] The formula for calculating TF-IDF is as follows:

[0054] tfidf i,j =tf i,j ×idf i

[0055] Use cosine similarity to calculate the similarity between any two columns. The formula is as follows:

[0056]

[0057] Here A i , B i Represent the components of vectors A and B respectively.

[0058] Step S102: Calculate the similarity between the data column clusters to be processed, and merge the two data column clusters to be processed with the highest similarity into a target data column cluster;

[0059] Specifically, after the clustering calculation converges, the clustered data columns are compared pairwise, and the two most similar data column clusters are merged into a new data column cluster, namely the target data column cluster. Convergence is an important tool for studying functions, which means converging to a point and approaching a certain value.

[0060] Step S103: If any two data columns in the target data column cluster come from different data tables, two data tables corresponding to the two data columns are obtained, and an association relationship between the nodes of the two data tables is generated in a graph database.

[0061] Specifically, if they do not belong to the same business data table, there is an association relationship between the corresponding business data tables. Therefore, the corresponding nodes of the business data tables are found in the graph database, and the nodes between the business data tables are associated based on the association relationship to be written into the graph database. Then, an index is created for the attributes of the nodes corresponding to the current comparison data column. For example, the relationship between accounts receivable and sales orders is established using Cypher, the operating language used by the graph database Neo4j:

[0062] match(rec_bill_order:receivables{sales order number:'10001'}),(sale_order:sales order{order number:'10001'})create(rec_bill_order)-[r:has_relation]->(sale_order);

[0063] An example of creating an index using Cypher, the operation language used by the graph database Neo4j:

[0064] CREATE INDEX ON: A / R (sales order number).

[0065] This solution, a document processing method based on knowledge graph, uses a clustering algorithm to obtain the similarity between data columns in a data table, and based on the above similarity, establishes the association relationship between data tables to store them in a graph database. Compared with existing technologies, it reduces human intervention and shortens the project cycle.

[0066] In one possible implementation, the document processing method based on the knowledge graph further includes:

[0067] Get several data tables to be processed;

[0068] Writing the plurality of to-be-processed data tables into the relational database;

[0069] The to-be-processed data table is associated with at least one business document.

[0070] In this embodiment, the data table to be processed is written into a relational database so that several columns to be processed can be subsequently obtained for clustering to obtain the association relationship between the business data tables, so that the business data tables can be stored in a graph database.

[0071] In another embodiment, the above method further includes:

[0072] Based on the association relationship, the two data tables are generated into nodes and attributes in the form of a graph data model and written into the graph database;

[0073] Wherein, the label of the node of the graph data model is set to the name of the corresponding business document;

[0074] The attribute of the node is set to the column value of the data column corresponding to the business document corresponding to the node in the to-be-processed data table.

[0075] Specifically, based on the document name and field name corresponding to each data table to be processed, nodes and attributes are generated in the form of a graph data model and written into the graph database; wherein, the graph data model is the implementation method used to store graph data, including attribute graph, hypergraph and triples.

[0076] In this embodiment, the label of the node of the graph data model can be set to the name of the corresponding business document; and the attribute of the node can be set to the column value of the data column corresponding to the business document corresponding to the node in the to-be-processed data table.

[0077] After obtaining several data tables to be processed, nodes and attributes are generated in the form of a graph data model based on the document name (for example, sales order) and field name (for example, order number) corresponding to each data table to be processed, and written into the graph database.

[0078] This solution stores data and its corresponding relationships in the form of a knowledge graph in a graph database. This allows penetrating queries on business data to be performed instead of multi-table join queries in a relational database to subgraph searches in a graph database. This allows for better results even when performing deep queries, significantly improving query performance.

[0079] like Figure 2 As shown, in one practicable manner, before the step of clustering the plurality of data columns using a clustering algorithm, the method further includes:

[0080] Step S1001: obtaining a data column of a target data type in the data table to be processed as a disabled column;

[0081] Step S1002: Use the other data columns in the to-be-processed data table except the disabled columns as the initial data columns.

[0082] Specifically, the data tables to be processed are traversed, the ID column and the numerical column in the data columns of each business data table to be processed are excluded, and the remaining columns after exclusion are put into the cache.

[0083] In this solution, the ID column and the numeric column in the data column of the data table are excluded so that the ID column and the numeric column in the data column do not participate in the clustering operation, which reduces the data involved in the operation, makes the clustering operation more efficient, and the operation results are more accurate.

[0084] In one practicable manner, before the step of clustering the plurality of data columns using a clustering algorithm, the method further includes:

[0085] Use appropriate docking methods to collect business data from external systems and write it into relational databases;

[0086] Specifically, connection methods can include TCP, HTTPS, and FTP. When connecting to the same information system, such as ERP or WMS, business data from different companies must be stored using the same table structure. When selecting a relational database, consider choosing between MySQL, Oracle, and others.

[0087] Configure transparent document information, including the document name and field names within the document, so that it can be mapped to specific business data tables and data columns;

[0088] Specifically, you can configure the document information to be penetrated through an interface device. Configure the name of the document to be penetrated (e.g., sales order) and the corresponding table name in the business database (e.g., sale_order). Configure the field name in the document to be penetrated (e.g., order number) and the corresponding column name in the business database (e.g., order_no).

[0089] In one practicable manner, step S101 specifically includes:

[0090] If the number of data tables corresponding to the data columns to be processed in the data column cluster to be processed is less than or equal to a preset threshold, clustering is stopped and the step of calculating the similarity between the data column clusters to be processed is performed.

[0091] Specifically, if the number of data tables corresponding to the data columns to be processed in the data column cluster to be processed is less than or equal to 5, clustering is stopped and the step of calculating the similarity between the data column clusters to be processed is performed.

[0092] This solution stops clustering when the number of data tables corresponding to the to-be-processed data columns in the to-be-processed data column cluster is less than or equal to a set threshold, thereby further improving the efficiency of clustering operations and the accuracy of operation results.

[0093] Example 2

[0094] like Figure 3 As shown, this embodiment discloses a method for querying business documents, which includes:

[0095] Step 201: Enter the name and target field of the business document, where the target field corresponds to an association relationship in the graph database, and the association relationship is generated based on the knowledge graph-based data processing method in Example 1.

[0096] Step 202: Process the name and target field encoding into a graph database query language to request a data table corresponding to the business document from the graph database.

[0097] Specifically, the name and target field of a business document are input, and the encoding of these names and target fields is parsed and assembled into a graph database query language to request the data table corresponding to the business document from the graph database. For example, a request in JSON format for the name and target field of a business document is input: {"Document Name":"A / R","Document Number":"00001"}. These names and target field encodings are parsed and assembled into the Cypher operation language used by the Neo4j graph database, such as: match(a:A / R)-[r*0..]->(b)where a.Document Number = '00001'return b.

[0098] This embodiment discloses a method for querying business documents. The query method inputs the name and target fields of the business document, parses and assembles them into a graph database query language, and queries the data table corresponding to the business document in the graph database. This method changes the multi-table joint query of the relational database to the sub-graph search of the graph database when performing a penetrating query on business data. Even when performing deep queries, good results can be achieved, greatly improving query performance.

[0099] Example 3

[0100] like Figure 4 As shown, this embodiment discloses a document processing system based on a knowledge graph, and the document processing system based on a knowledge graph includes:

[0101] Clustering module 11 is configured to cluster multiple data columns using a clustering algorithm to obtain multiple clusters of data columns to be processed. The multiple data columns are from at least two data tables in a relational database; each data column is a cluster class. Clustering is the process of dividing a collection of physical or abstract objects into multiple clusters consisting of similar objects.

[0102] Specifically, when clustering several initial data columns using a clustering algorithm, the TF-IDF statistical method is introduced to evaluate the importance of a column value in a business data table to the entire column value.

[0103] The formula for calculating TF is as follows:

[0104] The numerator is the column value t i Throughout the column value d j The denominator is the entire column value d j The sum of the number of times all column values appear in .

[0105] The formula for calculating IDF is as follows:

[0106]

[0107] The numerator of the logarithm is the total number of columns, and the denominator is the number of columns containing the values t i If the column value does not exist, the denominator will be zero, so 1+|{j:t i ∈d j}| as the denominator.

[0108] The formula for calculating TF-IDF is as follows:

[0109] tfidf i,j =tf i,j ×idf i

[0110] Use cosine similarity to calculate the similarity between any two columns. The formula is as follows:

[0111]

[0112] Here A i , B i Represent the components of vectors A and B respectively.

[0113] A similarity calculation module 12 is used to calculate the similarity between the data column clusters to be processed, and merge the two data column clusters to be processed with the highest similarity into a target data column cluster;

[0114] Specifically, after the clustering calculation converges, the clustered data columns are compared pairwise, and the two most similar data column clusters are merged into a new data column cluster, namely the target data column cluster. Convergence is an important tool for studying functions, which means converging to a point and approaching a certain value.

[0115] The form association module 13 is configured to obtain two data tables corresponding to any two data columns in the target data column cluster when the two data columns come from different data tables, and generate an association relationship between the nodes of the two data tables in a graph database.

[0116] Specifically, if they do not belong to the same business data table, there is an association relationship between the corresponding business data tables. Therefore, the corresponding nodes of the business data tables are found in the graph database, and the nodes between the business data tables are associated based on the association relationship to be written into the graph database. Then, an index is created for the attributes of the nodes corresponding to the current comparison data column. For example, the relationship between accounts receivable and sales orders is established using Cypher, the operating language used by the graph database Neo4j:

[0117] match(rec_bill_order:receivables{sales order number:'10001'}),(sale_order:sales order{order number:'10001'})create(rec_bill_order)-[r:has_relation]->(sale_order);

[0118] An example of creating an index using Cypher, the operation language used by the graph database Neo4j:

[0119] CREATE INDEX ON: A / R (sales order number).

[0120] This solution, a document processing method based on knowledge graph, uses a clustering algorithm to obtain the similarity between data columns in a data table, and based on the above similarity, establishes the association relationship between data tables to store them in a graph database. Compared with existing technologies, it reduces human intervention and shortens the project cycle.

[0121] In one embodiment, the knowledge graph-based document processing system further includes:

[0122] A first acquisition module 14 is used to acquire a number of data tables to be processed;

[0123] A writing module 15 is used to write the plurality of to-be-processed data tables into the relational database;

[0124] The to-be-processed data table is associated with at least one business document.

[0125] In another embodiment, the above method further includes:

[0126] Based on the association relationship, the two data tables are generated into nodes and attributes in the form of a graph data model and written into the graph database;

[0127] Wherein, the label of the node of the graph data model is set to the name of the corresponding business document;

[0128] The attribute of the node is set to the column value of the data column corresponding to the business document corresponding to the node in the to-be-processed data table.

[0129] Specifically, based on the document name and field name corresponding to each data table to be processed, nodes and attributes are generated in the form of a graph data model and written into the graph database; wherein, the graph data model is the implementation method used to store graph data, including attribute graph, hypergraph and triples.

[0130] In this embodiment, the label of the node of the graph data model can be set to the name of the corresponding business document; and the attribute of the node can be set to the column value of the data column corresponding to the business document corresponding to the node in the to-be-processed data table.

[0131] After obtaining several data tables to be processed, nodes and attributes are generated in the form of a graph data model based on the document name (for example, sales order) and field name (for example, order number) corresponding to each data table to be processed, and written into the graph database.

[0132] This solution stores data and its corresponding relationships in the form of a knowledge graph in a graph database. This allows penetrating queries on business data to be performed instead of multi-table join queries in a relational database to subgraph searches in a graph database. This allows for better results even when performing deep queries, significantly improving query performance.

[0133] In one practicable manner, the document processing system based on the knowledge graph further includes:

[0134] The second acquisition module 16 is configured to acquire a data column of a target data type in the data table to be processed as a disabled column;

[0135] The selection module 17 is configured to select the other data columns in the to-be-processed data table except the disabled columns as the initial data columns.

[0136] Specifically, the data tables to be processed are traversed, the ID column and the numerical column in the data columns of each business data table to be processed are excluded, and the remaining columns after exclusion are put into the cache.

[0137] In this solution, the ID column and the numeric column in the data column of the data table are excluded so that the ID column and the numeric column in the data column do not participate in the clustering operation, which reduces the data involved in the operation, makes the clustering operation more efficient, and the operation results are more accurate.

[0138] In one practicable manner, before the step of clustering the plurality of data columns using a clustering algorithm, the method further includes:

[0139] Use appropriate docking methods to collect business data from external systems and write it into relational databases;

[0140] Specifically, connection methods can include TCP, HTTPS, and FTP. When connecting to the same information system, such as ERP or WMS, business data from different companies must be stored using the same table structure. When selecting a relational database, consider choosing between MySQL, Oracle, and others.

[0141] Configure transparent document information, including the document name and field names within the document, so that it can be mapped to specific business data tables and data columns;

[0142] Specifically, you can configure the document information to be penetrated through an interface device. Configure the name of the document to be penetrated (e.g., sales order) and the corresponding table name in the business database (e.g., sale_order). Configure the field name in the document to be penetrated (e.g., order number) and the corresponding column name in the business database (e.g., order_no).

[0143] In one practicable manner, the clustering module 11 is specifically configured to: if the number of data tables corresponding to the data columns to be processed in the data column cluster to be processed is less than or equal to a preset threshold, stop clustering and execute the step of calculating the similarity between the data column clusters to be processed.

[0144] Specifically, if the number of data tables corresponding to the data columns to be processed in the data column cluster to be processed is less than or equal to 5, clustering is stopped and the step of calculating the similarity between the data column clusters to be processed is performed.

[0145] This solution stops clustering when the number of data tables corresponding to the to-be-processed data columns in the to-be-processed data column cluster is less than or equal to a set threshold, thereby further improving the efficiency of clustering operations and the accuracy of operation results.

[0146] Example 4

[0147] like Figure 5 As shown, this embodiment discloses a business document query system, which includes:

[0148] An information input module 21 is used to input the name and target field of the business document, wherein the target field corresponds to the association relationship in the graph database, and the association relationship is generated based on the data processing method based on the knowledge graph as in Example 1;

[0149] The form query module 22 is configured to process the name and target field encoding into a graph database query language to request a data table corresponding to the business document from the graph database.

[0150] Example 5

[0151] Figure 6 This is a schematic diagram of the structure of an electronic device provided in Example 5 of the present invention. The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the knowledge graph-based document processing method provided in Example 1 or the business document query method provided in Example 2. Figure 6 The electronic device 40 shown is only an example and should not limit the functionality and scope of use of the embodiments of the present invention.

[0152] like Figure 6 As shown, the electronic device 40 may be a general-purpose computing device, such as a server device. Components of the electronic device 40 may include, but are not limited to, the at least one processor 41, the at least one memory 42, and a bus 43 connecting different system components (including the memory 42 and the processor 41).

[0153] The bus 43 includes a data bus, an address bus, and a control bus.

[0154] The memory 42 may include a volatile memory, such as a random access memory (RAM) 421 and / or a cache memory 422 , and may further include a read-only memory (ROM) 423 .

[0155] The memory 42 may also include a program / utility 425 having a set (at least one) of program modules 424, such program modules 424 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0156] The processor 41 executes various functional applications and data processing by running computer programs stored in the memory 42, such as the knowledge graph-based document processing method provided in Example 1 of the present invention or the business document query method provided in Example 2.

[0157] The electronic device 40 can also communicate with one or more external devices 44 (e.g., a keyboard, pointing device, etc.). This communication can occur via an input / output (I / O) interface 45. Furthermore, the model-generating device 40 can also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 46. As shown, the network adapter 46 communicates with other modules of the model-generating device 40 via a bus 43. It should be understood that, although not shown, other hardware and / or software modules can be used in conjunction with the model-generating device 40, including but not limited to microcode, device drivers, redundant processors, external disk drive arrays, RAID (RAID) systems, tape drives, and data backup storage systems.

[0158] It should be noted that although several units / modules or sub-units / modules of the electronic device are mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of the present invention, the features and functions of two or more units / modules described above may be embodied in a single unit / module. Conversely, the features and functions of a single unit / module described above may be further divided and embodied by multiple units / modules.

[0159] Example 6

[0160] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, it implements the document processing method based on the knowledge graph provided in Example 1 or the business document query method provided in Example 2.

[0161] The readable storage medium may include, but is not limited to, a portable disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0162] In a possible implementation, the present invention can also be implemented in the form of a program product, which includes program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the knowledge graph-based document processing method provided in Example 1 or the business document query method provided in Example 2.

[0163] The program code for executing the present invention may be written in any combination of one or more programming languages, and may be executed entirely on the user device, partially on the user device, as an independent software package, partially on the user device and partially on a remote device, or entirely on the remote device.

[0164] Although specific embodiments of the present invention have been described above, those skilled in the art will appreciate that these are merely illustrative and that the scope of the present invention is defined by the appended claims. Those skilled in the art may make various changes or modifications to these embodiments without departing from the principles and essence of the present invention, and such changes and modifications are intended to fall within the scope of the present invention.

Claims

1. A document processing method based on knowledge graph, characterized in that: The document processing method based on knowledge graph includes: Clustering a plurality of data columns using a clustering algorithm to obtain a plurality of data column clusters to be processed, wherein the plurality of data columns are from at least two data tables of a relational database; Calculating the similarity between the data column clusters to be processed, and merging the two data column clusters to be processed with the highest similarity into a target data column cluster; If any two data columns in the target data column cluster come from different data tables, then the two data tables corresponding to the two data columns are obtained, and an association relationship between the nodes of the two data tables is generated in the graph database; Get several data tables to be processed; Writing the plurality of to-be-processed data tables into the relational database; Wherein, the to-be-processed data table is associated with at least one business document; Based on the association relationship, the two data tables are generated into nodes and attributes in the form of a graph data model, and written into a graph database; Wherein, the label of the node of the graph data model is set to the name of the corresponding business document; The attribute of the node is set to the column value of the data column corresponding to the business document corresponding to the node in the to-be-processed data table.

2. The document processing method based on knowledge graph according to claim 1, characterized in that: Before the step of clustering the plurality of data columns using a clustering algorithm, the method further includes: Acquire a data column of the target data type from the data table to be processed as a disabled column; The other data columns except the disabled columns in the to-be-processed data table are used as the plurality of data columns.

3. The document processing method based on knowledge graph according to claim 1, characterized in that: The step of clustering the plurality of data columns using a clustering algorithm further includes: If the number of data tables corresponding to the data columns to be processed in the data column cluster to be processed is less than or equal to a preset threshold, clustering is stopped and the step of calculating the similarity between the data column clusters to be processed is performed.

4. A document processing system based on knowledge graph, characterized in that: The document processing system based on knowledge graph includes: A clustering module, configured to cluster a plurality of data columns using a clustering algorithm to obtain a plurality of data column clusters to be processed, wherein the plurality of data columns are from at least two data tables of a relational database; A similarity calculation module is used to calculate the similarity between the data column clusters to be processed, and merge the two data column clusters to be processed with the highest similarity into a target data column cluster; a form association module, configured to obtain two data tables corresponding to any two data columns in the target data column cluster when the two data columns are from different data tables, and generate an association relationship between the nodes of the two data tables in a graph database; A first acquisition module is used to acquire several data tables to be processed; A writing module, configured to write the plurality of to-be-processed data tables into the relational database; wherein the to-be-processed data tables are associated with at least one business document; The form association module is further used to generate nodes and attributes from the two data tables in the form of a graph data model based on the association relationship, and write them into a graph database; wherein the label of the node of the graph data model is set to the name of the corresponding business document; and the attribute of the node is set to the column value of the data column corresponding to the business document corresponding to the node in the data table to be processed.

5. A method for querying business documents, characterized in that: The business document query method includes: Enter the name and target field of the business document, where the target field corresponds to an association relationship in the graph database, and the association relationship is generated based on the knowledge graph-based data processing method according to any one of claims 1 to 3; The name and target field encoding is processed into a graph database query language to request a data table corresponding to the business document from the graph database.

6. A business document query system, characterized in that: The business document query system includes: An information input module, configured to input a name and a target field of a business document, wherein the target field corresponds to an association relationship in the graph database, and the association relationship is generated based on the knowledge graph-based data processing method according to any one of claims 1 to 3; The form query module is used to process the name and target field encoding into a graph database query language to request to obtain a data table corresponding to the business document from the graph database.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, it implements the document processing method based on the knowledge graph as described in any one of claims 1 to 3, or the business document query method as described in claim 5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the document processing method based on the knowledge graph as described in any one of claims 1 to 3, or the business document query method as described in claim 5.

Citation Information

Patent Citations

  • Column data processing method and device based on big data and medium

    CN110569289A

  • Digital processing systems and methods for auto-recognition and aggregation of similar columns in collaborative work systems

    US20210304113A1