Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Method and device for identifying inter-table primary and foreign key fields based on bloom filter

A Bloom filter and recognition table technology, which is applied to instruments, electronic digital data processing, digital data information retrieval, etc., can solve the problems of increasing labor costs and resource investment, database modeling analysis and processing difficulties, etc., to reduce resources The effect of consumption

Active Publication Date: 2021-05-14
CHENGDU SEFON SOFTWARE CO LTD
View PDF8 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] The object of the present invention is to provide a method and device for identifying primary and foreign key fields between tables based on a Bloom filter, so as to solve the problem of lack of primary and foreign key metadata between tables in existing databases, which makes database modeling analysis and processing difficult, and increases the number of projects. During the implementation process, data exploration and manual determination of primary and foreign keys between tables involve a large amount of labor costs and resource investment, so as to greatly improve product development speed, shorten project cycle, improve product competitiveness, and expand product market share.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and device for identifying inter-table primary and foreign key fields based on bloom filter

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0045] Such as figure 1 As shown, the present invention can better solve the problem that the database lacks primary and foreign key metadata between tables, which makes database modeling analysis and processing difficult, and reduces a large amount of labor costs for data exploration and manual determination of primary and foreign keys between tables during project implementation. And resource input, greatly increase the speed of product development, shorten the project cycle, improve product competitiveness, and expand product market share; the specific steps are as follows:

[0046] Step 1, select a field a from database table A, and select a field b from database table B;

[0047] Step 2: Determine whether the data content in field a and field b in step 1 all meet the primary key requirements of "no NULL value" and "unique value" and "data volume greater than 1". If yes, execute the next step, otherwise restart Select field a and field b, and judge again whether they meet...

Embodiment 2

[0054] A device for identifying primary and foreign key fields between tables based on a Bloom filter includes a memory: used to store executable instructions; a processor: used to execute the executable instructions stored in the memory, and implement a Bloom filter-based A method for identifying primary and foreign key fields between tables.

Embodiment 3

[0056] This embodiment is to realize some function codes of this scheme:

[0057] list tableNames = DBInfoTool. readTableNames(source);

[0058] int recordCount = DBInfoTool. readTableRecordCount(tableName, source);

[0059] if (recordCount > 1) {

[0060] list fields = DBInfoTool. readFields(tableName, recordCount, source);

[0061] Field field = null;

[0062] for (Field fieldInList : fields) {

[0063] if (fieldInList. getName(). equals(fieldName)) {

[0064] field = fieldInList;

[0065] break;

[0066] }

[0067] }

[0068] if (field != null) {

[0069] DataTypeEnum dataType = field. getDataType();

[0070] SizeStatResult sizeStat = SizeStatResult.load(sizeFilePath);

[0071] String bloomFilterPath = BloomfilterPathTool. getBloomFilterPath(tableName, fieldName);

[0072] BloomFilter bloomFilter = BloomFilterTool. load(bloomFilterPath, dataType);

[0073] if (bloomFilter != null) {

[0074] for (int j = 0; j < tableNames. size(); ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a method and device for identifying inter-table primary and foreign key fields based on a bloom filter, and mainly solves the problems that in the prior art, an existing database lacks inter-table primary and foreign key metadata, so that database modeling analysis and processing are difficult; and the problems of large labor cost and resource investment caused by data exploration and manual determination of main and foreign keys between tables in a project implementation process are reduced. The number of database tables is judged, an existing method is adopted when the number is lower than a set threshold value, a Bloom filter is created through table field data content when the number is higher than the set threshold value, calculation of the inclusion relation of table fields is converted into calculation of the inclusion relation of the field filters, primary and foreign key fields between the tables are recognized, and the problem of huge consumption of calculation resources of a large number of tables is solved; and different numbers of database tables are processed separately through threshold values, resources are allocated reasonably, and resource consumption is reduced.

Description

technical field [0001] The invention relates to the field of identifying primary and foreign key fields between tables, in particular to a method and device for identifying primary and foreign key fields between tables based on a Bloom filter. Background technique [0002] In the prior art, when the number of database tables is small, such as less than 10,000 records, all the data in field a and field b can be directly read, and the inclusion relationship of the two field data can be directly calculated by using the list inclusion relationship, so as to identify the main data between the tables. Foreign key fields. However, when the amount of data reaches hundreds of millions, this kind of direct reading of all field data for inclusion relationship calculation will consume a lot of time to read data into memory, consume local resources, and invest a lot of manpower in data exploration and analysis. Problems, which in turn lead to prolonging the product development cycle and...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F16/2453G06F16/2455
CPCG06F16/24549G06F16/24558
Inventor 韩威宏王纯斌徐祥张艳王国玉
Owner CHENGDU SEFON SOFTWARE CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products