Entity relation graph generation method and device, equipment and medium

By obtaining the database metadata, judging and processing the relationship between table data, generating physical relationship maps, solving the problem of the E-R chart in existing technology that cannot completely describe the relationship between database tables, and realize the complete description of the database relationship.

CN119378546APending Publication Date: 2025-01-28BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202310920392.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-25
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

In database design, it is difficult for the prior art to fully describe the relationships of tables in databases through entity relationship diagrams (E-R diagrams), especially when software developers do not design physical master foreign key relationships.

Method used

By obtaining the metadata in the database, determine whether the table data has the first target relationship (physical main external key relationship), and the data collision processing of table data that does not have this relationship is calculated. These relationships generate physical relationship diagrams.

Benefits of technology

The second target relationship obtained by data collision processing can completely describe the physical relationship diagram that can fully describe the overall database, and solve the problem that the E-R chart cannot completely describe the database table relationship in the existing technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119378546A_ABST
    Figure CN119378546A_ABST
Patent Text Reader

Abstract

The invention relates to an entity relation graph generation method and device, equipment and a medium. The entity relation graph generation method comprises the steps that metadata stored in a database is obtained, and the metadata comprises multiple pieces of table data; judging whether the multiple pieces of table data have a first target relationship or not; performing data collision processing on the at least two pieces of first target table data without the first target relationship to obtain a second target relationship between the at least two pieces of first target table data; and generating an entity relation graph according to the second target relation. According to the embodiment of the invention, the entity relation graph capable of completely describing the whole database is generated directly through the second target relation obtained through data collision processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of database technology, and in particular to a method, device, equipment and medium for generating an entity relationship diagram. Background Art

[0002] The Entity Relationship Diagram (ER diagram) provides a method for representing entity types, attributes, and relationships to describe the conceptual model of the real world. It is usually used as a structural diagram for database design.

[0003] In the related art, when an ER diagram is generated for a database, it is usually designed and generated based on the physical primary and foreign key relationship of the metadata in the database. However, in some databases, software developers do not design the physical primary and foreign key relationship of the metadata in the database, resulting in the ER diagram generated by the database being unable to fully describe the overall table relationship of the database. Summary of the invention

[0004] In order to solve the above technical problems, the present disclosure provides a method, device, equipment and medium for generating an entity relationship diagram.

[0005] In a first aspect, the present disclosure provides a method for generating an entity relationship diagram, comprising:

[0006] Get the metadata stored in the database, which includes multiple table data;

[0007] Determine whether multiple table data have a first target relationship;

[0008] Performing data collision processing on at least two first target table data that do not have the first target relationship to obtain a second target relationship between the at least two first target table data;

[0009] An entity relationship diagram is generated according to the second target relationship.

[0010] In a second aspect, the present disclosure provides an entity relationship diagram generation device, comprising:

[0011] A data acquisition module is used to acquire metadata stored in a database, where the metadata includes data from multiple tables;

[0012] A relationship judgment module, used to judge whether multiple table data have a first target relationship;

[0013] A data processing module, used for performing data collision processing on at least two first target table data that do not have the first target relationship, to obtain a second target relationship between the at least two first target table data;

[0014] The first generating module is used to generate an entity relationship diagram according to the second target relationship.

[0015] In a third aspect, the present disclosure provides an entity relationship diagram generation device, comprising:

[0016] processor;

[0017] A memory for storing executable instructions;

[0018] The processor is used to read executable instructions from the memory and execute the executable instructions to implement the entity relationship diagram generation method of the first aspect.

[0019] In a fourth aspect, the present disclosure provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor implements the entity relationship diagram generation method of the first aspect.

[0020] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages:

[0021] The entity relationship diagram generation method, apparatus, device and medium of the disclosed embodiments can obtain metadata stored in a database, wherein the metadata includes multiple table data, then determine whether the multiple table data have a first target relationship, and then perform data collision processing on at least two first target table data that do not have the first target relationship to obtain a second target relationship of at least two first target table data. Finally, an entity relationship diagram is generated according to the second target relationship. Thus, for at least two first target table data that do not have the first target relationship, the corresponding second target relationship can be obtained through data collision processing, and an entity relationship diagram can be generated according to the second target relationship, so that an entity relationship diagram that can fully describe the entire database can be generated directly through the second target relationship obtained through the data collision processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.

[0023] Figure 1 A schematic diagram of a flow chart of a method for generating an entity relationship diagram provided in an embodiment of the present disclosure;

