Data model creation method and device, equipment, medium and product

By determining the target topic domain and target services of the second database table, generating an entity and attribute list, and creating a third data model, the data redundancy and inconsistency caused by data model creation in the prior art are solved, and efficient data and business docking and a clear data model are achieved.

CN119557282APending Publication Date: 2025-03-04BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411603236.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-11
Publication Date
2025-03-04

AI Technical Summary

Technical Problem

The creation method of data models in the prior art can easily lead to redundancy and inconsistency in data of the same entity in different modules, and increase development costs.

Method used

By determining the target topic domain and target service corresponding to each second database table based on the description field and the first data model in the first database table, generating an entity list and an attribute list, and creating a third data model corresponding to the target service.

Benefits of technology

It realizes efficient connection between data and services, provides a data model with clear structure and high service adaptability, improves demand reuse, reduces development costs, and enhances maintainability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119557282A_ABST
    Figure CN119557282A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data model creating method and device, equipment, a medium and a product. The method can be used in big data field. The method comprises the following steps: firstly, determining a target topic domain corresponding to each second database table in an application system according to a description field in a first database table and a first data model; then, for each second database table, determining a target service corresponding to the second database table according to the second data model of the target subject domain corresponding to the second database table and the description field of the second database table; then, for the target service, generating an entity list and an attribute list of the target service according to a second database table corresponding to the target service, a stock model entity and a stock model attribute; and finally, according to the entity list and the attribute list, creating a third data model corresponding to the target service. The consistency of the service data of the system is guaranteed, and the consistency of the basic data logic structure is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of big data, and in particular to a method, device, equipment, medium and product for creating a data model. Background Art

[0002] Database tables are usually used to store different types of business data within an enterprise, so that they can be quickly queried, stored, updated, and analyzed to support the business operations and management of the enterprise. However, as business data continues to increase, these existing database tables often have duplicate fields, redundancy, inconsistent data, etc., which is not conducive to data management and maintenance. In order to manage this data more efficiently, it is crucial to establish a unified data model for the database table.

[0003] In the prior art, the creation method of data models is usually based on the functions and requirements of each business. Under different business requirements, even for the same data entity (such as "customer" or "order"), its data structure and fields are only defined according to the current business data requirements to achieve the specific functions of the business or meet the needs of the current application scenario.

[0004] However, the data model creation method in the prior art easily leads to data redundancy and inconsistency of the same entity in different modules, and increases development costs. Summary of the invention

[0005] The embodiments of the present application provide a method, device, equipment, medium and product for creating a data model, so as to solve the problem that the method for creating a data model in the prior art easily leads to redundancy and inconsistency of data of the same entity in different modules and increases development costs.

[0006] In a first aspect, an embodiment of the present application provides a method for creating a data model, including:

[0007] Determine the target subject domain corresponding to each second database table in the application system according to the description field in the first database table and the first data model, each record of the first database table corresponds to a second database table, the description field is used to represent the first description information of each second database table, and the first data model includes the second description information of each subject domain;

[0008] For each second database table, determining a target business corresponding to the second database table according to a second data model of a target subject domain corresponding to the second database table and a description field of the second database table, wherein the second data model includes third description information of each business;

[0009] For the target business, generate an entity list and an attribute list of the target business according to the second database table, the stock model entity and the stock model attribute corresponding to the target business;

[0010] A third data model corresponding to the target business is created according to the entity list and the attribute list.

[0011] In a possible implementation, for the target business, generating an entity attribute list of the target business according to the second database table, the stock model entity, and the stock model attribute corresponding to the target business includes:

[0012] For the second database table corresponding to the target business, if the first model entity corresponding to the second database table exists in the stock model entity, the first model entity is associated with the second database table;

[0013] If the first model entity corresponding to the second database table does not exist in the stock model entity, creating a second model entity corresponding to the second database table, and associating the second model entity with the second database table;

[0014] If the first model attribute corresponding to the second database table exists in the stock model attribute, associating the first model attribute with the second database table;

[0015] If the first model attribute corresponding to the second database table does not exist in the stock model attribute, creating a second model attribute corresponding to the second database table, and associating the second model attribute with the second database table;

[0016] According to the model attributes and model entities associated with each database table, an entity attribute list of the target business is generated.

[0017] In a possible implementation, if the first model entity corresponding to the second database table exists in the stock model entity, associating the first model entity with the second database table includes:

[0018] If the first model entity corresponding to the second database table exists in the stock model entity, and the name of the first model entity does not meet the naming rule of the target business, create a second model entity corresponding to the second database table according to the naming rule, and associate the second model entity with the second database table;

[0019] If the first model entity corresponding to the second database table exists in the stock model entity, and the name of the first model entity meets the naming rule of the target business, then associating the first model entity with the second database table;

[0020] Correspondingly, if the stock model attribute contains the first model attribute corresponding to the second database table, associating the first model attribute with the second database table includes:

[0021] If the first model attribute corresponding to the second database table exists in the stock model attributes, and the name of the first model attribute does not meet the naming rule of the target business, creating a second model attribute corresponding to the second database table according to the naming rule, and associating the second model attribute with the second database table;

