Method, apparatus, and device for determining association relationships between data tables

By calculating the correlation degree of the splicing key field pairs of the data table, the correlation relationship between the data tables is automatically identified, and the problem of relying on manual input relationships in the existing technology is solved, and efficient and accurate data table splicing is achieved.

CN112115138BActive Publication Date: 2025-07-25THE FOURTH PARADIGM BEIJING TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010839661.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-19
Publication Date
2025-07-25
Estimated Expiration
2040-08-19

AI Technical Summary

Technical Problem

In the prior art, users need to manually enter the association relationship between data tables and primary foreign key information, resulting in the inability to splice data tables when they cannot obtain or provide these information.

Method used

By obtaining the data table pairs in the target data table collection and calculating the correlation degree of the spliced key field pairs, the association relationship between the data tables is automatically identified, including obtaining foreign key fields and primary key fields, calculating overlap and editing similarity indicators, and determining the association relationship of the data table.

Benefits of technology

It realizes the automatic identification of data table association relationships without manual screening and analysis, improves the efficiency and accuracy of data table associations, and reduces manpower work.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112115138B_ABST
    Figure CN112115138B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method, apparatus, and device for determining the association relationship between data tables, including: obtaining data table pairs involved in a target data table set; wherein, the data table pairs include a first data table and a second data table; obtaining a concatenated key field pair for associating the first data table and the second data table; wherein, the concatenated key field pair includes a foreign key field of the first data table and a primary key field of the second data table; calculating the association degree of the concatenated key field pair, and determining the association relationship between the data tables according to the calculated association degree.
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, and more particularly, to a method for determining an association relationship between data tables, an apparatus for determining an association relationship between data tables, a device including at least one computing device and at least one storage device, and a computer-readable storage medium. Background Art

[0002] With the emergence of massive amounts of data in various industries, data needs to be processed in more and more scenarios. For example, first determine the association relationship between data tables, and then splice the data tables according to the association relationship.

[0003] In the related art, the association relationship between two data tables and the primary and foreign key information of the two data tables are manually input by the user. This method depends on the user to provide the primary and foreign key information of the data table and the table association relationship. When the user cannot obtain or provide the table association relationship and primary and foreign key information of the data table, the data tables cannot be spliced. Summary of the Invention

[0004] An object of an embodiment of the present disclosure is to provide a new technical solution for determining an association relationship between data tables.

[0005] Obtain data table pairs involved in a target data table set; wherein, the data table pairs include a first data table and a second data table;

[0006] Obtain a splicing key field pair for associating the first data table and the second data table; wherein, the splicing key field pair includes a foreign key field of the first data table and a primary key field of the second data table;

[0007] Calculate the association degree of the splicing key field pair, and determine the association relationship between data tables according to the calculated association degree.

[0008] Optionally, the method further includes:

[0009] When the association degree meets a set condition, splice the first data table and the second data table.

[0010] Optionally, the method further includes:

[0011] Obtain the attribute information of the data table set;

[0012] According to the attribute information and a preset complexity calculation function, obtain the calculation complexity of the data table set;

[0013] Compare the calculation complexity with a complexity threshold to obtain a comparison result;

[0014] In the case that the comparison result indicates that the calculation complexity is less than or equal to the complexity threshold, perform the step of obtaining the data table pairs involved in the target data table set.

[0015] Optionally, the method further includes:

[0016] In the case that the comparison result indicates that the calculation complexity is greater than the complexity threshold, give a prompt that the calculation complexity is greater than the complexity threshold; or,

[0017] In the case that the comparison result indicates that the calculation complexity is greater than the complexity threshold, receive an enforcement instruction; in response to the enforcement instruction, perform the step of obtaining the data table pairs involved in the target data table set; or,

[0018] In the case that the comparison result indicates that the calculation complexity is greater than the complexity threshold, provide a selection interface for selecting a complexity calculation function; use the complexity calculation function selected through the selection interface as the preset complexity calculation function, and re - execute the step of obtaining the calculation complexity of the data table set according to the attribute information and the preset complexity calculation function.

[0019] Optionally, the attribute information at least includes the total number of data tables in the data table set, the maximum number of attribute fields of the data tables in the data table set, and the maximum number of rows of the data tables in the data table set.

[0020] Optionally, the obtaining of the data table pairs involved in the target data table set includes:

[0021] Successively use each data table in the data table set as the first data table;

[0022] For the first data table, successively select other data tables in the data table set except the data table as the second data table to obtain the data table pair.

[0023] Optionally, the obtaining of the concatenation key field pairs for associating the first data table and the second data table includes:

[0024] Obtain the foreign key fields of the first data table and the primary key fields of the second data table;

[0025] Obtain the concatenation key field pairs according to the foreign key fields of the first data table and the primary key fields of the second data table.

[0026] Optionally, the obtaining of the foreign key fields of the first data table and the primary key fields of the second data table includes:

[0027] Obtain one or more attribute fields involved in the specified first data table and the second data table by the user as the foreign key field and the primary key field; or,

[0028] In the case where the user does not specify, directly use all the attribute fields involved in the first data table and the second data table as the foreign key field and the primary key field.

[0029] Optionally, obtaining the spliced key field pair according to the foreign key field of the first data table and the primary key field of the second data table includes:

[0030] Select the foreign key field of the first data table;

[0031] Select a primary key field from the second data table that has the same data field type as the foreign key field;

[0032] Combine the foreign key field and the primary key field to obtain the spliced key field pair.

[0033] Optionally, the degree of association includes the coincidence degree,

[0034] Calculating the degree of association of the spliced key field pair includes:

[0035] Obtain a list of unique values of the foreign key field in the spliced key field pair;

[0036] Obtain a list of unique values of the primary key field in the spliced key field pair;

[0037] Obtain the coincidence degree of the foreign key field and the primary key field according to the list of unique values of the foreign key field and the list of unique values of the primary key field.

[0038] Optionally, obtaining the list of unique values of the foreign key field, or obtaining the list of unique values of the primary key field, includes:

[0039] Filter out the data that meets the set conditions in the foreign key field or the primary key field to obtain the list of unique values of the foreign key field, or the list of unique values of the primary key field.

[0040] Optionally, the set conditions include a first condition and a second condition, and filtering out the data that meets the set conditions in the foreign key field or the primary key field includes:

[0041] When the data included in the foreign key field or the primary key field is a null value, filter out the null value; and / or,

[0042] When the number of occurrences of the same data included in the foreign key field or the primary key field is greater than one, retain one of the data and filter out the other data.

[0043] Optionally, obtaining the coincidence degree of the foreign key field and the primary key field according to the list of unique values of the foreign key field and the list of unique values of the primary key field includes:

[0044] Sampling the list of unique values of the foreign key field according to a preset number of samples;

[0045] Obtaining the number of data included in the list of unique values of the foreign key field after the sampling as the first number of data;

[0046] Obtaining the number of data in the list of unique values of the foreign key field after the sampling that belong to the data in the list of unique values of the primary key field as the second number of data;

[0047] Obtaining the coincidence degree of the foreign key field and the primary key field according to the first number of data and the second number of data.

[0048] Optionally, sampling the list of unique values of the foreign key field according to a preset number of samples includes:

[0049] When the preset number of samples is greater than the number of rows of the first data table, retaining all the data in the list of unique values of the foreign key field; or,

[0050] When the preset number of samples is less than or equal to the number of rows of the first data table, extracting the number of samples of data from the list of unique values of the foreign key field.

[0051] Optionally, the correlation degree further includes an edit similarity,

[0052] Calculating the correlation degree of the concatenated key field pair further includes:

[0053] Obtaining the edit distance for converting the foreign key field to the primary key field, the length of the field name of the foreign key field, and the length of the field name of the primary key field;

[0054] Obtaining the edit similarity according to the edit distance, the length of the field name of the foreign key field, and the length of the field name of the primary key field.

[0055] Optionally, determining the association relationship between data tables includes:

[0056] When there is data with an occurrence number greater than one in the foreign key field and there is data with an occurrence number greater than one in the primary key field, obtaining that the first data table and the second data table have a many-to-many association relationship; or,

[0057] When the data included in the foreign key field has an occurrence frequency greater than once, and the data included in the primary key field does not have an occurrence frequency greater than once, the first data table and the right data table are obtained as a many-to-one association relationship; or,

[0058] When the data included in the foreign key field does not have an occurrence frequency greater than once, and the data included in the primary key field has an occurrence frequency greater than once, the first data table and the second data table are obtained as a one-to-many association relationship; or,

[0059] When the data included in the foreign key field does not have an occurrence frequency greater than once, and the data included in the primary key field does not have an occurrence frequency greater than once, the first data table and the second data table are obtained as a one-to-one association relationship.

[0060] Optionally, the degree of association includes at least one of the degree of coincidence and the edit similarity.

[0061] When the degree of association meets the set conditions, splicing the first data table and the second data table includes:

[0062] For any data table pair, sort the degree of coincidence and / or the edit similarity of each obtained splicing key field pair to obtain a sorting result;

[0063] According to the sorting result of the degree of coincidence and / or the sorting result of the edit similarity, obtain the splicing key field pairs corresponding to the first predetermined number of the degree of coincidence and / or the edit similarity as the target splicing key field pairs corresponding to the data table pair;

[0064] Splice the first data table and the second data table according to the target splicing key field pairs.

[0065] Optionally, when the degree of association meets the set conditions, splicing the first data table and the second data table further includes:

[0066] Obtain a set degree of coincidence threshold and / or edit similarity threshold;

[0067] For any data table pair, compare the degree of coincidence of each splicing key field pair with the degree of coincidence threshold, and / or compare the edit similarity of each splicing key field pair with the edit similarity threshold;

[0068] Use the splicing key field pairs corresponding to the degree of coincidence greater than the degree of coincidence threshold and / or the edit similarity corresponding to the edit similarity greater than the edit similarity threshold as the target splicing key field pairs corresponding to the data table pair;

[0069] Concatenate the first data table and the second data table according to the target concatenation key field pair.

[0070] Optionally, when the degree of association meets the set conditions, concatenating the first data table and the second data table further includes:

[0071] For any data table pair, delete the coincidence degrees with coincidence degrees less than or equal to the coincidence degree threshold in the sorting result of the coincidence degrees; and / or,