[0024] Figure 2 A schematic diagram of a process flow of another entity relationship diagram generation method provided by an embodiment of the present disclosure;

[0025] Figure 3 A schematic diagram of the structure of an entity relationship diagram generating device provided by an embodiment of the present disclosure;

[0026] Figure 4 A schematic diagram of the structure of an entity relationship diagram generating device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0027] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0028] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0029] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0030] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0031] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0032] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0033] In order to solve the above problems, the present disclosure provides a method, device, equipment and medium for generating an entity relationship diagram. Figure 1 The entity relationship diagram generation method provided in the embodiment of the present disclosure is described in detail.

[0034] Figure 1 A schematic flow chart of a method for generating an entity relationship diagram provided by an embodiment of the present disclosure is shown.

[0035] In the embodiment of the present disclosure, the entity relationship diagram generation method may be executed by a server, wherein the server may include but is not limited to servers such as cloud servers or cloud server clusters.

[0036] like Figure 1 As shown, the entity relationship diagram generation method may include the following steps.

[0037] S110: Obtain metadata stored in a database, where the metadata includes multiple table data.

[0038] In the embodiment of the present disclosure, the server may obtain metadata stored in the database.

[0039] Optionally, a database may be used to store the metadata.

[0040] Optionally, the metadata may be key data related to data source definition, target definition, conversion rules, etc. generated by the business system during the data warehouse construction process. The metadata may include multiple table data.

[0041] Optionally, the table data may be data stored in a table.

[0042] Specifically, the server may obtain metadata stored in a database, where the metadata may include multiple table data.

[0043] Optionally, S110 may specifically include: collecting metadata stored in a database of the business system; or searching for metadata stored in a local database.

[0044] In some embodiments of the present disclosure, the server may collect metadata stored in a database of the business system.

[0045] Optionally, the business system may be a system for processing various businesses.

[0046] Specifically, the business system can process various businesses and generate metadata, which is stored in a database of the business system. The server can collect corresponding metadata in the database of the business system.

[0047] In some other embodiments of the present disclosure, the server may search for metadata stored in a local database.

[0048] Optionally, the local database may be a database local to the server.

[0049] Specifically, the server may directly search for metadata of the stored business system in the local database.

[0050] In some other embodiments of the present disclosure, the server may also first collect corresponding metadata in the database of the business system and store it in a local database, thereby searching for metadata through the local database, which is not limited here.

[0051] S120: Determine whether the plurality of table data have a first target relationship.

[0052] In the embodiment of the present disclosure, the server may determine whether multiple table data have the first target relationship.

[0053] Optionally, the first target relationship may be used to characterize the relationship between table data.

[0054] Specifically, after acquiring the multiple table data, the server may determine whether the multiple table data have the first target relationship.

[0055] S130: Perform data collision processing on at least two first target table data that do not have the first target relationship, and obtain a second target relationship between the at least two first target table data.

[0056] In an embodiment of the present disclosure, after determining whether multiple table data have a first target relationship, the server may perform data collision processing on at least two first target table data that do not have the first target relationship to obtain a second target relationship between the at least two first target table data.

[0057] Optionally, the first target table data may be table data without the first target relationship.

[0058] Optionally, the data collision processing may be a process for calculating similarity relationships between table data.

[0059] Optionally, the second target relationship may be used to characterize the relationship between table data.

[0060] Specifically, after determining whether multiple table data have the first target relationship, if there are at least two first target table data that do not have the first target relationship, the server can perform data collision processing on the at least two first target table data to obtain the second target relationship between the at least two first target table data.

[0061] S140: Generate an entity relationship diagram according to the second target relationship.

[0062] In the embodiment of the present disclosure, after obtaining the second target relationship, the server may generate an entity relationship graph according to the second target relationship.

[0063] Specifically, the server may generate an entity relationship diagram (ER diagram) according to the second target relationship. The method for generating the entity relationship diagram may be any feasible method and is not limited here.

[0064] Therefore, in the embodiment of the present disclosure, it is possible to obtain metadata stored in a database, wherein the metadata includes multiple table data, and then determine whether the multiple table data have a first target relationship, and then perform data collision processing on the first target table data that does not have the first target relationship to obtain the second target relationship of the first target table data, and finally generate an entity relationship diagram based on the second target relationship. Therefore, it is possible to obtain the corresponding second target relationship through data collision processing for the first target table data that does not have the first target relationship, and generate an entity relationship diagram based on the second target relationship, so that an entity relationship diagram that can fully describe the entire database can be generated directly through the second target relationship obtained through the data collision processing.