[0022] If the first model attribute corresponding to the second database table exists in the stock model attributes, and the name of the first model attribute meets the naming rule of the target business, the first model attribute is associated with the second database table.

[0023] In a possible implementation manner, creating a third data model corresponding to the target business according to the entity list and the attribute list includes:

[0024] Generate an initial entity list and an initial attribute list of the target business according to the model attributes and model entities associated with each database table;

[0025] The initial entity list and the initial attribute list are deduplicated respectively to generate the entity list and the attribute list.

[0026] In a possible implementation, determining the target subject domain corresponding to each second database table in the application system according to the description field in the first database table and the first data model includes:

[0027] Deleting records in the first database table whose data type is non-business, and generating a processed first database table;

[0028] According to the processed description fields in the first database table and the first data model, a target subject domain corresponding to each second database table is determined.

[0029] In a possible implementation manner, creating a third data model corresponding to the target business according to the entity list and the attribute list includes:

[0030] According to the entity list, an entity definition table corresponding to the target business is obtained, wherein the entity definition table includes explanation information of the model entity corresponding to the target business;

[0031] According to the attribute list, obtaining an attribute definition table corresponding to the target business, wherein the attribute definition table includes explanation information of the model attributes corresponding to the target business;

[0032] Creating or updating an entity relationship graph corresponding to the target business according to the entity list and the attribute list;

[0033] According to the attribute list, a domain list is obtained, wherein the domain list includes data categories, referenced data standards and code values ​​to which the model attributes contained in the attribute list belong;

[0034] The third data model includes the entity list, the attribute list, the entity definition table, the attribute definition table, the entity relationship diagram, and the domain list.

[0035] In a second aspect, an embodiment of the present application provides a device for creating a data model, including:

[0036] A first determination module is used to determine the target subject domain corresponding to each second database table in the application system according to the description field in the first database table and the first data model, each record of the first database table corresponds to a second database table, the description field is used to represent the first description information of each second database table, and the first data model includes the second description information of each subject domain;

[0037] A second determination module is used to determine, for each second database table, a target business corresponding to the second database table according to a second data model of a target subject domain corresponding to the second database table and a description field of the second database table, wherein the second data model includes third description information of each business;

[0038] A generating module, configured to generate, for a target business, an entity list and an attribute list of the target business according to a second database table, stock model entities and stock model attributes corresponding to the target business;

[0039] A creation module is used to create a third data model corresponding to the target business according to the entity list and the attribute list.

[0040] In a possible implementation manner, the generating module is specifically used to:

[0041] For the second database table corresponding to the target business, if the first model entity corresponding to the second database table exists in the stock model entity, the first model entity is associated with the second database table;

[0042] If the first model entity corresponding to the second database table does not exist in the stock model entity, creating a second model entity corresponding to the second database table, and associating the second model entity with the second database table;

[0043] If the first model attribute corresponding to the second database table exists in the stock model attribute, associating the first model attribute with the second database table;

[0044] If the first model attribute corresponding to the second database table does not exist in the stock model attribute, creating a second model attribute corresponding to the second database table, and associating the second model attribute with the second database table;

[0045] According to the model attributes and model entities associated with each database table, an entity attribute list of the target business is generated.

[0046] In a possible implementation manner, the data model creation device further includes a processing module, specifically configured to:

[0047] If the first model entity corresponding to the second database table exists in the stock model entity, and the name of the first model entity does not meet the naming rule of the target business, create a second model entity corresponding to the second database table according to the naming rule, and associate the second model entity with the second database table;

[0048] If the first model entity corresponding to the second database table exists in the stock model entity, and the name of the first model entity meets the naming rule of the target business, then associating the first model entity with the second database table;

[0049] Correspondingly, if the stock model attribute contains the first model attribute corresponding to the second database table, associating the first model attribute with the second database table includes:

[0050] If the first model attribute corresponding to the second database table exists in the stock model attributes, and the name of the first model attribute does not meet the naming rule of the target business, creating a second model attribute corresponding to the second database table according to the naming rule, and associating the second model attribute with the second database table;

[0051] If the first model attribute corresponding to the second database table exists in the stock model attributes, and the name of the first model attribute meets the naming rule of the target business, the first model attribute is associated with the second database table.

[0052] In a possible implementation manner, the creation module is specifically used to:

[0053] Generate an initial entity list and an initial attribute list of the target business according to the model attributes and model entities associated with each database table;

[0054] The initial entity list and the initial attribute list are deduplicated respectively to generate the entity list and the attribute list.

[0055] In a possible implementation manner, the first determining module is specifically configured to:

[0056] Deleting records in the first database table whose data type is non-business, and generating a processed first database table;

[0057] According to the processed description fields in the first database table and the first data model, a target subject domain corresponding to each second database table is determined.

[0058] In a possible implementation manner, the creation module is specifically used to:

[0059] According to the entity list, an entity definition table corresponding to the target business is obtained, wherein the entity definition table includes explanation information of the model entity corresponding to the target business;