[0072] Delete the edit similarities with edit similarities less than or equal to the edit similarity threshold in the sorting result of the edit similarities;

[0073] Use the concatenation key field pairs corresponding to the remaining coincidence degrees after deletion, and / or use the concatenation key field pairs corresponding to the remaining edit similarities after deletion as the target concatenation key field pairs corresponding to the data table pair;

[0074] Concatenate the first data table and the second data table according to the target concatenation key field pair.

[0075] Optionally, when the degree of association meets the set conditions, concatenating the first data table and the second data table further includes:

[0076] For any data table pair, in the sorting result after deleting the coincidence degrees with coincidence degrees less than or equal to the coincidence degree threshold, and / or in the sorting result after deleting the edit similarities with edit similarities less than or equal to the edit similarity threshold, obtain the first predetermined number of concatenation key field pairs corresponding to the coincidence degrees and / or the edit similarities as the target concatenation key field pairs corresponding to the data table pair;

[0077] Concatenate the first data table and the second data table according to the target concatenation key field pair.

[0078] Optionally, the method further includes:

[0079] In response to a request for obtaining the sorting result of the coincidence degrees and / or the edit similarities, obtain the set display mode;

[0080] Display the sorting result of the coincidence degrees and / or the edit similarities according to the display mode.

[0081] Optionally, the degree of association includes at least one of a coincidence degree and an edit similarity, and the method further includes:

[0082] Provide a configuration interface for configuring the degree of association;

[0083] Obtain the configuration information input through the configuration interface; wherein, the configuration information at least includes the switch states of the coincidence degree and / or the editing similarity;

[0084] When the corresponding switch state is in the on state, display the coincidence degree and / or the editing similarity.

[0085] According to the second aspect of the present disclosure, there is also provided a device for determining the association relationship between data tables, which includes:

[0086] A first acquisition module, configured to acquire the data table pairs involved in the target data table set; wherein, the data table pairs include a first data table and a second data table;

[0087] A second acquisition module, configured to acquire the splicing key field pairs for associating the first data table and the second data table; wherein, the splicing key field pairs include the foreign key field of the first data table and the primary key field of the second data table;

[0088] A calculation module, configured to calculate the association degree of the splicing key field pairs, and determine the association relationship between the data tables according to the calculated association degree.

[0089] Optionally, the device further includes a splicing module,

[0090] The splicing module is configured to splice the first data table and the second data table when the association degree meets the set conditions.

[0091] Optionally, the first acquisition module is specifically configured to:

[0092] Obtain the attribute information of the data table set;

[0093] According to the attribute information and a preset complexity calculation function, obtain the calculation complexity of the data table set;

[0094] Compare the calculation complexity with the complexity threshold to obtain a comparison result;

[0095] When the comparison result indicates that the calculation complexity is less than or equal to the complexity threshold, execute the step of obtaining the data table pairs involved in the target data table set.

[0096] Optionally, the first acquisition module is specifically configured to:

[0097] When the comparison result indicates that the calculation complexity is greater than the complexity threshold, give a prompt that the calculation complexity is greater than the complexity threshold; or,

[0098] In the case that the comparison result indicates that the computing complexity is greater than the complexity threshold, receive an enforcement instruction; in response to the enforcement instruction, perform the step of obtaining the data table pairs involved in the target data table set; or,

[0099] In the case that the comparison result indicates that the computing complexity is greater than the complexity threshold, provide a selection interface for selecting a complexity calculation function; use the complexity calculation function selected through the selection interface as the preset complexity calculation function, and re - execute the step of obtaining the computing complexity of the data table set according to the attribute information and the preset complexity calculation function.

[0100] Optionally, the attribute information at least includes the total number of data tables in the data table set, the maximum number of attribute fields of the data tables in the data table set, and the maximum number of rows of the data tables in the data table set.

[0101] Optionally, the first obtaining module is specifically configured to:

[0102] Successively use each data table in the data table set as the first data table;

[0103] For the first data table, successively select other data tables in the data table set except the data table as the second data table to obtain the data table pair.

[0104] Optionally, the second obtaining module is specifically configured to:

[0105] Obtain the foreign key fields of the first data table and the primary key fields of the second data table;

[0106] Obtain the spliced key field pairs according to the foreign key fields of the first data table and the primary key fields of the second data table.

[0107] Optionally, the second obtaining module is specifically configured to:

[0108] Obtain one or more attribute fields involved in the first data table and the second data table specified by the user as the foreign key fields and the primary key fields; or,

[0109] In the case that the user does not specify, directly use all the attribute fields involved in the first data table and the second data table as the foreign key fields and the primary key fields.

[0110] Optionally, the second obtaining module is specifically configured to:

[0111] Select the foreign key fields of the first data table;

[0112] Select a primary key field from the second data table that has the same data field type as the foreign key field;

[0113] Combine the foreign key field and the primary key field to obtain the concatenated key field pair.

[0114] Optionally, the degree of association includes the coincidence degree, and the calculation module is specifically configured to:

[0115] Obtain a list of unique values of the foreign key field in the concatenated key field pair;

[0116] Obtain a list of unique values of the primary key field in the concatenated key field pair;

[0117] Obtain the coincidence degree of the foreign key field and the primary key field according to the list of unique values of the foreign key field and the list of unique values of the primary key field.

[0118] Optionally, the calculation module is specifically configured to:

[0119] Filter out the data that meets the set conditions in the foreign key field or the primary key field to obtain a list of unique values of the foreign key field, or a list of unique values of the primary key field.

[0120] Optionally, the set conditions include a first condition and a second condition, and the calculation module is specifically configured to:

[0121] When the data included in the foreign key field or the primary key field is a null value, filter out the null value; and / or,

[0122] When the number of occurrences of the same data included in the foreign key field or the primary key field is greater than one, retain one of the data and filter out the other data.

[0123] Optionally, the calculation module is specifically configured to:

[0124] Sample the list of unique values of the foreign key field according to a preset number of samples;

[0125] Obtain the number of data included in the list of unique values of the foreign key field after the sampling as the first number of data;

[0126] Obtain the number of data in the list of unique values of the foreign key field after the sampling that belong to the data in the list of unique values of the primary key field as the second number of data;

[0127] Obtain the coincidence degree of the foreign key field and the primary key field according to the first number of data and the second number of data.

[0128] The calculation module is specifically configured to:

[0129] Sample the list of unique values of the foreign key field according to a preset number of samples;

[0130] Obtain the number of data included in the list of unique values of the foreign key field after the sampling as the first number of data;

[0131] Obtain the number of data in the list of unique values of the foreign key field after the sampling that belong to the data in the list of unique values of the primary key field as the second number of data;

[0132] Obtain the coincidence degree of the foreign key field and the primary key field according to the first number of data and the second number of data.

[0133] Optionally, the calculation module is specifically configured to:

[0134] In the case where the preset number of samples is greater than the number of rows of the first data table, retain all the data in the list of unique values of the foreign key field; or,

[0135] In the case where the preset number of samples is less than or equal to the number of rows of the first data table, extract the number of samples of data from the list of unique values of the foreign key field.

[0136] Optionally, the association degree further includes an edit similarity, and the calculation module is specifically configured to:

[0137] Obtain the edit distance for converting the foreign key field to the primary key field, the length of the field name of the foreign key field, and the length of the field name of the primary key field;

[0138] Obtain the edit similarity according to the edit distance, the length of the field name of the foreign key field, and the length of the field name of the primary key field.

[0139] Optionally, the calculation module is specifically configured to:

[0140] Count whether there is data with an occurrence number greater than one in the foreign key field; and,

[0141] Count whether there is data with an occurrence number greater than one in the primary key field;

[0142] In the case where there is data with an occurrence number greater than one in the foreign key field and there is data with an occurrence number greater than one in the primary key field, obtain that the first data table and the second data table have a many-to-many association relationship; or,

[0143] When the foreign key field includes data that appears more than once, and the primary key field does not include data that appears more than once, the first data table and the second data table are obtained as a many-to-one association relationship; or,

[0144] When the foreign key field does not include data that appears more than once, and the primary key field includes data that appears more than once, the first data table and the second data table are obtained as a one-to-many association relationship; or,

[0145] When the foreign key field does not include data that appears more than once, and the primary key field does not include data that appears more than once, the first data table and the second data table are obtained as a one-to-one association relationship.

[0146] Optionally, the association degree includes at least one of the coincidence degree and the edit similarity degree, and the splicing module is specifically configured to:

[0147] Sort the coincidence degree and / or the edit similarity degree of each obtained splicing key field pair to obtain a sorting result;

[0148] According to the sorting result of the coincidence degree and / or the sorting result of the edit similarity degree, obtain the splicing key field pairs corresponding to the first predetermined number of the coincidence degree and / or the edit similarity degree as the target splicing key field pairs;

[0149] Splice the associated first data table and the second data table according to the target splicing key field pairs.

[0150] Optionally, the splicing module is specifically configured to:

[0151] Obtain a set coincidence degree threshold and / or an edit similarity degree threshold;

[0152] Compare the coincidence degree of each splicing key field pair with the coincidence degree threshold, and / or compare the edit similarity degree of each splicing key field pair with the edit similarity degree threshold;

[0153] Use the splicing key field pairs corresponding to the coincidence degree greater than the coincidence degree threshold and / or the edit similarity degree corresponding to the edit similarity degree greater than the edit similarity degree threshold as the target splicing key field pairs;

[0154] Splice the associated first data table and the second data table according to the target splicing key field pairs.

[0155] Optionally, the splicing module is specifically configured to:

[0156] Delete the coincidence degrees with coincidence degrees less than or equal to the coincidence degree threshold in the sorting result of the coincidence degrees; and / or,

[0157] Delete the edit similarities with edit similarities less than or equal to the edit similarity threshold in the sorting result of the edit similarities;

[0158] Use the splicing key field pairs corresponding to the retained coincidence degrees after deletion, and / or use the splicing key field pairs corresponding to the retained edit similarities after deletion as the target splicing key field pairs;

[0159] Splice the associated first data table and the second data table according to the target splicing key field pairs.

[0160] Optionally, the splicing module is specifically configured to:

[0161] In the sorting result of deleting the coincidence degrees with coincidence degrees less than or equal to the coincidence degree threshold, and / or in the sorting result of deleting the edit similarities with edit similarities less than or equal to the edit similarity threshold, obtain the first predetermined number of splicing key field pairs corresponding to the coincidence degrees and / or the edit similarities as the target splicing key field pairs;

[0162] Splice the associated first data table and the second data table according to the target splicing key field pairs.

[0163] Optionally, the device further includes a display module, and the first display module is used to:

[0164] In response to a request for obtaining the sorting result of the coincidence degrees and / or the edit similarities, obtain a set display mode;

[0165] Display the sorting result of the coincidence degrees and / or the edit similarities according to the display mode.

[0166] Optionally, the device further includes a second display module, and the second display module is used to:

[0167] Provide a configuration interface for configuring the correlation degree;

[0168] Obtain the configuration information input through the configuration interface; wherein, the configuration information at least includes the switch states of the coincidence degrees and / or the edit similarities;

[0169] When the corresponding switch state is in the on state, display the coincidence degrees and / or the edit similarities.

[0170] According to a third aspect of the present disclosure, there is also provided a device including at least one computing device and at least one storage device, wherein the at least one storage device is configured to store instructions for controlling the at least one computing device to execute the method according to the first aspect above.

[0171] According to a fourth aspect of the present disclosure, there is also provided a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the method according to the first aspect above.

[0172] One beneficial effect of the present disclosure is that, according to the technical solution of the embodiments of the present disclosure, it is possible to obtain the data table pairs involved in the target data table set, as well as the splicing key field pairs for associating the two data tables in the data table pair, and calculate the association degree of the splicing key field pairs, thereby automatically identifying the association relationship between the data tables. That is, the embodiments of the present disclosure do not rely on manual screening and analysis of the splicing keys, and can automatically identify the association relationship between the data tables, reducing a large amount of manual work and making the association of data tables more efficient and accurate. BRIEF DESCRIPTION OF THE DRAWINGS

[0173] Other features and advantages of the present invention will become clear from the following detailed description of the exemplary embodiments of the present invention with reference to the accompanying drawings.

[0174] Figure 1 is a block diagram showing an example of the hardware configuration of an electronic device that can be used to implement the embodiments of the present disclosure;

[0175] Figure 2 shows a flowchart of a method for determining the association relationship between data tables according to an embodiment of the present disclosure;

[0176] Figure 3 shows a schematic block diagram of a device for determining the association relationship between data tables according to an embodiment of the present disclosure;

[0177] Figure 4 shows a schematic block diagram of a device for determining the association relationship between data tables according to another embodiment of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS

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

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

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

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

[0182] It should be noted that like reference numerals and letters denote like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.

[0183] Next, various embodiments and examples according to embodiments of the present invention will be described with reference to the accompanying drawings.

[0184] <Hardware Configuration>

[0185] The method of the embodiments of the present disclosure can be implemented by at least one electronic device, that is, the apparatus 3000 for implementing the method can be arranged on the at least one electronic device. Figure 1 The hardware structure of an arbitrary electronic device is shown. Figure 1 The shown electronic device can be a portable computer, a desktop computer, a workstation, a server, etc., or any other device having a computing device such as a processor and a storage device such as a memory, which is not limited herein.

[0186] As Figure 1 shown, the electronic device 1000 may include a processor 1100, a memory 1200, an interface device 1300, a communication device 1400, a display device 1500, an input device 1600, a speaker 1700, a microphone 1800, and so on. Among them, the processor 1100 is used to execute a computer program. The computer program can be written in an instruction set of architectures such as x86, Arm, RISC, MIPS, SSE, etc. The memory 1200 includes, for example, a ROM (read-only memory), a RAM (random access memory), a non-volatile memory such as a hard disk, etc. The interface device 1300 includes, for example, a USB interface, a headphone interface, etc. The communication device 1400 can perform wired or wireless communication, and specifically can include Wifi communication, Bluetooth communication, 2G / 3G / 4G / 5G communication, etc. The display device 1500 is, for example, a liquid crystal display screen, a touch display screen, etc. The input device 1600 can include, for example, a touch screen, a keyboard, a body sensor input, etc. The electronic device 1000 can output voice information through the speaker 1700 and can collect voice information through the microphone 1800, etc.

[0187] Figure 1The electronic device shown is merely illustrative and in no way limits the present invention, its applications, or its use. In the embodiments applied to the present disclosure, the memory 1200 of the electronic device 1000 is used to store instructions for controlling the processor 1100 to operate to execute the method for determining the association relationship between data tables in the embodiments of the present disclosure. Those skilled in the art can design the instructions according to the solutions disclosed in the present invention. How the instructions control the processor to operate is well known in the art and will not be described in detail herein.

[0188] In one embodiment, a device including at least one computing device and at least one storage device is provided. The at least one storage device is used to store instructions for controlling the at least one computing device to execute the method according to any embodiment of the present disclosure.

[0189] The device may include at least one Figure 1 of the electronic devices 1000 shown to provide at least one computing device such as a processor and at least one storage device such as a memory, which are not limited herein.

[0190] <Method Embodiment>

[0191] In the present embodiment, a method for determining the association relationship between data tables is provided. The method for determining the association relationship between data tables may be implemented by an electronic device, and the electronic device may be the Figure 1 electronic device 1000 shown.

[0192] According to Figure 2 shown, the method for determining the association relationship between data tables in the present embodiment may include the following steps S2100 to S2300:

[0193] Step S2100, obtain the data table pairs involved in the target data table set.

[0194] The target data table set may be a set of data tables composed of the data tables that the user selects and needs to process. The target data table set may be represented as E = {t1, t2,..., t n}, where n represents the number of data tables in the data table set E, and t n represents the nth data table.

[0195] The data table pair includes a first data table and a second data table. For example, for any data table pair <t n , t i > in the data table set E = {t1, t2,..., t j}, t i is the first data table, also referred to as the left data table, and t j is the second data table, also referred to as the right data table.

[0196] In this embodiment, obtaining the data table pairs involved in the target data table set in step S2100 may further include the following steps S2110 to S2120:

[0197] Step S2110: Take each data table in the data table set as the first data table in sequence.

[0198] In this step S2110, the data table set E = {t1, t2, t3}, that is, the data table set E includes data tables t1, t2, and t3. Here, the data tables t1, t2, and t3 can be taken as the first data table in sequence.

[0199] Step S2120: For the first data table, select other data tables in the data table set except the data table as the second data table in sequence to obtain data table pairs.

[0200] Continuing with the example of step S2110 above, first take data table t1 as the first data table. At this time, select data tables t2 and t3 in the data table set E except data table t1 as the second data table in sequence to obtain data table pairs <t1, t2> and <t1, t3> with data table t1 as the first data table. Here, in the same way, data table pairs <t2, t1> and <t2, t3> with data table t2 as the first data table, and data table pairs <t3, t1> and <t3, t2> with data table t3 as the first data table can be obtained. Using this sequential acquisition method can ensure the efficiency and accuracy of the obtained data table pairs.

[0201] It can be understood that the user can also only select one main data table and only consider such ordered data table pairs <t, ti>, where t is the main data table selected by the user and ti is other data tables in the data table set except the main data table t.

[0202] Step S2200: Obtain the splicing key field pairs for associating the first data table and the second data table.

[0203] The splicing key field pair includes the foreign key field of the first data table and the primary key field of the second data table.

[0204] In this embodiment, obtaining the splicing key field pairs for associating the first data table and the second data table in step S2200 may further include the following steps S2210 to S2220:

[0205] Step S2210: Obtain the foreign key field of the first data table and the primary key field of the second data table.

[0206] In one example, the user can specify the foreign key fields of the first data table and the primary key fields of the second data table. For example, the user can specify one or more foreign key fields of the first data table and, one or more primary key fields of the second data table. Here, the electronic device 1000 can obtain one or more attribute fields involved in the first data table and the second data table specified by the user as the foreign key fields and the primary key fields, so that the selected primary key fields and foreign key fields better meet the user's needs.

[0207] In one example, it can also be that, in the case where the user does not specify, all the attribute fields involved in the first data table and the second data table are directly used as the foreign key fields and the primary key fields.

[0208] Taking the data table set E = {t1, t2} as an example, the specific contents of the data table t1 and the data table t2 are shown in Table 1 and Table 2 below. Here, by using the methods of the above step S2110 and this step S2120, the data table pair <t1, t2> with t1 as the first data table and, the data table pair <t2, t1> with t2 as the first data table can be obtained. According to this step S2210, the foreign key fields of the first data table t1 in the data table pair <t1, t2> can be index, name, level, and flag, the primary key fields of the second data table t2 can be idx, alias, and rank, and the foreign key fields of the first data table t2 in the obtained data table pair <t2, t1> can be idx, alias, and rank, and the primary key fields of the second data table t1 can be index, name, level, and flag. The data table t1 and the data table t2 are shown in Table 1 and Table 2 below:

[0209] Table 1: Data table t1

[0210] index name level flag 0 Mike None 1 1 Peter a 1 2 Mary b 1 3 Steve None 1 4 John Doe a 1

[0211] Table 2: Data table t2

[0212] idx alias rank 3 Mike c 1 Peter a 2 Mary b 7 Steve None 5 John Doe a 10 Steve d

[0213] Step S2220: Obtain a spliced key field pair according to the foreign key fields of the first data table and the primary key fields of the second data table.

[0214] In this step S2220, obtaining a spliced key field pair according to the foreign key fields of the first data table and the primary key fields of the second data table can further include: selecting the foreign key fields of the first data table; selecting the primary key fields with the same data field type as the foreign key fields from the second data table; combining the foreign key fields and the primary key fields to obtain a spliced key field pair.

[0215] It can be understood that in data table t1, the fields index and flag are of integer type, and the fields name and level are of character type. In data table t2, the field idx is of integer type, and the fields alias and rank are of character type.

[0216] Continuing with the example of step S2210 above, for the data table pair <t1, t2>, the foreign key field index of the first data table t1 in the data table pair <t1, t2> is selected. Since this foreign key field index is of integer type, here, the primary key field of integer type in the second data table t2 is selected as idx, and the foreign key field index and the primary key field idx are combined to obtain the concatenated key field pair <index, idx>. Here, the concatenated key field pairs <name, alias>, <name, rank>, <level, alias>, <level, rank>, <flag, idx> can be obtained in the same way.