[0065] Optionally, S120 may specifically include: querying and parsing data definition statements in multiple table data; and determining whether the data definition statements have a first target relationship, where the first target relationship is a physical primary and foreign key relationship for representing the table data.

[0066] In the embodiment of the present disclosure, the server may query and parse data definition statements in multiple table data.

[0067] Optionally, a data definition language (DDL) may be a language used to describe real-world entities to be stored in a database. For example, a data definition statement may be used to create, delete, modify, etc., an object in a database.

[0068] Specifically, the server may query and obtain data definition statements in multiple table data, and parse the data definition statements.

[0069] Furthermore, the server may determine whether the data definition statement contains the first target relationship.

[0070] Optionally, the first target relationship may be a physical primary-foreign key relationship used to represent table data.

[0071] Optionally, the physical primary-foreign key relationship may be used to characterize the constraint relationship between the data in two tables.

[0072] Specifically, the server may determine whether there is a first target relationship through a data definition statement, that is, determine whether there is a physical primary-foreign key relationship in the table data through a data definition statement.

[0073] Optionally, S130 may specifically include: combining at least two first target table data that do not have the first target relationship to generate corresponding multiple matrix data; calculating the similarity of the multiple matrix data based on a matrix similarity algorithm; and obtaining the second target relationship between at least two first target table data according to the similarity.

[0074] In the embodiment of the present disclosure, after determining whether a plurality of table data have the first target relationship, the server may respectively perform combination processing on at least two first target table data that do not have the first target relationship to generate a corresponding plurality of matrix data.

[0075] Optionally, the combination process may be a process of combining table data.

[0076] Optionally, the matrix data may be data stored in a matrix form.

[0077] Specifically, the server may perform combination processing on each first target table data that does not have the first target relationship, for example, combining the data in the table data into a corresponding matrix to obtain corresponding multiple matrix data.

[0078] Furthermore, the server may calculate the similarity of multiple matrix data based on a matrix similarity algorithm.

[0079] Optionally, the matrix similarity algorithm may be an algorithm for calculating similarities between matrices.

[0080] Optionally, the similarity may be data used to characterize the degree of similarity between matrices.

[0081] Specifically, the server may calculate the similarity of multiple matrix data by using a matrix similarity algorithm, wherein the matrix similarity algorithm may be any known algorithm, such as using eigenvalues ​​and characteristic polynomials, matrix diagonalization, matrix Jordan canonical form, etc., which is not limited here.

[0082] In some ways, the matrix similarity algorithm is modified. For example, if there are some text fields or pictures stored in the database, and one field can store 2 times the similarity matrix, this can be split into multiple matrices. Then a tree structure is formed, and the tree nodes are all matrices, so two matrix trees are obtained, and the similarity between the two matrix trees is calculated by the matrix similarity algorithm.

[0083] Furthermore, after obtaining the similarities of the plurality of matrix data, the server may obtain a second target relationship between at least two first target table data according to the similarities.

[0084] Specifically, after obtaining the similarities of the plurality of matrix data, the server can obtain the similarities between the data in the matrix data, and thus can obtain the second target relationship between at least two first target table data according to the similarities.

[0085] Therefore, in the embodiment of the present disclosure, the second target relationship between at least two first target table data can be obtained through a matrix similarity algorithm, thereby facilitating the generation of an entity relationship diagram that can fully describe the entire database.

[0086] Optionally, obtaining a second target relationship between at least two first target table data based on the similarity may specifically include: when the similarity is greater than or equal to a preset threshold, obtaining a second target relationship representing a similar relationship; when the similarity is less than a preset threshold, obtaining a second target relationship representing a non-similar relationship.

[0087] In some embodiments of the present disclosure, when the similarity is greater than or equal to a preset threshold, the server may obtain a second target relationship representing a similar relationship.

[0088] Optionally, the preset threshold may be a pre-set value. For example, the preset threshold may be a value greater than 0.4, such as 0.5, 0.6, etc., which is not limited here.

[0089] Optionally, having a similar relationship may represent similarity between data in the representation tables.

[0090] Specifically, after obtaining the similarity, the server can obtain the second target relationship based on the similarity value. If the similarity is greater than or equal to a preset threshold, such as greater than 0.5, it can be determined that there is a similar relationship between the two table data, and the server can obtain the second target relationship that represents the similar relationship.