[0060] According to the attribute list, obtaining an attribute definition table corresponding to the target business, wherein the attribute definition table includes explanation information of the model attributes corresponding to the target business;

[0061] Creating or updating an entity relationship graph corresponding to the target business according to the entity list and the attribute list;

[0062] According to the attribute list, a domain list is obtained, wherein the domain list includes data categories, referenced data standards and code values ​​to which the model attributes contained in the attribute list belong;

[0063] The third data model includes the entity list, the attribute list, the entity definition table, the attribute definition table, the entity relationship diagram, and the domain list.

[0064] In a third aspect, an embodiment of the present application provides an electronic device, including: a memory, a processor;

[0065] The memory stores computer-executable instructions;

[0066] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the above first aspect and / or various possible implementations of the first aspect.

[0067] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the first aspect above and / or various possible implementations of the first aspect.

[0068] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the above first aspect and / or various possible implementation methods of the first aspect.

[0069] The data model creation method, device, equipment, medium and product provided in the embodiment of the present application first correspond to the target business field corresponding to each record in the application system according to the first field (i.e., the first description information) of each record in the first database table (i.e., the second database table) and the second field (i.e., the second description information) of each business field (subject domain) in the first data model; then, for each record, the third field (i.e., the third description information) of the corresponding target business field is used to correspond to the business of the second data model to determine the target business corresponding to each record; then, for each target business, according to each record corresponding to the target business, the existing stock model entities and the stock model attributes, the entity list and attribute list of the target business are generated; finally, based on the entity and attribute list just now, the data model corresponding to the target business (i.e., the third data model) is constructed. Through this method, efficient docking of data and business is achieved, and a data model with clear structure and high business adaptability can be provided for the application system. When it is implemented, only the content related to the business itself needs to be considered, which greatly improves the demand reuse, reduces the development cost, and enhances maintainability. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0071] Figure 1 Schematic diagram of the process of creating a data model provided in the embodiment of the present application Figure 1 ;

[0072] Figure 2 Schematic diagram of the process of creating a data model provided in the embodiment of the present application Figure 2 ;

[0073] Figure 3 An entity relationship diagram of a method for creating a data model provided in an embodiment of the present application;

[0074] Figure 4 A schematic diagram of the structure of a device for creating a data model provided in an embodiment of the present application;

[0075] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0076] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0077] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0078] First, the terms involved in this application are explained:

[0079] Data model: An abstraction of data features. It provides a logical and consistent representation of business concept information based on certain rules.

[0080] Stock database tables: database tables that already exist and are in use in the enterprise's existing systems. These tables are usually gradually established during the development and operation of the enterprise's business systems to meet the specific business needs of each application system. Stock database tables already contain historical data.

[0081] Subject domain: Subject domain provides a high-level view of the business and is a logical grouping of data entities. Data is organized into independent and complete domains according to business requirements. Each subject domain corresponds to the data entities involved in a certain domain and provides a complete and consistent description of the data entities in the domain at a higher level.

[0082] Entity: An abstract or concrete thing that is managed and maintained by business needs. Entity comes from business information needs and is a basic business data concept that stores information. Things and concepts such as cars, people, organizations, and plans can all be entities.

[0083] Attribute: Attribute is a specific description of an entity. An entity has multiple attributes to describe the characteristics of the entity. For example, "name" is a description of a person. A person can also be described by many descriptors, such as: name, address, age, income, family, hobbies, relationship with institutions, etc.

[0084] Domain / instance: According to the model design specifications and data standards, domains and instances are used to describe the specific data category, referenced data standards, and code values ​​of each attribute.

[0085] Database tables are usually used to store different types of business data within an enterprise, so that they can be quickly queried, stored, updated, and analyzed to support the business operations and management of the enterprise. However, as business data continues to increase, these existing database tables often have duplicate fields, redundancy, inconsistent data, etc., which is not conducive to data management and maintenance. In order to manage this data more efficiently, it is crucial to establish a unified data model for the database table.

[0086] In the prior art, the creation method of data models is usually based on the functions and requirements of each business. Under different business requirements, even for the same data entity (such as "customer" or "order"), its data structure and fields are only defined according to the current business data requirements to achieve the specific functions of the business or meet the needs of the current application scenario.

[0087] However, the data model creation method in the prior art is only defined according to the current business data requirements, focusing only on the local area without considering the data consistency and compatibility with other business modules or systems. This results in the data structure of the same entity being inconsistent in different modules, which leads to data redundancy, inconsistency, and difficulties in data integration and sharing, increasing the difficulty and cost of development.