[0217] Similarly, for the data table pair <t2, t1>, the foreign key field idx of the first data table t2 in the data table pair <t2, t1> is selected. Since this foreign key field idx is of integer type, here, the primary key fields of integer type in the second data table t1 are selected as index and flag, and the foreign key field idx is combined with the primary key fields index and flag respectively to obtain the concatenated key field pairs <idx, index> and <idx, flag>. Here, the concatenated key field pairs <alias, name>, <alias, level>, <rank, name>, <rank, level> can be obtained in the same way.

[0218] Step S2300, calculate the correlation degree of the concatenated key field pairs, and determine the association relationship between the data tables according to the calculated correlation degree.

[0219] In an example, the correlation degree includes the coincidence degree. Calculating the correlation degree of the concatenated key field pairs in this step S2300 can further include the following steps S2310a to S2330a:

[0220] Step S2310a, obtain the unique value list of the foreign key field in the concatenated key field pair.

[0221] Step S2320a, obtain the unique value list of the primary key field in the concatenated key field pair.

[0222] The above step S2310a and this step S2320a can further include: filtering out the data that meets the set conditions in the foreign key field or the primary key field to obtain the unique value list of the foreign key field, or the unique value list of the primary key field.

[0223] The set conditions may include a first condition and a second condition. Here, obtaining a list of unique values based on the set of fields obtained after filtering can not only improve the processing speed, reduce data redundancy, but also improve the accuracy of the obtained list of unique values.

[0224] The above first condition may include: the data included in the foreign key field or the primary key field is a null value. Then, filtering the data that meets the set conditions in the foreign key field or the primary key field includes: when the data included in the foreign key field or the primary key field is a null value, filtering out the null value.

[0225] The above second condition may include: the number of occurrences of the same data included in the foreign key field or the primary key field is greater than one. Then, filtering the data that meets the set conditions in the foreign key field or the primary key field includes: when the number of occurrences of the same data included in the foreign key field or the primary key field is greater than one, retaining one of the data and filtering out the others.

[0226] In this embodiment, as long as a field meets any of the first condition and the second condition, it is filtered out.

[0227] Exemplarily, for the foreign key field level in the concatenated key field pair <level, rank>, the null value None is removed. At the same time, since the number of occurrences of the data a is greater than one, any one of them is filtered out and the other is retained, obtaining the list of unique values [a, b] for the foreign key field level. And, for the primary key field rank in the concatenated key field pair <level, rank>, the null value None is removed. At the same time, since the number of occurrences of the data a is greater than one, any one of them is filtered out and the other is retained, obtaining the list of unique values [a, b, c, d] for the foreign key field level.

[0228] Step S2330a, obtain the coincidence degree of the foreign key field and the primary key field according to the list of unique values of the foreign key field and the list of unique values of the primary key field.

[0229] In this step S2330a, obtaining the coincidence degree of the foreign key field and the primary key field according to the list of unique values of the foreign key field and the list of unique values of the primary key field may further include the following steps S2331 to S2334:

[0230] Step S2331, sample the list of unique values of the foreign key field according to the preset number of samples.

[0231] The preset number of samples may be a value set according to the specific application scenario and specific application requirements. For example, the preset number of samples may be 100, or it may be other values, which are not limited in this embodiment.

[0232] For example, when the preset number of samples is greater than the number of rows in the first data table, all data in the unique value list of the foreign key field is retained.

[0233] Exemplarily, for the concatenated key field pair <level, rank>, the number of rows in the corresponding first data table t1 is 6, which is less than the number of samples 100. Here, all data in the unique value list [a, b] of the foreign key field level can be retained.

[0234] For example, when the preset number of samples is less than or equal to the number of rows in the first data table, the number of samples of data is drawn from the unique value list of the foreign key field.

[0235] Step S2332: Obtain the number of data included in the unique value list of the foreign key field after sampling as the first number of data.

[0236] Continuing the example of step S2331 above, for the concatenated key field pair <level, rank>, after sampling, the unique value list of the foreign key field level is [a, b], and the number of this data is 2. To distinguish the data in this step S2332 from the data in the subsequent step S2333, here, the number of this data 2 is called the first number of data.

[0237] Step S2333: Obtain the number of data in the unique value list of the foreign key field after sampling that belongs to the data in the unique value list of the primary key field as the second number of data.

[0238] Continuing the example of step S2332 above, for the concatenated key field pair <level, rank>, since the unique value list of the primary key field rank is [a, b, c, d], here, since the unique value list of the foreign key field level after sampling is [a, b], the two data a and b in this unique value list are both in the unique value list of the primary key field rank. Here, the second number of data is 2.

[0239] Step S2334: Obtain the coincidence degree of the foreign key field and the primary key field according to the first number of data and the second number of data.

[0240] In this step S2334, the calculation formula for the coincidence degree C is as follows:

[0241]

[0242] Wherein, L1 represents the first number of data, and L2 represents the second number of data.

[0243] Continuing with the example of step S2334 above, if the number of first data L1 = 2 and the number of second data L2 = 2, then for the foreign key field level and the primary key field rank of the join key field pair <level,rank>, the coincidence degree C = 2 / 2 = 1. Here, the same method can be used to obtain that for the join key field pair <index,idx>, the coincidence degree C of the foreign key field index and the primary key field idx is 0.6; for the join key field pair <name,alias>, the coincidence degree C of the foreign key field name and the primary key field alias is 1; for the join key field pair <name,rank>, the coincidence degree C of the foreign key field name and the primary key field rank is 0; for the join key field pair <level,alias>, the coincidence degree C of the foreign key field level and the primary key field alias is 0; for the join key field pair <level,rank>, the coincidence degree C of the foreign key field level and the primary key field alias is 1; for the join key field pair <flag,idx>, the coincidence degree C of the foreign key field flag and the primary key field idx is 1; for the join key field pair <idx,index>, the coincidence degree C of the foreign key field idx and the primary key field index is 0.5; for the join key field pair <idx,flag>, the coincidence degree C of the foreign key field idx and the primary key field flag is 0.166667; for the join key field pair <alias,name>, the coincidence degree C of the foreign key field alias and the primary key field name is 1; for the join key field pair <alias,level>, the coincidence degree C of the foreign key field alias and the primary key field level is 0; for the join key field pair <rank,name>, the coincidence degree C of the foreign key field rank and the primary key field name is 0; for the join key field pair <rank,level>, the coincidence degree C of the foreign key field rank and the primary key field level is 0.5.

[0244] In one example, the association degree includes edit similarity. Calculating the association degree of the join key field pair in this step S2300 may further include the following steps S2310b to S2320b:

[0245] Step S2310b: Obtain the edit distance for converting the foreign key field into the primary key field, the length of the field name of the foreign key field, and the length of the field name of the primary key field.

[0246] The above edit distance is the minimum number of operations required to convert one string into another. For example, to convert the string abc into the string acb, at least 2 operations are required. The first operation is to change b in abc to c, and the second operation is to change c in abc to b.

[0247] Exemplarily, for the concatenated key field pair <level, rank>, the field name of its foreign key field is level, and the field name of its primary key field is rank. It can be known that the edit distance d = 5.

[0248] Step S2320b: Obtain the edit similarity according to the edit distance, the length of the field name of the foreign key field, and the length of the field name of the primary key field.

[0249] In this step S2320b, the edit similarity sim can be calculated using the following formula:

[0250]

[0251] where d represents the edit distance, s represents the length of the field name of the foreign key field in the concatenated key field pair, t represents the length of the field name of the primary key field in the concatenated key field pair, and max(s, t) represents taking the maximum value of s and t.

[0252] Continuing with the example of step S2320b above, for the concatenated key field pair <level, rank>, the edit distance d is 5, the length s of the field name of the foreign key field level is 5, the length t of the field name of the primary key field rank is 4, then max(s, t) is 5. Then, the edit similarity for the concatenated key field pair <level, rank> is

[0253] It can be understood that other similarity calculation methods can also be used, such as Jaccard similarity.

[0254] In one example, the correlation degree can also include whether there is data with an occurrence frequency greater than once in the foreign key field and the primary key field.

[0255] For example, it can be to count whether there is data with an occurrence frequency greater than once in the foreign key field and whether there is data with an occurrence frequency greater than once in the primary key field.

[0256] Specifically, in the case where there is data with an occurrence frequency greater than once in the foreign key field and there is data with an occurrence frequency greater than once in the primary key field, it is obtained that the first data table and the second data table have a many-to-many association relationship; or,

[0257] In the case where there is data with an occurrence frequency greater than once in the foreign key field and there is no data with an occurrence frequency greater than once in the primary key field, it is obtained that the first data table and the second data table have a many-to-one association relationship; or,

[0258] When the data with the number of occurrences greater than one is not included in the foreign key field, and the data with the number of occurrences greater than one is included in the primary key field, a one-to-many association relationship between the first data table and the second data table is obtained; or,

[0259] When the data with the number of occurrences greater than one is not included in the foreign key field, and the data with the number of occurrences greater than one is not included in the primary key field, a one-to-one association relationship between the first data table and the second data table is obtained.

[0260] According to the method of the embodiments of the present disclosure, it can obtain the data table pairs involved in the target data table set, as well as the splicing key field pairs for associating the two data tables in the data table pairs, and calculate the association degree of the splicing key field pairs, thereby automatically identifying the association relationship between the data tables. That is, the embodiments of the present disclosure do not rely on manual screening and analysis of the splicing keys, automatically identify the association relationship between the data tables, reduce a large amount of manual work, and make the association of the data tables more efficient and accurate.

[0261] In one embodiment, before performing the step S2100 of obtaining the data table pairs involved in the target data table set, the following steps S2010 to S2040 are further included:

[0262] Step S2010, obtaining the attribute information of the data table set.

[0263] The attribute information of the data table set at least includes the total number of data tables in the data table set, the maximum number of attribute fields of the data tables in the data table set, and the maximum number of rows of the data tables in the data table set.