[0091] In some other embodiments of the present disclosure, when the similarity is less than a preset threshold, the server obtains a second target relationship representing a relationship that does not have a similarity.

[0092] Optionally, not having a similar relationship may represent that the data in the representation tables are not similar.

[0093] Specifically, after obtaining the similarity, the server can obtain the second target relationship according to the similarity value. If the similarity is less than a preset threshold, such as less than 0.5, it can be determined that there is no similarity relationship between the two table data, and the server can obtain the second target relationship indicating that there is no similarity relationship.

[0094] Therefore, by judging the difference between the similarity and the preset threshold, it is possible to determine whether the two table data have a similar relationship and obtain the corresponding second target relationship.

[0095] Optionally, S140 may specifically include: when the second target relationship represents a similar relationship, generating an entity relationship graph according to the second target relationship.

[0096] In an embodiment of the present disclosure, when the second target relationship represents a similar relationship, the server generates an entity relationship graph according to the second target relationship.

[0097] Specifically, after obtaining the second target relationship, the server judges the second target relationship. If the second target relationship is characterized by a similar relationship, it means that the data of the two tables are similar. At this time, the server can generate an entity relationship diagram corresponding to the two tables based on the second target relationship; if the second target relationship is characterized by a lack of similarity, it means that the data of the two tables are not similar. At this time, the server will not generate an entity relationship diagram corresponding to the two tables.

[0098] Table 1

[0099] Line Number User ID User Name User age User Gender Num Zhangsan Zhang San 10 male

[0100] Table 2

[0101] Line Number Department ID Department Name describe Num Test_dept_id Testing Department Desc

[0102] As shown above, Table 1 and Table 2 can be two different first target table data respectively. The server can combine the two first target table data to generate two corresponding matrix data, and then calculate the similarity of the two matrix data through a matrix similarity algorithm to obtain the second target relationship between the two first target table data, that is, to obtain the similarity relationship between the two first target table data, and in the case of having a similar relationship, generate the entity relationship diagram corresponding to Table 1 and Table 2.

[0103] Optionally, after S140, the entity relationship diagram generation method may further include: generating an entity relationship diagram according to the first target relationship for at least two second target table data having the first target relationship.

[0104] In an embodiment of the present disclosure, the server may generate an entity relationship graph according to the first target relationship for at least two second target table data having the first target relationship.

[0105] Specifically, after determining that at least two second target table data have the first target relationship, ie, have a physical primary-foreign key relationship, the server can directly generate an entity relationship graph corresponding to the at least two second target table data according to the first target relationship.

[0106] Figure 2 A schematic flow chart of another entity relationship diagram generation method provided by an embodiment of the present disclosure is shown.

[0107] like Figure 2 As shown, the entity relationship diagram generation method may include the following steps.

[0108] S210: Collect metadata stored in a database of the business system.

[0109] In an embodiment of the present disclosure, the server may collect metadata stored in a database of the business system.

[0110] S220: Storing metadata in a local database, where the metadata includes multiple table data.

[0111] In an embodiment of the present disclosure, the server may store the collected metadata in a local database, and the metadata may include a plurality of table data.

[0112] S230: Determine whether the plurality of table data have a first target relationship.

[0113] In the embodiment of the present disclosure, the server may determine whether multiple table data have the first target relationship. If there are table data with more first target relationships, execute S240; if there are no table data with more first target relationships, execute S250.

[0114] S240: Generate an entity relationship diagram according to the first target relationship.

[0115] In an embodiment of the present disclosure, the server may generate an entity relationship graph according to the first target relationship for at least two second target table data having the first target relationship.

[0116] S250: Perform data collision processing on at least two first target table data that do not have the first target relationship, and obtain a second target relationship between the at least two first target table data.

[0117] In the embodiment of the present disclosure, the server may perform data collision processing on at least two first target table data that do not have the first target relationship, and obtain the second target relationship between the at least two first target table data.

[0118] S260: Generate an entity relationship diagram according to the second target relationship.

[0119] In an embodiment of the present disclosure, the server may generate an entity relationship graph according to the second target relationship.

[0120] Figure 3 A schematic diagram of the structure of an entity relationship diagram generating device provided by an embodiment of the present disclosure is shown.

[0121] like Figure 3 As shown, the entity relationship diagram generating device 300 may include a data acquisition module 310 , a relationship judgment module 320 , a data processing module 330 and a first generating module 340 .