[0088] Based on this, the present application proposes a method, device, equipment, medium and product for creating a data model. Since each application system may involve multiple business areas, if there is a unified source definition and management for the common business areas (such as core business entities such as customers, products, orders, etc.), each application system only needs to consider its own proprietary functions without the need to repeatedly define or maintain common data. This not only reduces development and maintenance costs, but also avoids content inconsistencies caused by each system maintaining data separately, thereby improving data accuracy and reliability. Specifically, firstly, the first field (i.e., the first description information) of each record in the first database table (i.e., the second database table) is matched with the second field (i.e., the second description information) of each business domain (subject domain) in the first data model to determine the target business domain corresponding to each record in the application system; then, for each record, the third field (i.e., the third description information) of the corresponding target business domain is used to correspond to the business of the second data model to determine the target business corresponding to each record; then, for each target business, the entity list and attribute list of the target business are generated according to each record corresponding to the target business, the existing stock model entities and stock model attributes; finally, based on the entity and attribute lists just now, the data model corresponding to the target business (i.e., the third data model) is constructed. Through this method, efficient docking of data and business is achieved, and a data model with clear structure and high business adaptability can be provided for the application system. When it is implemented, only the content related to the business itself needs to be considered, which greatly improves the demand reuse, reduces development costs, and enhances maintainability.

[0089] It should be noted that the method and device for creating the data model of the present application can be used in the field of big data, and can also be used in any field except the field of big data. The application field of the method and device for creating the data model of the present application is not limited.

[0090] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0091] Figure 1 Schematic diagram of the process of creating a data model provided in the embodiment of the present application Figure 1 ;like Figure 1 As shown, the method includes:

[0092] S101. Determine a target subject domain corresponding to each second database table in the application system according to a description field in the first database table and a first data model.

[0093] Among them, each record of the first database table corresponds to a second database table, the description field is used to represent the first description information of each second database table, the first data model includes the second description information of each subject domain, and the first data model includes all target subject domains in the application system. Specifically, the above description can be illustrated by Table 1.

[0094] Table 1 Application system data dictionary items

[0095] System English name System Chinese name database Table Chinese name Table English name Dictionary name Chinese name Data categories Data Description Data Category GPP Payment Platform DB Account Table ACCOUNTS 30017 Account Currency Basic data Currency Code Class GPP Payment Platform DB Transaction table MINF 74808 Transaction Type Basic data Change Type Code Class GPP Payment Platform DB Payout Table MOP 70584 Value Date Basic data Start and end time Date Class … … … … … … … … … … GPP Payment Platform DB Account Table DESCRIPT 41637 Value Date Basic data Account Description Text Class

[0096] Among them, the entire Table 1 is the first database table; a record in Table 1 corresponds to a second database table, that is, each row of records starting from the second row in Table 1 corresponds to a second database table; accordingly, each column in Table 1 is a description field of each second database table. For example, a row of records corresponding to the account table in Table 1 corresponds to a second database table, and the text corresponding to the English name, dictionary name, Chinese name, etc. of the corresponding table in the row is a description field of the second database table.

[0097] In one achievable manner, when determining the target subject domain corresponding to each second database table in the application system, in order to reduce the amount of calculation, the first database table also needs to be processed. The specific manner includes:

[0098] First, the records with non-business data types in the first database table are deleted to generate a processed first database table; then, the target subject domain corresponding to each second database table is determined according to the description field in the processed first database table and the first data model.

[0099] Among them, non-business records refer to data records that have no direct relationship with the target subject domain, which may include technical data, derivative data, parameters and other data items.

[0100] It can be understood that by first cleaning non-business data and then matching the first data model with the first database table to determine the target subject domain corresponding to each second database table, this method eliminates unnecessary data and improves the accuracy of data management and the efficiency of system processing.

[0101] S102: For each second database table, determine the target business corresponding to the second database table according to the second data model of the target subject domain corresponding to the second database table and the description field of the second database table.

[0102] The second data model includes third description information of each service.

[0103] It can be understood that by further accurately dividing the second database table according to the description field of the second database table and the second data model of the target subject domain corresponding to the second database table to determine the target business corresponding to the second database table, this method reduces data redundancy and business mismatch, and lays the foundation for further business entity division in the future.

[0104] S103. For the target business, generate an entity list and an attribute list of the target business according to the second database table, stock model entities and stock model attributes corresponding to the target business.

[0105] It is understandable that the entity list and attribute list of the target business are constructed according to the second database table, stock model entity and the attribute of the stock model entity corresponding to the target business. This design method enables the data model to directly reflect business needs and data calls to be more in line with business scenarios.

[0106] S104. Create a third data model corresponding to the target business according to the entity list and the attribute list.

[0107] It should be noted that after creating the third data model corresponding to the target business, it is also necessary to connect the process model and product model to check the integrity of the business and ensure that the input and output data in the process are expressed in the data model. Furthermore, it is possible to iteratively map and analyze other existing data dictionaries to continuously supplement and improve the third data model in related business areas.

[0108] It is understandable that building a data model structure with entity and attribute lists makes each part of the model more modular. For different businesses, the model is more independent. In subsequent maintenance and expansion, only the corresponding list needs to be adjusted, without making large-scale modifications to the global model, which improves the reusability and maintainability of the data model.