[0264] Step S2020, obtaining the calculation complexity of the data table set according to the attribute information and a preset complexity calculation function.

[0265] The calculation complexity in this step S2020 can be calculated using the following formula:

[0266] ceil(log 10 (n tables 2 ×max_n_col 2 ×max_n_row)) (3)

[0267] Where n tables represents the total number of data tables in the data table set, max_n_col represents the maximum number of attribute fields of the data tables in the data table set, max_n_row represents the maximum number of rows of the data tables in the data table set, log 10 represents the logarithmic function with base 10, and ceil is the ceiling function.

[0268] Step S2030: Compare the computational complexity with the complexity threshold to obtain a comparison result.

[0269] The complexity threshold can be a value set according to specific application scenarios and specific application requirements, and this embodiment does not limit it here.

[0270] Step S2040: When the comparison result indicates that the computational complexity is less than or equal to the complexity threshold, perform the step of obtaining the data table pairs involved in the target data table set.

[0271] According to this embodiment, before obtaining the data table pairs in the target data table set, it first estimates the computational complexity of the target data table set, then compares the computational complexity with a preset complexity threshold. If the estimated computational complexity value is less than or equal to the threshold, it continues with the subsequent steps, which can avoid resource waste.

[0272] In this embodiment, when the comparison result indicates that the computational complexity is greater than the complexity threshold, it also gives a prompt that the computational complexity is greater than the complexity threshold; or,

[0273] When the comparison result indicates that the computational complexity is greater than the complexity threshold, receive an enforcement instruction; in response to the enforcement instruction, perform the step of obtaining the data table pairs involved in the target data table set; or,

[0274] When the comparison result indicates that the computational complexity is greater than the complexity threshold, provide a selection interface for selecting a complexity calculation function; use the complexity calculation function selected through the selection interface as the preset complexity calculation function, and re - execute the step of obtaining the computational complexity of the target data table set according to the attribute information and the preset complexity calculation function.

[0275] As can be seen above, when the computational complexity is greater than the complexity threshold, it will prompt the user that the current computational complexity is relatively high and provide relevant suggestions for reducing the computational complexity. At the same time, the user can also choose to enforce it, or can adopt other formulas or models for estimating the computational complexity.

[0276] In one embodiment, since the correlation degree can include the coincidence degree and the edit similarity, after calculating the correlation degree of the splicing key pairs according to the above step S2300, it further includes step S2400: when the correlation degree meets the set conditions, splice the first data table and the second data table. Table 3 shows the relevant information of the target data table set E = {t1, t2} obtained according to the above embodiment:

[0277] Table 3: Relevant Information of Target Data Table Set E = {t1, t2}

[0278]

[0279] Among them, in the above Table 3, left_table represents the left data table, that is, the first data table; right_table represents the right data table, that is, the second data table; left_key represents the left key, that is, the foreign key of the first data table; right_key represents the right key, that is, the primary key of the second data table; left_est_join_rto represents the coincidence degree; Relation represents the table association relationship, 1:N represents the association relationship is one-to-many, N:N represents the association relationship is many-to-many, N:1 represents the association relationship is many-to-one, 1:1 represents the association relationship is one-to-one; left_is_primary represents whether the left key is a unique value, that is, whether the foreign key of the first data table is a unique value, 1 represents a unique value, 0 represents not a unique value; right_is_primary represents whether the right key is a unique value, that is, whether the left key of the second data table is a unique value, 1 represents a unique value, 0 represents not a unique value. Here, the table association relationship can be determined according to the values of left_is_primary and right_is_primary. For example, in the first row of Table 3, the value of left_is_primary corresponding to the foreign key index of the first data table t1 is 1, and the value of right_is_primary corresponding to the primary key idx of the second data table t2 is 1, then the corresponding table relationship type is one-to-one.

[0280] In one example, in this step S2400, when the association degree meets the set conditions, splicing the first data table and the second data table may include the following steps S2410a to S2430a:

[0281] Step S2410a, for any data table pair, sort the coincidence degree and / or edit similarity of each obtained splicing key field pair to obtain a sorting result.

[0282] In this step S2410a, for example, for the data table pairs <t1, t2> and <t2, t1> respectively, sort the coincidence degree (left_est_join_rot) of each obtained splicing key field pair in descending order, and the obtained sorting result is shown in Table 4:

[0283] Table 4: Sorted relevant information of the target data table set E = {t1, t2}

[0284]

[0285]

[0286] Step S2420a, according to the sorting result of the coincidence degree and / or the sorting result of the edit similarity, obtain the splicing key field pairs corresponding to the top predetermined number of coincidence degrees and / or edit similarities as the target splicing key field pairs corresponding to the data table pairs.

[0287] In this step S2420a, for the data table pair <t1, t2> and the data table pair <t2, t1>, the splicing key field pairs corresponding to the top 3 coincidence degrees can be respectively selected as the target splicing key field pairs. For example, in Table 5, the target splicing key field pairs for the data table pair <t1, t2> are <name, alias>, <level, rank> and <flag, idx>, and the target splicing key field pairs for the data table pair <t2, t1> are <alias, name>, <idx, index> and <rank, level>, as shown in Table 5:

[0288] Table 5: Target splicing key field pairs of the target data table set E = {t1, t2}

[0289]

[0290] Step S2430a, splice the first data table and the second data table according to the target splicing key field pairs.

[0291] Continuing with the example of the above step S2420a, for example, the data tables t1 and t2 can be left-joined according to <name, alias> or <level, rank> or <flag, idx>, and the data tables t1 and t2 can be left-joined according to <alias, name>, <idx, index> and <rank, level>.

[0292] In an example, in this step S2400, when the association degree meets the set conditions, splicing the first data table and the second data table may include the following steps S2410b to S2440b:

[0293] Step S2410b, obtain the set coincidence degree threshold and / or edit similarity threshold.

[0294] The coincidence degree threshold and the edit similarity threshold can be set according to the specific application scenario and specific application requirements. For example, both the coincidence degree threshold and the edit similarity threshold can be 0.7.

[0295] Step S2420b, for any data table pair, compare the coincidence degree of each splicing key field pair with the coincidence degree threshold, and / or compare the edit similarity of each splicing key field pair with the edit similarity threshold.

[0296] Step S2430b, use the pair of splicing key fields corresponding to the coincidence degree greater than the coincidence degree threshold, and / or use the pair of splicing key fields corresponding to the editing similarity greater than the editing similarity threshold as the target pair of splicing key fields corresponding to the data table pair.

[0297] Step S2440b, splice the first data table and the second data table according to the target pair of splicing key fields.

[0298] In one example, when the correlation degree meets the set conditions in this step S2400, splicing the first data table and the second data table may include the following steps S2410c to S2440c:

[0299] Step S2410c, for any pair of data tables, delete the coincidence degrees with coincidence degrees less than or equal to the coincidence degree threshold in the sorting result of the coincidence degrees.

[0300] Step S2420c, delete the editing similarities with editing similarities less than or equal to the editing similarity threshold in the sorting result of the editing similarities.

[0301] Step S2430c, use the pair of splicing key fields corresponding to the remaining coincidence degrees after deletion, and / or use the pair of splicing key fields corresponding to the remaining editing similarities after deletion as the target pair of splicing key fields corresponding to the data table pair.

[0302] Step S2440c, splice the first data table and the second data table according to the target pair of splicing key fields.

[0303] In one example, when the correlation degree meets the set conditions in this step S2400, splicing the first data table and the second data table may include the following steps S2410d to S2420d:

[0304] Step S2410d, for any pair of data tables, obtain the first predetermined number of pairs of splicing key fields corresponding to the coincidence degrees and / or editing similarities in the sorting result after deleting the coincidence degrees with coincidence degrees less than or equal to the coincidence degree threshold, and / or in the sorting result after deleting the editing similarities with editing similarities less than or equal to the editing similarity threshold as the target pair of splicing key fields.

[0305] For example, if the coincidence degree threshold is 0.7 and the predetermined number is 2, then candidate field pairs with a coincidence degree lower than the coincidence degree threshold of 0.7 are excluded from the sorting result, and the 2 field pairs with the highest coincidence degree and edit similarity among all candidate field pairs of each data table pair are selected. The target stitching key field pairs for the data table pair <t1, t2> in Table 6 are <name, alias> and <level, rank>, and, the target stitching key field pairs for the data table pair <t2, t1> are <alias, name>. The following Table 6 can be obtained:

[0306] Table 6: Target stitching key field pairs of the target data table set E = {t1, t2}

[0307]

[0308] Step S2420d, stitch the first data table and the second data table according to the target stitching key field pairs.

[0309] Continuing with the example of step S2420a above, for example, the data tables t1 and t2 can be left-stitched according to <name, alias> or <level, rank>, and, the data tables t1 and t2 can be left-stitched according to <alias, name>.

[0310] In one embodiment, the method for determining the association relationship between data tables in the present disclosure may further include: in response to a request for obtaining the sorting result of the coincidence degree and / or edit similarity, obtaining a set display mode; displaying the sorting result of the coincidence degree and / or edit similarity according to the display mode.

[0311] The display mode may be in the form of a chart.

[0312] In this embodiment, it may display the sorting result of the coincidence degree and / or edit similarity according to the set display mode in response to the request for obtaining the sorting result of the coincidence degree and / or edit similarity, so that the display output has more friendly visibility.

[0313] In one embodiment, the method for determining the association relationship between data tables in the present disclosure may further include the following steps S3100 to S3300:

[0314] Step S3100, provide a configuration interface for configuring the association degree.

[0315] Step S3200, obtain the configuration information input through the configuration interface.

[0316] The configuration information includes at least the switch states of the coincidence degree and / or edit similarity.

[0317] Step S3300, when the corresponding switch state is the on state, display the coincidence degree and / or edit the similarity degree.

[0318] According to the embodiments of the present disclosure, the user can manually select the display items. For example, as shown in Tables 3, 4, 5, and 6, the edit similarity degree is not displayed. Of course, the coincidence degree can also not be displayed, or other items can not be displayed. This embodiment does not make any limitation here.

[0319] <Device Embodiment>

[0320] In this embodiment, a device 3000 for determining the association relationship between data tables is provided, as Figure 3 shown, including a first acquisition module 3100, a second acquisition module 3200, and a calculation module 3300.