[0122] The data acquisition module 310 can be used to acquire metadata stored in a database, where the metadata includes multiple table data.

[0123] The relationship determination module 320 may be used to determine whether multiple table data have a first target relationship.

[0124] The data processing module 330 may be used to perform data collision processing on at least two first target table data that do not have the first target relationship, and obtain a second target relationship between the at least two first target table data.

[0125] The first generating module 340 may be configured to generate an entity relationship diagram according to the second target relationship.

[0126] Therefore, in the embodiment of the present disclosure, it is possible to obtain metadata stored in a database, wherein the metadata includes multiple table data, and then determine whether the multiple table data have a first target relationship, and then perform data collision processing on the first target table data that does not have the first target relationship to obtain the second target relationship of the first target table data, and finally generate an entity relationship diagram based on the second target relationship. Therefore, it is possible to obtain the corresponding second target relationship through data collision processing for the first target table data that does not have the first target relationship, and generate an entity relationship diagram based on the second target relationship, so that an entity relationship diagram that can fully describe the entire database can be generated directly through the second target relationship obtained through the data collision processing.

[0127] In some embodiments of the present disclosure, the data acquisition module 310 may specifically include a data acquisition unit and a data search unit.

[0128] The data collection unit can be used to collect metadata stored in a database of the business system.

[0129] The data search unit may be used to search for metadata stored in a local database.

[0130] In some embodiments of the present disclosure, the relationship judgment module 320 may specifically include a statement query unit and a relationship judgment unit.

[0131] The statement query unit can be used to query and parse data definition statements in multiple table data.

[0132] The relationship determination unit may be used to determine whether a data definition statement has a first target relationship, where the first target relationship is a physical primary and foreign key relationship used to characterize table data.

[0133] In some embodiments of the present disclosure, the data processing module 330 may specifically include a first processing unit, a similarity calculation unit and a second processing unit.

[0134] The first processing unit can be used to perform combination processing on at least two first target table data that do not have the first target relationship to generate corresponding multiple matrix data.

[0135] The similarity calculation unit can be used to calculate the similarity of multiple matrix data based on a matrix similarity algorithm.

[0136] The second processing unit may be configured to obtain a second target relationship between at least two first target table data according to the similarity.

[0137] In some embodiments of the present disclosure, the second processing unit may be specifically configured to obtain a second target relationship representing a similar relationship when the similarity is greater than or equal to a preset threshold.

[0138] In some embodiments of the present disclosure, the second processing unit may be specifically configured to obtain a second target relationship representing a relationship that does not have a similarity when the similarity is less than a preset threshold.

[0139] In some embodiments of the present disclosure, the first generating module 340 may also be specifically configured to generate an entity relationship graph according to the second target relationship when the second target relationship represents a similar relationship.

[0140] In some embodiments of the present disclosure, the entity relationship diagram generating device 300 may further include a second generating module.

[0141] The second generating module can be used to generate an entity relationship diagram according to the first target relationship for at least two second target table data having the first target relationship.

[0142] It should be noted that Figure 3 The entity relationship diagram generating apparatus 300 shown can execute Figure 1 The various steps in the method embodiment shown in the figure are implemented Figure 1 The various processes and effects in the method embodiment shown are not described in detail here.

[0143] Figure 4 A schematic diagram of the structure of an entity relationship diagram generating device provided by an embodiment of the present disclosure is shown.

[0144] In some embodiments of the present disclosure, Figure 4 The entity relationship diagram generating device shown may be an electronic device. Specifically, the electronic device may include but is not limited to mobile terminals such as mobile phones, vehicle-mounted devices, vehicle controllers, tablet computers, wearable devices, smart home devices, etc.

[0145] like Figure 4 As shown, the entity relationship diagram generating device may include a processor 401 and a memory 402 storing computer program instructions.