[0109] The method for creating a data model provided in the embodiment of the present application first corresponds the first field (i.e., the first description information) of each record in the first database table (i.e., the second database table) to the second field (i.e., the second description information) of each business field (subject domain) in the first data model to determine the target business field corresponding to each record in the application system; then, for each record, the third field (i.e., the third description information) of the corresponding target business field is used to correspond to the business of the second data model to determine the target business corresponding to each record; then, for each target business, according to each record corresponding to the target business, the existing stock model entities and the stock model attributes, the entity list and attribute list of the target business are generated; finally, based on the entity and attribute list just now, the data model corresponding to the target business (i.e., the third data model) is constructed. Through this method, efficient docking of data and business is achieved, and a data model with clear structure and high business adaptability can be provided for the application system. When it is implemented, only the content related to the business itself needs to be considered, which greatly improves the demand reuse, reduces development costs, and enhances maintainability.

[0110] Figure 2 Schematic diagram of the process of creating a data model provided in the embodiment of the present application Figure 2 ;like Figure 2 As shown, in this embodiment Figure 1 Based on the embodiment, the process of generating the entity list and attribute list of the target business is described in detail, and the specific method includes:

[0111] S201. For a second database table corresponding to a target business, if a first model entity corresponding to the second database table exists in the stock model entity, the first model entity is associated with the second database table.

[0112] It should be understood that after determining the target business corresponding to the second database table according to the first data model and the second data model, the second database table is entity mapped and associated according to the existing model entity. The second database table can directly reference the fields and structures in the first model entity without redefining or copying the same data fields, thereby ensuring the consistency of data between the two and reducing data inconsistency problems caused by multiple independent data sources.

[0113] In an optional manner, a specific manner of associating the first model entity with the second database table includes:

[0114] First, if there is a first model entity corresponding to the second database table in the existing model entity, and the name of the first model entity does not meet the naming rules of the target business, a second model entity corresponding to the second database table is created according to the naming rules, and the second model entity is associated with the second database table; then, if there is a first model entity corresponding to the second database table in the existing model entity, and the name of the first model entity meets the naming rules of the target business, the first model entity is associated with the second database table.

[0115] It should be noted that the naming rules of the first model entity are generally added with reference to the three normal forms, namely the purpose, definition and scope of the entity. Among them, the purpose is to describe the intention and function of creating the entity; the definition is to describe the accurate business meaning of the entity; the scope is to describe the specific scope of the business information recorded by the entity. This naming method reduces the different understandings of the same data in different systems or business modules and improves data consistency. Specifically, the specific method of entity definition can be explained in Table 2 below, which is a specific example of defining entities according to the three normal forms.

[0116] Table 2 Entity definition example table

[0117]

[0118] It can be understood that by first determining whether there is a first model entity corresponding to the second database table in the existing model entity, if the first model entity exists but the name of the first model entity does not meet the naming rules of the target business, a new second model entity that meets the naming rules is created according to the naming rules of the target business, and then the second model entity is associated with the second database table, which ensures that the name of the new model entity is consistent with the current business requirements. Correspondingly, if there is a first model entity corresponding to the second database table in the existing model entity, and the name of the first model entity meets the naming rules of the target business, the existing first model entity is directly associated with the second database table without creating a new model entity. This not only reuses the existing model entity, but also ensures that its name meets business requirements. In this way, it helps to unify naming standards in complex systems, reduce data redundancy, and enable systems to share data more efficiently.

[0119] S202: If the first model entity corresponding to the second database table does not exist in the existing model entity, create a second model entity corresponding to the second database table, and associate the second model entity with the second database table.

[0120] It is understandable that if the first model entity corresponding to the second database table does not exist in the existing model entity, it means that the existing model entity does not cover the first model entity corresponding to the current second database table. In order to ensure the integrity of the existing model entity and subsequent availability, it is necessary to create a new second model entity corresponding to it according to the requirements of the second database table. This model entity should contain the structure and business semantics of the second database table and follow the enterprise's naming rules and three-paradigm naming method for subsequent management and understanding.

[0121] S203: If the first model attribute corresponding to the second database table exists in the stock model attributes, the first model attribute is associated with the second database table.

[0122] Accordingly, the specific manner of associating the first model attribute with the second database table includes:

[0123] First, if there is a first model attribute corresponding to the second database table in the stock model attributes, and the name of the first model attribute does not meet the naming rules of the target business, then the second model attribute corresponding to the second database table is created according to the naming rules, and the second model attribute is associated with the second database table; then, if there is a first model attribute corresponding to the second database table in the stock model attributes, and the name of the first model attribute meets the naming rules of the target business, then the first model attribute is associated with the second database table.

[0124] It should be noted that the naming rules of the first model attributes are also added with reference to the three normal forms, namely the purpose, definition and scope of the attribute. Among them, the purpose is to describe the intention and function of creating the attribute; the definition is to describe the accurate business meaning of the attribute; the scope is to describe the specific scope of the business information recorded by the attribute. This naming method reduces the different understandings of the same data in different systems or business modules and improves data consistency. Specifically, the specific method of attribute definition can be explained in Table 3 below, which is a specific example of defining attributes according to the three normal forms.