[0321] The first acquisition module 3100 is configured to acquire the data table pairs involved in the target data table set; wherein, the data table pairs include a first data table and a second data table.

[0322] The second acquisition module 3200 is configured to acquire the splicing key field pairs associating the first data table and the second data table; wherein, the splicing key field pairs include the foreign key field of the first data table and the primary key field of the second data table.

[0323] The calculation module 3300 is configured to calculate the association degree of the splicing key field pairs, and determine the association relationship between the data tables according to the calculated association degree.

[0324] In one embodiment, as Figure 4 shown, the device 3000 further includes a splicing module 3400.

[0325] The splicing module 3400 is configured to splice the first data table and the second data table when the association degree meets the set conditions.

[0326] In one embodiment, the first acquisition module 3100 is specifically configured to:

[0327] Acquire the attribute information of the data table set;

[0328] According to the attribute information and a preset complexity calculation function, acquire the calculation complexity of the data table set;

[0329] Compare the calculation complexity with the complexity threshold to obtain a comparison result;

[0330] When the comparison result indicates that the calculation complexity is less than or equal to the complexity threshold, execute the step of acquiring the data table pairs involved in the target data table set.

[0331] In one embodiment, the first acquisition module 3100 is specifically configured to:

[0332] In the case that the comparison result indicates that the computational complexity is greater than the complexity threshold, give a prompt that the computational complexity is greater than the complexity threshold; or,

[0333] In the case that the comparison result indicates that the computational complexity is greater than the complexity threshold, receive an enforcement instruction; in response to the enforcement instruction, perform the step of obtaining the data table pairs involved in the target data table set; or,

[0334] In the case that the comparison result indicates that the computational complexity is greater than the complexity threshold, provide a selection interface for selecting a complexity calculation function; use the complexity calculation function selected through the selection interface as the preset complexity calculation function, and re - execute the step of obtaining the computational complexity of the data table set according to the attribute information and the preset complexity calculation function.

[0335] In one embodiment, the attribute information at least includes the total number of data tables in the data table set, the maximum number of attribute fields of the data tables in the data table set, and the maximum number of rows of the data tables in the data table set.

[0336] In one embodiment, the first acquisition module 3100 is specifically configured to:

[0337] Successively use each data table in the data table set as the first data table;

[0338] For the first data table, successively select other data tables in the data table set except the data table as the second data table to obtain the data table pairs.

[0339] In one embodiment, the second acquisition module 3100 is specifically configured to:

[0340] Obtain the foreign key fields of the first data table and the primary key fields of the second data table;

[0341] Obtain the spliced key field pairs according to the foreign key fields of the first data table and the primary key fields of the second data table.

[0342] In one embodiment, the second acquisition module 3200 is specifically configured to:

[0343] Obtain one or more attribute fields involved in the specified first data table and second data table by the user as the foreign key fields and the primary key fields; or,

[0344] In the case where the user does not specify, all the attribute fields involved in the first data table and the second data table are directly used as the foreign key fields and the primary key fields.

[0345] In one embodiment, the second acquisition module 3200 is specifically configured to:

[0346] Select the foreign key fields of the first data table;

[0347] Select the primary key fields having the same data field type as the foreign key fields from the second data table;

[0348] Combine the foreign key fields and the primary key fields to obtain the spliced key field pairs.

[0349] In one embodiment, the correlation degree includes the coincidence degree, and the calculation module 3300 is specifically configured to:

[0350] Obtain the unique value list of the foreign key fields in the spliced key field pairs;

[0351] Obtain the unique value list of the primary key fields in the spliced key field pairs;

[0352] Obtain the coincidence degree of the foreign key fields and the primary key fields according to the unique value list of the foreign key fields and the unique value list of the primary key fields.

[0353] In one embodiment, the calculation module 3300 is specifically configured to:

[0354] Filter out the data in the foreign key fields or the primary key fields that meet the set conditions to obtain the unique value list of the foreign key fields, or the unique value list of the primary key fields.

[0355] In one embodiment, the set conditions include a first condition and a second condition, and the calculation module 3300 is specifically configured to:

[0356] When the data included in the foreign key fields or the primary key fields is a null value, filter out the null value; and / or,

[0357] When the number of occurrences of the same data in the foreign key fields or the primary key fields is greater than one, retain one of the data and filter out the other data.

[0358] In one embodiment, the calculation module 3300 is specifically configured to:

[0359] Sample the unique value list of the foreign key fields according to the preset number of samples;

[0360] Obtain the number of data included in the unique value list of the foreign key fields after the sampling as the first number of data;

[0361] Obtain the number of data in the unique value list of the foreign key field that belong to the unique value list of the primary key field after the sampling as the second data number;

[0362] Obtain the coincidence degree of the foreign key field and the primary key field according to the first data number and the second data number.

[0363] In one embodiment, the calculation module 3300 is specifically configured to:

[0364] In the case that the preset sampling number is greater than the number of rows of the first data table, retain all data in the unique value list of the foreign key field; or,

[0365] In the case that the preset sampling number is less than or equal to the number of rows of the first data table, extract the sampling number of data from the unique value list of the foreign key field.

[0366] In one embodiment, the association degree further includes an edit similarity, and the calculation module 3300 is specifically configured to:

[0367] Obtain the edit distance for converting the foreign key field into the primary key field, the length of the field name of the foreign key field, and the length of the field name of the primary key field;

[0368] Obtain the edit similarity according to the edit distance, the length of the field name of the foreign key field, and the length of the field name of the primary key field.

[0369] In one embodiment, the calculation module 3300 is specifically configured to:

[0370] In the case that the foreign key field includes data with the number of occurrences greater than once, and the primary key field includes data with the number of occurrences greater than once, obtain that the first data table and the second data table have a many-to-many association relationship; or,

[0371] In the case that the foreign key field includes data with the number of occurrences greater than once, and the primary key field does not include data with the number of occurrences greater than once, obtain that the first data table and the second data table have a many-to-one association relationship; or,

[0372] In the case that the foreign key field does not include data with the number of occurrences greater than once, and the primary key field includes data with the number of occurrences greater than once, obtain that the first data table and the second data table have a one-to-many association relationship; or,

[0373] When the data with the number of occurrences greater than one is not included in the foreign key field, and the data with the number of occurrences greater than one is not included in the primary key field, the first data table and the second data table are obtained as a one-to-one association relationship.

[0374] In one embodiment, the association degree includes at least one of the coincidence degree and the edit similarity. The splicing module 3400 is specifically configured to:

[0375] For any one of the data table pairs, sort the coincidence degree and / or the edit similarity of each obtained splicing key field pair to obtain a sorting result;

[0376] According to the sorting result of the coincidence degree and / or the sorting result of the edit similarity, obtain the splicing key field pairs corresponding to the top predetermined number of the coincidence degree and / or the edit similarity as the target splicing key field pairs corresponding to the data table pair;

[0377] Splice the first data table and the second data table according to the target splicing key field pairs.

[0378] In one embodiment, the splicing module 3400 is specifically configured to:

[0379] Obtain a set coincidence degree threshold and / or edit similarity threshold;

[0380] For any one of the data table pairs, compare the coincidence degree of each splicing key field pair with the coincidence degree threshold, and / or compare the edit similarity of each splicing key field pair with the edit similarity threshold;

[0381] Take the splicing key field pairs corresponding to the coincidence degree greater than the coincidence degree threshold and / or the splicing key field pairs corresponding to the edit similarity greater than the edit similarity threshold as the target splicing key field pairs corresponding to the data table pair;

[0382] Splice the first data table and the second data table according to the target splicing key field pairs.

[0383] In one embodiment, the splicing module 3400 is specifically configured to:

[0384] For any one of the data table pairs, delete the coincidence degree with the coincidence degree less than or equal to the coincidence degree threshold in the sorting result of the coincidence degree; and / or,

[0385] Delete the edit similarity with the edit similarity less than or equal to the edit similarity threshold in the sorting result of the edit similarity;

[0386] Use the pair of splicing key fields corresponding to the coincidence degree retained after deletion, and / or the pair of splicing key fields corresponding to the edit similarity retained after deletion, as the target pair of splicing key fields corresponding to the data table pair;

[0387] Splice the first data table and the second data table according to the target pair of splicing key fields.

[0388] In one embodiment, the splicing module 3400 is specifically configured to:

[0389] For any one of the data table pairs, in the sorting result of the coincidence degree where the coincidence degree is less than or equal to the coincidence degree threshold, and / or in the sorting result of the edit similarity where the edit similarity is less than or equal to the edit similarity threshold, obtain the first predetermined number of pairs of splicing key fields corresponding to the coincidence degree and / or the edit similarity, as the target pair of splicing key fields corresponding to the data table pair;

[0390] Splice the first data table and the second data table according to the target pair of splicing key fields.

[0391] In one embodiment, the apparatus 3000 further includes a first display module (not shown in the figure), and the first display module is configured to:

[0392] In response to a request for obtaining the sorting result of the coincidence degree and / or the edit similarity, obtain a set display mode;

[0393] Display the sorting result of the coincidence degree and / or the edit similarity according to the display mode.

[0394] In one embodiment, the apparatus 3000 further includes a second display module, and the second display module is configured to:

[0395] Provide a configuration interface for configuring the correlation degree;

[0396] Obtain configuration information input through the configuration interface; wherein, the configuration information at least includes the switch states of the coincidence degree and / or the edit similarity;

[0397] When the corresponding switch state is in the on state, display the coincidence degree and / or the edit similarity.

[0398] <Embodiment of the storage medium>

[0399] This embodiment provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the method according to any one of the above method embodiments.

[0400] The present invention may be an apparatus, a method, and / or a computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions thereon for causing a processor to implement aspects of the present invention.

[0401] A computer-readable storage medium may be a tangible device that can retain and store instructions for use by an instruction execution device. A computer-readable storage medium may be, for example—but not limited to—an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as a punch card or raised structures in a groove having instructions stored thereon, and any suitable combination of the foregoing. The computer-readable storage medium as used herein is not to be construed as a transitory signal per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through an optical fiber cable), or electrical signals transmitted through a wire.

