Method and system for creating a master data model
By configuring field and attribute rules, the table structure and API interface of the master data target model are generated, which solves the problem of inconsistent data standards among different business units, realizes dynamic maintenance and creation of the master data model, and improves system efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA TELECOM DIGITAL INTELLIGENCE TECH CO LTD
- Filing Date
- 2023-02-07
- Publication Date
- 2026-06-19
Smart Images

Figure CN116185360B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing. More specifically, this invention relates to a method and system for creating a master data model. Background Technology
[0002] As information systems proliferate, new problems emerge: users across different business units use different data standards, and there is a lack of connection points between different management systems. These issues lead to deteriorating data quality and reduced system efficiency. In particular, there are no good solutions for the dynamic maintenance of master data models in existing technologies. Most master data models in existing technologies are not reusable and cannot be dynamically expanded for different types of master data, thus creating a bottleneck for master data maintenance. Summary of the Invention
[0003] One object of the present invention is to provide a method and system for creating a master data model to solve the above-mentioned problems.
[0004] To achieve the objectives and other advantages of this invention, a method for creating a master data model is provided, comprising:
[0005] Obtain the initial model data of the master data;
[0006] Configure the field restriction rules and field attribute rules of the initial master data model to obtain the target master data model;
[0007] The master data target model is approved. If the approval is successful, the master data target model is published, and the table structure corresponding to the master data target model is generated based on the DDL statement information of the master data target model. The API interface corresponding to the field information of the master data target model is also generated based on the field information of the master data target model. If the approval is unsuccessful, the creation of the master data model is terminated.
[0008] Preferably, in the method for creating the master data model, the field restriction rules include whether it is modifiable, whether it is a primary key field, whether it is an encoded field, whether it is data anonymized, value range check type, and associated object.
[0009] Preferably, in the method for creating the master data model, the field attribute rules include field encoding, field name, data type, length, precision, and enabled status.
[0010] Preferably, in the method for creating the master data model, the table structure includes a master data subject area table, a master data master table, a master data relationship table, an encoding rule table, and a dictionary table.
[0011] This invention also provides a system for creating a master data model, comprising:
[0012] The acquisition module is used to acquire the initial model data of the master data.
[0013] The configuration module is used to configure the field restriction rules and field attribute rules of the initial master data model to obtain the target master data model;
[0014] The approval module is used to approve the master data target model. If the approval is successful, the master data target model is published; otherwise, the creation of the master data model ends.
[0015] The table structure generation module is used to generate the table structure corresponding to the master data target model based on the DDL statement information of the master data target model after the model is published.
[0016] The dynamic interface generation module is used to generate API interfaces corresponding to the fields of the master data target model based on the field information of the master data target model after the model is published.
[0017] Preferably, in the master data model creation system, the field restriction rules include whether it is modifiable, whether it is a primary key field, whether it is an encoded field, whether it is data anonymized, value range check type, and associated object.
[0018] Preferably, in the master data model creation system, the field attribute rules include field code, field name, data type, length, precision, and enabled status.
[0019] Preferably, in the master data model creation system, the table structure includes a master data subject area table, a master data master table, a master data relationship table, an encoding rule table, and a dictionary table.
[0020] The present invention also provides a storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method.
[0021] The present invention also provides an electronic device, comprising: at least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to cause the at least one processor to perform the method described above.
[0022] The present invention has at least the following beneficial effects:
[0023] This invention, during the creation of the master data model, configures field restriction rules and field attribute rules, and automatically generates corresponding API interfaces for fields based on the field information of the master data target model. This enables the dynamic creation of instance class master data, the table structure of instance class master data, and API interfaces with a single model data entry, achieving the function of dynamic maintenance and creation of the master data model.
[0024] Other advantages, objectives and features of the present invention will become apparent in part from the following description, and in part from those skilled in the art through study and practice of the invention. Attached Figure Description
[0025] Figure 1 This is a flowchart illustrating a method for creating a master data model according to an embodiment of the present invention;
[0026] Figure 2 This is a schematic diagram of the structure of a master data model creation system according to another embodiment of the present invention; Detailed Implementation
[0027] The present invention will now be described in further detail with reference to the embodiments and accompanying drawings, so that those skilled in the art can implement it based on the description.
[0028] It should be understood that terms such as “having,” “comprising,” and “including” as used herein do not exclude the presence or addition of one or more other elements or combinations thereof.
[0029] like Figure 1 As shown, the present invention provides a method for creating a master data model, comprising:
[0030] S10. Obtain the initial model data of the master data.
[0031] Model data can be imported in batches by the user or processed manually through views; when creating an initial model, the initial model can be placed in a certain domain, and the surrounding attributes of the initial model can be set according to the relevant domain; the initial model can inherit, combine, and associate with other models.
[0032] S20. Configure the field restriction rules and field attribute rules of the initial master data model to obtain the target master data model.
[0033] When configuring field restriction rules, it is supported to enter a single field, and it is also supported to reference existing model fields. Field restriction rules include, but are not limited to: whether it can be modified, whether it is a primary key field, whether it is an encoded field, whether it is data anonymization, value range check type, and associated objects. If the field has relevant restrictions, the program can restrict the value according to the relevant restriction rules when filling in the value.
[0034] Field attribute rules include, but are not limited to: field encoding, field name, data type, length, precision, and enabled status; among which, the data type can be selected from a variety of built-in types, such as: number, string, date, time, file, and image.
[0035] S30. Approve the master data target model. If the approval is successful, publish the master data target model; otherwise, end the master data model creation.
[0036] Model approval utilizes the ITSM approval process engine, which supports configurable processing and multi-level approval. The approval module employs a pluggable design, allowing for flexible integration across multiple business modules. After model editing, the model is still in the unapproved stage. At this point, the approval process engine's exposed interface sends the model to a buffer queue, specifying the approver and approval level. As the model circulates within the approval process engine, each node triggers SMS and email gateways to send email and SMS notifications for key information. Once the approval process engine completes the approval, the result is placed in a message queue. The master data system subscribes to this topic and parses the approval result. Approved models can be automatically published, signifying their usability. If approval fails, the creation of the master data model ends.
[0037] S40. After the model is published, the table structure corresponding to the master data target model is generated based on the DDL statement information of the master data target model.
[0038] Before sending the master data target model into the approval process engine, the backend generates DDL statements based on the entered model data, field restriction rules, and field attribute rules. After the model is published, the backend uses the DDL statements and encapsulated DDL algorithms, along with technologies such as reflection and dynamic proxies, to automate the model table, instance data table, and other peripheral auxiliary tables corresponding to the master data target model, generating the table structure corresponding to the master data target model. This table structure includes a master data subject area table, a master data main table, a master data relationship table, an encoding rule table, and a dictionary table. The master data subject area table primarily stores the themes of the master data (master data can be categorized by theme). The master data main table stores relevant table field information for each type of master data, such as master data encoding, master data name, version number, and field length. The master data relationship table stores the reference relationships between master data sets. The encoding rule table stores built-in encoding rules, and when fields are entered, the validation rules for those fields can be specified during data entry. The field table stores dictionary values.
[0039] S50. Generate API interfaces corresponding to the fields of the master data target model based on the field information of the master data target model.
[0040] After the model is published, the backend will automatically generate the corresponding CRUD API interfaces based on the model fields and using technologies such as reflection, dynamic proxy, recursion, and divide-and-conquer algorithms. When the instance class master data is inserted into the database, the input parameter fields are validated according to the validation rules set for each field in the model configuration. If the validation is successful, the data can be inserted into the database normally.
[0041] The method of this invention rapidly generates an initial master data model based on the master data under management, and dynamically specifies corresponding maintenance fields and validation rules (field restriction rules and field attribute rules) according to the relevant rules of the master data. This enables the configurability of field types and attributes, and performs corresponding rule validation on the instance class master data according to the rules. The model release can be connected to the ITSM approval process engine of the integrated reporting system for customized process approval, and automatically notify relevant approvers via SMS according to the approval process. After the release is completed, the corresponding model table and the corresponding CRUD API interface for instance class master data can be automatically generated in the database, achieving one-click configuration, no code modification required, and automatic business process integration. It also enables the dynamic creation of instance class master data, the table structure of instance class master data, and API interfaces with a single model data entry, achieving the function of dynamic maintenance and creation of master data models.
[0042] like Figure 2 As shown, this invention provides a master data model creation system, including an acquisition module, a configuration module, an approval module, a table structure generation module, and a dynamic interface generation module. Among them,
[0043] The acquisition module is used to acquire the initial model data of the master data.
[0044] Model data can be imported in batches by the user or processed manually through views; when creating an initial model, the initial model can be placed in a certain domain, and the surrounding attributes of the initial model can be set according to the relevant domain; the initial model can inherit, combine, and associate with other models.
[0045] The configuration module is used to configure the field restriction rules and field attribute rules of the initial master data model to obtain the target master data model.
[0046] When configuring field restriction rules, it is supported to enter a single field, and it is also supported to reference existing model fields. Field restriction rules include, but are not limited to: whether it can be modified, whether it is a primary key field, whether it is an encoded field, whether it is data anonymization, value range check type, and associated objects. If the field has relevant restrictions, the program can restrict the value according to the relevant restriction rules when filling in the value.
[0047] Field attribute rules include, but are not limited to: field encoding, field name, data type, length, precision, and enabled status; among which, the data type can be selected from a variety of built-in types, such as: number, string, date, time, file, and image.
[0048] The approval module is used to approve the master data target model. If the approval is successful, the master data target model is published; otherwise, the creation of the master data model ends.
[0049] Model approval utilizes the ITSM approval process engine, which supports configurable processing and multi-level approval. The approval module employs a pluggable design, allowing for flexible integration across multiple business modules. After model editing, the model is still in the unapproved stage. At this point, the approval process engine's exposed interface sends the model to a buffer queue, specifying the approver and approval level. As the model circulates within the approval process engine, each node triggers SMS and email gateways to send email and SMS notifications for key information. Once the approval process engine completes the approval, the result is placed in a message queue. The master data system subscribes to this topic and parses the approval result. Approved models can be automatically published, signifying their usability. If approval fails, the creation of the master data model ends.
[0050] The table structure generation module is used to generate the table structure corresponding to the master data target model based on the DDL statement information of the master data target model after the model is published.
[0051] Before sending the master data target model into the approval process engine, the backend generates DDL statements based on the entered model data, field restriction rules, and field attribute rules. After the model is published, the backend uses the DDL statements and encapsulated DDL algorithms, along with technologies such as reflection and dynamic proxies, to automate the model table, instance data table, and other peripheral auxiliary tables corresponding to the master data target model, generating the table structure corresponding to the master data target model. This table structure includes a master data subject area table, a master data main table, a master data relationship table, an encoding rule table, and a dictionary table. The master data subject area table primarily stores the themes of the master data (master data can be categorized by theme). The master data main table stores relevant table field information for each type of master data, such as master data encoding, master data name, version number, and field length. The master data relationship table stores the reference relationships between master data sets. The encoding rule table stores built-in encoding rules, and when fields are entered, the validation rules for those fields can be specified during data entry. The field table stores dictionary values.
[0052] The dynamic interface generation module is used to generate API interfaces corresponding to the fields of the master data target model based on the field information of the master data target model.
[0053] After the model is published, the backend will automatically generate the corresponding CRUD API interfaces based on the model fields and using technologies such as reflection, dynamic proxy, recursion, and divide-and-conquer algorithms. When the instance class master data is inserted into the database, the input parameter fields are validated according to the validation rules set for each field in the model configuration. If the validation is successful, the data can be inserted into the database normally.
[0054] The system of this invention quickly generates an initial master data model based on the master data under management, and dynamically specifies corresponding maintenance fields and validation rules (field restriction rules and field attribute rules) according to the relevant rules of the master data. It realizes the configurability of field types and attributes, and performs corresponding rule validation on instance class master data according to the rules. The model release can be connected to the ITSM approval process engine of the comprehensive reporting system and perform customized process approval. It automatically notifies relevant approvers via SMS according to the approval process. After the release is completed, it can automatically generate the corresponding model table in the database and generate the corresponding CRUD API interface for instance class master data, achieving the goal of one-click configuration, no code modification, and automatic business process connection. It also realizes the dynamic creation of instance class master data, instance class master data table structure and API interface with one model data entry, achieving the function of dynamic maintenance and creation of master data model.
[0055] The present invention also provides a storage medium, which includes various media capable of storing program code such as ROM, RAM, magnetic disk or optical disk, wherein a computer program is stored, and when the computer program is loaded and executed by a processor, it implements all or part of the steps of the above-described method for creating the master data model.
[0056] The present invention also provides an electronic device, which includes a processor (CPU / MCU / SOC) and a memory (ROM / RAM), such as a desktop computer, a portable computer, or a smartphone. Specifically, the memory stores a computer program, and when the processor loads and executes the computer program, it implements all or part of the steps of the aforementioned master data model creation method.
[0057] Although embodiments of the present invention have been disclosed above, they are not limited to the applications listed in the specification and embodiments. They can be applied to various fields suitable for the present invention. For those skilled in the art, other modifications can be easily made. Therefore, without departing from the general concept defined by the claims and their equivalents, the present invention is not limited to the specific details and illustrations shown and described herein.
Claims
1. A method of creating a master data model, characterized by, include: Obtain the initial model data of the master data; Configure the field restriction rules and field attribute rules of the initial master data model to obtain the target master data model; wherein, the field restriction rules include whether data is desensitized, and after the field restriction rules and field attribute rules are configured, the background automatically generates DDL statements; The master data target model is approved using an ITSM approval process engine. The ITSM approval process engine supports configurable processing and multi-level approval. The approval module is pluggable and can be flexibly integrated into multiple business modules. The master data target model is sent to the approval buffer queue and a specific approver and approval level are specified. When the approval flow reaches each node, SMS and email gateways are triggered to send key information reminders. The approval result is fed back through a message queue, and the master data system subscribes to and parses the approval result. If approved, the master data target model is released. Based on the DDL statement information of the master data target model, and combined with the encapsulated DDL algorithm, reflection, and dynamic proxy technology, the table structure corresponding to the master data target model is automatically generated. The table structure includes a master data subject domain table, a master data main table, a master data relationship table, an encoding rule table, and a dictionary table. Simultaneously, based on the field information of the master data target model, CRUD API interfaces corresponding to the fields of the master data target model are generated using reflection, dynamic proxy, recursion, and divide-and-conquer algorithms. When instance class master data is added to the database, the API interfaces automatically validate the input parameter fields according to the field validation rules. If the approval fails, the creation of the master data model will be terminated.
2. The method of creating a master data model of claim 1, wherein, The field restriction rules also include whether it is modifiable, whether it is a primary key field, whether it is an encoded field, the value range check type, and the associated object.
3. The method of creating a master data model of claim 1, wherein, The field attribute rules include field encoding, field name, data type, length, precision, and enabled status.
4. A master data model creation system, characterized in that, include: The acquisition module is used to acquire the initial model data of the master data. The configuration module is used to configure the field restriction rules and field attribute rules of the initial master data model to obtain the master data target model; wherein, the field restriction rules include whether data is desensitized, and after the field restriction rules and field attribute rules are configured, the background automatically generates DDL statements; The approval module is used to approve the master data target model using the ITSM approval process engine. The ITSM approval process engine supports configurable processing and multi-level approval. The approval module has a pluggable design and can be flexibly integrated into multiple business modules. The master data target model is sent to the approval buffer queue and a specific approver and approval level are specified. When the approval flow reaches each node, it triggers SMS and email gateways to send key information reminders. The approval result is fed back through the message queue, and the master data system subscribes to and parses the approval result. If the approval is passed, the master data target model is published; otherwise, the creation of the master data model ends. The table structure generation module is used to automatically generate the table structure corresponding to the master data target model after the model is published, based on the DDL statement information of the master data target model and in combination with the encapsulated DDL algorithm, reflection and dynamic proxy technology. The table structure includes a master data subject domain table, a master data main table, a master data relationship table, an encoding rule table and a dictionary table. The dynamic interface generation module is used to generate CRUD API interfaces corresponding to the fields of the master data target model after the model is published, based on the field information of the master data target model, using reflection, dynamic proxy, recursion and divide-and-conquer algorithms. When the instance class master data is entered into the database, the API interface automatically validates the input parameter fields according to the field validation rules.
5. The master data model creation system as described in claim 4, characterized in that, The field restriction rules also include whether it is modifiable, whether it is a primary key field, whether it is an encoded field, the value range check type, and the associated object.
6. The system for creating a master data model of claim 4, wherein, The field attribute rules include field encoding, field name, data type, length, precision, and enabled status.
7. A storage medium having stored thereon a computer program, characterized in that When the program is executed by the processor, it implements the method of any one of claims 1-3.
8. An electronic device, characterized by include: At least one processor, and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to perform the method of any one of claims 1-3.