[0125] Table 3 Attribute definition example table

[0126] Property Name Attribute Purpose Property Definition Attribute Range Ticket submission time Used to record the time of submitting the bill application Record the time of ticket application Legal date Bill amount Record the specific amount of the bill The specific amount recorded on the bill Legal values Bill issue date Used to record the issue date of the ticket The specific date of issue recorded on the bill Legal date … … … … Note Contract Number Used to uniquely identify the bill contract The bill contract number is the unique number of the bill contract Legal Number

[0127] It can be understood that by first determining whether the first model attribute corresponding to the second database table exists in the stock model attribute, if it exists but the name of the first model attribute does not meet the naming rules of the target business, a new second model attribute that meets the naming rules is created according to the naming rules of the target business, and then the second model attribute is associated with the second database table; correspondingly, if the first model attribute corresponding to the second database table exists in the stock model attribute, and the name of the first model attribute meets the naming rules of the target business, the existing first model attribute is directly associated with the second database table without creating a new model attribute. This method can not only reduce system complexity, but also provide strong support for subsequent data expansion and business development.

[0128] S204: If the first model attribute corresponding to the second database table does not exist in the stock model attributes, create a second model attribute corresponding to the second database table, and associate the second model attribute with the second database table.

[0129] It can be understood that when the corresponding attribute is not found in the existing model attributes, by creating a new second model attribute and associating it with the second database table, the existing data model can be effectively expanded to ensure that the needs of the new business are met and provide support for subsequent system expansion, data sharing and maintenance.

[0130] S205: Generate an entity list and an attribute list of the target business according to the model attributes and model entities associated with each database table.

[0131] The entity list contains all model entities related to the target business; the attribute list contains the specific attributes of each business entity.

[0132] Furthermore, according to the entity list and attribute list of the target business obtained in the above embodiment, the method for creating a third data model corresponding to the target business includes:

[0133] First, an initial entity list and an initial attribute list of the target business are generated according to the model attributes and model entities associated with each database table; then, the initial entity list and the initial attribute list are deduplicated to generate an entity list and an attribute list.

[0134] It should be noted that before forming the entity list and attribute list, deduplication processing is required to ensure that the entity list and attribute list have no redundant entities and attributes and can accurately reflect the needs of the target business.

[0135] It can be understood that first, the model attributes and model entities associated with each database table are traversed, all business entities and all attributes of each entity are listed respectively, and the corresponding initial entity list and initial attribute list are generated; further, check whether there are duplicate entities in the initial entity list, remove redundant entities according to their business meaning, definition and scope, and deduplicate the attribute list of each entity to ensure that each attribute is unique and non-duplicate in the same entity. Finally, the entity list and attribute list after deduplication are generated to ensure that the relationship between each business field and data model is clear and non-redundant. This method ensures the uniqueness of the data model generated subsequently and reduces the complexity of data maintenance.

[0136] In one achievable manner, the specific process of creating the third data model corresponding to the target business includes:

[0137] First, based on the entity list, obtain the entity definition table corresponding to the target business; then, based on the attribute list, obtain the attribute definition table corresponding to the target business; then, based on the entity list and the attribute list, create or update the entity relationship diagram corresponding to the target business; finally, based on the attribute list, obtain the domain list.

[0138] Among them, the third data model includes an entity list, an attribute list, an entity definition table, an attribute definition table, an entity relationship diagram and a domain list; the entity definition table includes the explanatory information of the model entities corresponding to the target business; the attribute definition table includes the explanatory information of the model attributes corresponding to the target business; the domain list includes the data categories, referenced data standards and code values ​​to which the model attributes contained in the attribute list belong.

[0139] It should be noted that the entity relationship diagram is a graphical representation tool used to describe the data model, which shows the entities, the relationships between entities and the attributes of the entities.

[0140] Furthermore, the specific steps for establishing the entity relationship diagram are as follows: first, add new entities according to the entity list and attribute list; then determine the relationship between entities and define the entity relationship; finally, check the relationship between entities in different target subject domains to identify the key attributes between entities and establish an entity relationship diagram. The entity relationship mainly includes: inheritance relationship, reference relationship, and self-association relationship. Specifically, the inheritance relationship represents the inheritance of the parent entity by the child entity; the reference relationship represents the association relationship between one entity and another entity, including attribute entities and reference entities; the self-association relationship is the association method between the same entities, which is called self-association, indicating that there is a self-association between instances of an entity, such as in the "student" entity, the class monitor and ordinary students have a management and management relationship.

[0141] The domain list is mainly used to indicate the type, length and other attributes of data items, such as text class, date and time class, etc. The code value is the data definition of the code class and the specific instance it contains.

[0142] It is understandable that by obtaining entity lists, attribute lists, entity definition tables, attribute definition tables, entity relationship diagrams, and domain lists, and combining this information to establish a third data model, data sharing and cross-system integration can be effectively achieved. By defining clear entities and attributes, the system can be expanded more easily. New business needs or business changes only need to be expanded in the data model, without making major changes to the existing system structure. Data maintenance and updates rely more on model changes rather than modifying database tables one by one, which greatly reduces the error rate of manual operations and improves efficiency.