[0402] The computer-readable program instructions described herein may be downloaded to respective computing / processing devices from a computer-readable storage medium or may be downloaded to an external computer or external storage device through a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network may include copper transmission cables, optical fiber transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in each computing / processing device.

[0403] The computer program instructions for carrying out the operations of the present invention may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state-setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or it may be connected to an external computer (e.g., through the Internet using an Internet service provider). In some embodiments, by using the state information of the computer-readable program instructions to customize an electronic circuit, such as a programmable logic circuit, a field-programmable gate array (FPGA), or a programmable logic array (PLA), the electronic circuit can execute the computer-readable program instructions to implement various aspects of the present invention.

[0404] Aspects of the present invention are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.

[0405] These computer-readable program instructions may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, when executed by the processor of the computer or other programmable data processing apparatus, create a means for implementing the functions / acts specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions may also be stored in a computer-readable storage medium, which instructions cause a computer, a programmable data processing apparatus, and / or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises a manufacture including instructions for implementing various aspects of the functions / acts specified in one or more blocks of the flowchart and / or block diagram.

[0406] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device, causing a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process such that the instructions executed on the computer, other programmable data processing apparatus, or other device implement the functions / acts specified in one or more boxes of the flowchart and / or block diagram.

[0407] The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, a segment of code, or a portion of an instruction, which contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions noted in the blocks may occur out of the order noted in the figures. For example, two consecutive blocks may in fact be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block of the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented by a dedicated hardware-based system that performs the specified functions or acts, or by a combination of dedicated hardware and computer instructions. As is well known to those skilled in the art, implementation by hardware, implementation by software, and implementation by a combination of software and hardware are equivalent.

[0408] The embodiments of the present invention have been described above. The above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The choice of terms used herein is intended to best explain the principles of the embodiments, the practical application, or improvements made to the technology in the market, or to enable other ordinary skilled persons in the art to understand the embodiments disclosed herein. The scope of the present invention is defined by the appended claims.

Claims

1. A method for determining the association relationship between data tables, comprising: Obtaining the data table pairs involved in the target data table set; wherein, the data table pairs include a first data table and a second data table; Obtaining the splicing key field pairs for associating the first data table and the second data table; wherein, the splicing key field pairs include the foreign key field of the first data table and the primary key field of the second data table, and the foreign key field and the primary key field in the same splicing key field pair have the same data field type; Calculating the association degree of the splicing key field pairs, and determining the association relationship between the data tables according to the calculated association degree; wherein, the association degree includes at least one of the coincidence degree and the edit similarity, the association degree includes the coincidence degree, and calculating the association degree of the splicing key field pairs includes: obtaining the unique value list of the foreign key field in the splicing key field pair; obtaining the unique value list of the primary key field in the splicing key field pair; obtaining the coincidence degree of the foreign key field and the primary key field according to the unique value list of the foreign key field and the unique value list of the primary key field; the obtaining the unique value list of the foreign key field, or, obtaining the unique value list of the primary key field, includes: filtering the data in the foreign key field or the primary key field that meets the set conditions to obtain the unique value list of the foreign key field, or, the unique value list of the primary key field; When the association degree meets the set conditions, splicing the first data table and the second data table.

2. The method according to claim 1, wherein The method further includes: Obtaining the attribute information of the target data table set; Obtaining the calculation complexity of the target data table set according to the attribute information and a preset complexity calculation function; Comparing the calculation complexity with a complexity threshold to obtain a comparison result; When the comparison result indicates that the calculation complexity is less than or equal to the complexity threshold, performing the step of obtaining the data table pairs involved in the target data table set.

3. The method according to claim 2, wherein, The method further includes: When the comparison result indicates that the calculation complexity is greater than the complexity threshold, giving a prompt that the calculation complexity is greater than the complexity threshold; or, When the comparison result indicates that the calculation complexity is greater than the complexity threshold, receiving a forced execution instruction; in response to the forced execution instruction, performing the step of obtaining the data table pairs involved in the target data table set; or, When the comparison result indicates that the calculation complexity is greater than the complexity threshold, providing a selection interface for selecting a complexity calculation function; using the complexity calculation function selected through the selection interface as the preset complexity calculation function, and re-performing the step of obtaining the calculation complexity of the target data table set according to the attribute information and the preset complexity calculation function.

4. According to the method described in claim 2, wherein, The attribute information at least includes the total number of data tables in the target data table set, the maximum number of attribute fields of the data tables in the target data table set, and the maximum number of rows of the data tables in the target data table set.

5. The method according to claim 1, wherein The obtaining of the data table pairs involved in the target data table set includes: Successively taking each data table in the target data table set as the first data table; For the first data table, successively selecting other data tables in the target data table set except the first data table as the second data table to obtain the data table pair.

6. The method according to claim 1, wherein The obtaining of the splicing key field pairs for associating the first data table and the second data table includes: Obtaining the foreign key fields of the first data table and the primary key fields of the second data table; Obtaining the splicing key field pairs according to the foreign key fields of the first data table and the primary key fields of the second data table.

7. The method according to claim 6, wherein, The obtaining of the foreign key fields of the first data table and the primary key fields of the second data table includes: Obtaining one or more attribute fields involved in the first data table and the second data table specified by the user as the foreign key fields and the primary key fields; or, In the case where the user does not specify, directly taking all the attribute fields involved in the first data table and the second data table as the foreign key fields and the primary key fields.

8. The method according to claim 6, wherein, The obtaining of the splicing key field pairs according to the foreign key fields of the first data table and the primary key fields of the second data table includes: Selecting the foreign key fields of the first data table; Selecting the primary key fields with the same data field type as the foreign key fields from the second data table; Combining the foreign key fields and the primary key fields to obtain the splicing key field pairs.

9. The method according to claim 1, wherein The set conditions include a first condition and a second condition. Filtering the data in the foreign key fields or the primary key fields that meet the set conditions includes: When the value included in the foreign key fields or the primary key fields is a null value, filtering the null value; and / or, When the number of occurrences of the same data included in the foreign key fields or the primary key fields is greater than once, retaining one of the data and filtering the other data.

10. The method according to claim 1, wherein The obtaining of the coincidence degree of the foreign key fields and the primary key fields according to the unique value list of the foreign key fields and the unique value list of the primary key fields includes: Sampling the unique value list of the foreign key fields according to the preset sampling number; Obtaining the number of data included in the unique value list of the foreign key fields after the sampling as the first data number; Obtaining the number of data in the unique value list of the foreign key fields after the sampling that belong to the data in the unique value list of the primary key fields as the second data number; Obtaining the coincidence degree of the foreign key fields and the primary key fields according to the first data number and the second data number.

11. The method according to claim 10, wherein, The sampling of the unique value list of the foreign key fields according to the preset sampling number includes: In the case where the preset sampling number is greater than the number of rows of the first data table, retaining all the data in the unique value list of the foreign key fields; or, In the case where the preset sampling number is less than or equal to the number of rows of the first data table, extracting the sampling number of data from the unique value list of the foreign key fields.

12. The method according to claim 1, wherein, The correlation degree also includes the editing similarity, Calculating the correlation degree of the spliced key field pairs further includes: Obtaining the edit distance for converting the foreign key field to the primary key field, the length of the field name of the foreign key field, and the length of the field name of the primary key field; Obtaining the edit similarity according to the edit distance, the length of the field name of the foreign key field, and the length of the field name of the primary key field.

13. The method according to claim 1, wherein Determining the association relationship between data tables includes: In the case where the data included in the foreign key field has an occurrence number greater than one and the data included in the primary key field has an occurrence number greater than one, obtaining that the first data table and the second data table have a many-to-many association relationship; or, In the case where the data included in the foreign key field has an occurrence number greater than one and the data included in the primary key field does not have an occurrence number greater than one, obtaining that the first data table and the second data table have a many-to-one association relationship; or, In the case where the data included in the foreign key field does not have an occurrence number greater than one and the data included in the primary key field has an occurrence number greater than one, obtaining that the first data table and the second data table have a one-to-many association relationship; or, In the case where the data included in the foreign key field does not have an occurrence number greater than one and the data included in the primary key field does not have an occurrence number greater than one, obtaining that the first data table and the second data table have a one-to-one association relationship.

14. The method according to claim 2, wherein, The step of splicing the first data table and the second data table when the correlation degree meets the set conditions includes: For any data table pair, sorting the coincidence degree and / or the edit similarity of each obtained spliced key field pair to obtain a sorting result; According to the sorting result of the coincidence degree and / or the sorting result of the edit similarity, obtaining the spliced key field pairs corresponding to the first predetermined number of the coincidence degrees and / or the edit similarities as the target spliced key field pairs corresponding to the data table pair; Splicing the first data table and the second data table according to the target spliced key field pairs.

15. The method according to claim 14, wherein, The step of splicing the first data table and the second data table when the correlation degree meets the set conditions further includes: Obtaining a set coincidence degree threshold and / or an edit similarity threshold; For any data table pair, comparing the coincidence degree of each spliced key field pair with the coincidence degree threshold, and / or comparing the edit similarity of each spliced key field pair with the edit similarity threshold; Taking the spliced key field pairs corresponding to the coincidence degrees greater than the coincidence degree threshold and / or the spliced key field pairs corresponding to the edit similarities greater than the edit similarity threshold as the target spliced key field pairs corresponding to the data table pair; Splicing the first data table and the second data table according to the target spliced key field pairs.

16. The method according to claim 14, wherein The step of splicing the first data table and the second data table when the correlation degree meets the set conditions further includes: For any of the said data table pairs, delete the coincidence degrees with coincidence degrees less than or equal to the coincidence degree threshold in the sorting result of the coincidence degree; and / or, Delete the edit similarities with edit similarities less than or equal to the edit similarity threshold in the sorting result of the edit similarity; Use the pair of splicing key fields corresponding to the remaining coincidence degrees after deletion, and / or use the pair of splicing key fields corresponding to the remaining edit similarities after deletion as the target pair of splicing key fields corresponding to the said data table pair; Splice the first data table and the second data table according to the target pair of splicing key fields.