[0146] Specifically, the processor 401 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0147] The memory 402 may include a large capacity memory for information or instructions. By way of example and not limitation, the memory 402 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a tape, or a universal serial bus (USB) drive or a combination of two or more of these. Where appropriate, the memory 402 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 402 may be inside or outside the integrated gateway device. In a particular embodiment, the memory 402 is a non-volatile solid-state memory. In a particular embodiment, the memory 402 includes a read-only memory (ROM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (Electrically Erasable Programmable ROM, EEPROM), an electrically rewritable ROM (EAROM) or a flash memory, or a combination of two or more of these.

[0148] The processor 401 reads and executes the computer program instructions stored in the memory 402 to perform the steps of the entity relationship diagram generation method provided in the embodiment of the present disclosure.

[0149] In one example, the entity relationship diagram generating device may further include a transceiver 403 and a bus 404. Figure 4 As shown, the processor 401, the memory 402 and the transceiver 403 are connected via a bus 404 and communicate with each other.

[0150] The bus 404 includes hardware, software, or both. For example, but not limitation, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industrial Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a Memory bus, a MicroChannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses or a combination of two or more of these. Where appropriate, the bus 404 may include one or more buses. Although embodiments of the present application describe and illustrate a particular bus, the present application contemplates any suitable bus or interconnect.

[0151] The embodiments of the present disclosure also provide a computer-readable storage medium, which may store a computer program. When the computer program is executed by a processor, the processor implements the entity relationship diagram generation method provided by the embodiments of the present disclosure.

[0152] The above-mentioned storage medium may, for example, include a memory 402 of computer program instructions, and the above-mentioned instructions may be executed by the processor 401 of the entity relationship diagram generation device to complete the entity relationship diagram generation method provided by the embodiment of the present disclosure. Optionally, the storage medium may be a non-temporary computer-readable storage medium, for example, the non-temporary computer-readable storage medium may be a ROM, a random access memory (Random Access Memory, RAM), a compact disc read-only memory (CompactDisc ROM, CD-ROM), a magnetic tape, a floppy disk, and an optical data storage device, etc.

[0153] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising" is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.

[0154] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for generating an entity relationship diagram, characterized in that: include: Obtaining metadata stored in a database, wherein the metadata includes multiple table data; Determining whether the plurality of table data have a first target relationship; Performing data collision processing on at least two first target table data that do not have the first target relationship to obtain a second target relationship between the at least two first target table data; An entity relationship diagram is generated according to the second target relationship.

2. The method according to claim 1, characterized in that The step of obtaining metadata stored in the database includes: Collecting the metadata stored in a database of a business system; Or, search for the metadata stored in a local database.

3. The method according to claim 1, characterized in that: Determining whether the plurality of table data have a first target relationship includes: Query and parse data definition statements in the plurality of table data; It is determined whether the data definition statement has a first target relationship, where the first target relationship is a physical primary and foreign key relationship for representing table data.

4. The method according to claim 1, characterized in that: The performing data collision processing on at least two first target table data that do not have the first target relationship to obtain the second target relationship between the at least two first target table data includes: Combining the at least two first target table data that do not have the first target relationship to generate corresponding multiple matrix data; Based on a matrix similarity algorithm, calculating the similarity of the plurality of matrix data; A second target relationship between the at least two first target table data is obtained according to the similarity.

5. The method according to claim 4, characterized in that The obtaining the second target relationship between the at least two first target table data according to the similarity comprises: When the similarity is greater than or equal to a preset threshold, obtaining the second target relationship representing a similar relationship; When the similarity is less than a preset threshold, the second target relationship representing the lack of similarity is obtained.

6. The method according to claim 5, characterized in that The generating an entity relationship diagram according to the second target relationship includes: When the second target relationship represents a similar relationship, an entity relationship graph is generated according to the second target relationship.

7. The method according to claim 1, characterized in that After determining whether the plurality of table data have the first target relationship, the method further includes: For at least two second target table data having the first target relationship, the entity relationship diagram is generated according to the first target relationship.

8. An entity relationship diagram generating device, characterized in that: include: A data acquisition module, used to acquire metadata stored in a database, wherein the metadata includes multiple table data; A relationship determination module, used for determining whether the plurality of table data have a first target relationship; A data processing module, configured to perform data collision processing on at least two first target table data that do not have the first target relationship, to obtain a second target relationship between the at least two first target table data; A first generating module is used to generate an entity relationship diagram according to the second target relationship.

9. An entity relationship diagram generating device, characterized in that: include: processor; A memory for storing executable instructions; The processor is used to read the executable instructions from the memory and execute the executable instructions to implement the entity relationship diagram generation method described in any one of claims 1 to 7.

10. A non-volatile computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the entity relationship diagram generation method described in any one of claims 1 to 7.

Citation Information

Cited By

  • Data relation network generation method and system based on data standard

    CN120950606A

  • A data relationship network generation method and system based on data standards

    CN120950606B