[0143] Figure 3 An entity relationship diagram of a method for creating a data model provided in an embodiment of the present application; Figure 3 As shown, this figure is an example diagram of entity relationship.

[0144] It should be noted that the specific method of establishing the entity relationship diagram has been Figure 2 The details are described in the embodiments, and the embodiments of the present application will not be described in detail here.

[0145] Figure 4 A schematic diagram of the structure of a device for creating a data model provided in an embodiment of the present application; Figure 4 As shown, the data model creation device 40 provided in this embodiment includes: a first determination module 401 , a second determination module 402 , a generation module 403 , and a creation module 404 .

[0146] A first determination module 401 is used to determine the target subject domain corresponding to each second database table in the application system according to the description field in the first database table and the first data model, each record in the first database table corresponds to a second database table, the description field is used to represent the first description information of each second database table, and the first data model includes the second description information of each subject domain;

[0147] A second determination module 402 is used to determine, for each second database table, a target business corresponding to the second database table according to a second data model of a target subject domain corresponding to the second database table and a description field of the second database table, wherein the second data model includes third description information of each business;

[0148] A generating module 403 is used to generate an entity list and an attribute list of the target business according to the second database table, the stock model entity and the stock model attribute corresponding to the target business;

[0149] The creation module 404 is used to create a third data model corresponding to the target business according to the entity list and the attribute list.

[0150] In a possible implementation, the generating module 403 is specifically configured to:

[0151] For the second database table corresponding to the target business, if the first model entity corresponding to the second database table exists in the stock model entity, the first model entity is associated with the second database table;

[0152] If the first model entity corresponding to the second database table does not exist in the existing model entity, create a second model entity corresponding to the second database table, and associate the second model entity with the second database table;

[0153] If the first model attribute corresponding to the second database table exists in the stock model attribute, the first model attribute is associated with the second database table;

[0154] If the first model attribute corresponding to the second database table does not exist in the stock model attribute, create a second model attribute corresponding to the second database table, and associate the second model attribute with the second database table;

[0155] Generate a list of entity attributes of the target business based on the model attributes and model entities associated with each database table.

[0156] In a possible implementation, the data model creation device further includes a processing module 405, which is specifically configured to:

[0157] If the first model entity corresponding to the second database table exists in the existing model entity, and the name of the first model entity does not meet the naming rule of the target business, then create a second model entity corresponding to the second database table according to the naming rule, and associate the second model entity with the second database table;

[0158] If the first model entity corresponding to the second database table exists in the stock model entity, and the name of the first model entity meets the naming rule of the target business, then the first model entity is associated with the second database table;

[0159] Correspondingly, if the first model attribute corresponding to the second database table exists in the stock model attribute, the first model attribute is associated with the second database table, including:

[0160] If the first model attribute corresponding to the second database table exists in the existing model attributes, and the name of the first model attribute does not meet the naming rule of the target business, then create a second model attribute corresponding to the second database table according to the naming rule, and associate the second model attribute with the second database table;

[0161] If the first model attribute corresponding to the second database table exists in the stock model attributes, and the name of the first model attribute meets the naming rule of the target business, the first model attribute is associated with the second database table.

[0162] In a possible implementation, the creation module 404 is specifically configured to:

[0163] Generate an initial entity list and an initial attribute list of the target business according to the model attributes and model entities associated with each database table;

[0164] The initial entity list and the initial attribute list are deduplicated to generate an entity list and an attribute list.

[0165] In a possible implementation manner, the first determining module 401 is specifically configured to:

[0166] Deleting records in the first database table whose data type is non-business, and generating a processed first database table;

[0167] According to the processed description fields in the first database table and the first data model, a target subject domain corresponding to each second database table is determined.

[0168] In a possible implementation, the creation module 404 is specifically configured to:

[0169] According to the entity list, an entity definition table corresponding to the target business is obtained, where the entity definition table includes explanation information of the model entity corresponding to the target business;

[0170] According to the attribute list, an attribute definition table corresponding to the target business is obtained, where the attribute definition table includes explanation information of the model attributes corresponding to the target business;

[0171] Create or update the entity relationship diagram corresponding to the target business based on the entity list and attribute list;

[0172] According to the attribute list, a domain list is obtained, wherein the domain list includes the data category, referenced data standard and code value to which the model attributes contained in the attribute list belong;

[0173] The third data model includes an entity list, an attribute list, an entity definition table, an attribute definition table, an entity relationship diagram, and a domain list.

[0174] The data model creation device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be described in detail here.

[0175] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 5As shown, the electronic device 50 provided in this embodiment includes: at least one processor 501 and a memory 502. Optionally, the device 50 also includes a communication component 503. The processor 501, the memory 502 and the communication component 503 are connected via a bus 504.

[0176] In a specific implementation process, at least one processor 501 executes the computer-executable instructions stored in the memory 502, so that at least one processor 501 executes the above method.