17. The method according to claim 16, wherein, The step of splicing the first data table and the second data table when the association degree meets the set condition further includes: For any of the said data table pairs, in the sorting result after deleting the coincidence degrees with coincidence degrees less than or equal to the coincidence degree threshold, and / or in the sorting result after deleting the edit similarities with edit similarities less than or equal to the edit similarity threshold, obtain the first predetermined number of pairs of splicing key fields corresponding to the coincidence degrees and / or the edit similarities as the target pair of splicing key fields corresponding to the said data table pair; Splice the first data table and the second data table according to the target pair of splicing key fields.

18. The method according to claim 14, 16 or 17, wherein, The method further includes: In response to a request for obtaining the sorting result of the coincidence degree and / or the edit similarity, obtain the set display mode; Display the sorting result of the coincidence degree and / or the edit similarity according to the display mode.

19. The method according to claim 1, wherein The method further includes: Provide a configuration interface for configuring the association degree; Obtain the configuration information input through the configuration interface; wherein, the configuration information at least includes the switch states of the coincidence degree and / or the edit similarity; Display the coincidence degree and / or the edit similarity when the corresponding switch state is in the on state.

20. An apparatus for determining the association relationship between data tables, comprising: A first acquisition module, configured to acquire the data table pairs involved in the target data table set; wherein, the data table pairs include a first data table and a second data table; A second acquisition module, configured to acquire the pair of splicing key fields for associating the first data table and the second data table; wherein, the pair of splicing key fields includes the foreign key field of the first data table and the primary key field of the second data table, and the foreign key field and the primary key field in the same pair of splicing key fields have the same data field type; A calculation module, configured to calculate the association degree of the spliced key field pairs, and determine the association relationship between data tables according to the calculated association degree; wherein, the association degree includes at least one of coincidence degree and edit similarity, and the association degree includes coincidence degree. Specifically, the calculation module is configured to: obtain the unique value list of the foreign key field in the spliced key field pair; obtain the unique value list of the primary key field in the spliced key field pair; obtain the coincidence degree of the foreign key field and the primary key field according to the unique value list of the foreign key field and the unique value list of the primary key field; specifically, the calculation module is configured to: filter out the data that meets the set conditions in the foreign key field or the primary key field to obtain the unique value list of the foreign key field, or the unique value list of the primary key field. A splicing module, configured to splice the first data table and the second data table when the association degree meets the set conditions.

21. The apparatus according to claim 20, wherein, Specifically, the first obtaining module is configured to: Obtain the attribute information of the data table set; Obtain the calculation complexity of the data table set according to the attribute information and a preset complexity calculation function; Compare the calculation complexity with a complexity threshold to obtain a comparison result; When the comparison result indicates that the calculation complexity is less than or equal to the complexity threshold, execute the step of obtaining the data table pairs involved in the target data table set.

22. The device according to claim 21, wherein, Specifically, the first obtaining module is configured to: When the comparison result indicates that the calculation complexity is greater than the complexity threshold, give a prompt that the calculation complexity is greater than the complexity threshold; or When the comparison result indicates that the calculation complexity is greater than the complexity threshold, receive a forced execution instruction; in response to the forced execution instruction, execute the step of obtaining the data table pairs involved in the target data table set; or When the comparison result indicates that the calculation complexity is greater than the complexity threshold, provide a selection interface for selecting a complexity calculation function; use the complexity calculation function selected through the selection interface as the preset complexity calculation function, and re-execute the step of obtaining the calculation complexity of the data table set according to the attribute information and the preset complexity calculation function.

23. The apparatus according to claim 21, wherein The attribute information at least includes the total number of data tables in the target data table set, the maximum number of attribute fields of the data tables in the target data table set, and the maximum number of rows of the data tables in the target data table set.

24. The apparatus according to claim 20, wherein Specifically, the first obtaining module is configured to: Successively use each data table in the target data table set as the first data table; For the first data table, successively select other data tables in the target data table set except the first data table as the second data table to obtain the data table pairs.

25. The apparatus according to claim 20, wherein Specifically, the second obtaining module is configured to: Obtain the foreign key field of the first data table and the primary key field of the second data table; Obtain the spliced key field pair according to the foreign key field of the first data table and the primary key field of the second data table.

26. The apparatus according to claim 25, wherein, The second acquisition module is specifically configured to: acquire one or more attribute fields involved in the first data table and the second data table specified by the user, as the foreign key field and the primary key field; or, in the case where the user does not specify, directly use all the attribute fields involved in the first data table and the second data table as the foreign key field and the primary key field.

27. The apparatus according to claim 25, wherein, The second acquisition module is specifically configured to: select the foreign key field of the first data table; select a primary key field having the same data field type as the foreign key field from the second data table; combine the foreign key field and the primary key field to obtain the spliced key field pair.

28. The apparatus according to claim 20, wherein The set conditions include a first condition and a second condition, and the calculation module is specifically configured to: when the data included in the foreign key field or the primary key field is a null value, filter out the null value; and / or, when the number of occurrences of the same data included in the foreign key field or the primary key field is greater than one, retain one of the data and filter out the other data.

29. The apparatus according to claim 20, wherein, The calculation module is specifically configured to: sample the unique value list of the foreign key field according to a preset sampling number; obtain the number of data included in the unique value list of the foreign key field after the sampling as the first data number; obtain the number of data in the unique value list of the foreign key field after the sampling that belong to the data in the unique value list of the primary key field as the second data number; obtain the coincidence degree of the foreign key field and the primary key field according to the first data number and the second data number.

30. The apparatus according to claim 29, wherein, The calculation module is specifically configured to: when the preset sampling number is greater than the number of rows of the first data table, retain all the data in the unique value list of the foreign key field; or, when the preset sampling number is less than or equal to the number of rows of the first data table, extract the sampling number of data from the unique value list of the foreign key field.

31. The apparatus according to claim 20, wherein, The association degree further includes an edit similarity, and the calculation module is specifically configured to: obtain the edit distance for converting the foreign key field into the primary key field, the length of the field name of the foreign key field, and the length of the field name of the primary key field; obtain the edit similarity according to the edit distance, the length of the field name of the foreign key field, and the length of the field name of the primary key field.

32. The apparatus according to claim 20, wherein The calculation module is specifically configured to: count whether there is data with the number of occurrences greater than one in the foreign key field; and, count whether there is data with the number of occurrences greater than one in the primary key field; when there is data with the number of occurrences greater than one in the foreign key field and there is data with the number of occurrences greater than one in the primary key field, obtain that the first data table and the second data table have a many-to-many association relationship; or, when there is data with the number of occurrences greater than one in the foreign key field and there is no data with the number of occurrences greater than one in the primary key field, obtain that the first data table and the second data table have a many-to-one association relationship; or, When the data with the occurrence times greater than once is not included in the foreign key field, and the data with the occurrence times greater than once is included in the primary key field, the one-to-many association relationship between the first data table and the second data table is obtained; Or, When the data with the occurrence times greater than once is not included in the foreign key field, and the data with the occurrence times greater than once is not included in the primary key field, the one-to-one association relationship between the first data table and the second data table is obtained.

33. The apparatus according to claim 21, wherein The splicing module is specifically used for: Sorting the coincidence degree and / or the edit similarity of each obtained splicing key field pair to obtain a sorting result; According to the sorting result of the coincidence degree and / or the sorting result of the edit similarity, obtaining the splicing key field pairs corresponding to the first predetermined number of the coincidence degree and / or the edit similarity as the target splicing key field pairs; Splicing the associated first data table and the second data table according to the target splicing key field pairs.

34. The apparatus according to claim 33, wherein, The splicing module is specifically used for: Obtaining a set coincidence degree threshold and / or an edit similarity threshold; Comparing the coincidence degree of each splicing key field pair with the coincidence degree threshold, and / or comparing the edit similarity of each splicing key field pair with the edit similarity threshold; Taking the splicing key field pairs corresponding to the coincidence degree greater than the coincidence degree threshold and / or the edit similarity corresponding to the edit similarity greater than the edit similarity threshold as the target splicing key field pairs; Splicing the associated first data table and the second data table according to the target splicing key field pairs.

35. The apparatus according to claim 33, wherein, The splicing module is specifically used for: Deleting the coincidence degree with the coincidence degree less than or equal to the coincidence degree threshold in the sorting result of the coincidence degree; and / or, Deleting the edit similarity with the edit similarity less than or equal to the edit similarity threshold in the sorting result of the edit similarity; Taking the splicing key field pairs corresponding to the remaining coincidence degree after deletion and / or the splicing key field pairs corresponding to the remaining edit similarity after deletion as the target splicing key field pairs; Splicing the associated first data table and the second data table according to the target splicing key field pairs.

36. The apparatus according to claim 35, wherein, The splicing module is specifically used for: In the sorting result of deleting the coincidence degree with the coincidence degree less than or equal to the coincidence degree threshold and / or in the sorting result of deleting the edit similarity with the edit similarity less than or equal to the edit similarity threshold, obtaining the splicing key field pairs corresponding to the first predetermined number of the coincidence degree and / or the edit similarity as the target splicing key field pairs; Splicing the associated first data table and the second data table according to the target splicing key field pairs.

37. The apparatus according to claim 33, 35 or 36, wherein, The device further includes a first display module, and the first display module is used for: Responding to the request for obtaining the sorting result of the coincidence degree and / or the edit similarity, and obtaining a set display mode; Displaying the sorting result of the coincidence degree and / or the edit similarity according to the display mode.

38. The apparatus according to claim 20, wherein, The device further includes a second display module, and the second display module is configured to: Provide a configuration interface for configuring the degree of association; Obtain configuration information input through the configuration interface; wherein, the configuration information at least includes the switch states of the degree of coincidence and / or the edit similarity; When the corresponding switch state is in the on state, display the degree of coincidence and / or the edit similarity.

39. An apparatus comprising at least one computing device and at least one storage device, wherein, The at least one storage device is used to store instructions, and the instructions, when executed by the at least one computing device, implement the method according to any one of claims 1 to 19.

40. A computer-readable storage medium, wherein, A computer program is stored thereon, and the computer program, when executed by a processor, implements the method according to any one of claims 1 to 19.

Citation Information

Patent Citations

  • A method and a system for realizing data table splicing and automatic training of a machine learning model

    CN109739855A

  • Method and device for determining data table relationship and computer readable storage medium

    CN111143483A