[0177] The specific implementation process of the processor 501 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.

[0178] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.

[0179] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-volatile Memory, NVM), such as at least one disk memory.

[0180] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.

[0181] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.

[0182] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.

[0183] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.

[0184] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.

[0185] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.

[0186] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0187] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0188] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0189] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0190] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.

Claims

1. A method for creating a data model, characterized in that: include: Determine the target subject domain corresponding to each second database table in the application system according to the description field in the first database table and the first data model, each record of the first database table corresponds to a second database table, the description field is used to represent the first description information of each second database table, and the first data model includes the second description information of each subject domain; For each second database table, determining a target business corresponding to the second database table according to a second data model of a target subject domain corresponding to the second database table and a description field of the second database table, wherein the second data model includes third description information of each business; For the target business, generate an entity list and an attribute list of the target business according to the second database table, the stock model entity and the stock model attribute corresponding to the target business; A third data model corresponding to the target business is created according to the entity list and the attribute list.

2. The method according to claim 1, characterized in that: The step of generating, for the target business, an entity list and an attribute list of the target business according to the second database table, the stock model entity and the stock model attribute corresponding to the target business, includes: For the second database table corresponding to the target business, if the first model entity corresponding to the second database table exists in the stock model entity, the first model entity is associated with the second database table; If the first model entity corresponding to the second database table does not exist in the stock model entity, creating a second model entity corresponding to the second database table, and associating the second model entity with the second database table; If the first model attribute corresponding to the second database table exists in the stock model attribute, associating the first model attribute with the second database table; If the first model attribute corresponding to the second database table does not exist in the stock model attribute, creating a second model attribute corresponding to the second database table, and associating the second model attribute with the second database table; According to the model attributes and model entities associated with each database table, an entity attribute list of the target business is generated.

3. The method according to claim 2, characterized in that If the first model entity corresponding to the second database table exists in the stock model entity, associating the first model entity with the second database table includes: If the first model entity corresponding to the second database table exists in the stock model entity, and the name of the first model entity does not meet the naming rule of the target business, create a second model entity corresponding to the second database table according to the naming rule, and associate the second model entity with the second database table; If the first model entity corresponding to the second database table exists in the stock model entity, and the name of the first model entity meets the naming rule of the target business, then associating the first model entity with the second database table; Correspondingly, if the stock model attribute contains the first model attribute corresponding to the second database table, associating the first model attribute with the second database table includes: If the first model attribute corresponding to the second database table exists in the stock model attributes, and the name of the first model attribute does not meet the naming rule of the target business, creating a second model attribute corresponding to the second database table according to the naming rule, and associating the second model attribute with the second database table; If the first model attribute corresponding to the second database table exists in the stock model attributes, and the name of the first model attribute meets the naming rule of the target business, the first model attribute is associated with the second database table.

4. The method according to claim 2 or 3, characterized in that: The step of creating a third data model corresponding to the target business according to the entity list and the attribute list includes: Generate an initial entity list and an initial attribute list of the target business according to the model attributes and model entities associated with each database table; The initial entity list and the initial attribute list are deduplicated respectively to generate the entity list and the attribute list.

5. The method according to any one of claims 1 to 3, characterized in that: The step of determining the target subject domain corresponding to each second database table in the application system according to the description field in the first database table and the first data model includes: Deleting records in the first database table whose data type is non-business, and generating a processed first database table; According to the processed description fields in the first database table and the first data model, a target subject domain corresponding to each second database table is determined.

6. The method according to any one of claims 1 to 3, characterized in that: The step of creating a third data model corresponding to the target business according to the entity list and the attribute list includes: According to the entity list, an entity definition table corresponding to the target business is obtained, wherein the entity definition table includes explanation information of the model entity corresponding to the target business; According to the attribute list, obtaining an attribute definition table corresponding to the target business, wherein the attribute definition table includes explanation information of the model attributes corresponding to the target business; Creating or updating an entity relationship graph corresponding to the target business according to the entity list and the attribute list; According to the attribute list, a domain list is obtained, wherein the domain list includes data categories, referenced data standards and code values ​​to which the model attributes contained in the attribute list belong; The third data model includes the entity list, the attribute list, the entity definition table, the attribute definition table, the entity relationship diagram, and the domain list.

7. A device for creating a data model, characterized in that: include: A first determination module is used to determine the target subject domain corresponding to each second database table in the application system according to the description field in the first database table and the first data model, each record of the first database table corresponds to a second database table, the description field is used to represent the first description information of each second database table, and the first data model includes the second description information of each subject domain; A second determination module is used to determine, for each second database table, a target business corresponding to the second database table according to a second data model of a target subject domain corresponding to the second database table and a description field of the second database table, wherein the second data model includes third description information of each business; A generating module, configured to generate, for a target business, an entity list and an attribute list of the target business according to a second database table, stock model entities and stock model attributes corresponding to the target business; A creation module is used to create a third data model corresponding to the target business according to the entity list and the attribute list.

8. An electronic device, characterized in that: include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 6 when executed by a processor.

10. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.