CN109947741B - Method for modeling and storing attribute parameters of items - Google Patents
Method for modeling and storing attribute parameters of items Download PDFInfo
- Publication number
- CN109947741B CN109947741B CN201910104873.XA CN201910104873A CN109947741B CN 109947741 B CN109947741 B CN 109947741B CN 201910104873 A CN201910104873 A CN 201910104873A CN 109947741 B CN109947741 B CN 109947741B
- Authority
- CN
- China
- Prior art keywords
- item
- class
- attribute
- variable type
- relationship
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Abstract
The invention aims to disclose a method for modeling and storing attribute parameters of an item, which adopts 'name-real separation' to perform data modeling, can realize the modeling of all attributes and relations of all items through four core classes and a plurality of non-core classes, and realizes the storage of all version data and accessory information thereof.
Description
Technical Field
The invention relates to a method for modeling and storing parameters, in particular to a method for modeling and storing object property parameters for software development.
Background
During software development, entity classes, attributes and relationships are usually modeled by a conceptual model (generally, an E-R diagram or a class diagram, which has different forms but the same expression), and then the implementation of the conceptual model in a database (namely, the detailed description of a data table) is described by a physical model after the E-R diagram is logically converted into a relationship. Generally, an entity class in a conceptual model corresponds to a data table in a physical model, wherein each field (or column) of the data table corresponds to an attribute of the entity class, and each record corresponds to an instance of the entity class. In addition, the entity class and the "many-to-many relationship" between entity classes are realized by separately creating data tables.
Although the above-mentioned "one entity class and one data table (hereinafter referred to as an entity table)" and "one entity to one data table (hereinafter referred to as a contact table)" are widely used, there are the following problems for the data management system of an enterprise:
1) If there are many entity classes, hundreds of entity classes, and there may be a connection between every two entities, it is necessary to create an entity table of O (N) order and a connection table of O (N × N) order, and as the business of the enterprise is developed or the data of the enterprise is sorted deeper, the connections between the entity classes and the entities may be continuously increased or modified, thereby causing dynamic table building of the database, and bringing great challenges to database maintenance and software development.
2) If the attributes (or called member variables) of an entity class are hundreds, and the number of instances of the entity class is small, the entity table corresponding to the entity class has a situation of "few rows and many columns", which, on one hand, makes the database table building workload heavy (to describe hundreds of fields), and on the other hand, cannot fully exert the advantages of the database in the data "add, delete" (create, retrieve, update, delete, CRUD).
3) The attribute value of the instance stored in the entity table may be only one piece of data, or one version of data, and may not store all versions of data. If a software system needs to store data values formed by certain entity attributes in different stages, a plurality of data tables (namely one table at one stage) need to be established, however, the storage problem of data of indefinite versions cannot be solved because the number of 'stages' or 'versions' of each attribute is indefinite and unequal.
4) In the above-described entity table, only the attribute values of the items are stored. However, a software system often stores, in addition to the attribute value, other information related to the attribute value, such as data entry time, data version, entered flow information, data source, data security level, and the like. Although this information may also be stored by designing a contact list or log, a database designed in this manner would be very complex "E-R" if the information itself were important.
In summary, when a data management system of an enterprise is built, if there are many entity types and attributes and relationships of each entity, an indefinite version of a data value needs to be stored, and a "coming and going" of each data value needs to be stored at the same time, in this case, the traditional data modeling and storing manner is "frustrated".
Therefore, there is a particular need for a method of modeling and storing attribute parameters of an item that addresses the above-identified problems.
Disclosure of Invention
The invention aims to provide a method for modeling and storing attribute parameters of an item, which solves the problems of multiple entity types, multiple attributes and relationships of each entity, uncertain data versions and simultaneous storage of data value accessory information aiming at the defects of the prior art, and reasonably, simply and efficiently models and stores the attributes and relationships of the entity item.
The technical problem solved by the invention can be realized by adopting the following technical scheme:
a method for modeling and storing an item attribute parameter, comprising the steps of:
s1, establishing classes including an Item type Class, an Item Class Item, a Unit Class Unit and an enumeration Class Enume; the system comprises an Item type Class, an Item type Item, a Unit Class Unit and an enumeration Class Enume, wherein the Item type Class carries out unified modeling on all Item types, the Item type Item carries out unified modeling on all items, the Unit Class Unit carries out unified modeling on all units, and the enumeration Class Enume carries out unified modeling on all enumeration values;
s2, establishing an attribute name ParamName, and carrying out unified modeling on attribute metadata of all entities;
s3, establishing an attribute value class ParamValue, and performing unified modeling on attribute value related data of all entities;
s4, establishing a relationship name, relatlName, and carrying out unified modeling on metadata of relationships among all entities from the view of an object item at one end of the relationship;
s5, establishing a relation value class RelatValue, and carrying out unified modeling on relation values of all the relationships between the entities from the view angles of the items at the two ends of the relationship;
s6, after the conceptual model is completely established, the conceptual model can be converted into a physical model of a database structure, wherein the class in the conceptual model is converted into a data table in the database; the reference relation between classes is converted into a primary key-foreign key relation between data tables.
In one embodiment of the invention, the attribute name class ParamName comprises at least member variables id, class, name, code, unit, dataType, enume, and fields; wherein id is the identification code of the attribute metadata, and the variable type is long or UUID; class is the entity Class to which the attribute metadata belongs, and the variable type is the item type Class established in step S1; name is the name of the attribute, variable type String; code is the encoding of the attribute, variable type is String; dataType is the data type for the attribute, and the variable type is int or String; the Unit is a Unit of the attribute, and the variable type is a Unit class Unit established by S1; enum is an enumerated value of the attribute, and the variable type is an enumerated class enum established in the step S1; fields is the column information of the array type attribute, and the variable type is List < ParamName >.
Further, the user may increase or decrease the required member variables to describe the metadata information for an attribute, but not the member variables associated with the attribute value of the attribute.
In one embodiment of the invention, the attribute value class ParamValue includes at least member variables id, item, paramName, value, values, date, version, desFlow and QAFlow; wherein id is the identification code of the attribute value, and the variable type is long or UUID; item is an instance Item to which the attribute value is subordinate, and the variable type is an Item class Item established in step S1; the paramName is attribute name metadata corresponding to the attribute value, and the variable type is the attribute name class paramName established in the step S2; value is a specific value (corresponding to a single parameter) of the attribute value, and the variable type is String; values are also the specific value of the attribute value (the parameter corresponding to the array type), and the variable type is JSONARray or String [ ] [ ]; date is the release time of the attribute value, and the variable type is Date; version is the version number of the attribute value, and the variable type is Char; desFlow is the generation flow of the attribute value, and QAFlow is the warranty flow of the attribute value.
In one embodiment of the invention, the relationship name class RelatName includes at least member variables id, leftClass, name, code, oneToMany, and rightCategory; wherein id is the identifier of the relation name metadata, and the variable type is long or UUID; the leftClass is an item type Class to which a view-angle end item of the relation is subordinate, and the variable type is an item type Class established in the step S1; name is the name of the relationship, variable type String; code is the relational code, variable type String; oneToMany is the maximum number of item instances allowed at the other end of the relationship, and the variable type is int; the rightCategory is the category of item type of the other end item of the relationship, and the variable type is int or String.
In one embodiment of the invention, the relationship value class RelatValue includes at least the member variables, leftItem, leftRelat, leftOrder, rightItem, rightRelat, and rightOrder; wherein, leftItem is an Item at one end of the relationship, and the variable type is the Item class Item established in step S1; leftRelat is relationship name metadata at one end of the relationship, and the variable type is the relationship name class RelatName established in the step S4; leftOrderr is the item order at one end of the relationship, variable type is int; the rightItem is an Item at the other end of the relationship, and the variable type is the Item class Item established in step S1; rightRelat is the relationship name metadata of the other end of the relationship, and the variable type is the relationship name class RelatName established in step S4; right order is the order of the items at the other end of the relationship and the variable type is int.
Compared with the prior art, the modeling and storing method of the attribute parameters of the items adopts 'name-real separation' to perform data modeling, can realize the modeling of all the attributes and relations of all the items through four core classes and a plurality of non-core classes, and realizes the storage of all version data and the auxiliary information thereof.
The features of the present invention will be apparent from the accompanying drawings and from the detailed description of the preferred embodiments which follows.
Drawings
FIG. 1 is a schematic diagram of an item property-related conceptual model of the present invention;
FIG. 2 is a schematic diagram of a conceptual model of relationship correlation between items of the present invention;
FIG. 3 is a schematic diagram of an item attribute-dependent physical model of the present invention;
FIG. 4 is a diagram of a physical model related to relationships between items according to the present invention.
Detailed Description
In order to make the technical means, the creation characteristics, the achievement purposes and the effects of the invention easy to understand, the invention is further explained by combining the specific drawings.
Examples
As shown in fig. 1 to 4, the method for modeling and storing the attribute parameters of the item of the present invention comprises the following steps:
s1, establishing classes including an Item type Class, an Item Class Item, a Unit Class, an enumeration Class Enume and the like, wherein the Item type Class uniformly models all Item types. The Item class Item models all items uniformly. The Unit class Unit uniformly models all units. The enumeration class Enume models all enumerated values uniformly.
S2, establishing a property name class (ParamName), and uniformly modeling the property metadata of all the entities, as shown in figure 1. This class includes at least the member variables id, class, name, code, unit, dataType, enume, fields, etc. Wherein id is the identification code of the attribute metadata, and the variable type is long or UUID; class is the entity Class to which the attribute metadata belongs, and the variable type is the item type Class established by S1; name is the name of the attribute, variable type is String; code is the encoding of this attribute, variable type is String; dataType is the data type for the attribute, and the variable type is int or String; the Unit is a Unit of the attribute, and the variable type is a Unit class Unit established by S1; the Enume is an enumerated value of the attribute, and the variable type is an enumerated type Enume established by S1; fields is the column information for the tuple type attribute, and the variable type may be List < ParamName >. The user may increase or decrease the required member variables to describe the metadata information for an attribute, but not the member variables associated with the attribute value for that attribute.
And S3, establishing an attribute value class (ParamValue) which performs unified modeling on attribute value related data of all entities, as shown in figure 1. This class includes at least member variables id, item, paramName, value, values, date, version, desFlow, QAFlow, etc. Wherein id is the identification code of the attribute value, and the variable type is long or UUID; item is an instance Item to which the attribute value is subordinate, and the variable type is Item class Item established by S1; the paramName is the 'attribute name' metadata corresponding to the attribute value, and the variable type is the attribute name class paramName established by S2; value is a specific numerical value (corresponding to a single parameter) of the attribute value, and the variable type is String; values are also the specific value of the attribute value (the parameter corresponding to the array type), and the variable type is JSONARray or String [ ] [ ]; date is the release time of the attribute value, and the variable type is Date; version is the version number of the attribute value, and the variable type is Char; desFlow is the generation flow of the attribute value, QAFlow is the warranty flow of the attribute value.
S4, establishing a relationship name class (RelatName), wherein the relationship name class is used for modeling metadata of relationships among all entities uniformly from the view point of the items at one end (but not at two ends) of the relationship, as shown in FIG. 2. The class includes at least member variables id, leftClass, name, code, oneToMany, rightCategory, and the like. Wherein id is the identifier of the relationship name metadata, and the variable type is long or UUID; the leftClass is an item type Class to which an item at the view end of the relationship belongs, and the variable type is an item type Class established by the S1; name is the name of the relationship, variable type String; code is the relational code, variable type String; oneToMany is the maximum number of item instances allowed at the other end of the relationship, and the variable type is int; right Category is the category of item type for the other end item of the relationship, and variable type is int or String.
S5, establishing a relation value class (RelatValue), wherein the class is used for uniformly modeling the relation values of the relation among all the entities from the view angles of the items at the two ends of the relation, as shown in figure 2. This class includes at least the member variables leftItem, leftRelat, leftOrder, rightItem, rightRelat, rightOrder, and so on. Wherein, leftItem is an Item at one end of the relationship, and the variable type is an Item class Item established by S1; leftRelat is the relationship name metadata at one end of the relationship, and the variable type is the relationship name class RelatName established by S4; leftOrderr is the item order at one end of the relationship, and the variable type is int; the rightItem is an Item at the other end of the relationship, and the variable type is an Item class Item established by S1; rightRelat is the relationship name metadata at the other end of the relationship, and the variable type is the relationship name class RelatName established by S4; rightOrder is the item order at the other end of the relationship and the variable type is int.
After the conceptual model is completely established, the conceptual model can be converted into a physical model of a database structure. Wherein the classes in the conceptual model are converted into data tables in the database; the reference relation between classes is converted into a primary key-foreign key relation between data tables. As shown in fig. 3 and 4.
And S6, during software development, the class and data structure of the invention can be directly adopted as a basis for modeling and storing the attributes and the relationships of the items. Of course, appropriate adjustments are made to the actual software development language and database product.
From the above, the method is suitable for the situations of multiple item types, multiple item attributes, multiple item relationships, uncertain data versions and the need of storing data flow information simultaneously during data modeling. The method can solve the problems of data modeling and storage under the conditions, and provides convenience for database maintenance, information retrieval and the like.
The foregoing shows and describes the general principles and features of the present invention, together with the advantages thereof. It will be understood by those skilled in the art that the present invention is not limited to the embodiments described above, which are merely illustrative of the principles of the present invention, but that various changes and modifications may be made without departing from the spirit and scope of the invention, which is defined by the appended claims and their equivalents.
Claims (6)
1. A method of modeling and storing attribute parameters of an item, comprising the steps of:
s1, establishing classes including an Item type Class, an Item Class Item, a Unit Class Unit and an enumeration Class Enume; the system comprises an Item type Class, an Item type Item, a Unit Class Unit and an enumeration Class Enume, wherein the Item type Class carries out unified modeling on all Item types, the Item type Item carries out unified modeling on all items, the Unit Class Unit carries out unified modeling on all units, and the enumeration Class Enume carries out unified modeling on all enumeration values;
s2, establishing an attribute name class ParamName, and performing unified modeling on attribute metadata of all entities;
s3, establishing an attribute value class ParamValue, and performing unified modeling on attribute value related data of all entities;
s4, establishing a relationship name, relatlName, and carrying out unified modeling on metadata of relationships among all entities from the view of an object item at one end of the relationship;
s5, establishing a relation value class RelatValue, and carrying out unified modeling on relation values of all the relationships among the entities from the view angles of the items at the two ends of the relationship;
s6, after the conceptual model is completely established, the conceptual model can be converted into a physical model of a database structure, wherein the class in the conceptual model is converted into a data table in the database; the reference relation between classes is converted into a primary key-foreign key relation between data tables.
2. The method of modeling and storing an item attribute parameter of claim 1 wherein the attribute name class ParamName includes at least member variables id, class, name, code, unit, dataType, enume, and fields; wherein id is the identification code of the attribute metadata, and the variable type is long or UUID; class is the entity Class to which the attribute metadata belongs, and the variable type is the item type Class established in step S1; name is the name of the attribute, variable type String; code is the encoding of the attribute, variable type is String; dataType is the data type for the attribute, and the variable type is int or String; the Unit is a Unit of the attribute, and the variable type is a Unit class Unit established by S1; enum is an enumerated value of the attribute, and the variable type is an enumerated class enum established in the step S1; fields is the column information of the tuple type attribute, and the variable type is List < ParamName >.
3. A method of modelling and storing an attribute parameter of an item according to claim 2 wherein a user can increase or decrease the member variables required to describe the metadata information for an attribute but not the member variables associated with the attribute value for that attribute.
4. The method of modeling and storing an item attribute parameter of claim 1 wherein the attribute value class ParamValue includes at least member variables id, item, paramName, value, values, date, version, desFlow, and QAFlow; wherein id is the identification code of the attribute value, and the variable type is long or UUID; item is an instance Item to which the attribute value is subordinate, and the variable type is an Item class Item established in step S1; the paramName is attribute name metadata corresponding to the attribute value, and the variable type is the attribute name class paramName established in the step S2; value is a specific numerical value of the attribute value, namely corresponding to a single parameter, and the variable type is String; values are also the specific values of the attribute value, i.e., the parameters corresponding to the array type, the variable type is JSONARray or String [ ] [ ]; date is the release time of the attribute value, and the variable type is Date; version is the version number of the attribute value, and the variable type is Char; desFlow is the generation flow of the attribute value, QAFlow is the warranty flow of the attribute value.
5. The method of modeling and storing an item attribute parameter of claim 1 wherein the relationship name class relatlame includes at least member variables id, leftClass, name, code, onetomay, and rightCategory; wherein id is an identifier of the relationship name metadata, and the variable type is long or UUID; the leftClass is an item type Class to which an item at the view end of the relationship belongs, and the variable type is an item type Class established in the step S1; name is the name of the relationship, variable type String; code is the relational code, variable type String; oneToMany is the maximum number of item instances allowed by the other end of the relationship, and the variable type is int; the rightCategory is the category of item type of the other end item of the relationship, and the variable type is int or String.
6. The method of modeling and storing an item property parameter of claim 1, wherein the relationship value class relatlvalue includes at least member variables leftItem, leftRelat, leftOrde, rightItem, rightRelat, and rightOrder; wherein, leftItem is an Item at one end of the relationship, and the variable type is the Item class Item established in step S1; leftRelat is relationship name metadata at one end of the relationship, and the variable type is a relationship name class RelatName established in step S4; leftOrder is the item order at one end of the relationship, variable type is int; the rightItem is an Item at the other end of the relationship, and the variable type is the Item class Item established in the step S1; rightRelat is the relationship name metadata of the other end of the relationship, and the variable type is the relationship name class RelatName established in step S4; right order is the order of the items at the other end of the relationship and the variable type is int.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910104873.XA CN109947741B (en) | 2019-02-01 | 2019-02-01 | Method for modeling and storing attribute parameters of items |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910104873.XA CN109947741B (en) | 2019-02-01 | 2019-02-01 | Method for modeling and storing attribute parameters of items |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109947741A CN109947741A (en) | 2019-06-28 |
CN109947741B true CN109947741B (en) | 2022-12-02 |
Family
ID=67007962
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910104873.XA Active CN109947741B (en) | 2019-02-01 | 2019-02-01 | Method for modeling and storing attribute parameters of items |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109947741B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110711389B (en) * | 2019-09-29 | 2023-03-07 | 上海莉莉丝科技股份有限公司 | Data processing method, device, equipment and computer readable medium |
CN111198870B (en) * | 2019-12-23 | 2024-04-02 | 浙江中控技术股份有限公司 | Modeling method and system for process equipment |
CN112416949A (en) * | 2020-12-15 | 2021-02-26 | 上海核工程研究设计院有限公司 | Structure data packaging method based on digital delivery |
CN113721897A (en) * | 2021-08-03 | 2021-11-30 | 中国航空工业集团公司沈阳飞机设计研究所 | Modeling method based on OPM |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH07129445A (en) * | 1993-10-29 | 1995-05-19 | Hitachi Ltd | Method for generating logical configuration of data base file |
CN103186628A (en) * | 2011-12-31 | 2013-07-03 | 上海可鲁系统软件有限公司 | Method for mapping between common information model and relational database |
CN105630500A (en) * | 2015-12-25 | 2016-06-01 | 江苏东大金智信息系统有限公司 | CIM object model for data processing and programming frame thereof |
CN108710660A (en) * | 2018-05-11 | 2018-10-26 | 上海核工程研究设计院有限公司 | A kind of items property parameters modeling of database and storage method |
-
2019
- 2019-02-01 CN CN201910104873.XA patent/CN109947741B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH07129445A (en) * | 1993-10-29 | 1995-05-19 | Hitachi Ltd | Method for generating logical configuration of data base file |
CN103186628A (en) * | 2011-12-31 | 2013-07-03 | 上海可鲁系统软件有限公司 | Method for mapping between common information model and relational database |
CN105630500A (en) * | 2015-12-25 | 2016-06-01 | 江苏东大金智信息系统有限公司 | CIM object model for data processing and programming frame thereof |
CN108710660A (en) * | 2018-05-11 | 2018-10-26 | 上海核工程研究设计院有限公司 | A kind of items property parameters modeling of database and storage method |
Non-Patent Citations (3)
Title |
---|
"数字城市"土地利用空间数据库建库方法研究;邓婧等;《中国山区土地资源开发利用与人地协调发展研究》;20100630;723-730页 * |
Models and Adaptive Architecture for Smart Data Management;Pierre De Vettor等;《 2015 IEEE 24th International Conference on Enabling Technologies: Infrastructure for Collaborative Enterprises》;20150813;164-169页 * |
核电数字化设计体系的组成和数据管理;申屠军等;《仪器仪表用户》;20171108;68-72页 * |
Also Published As
Publication number | Publication date |
---|---|
CN109947741A (en) | 2019-06-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109947741B (en) | Method for modeling and storing attribute parameters of items | |
JP7419244B2 (en) | Learning ETL rules by example | |
CN110300963B (en) | Data management system in a large-scale data repository | |
US7970728B2 (en) | Dynamically building and populating data marts with data stored in repositories | |
CN102918530B (en) | Data mart automation | |
Stanescu et al. | Automatic mapping of MySQL databases to NoSQL MongoDB | |
WO2018051097A1 (en) | System for analysing data relationships to support query execution | |
US20110231359A1 (en) | Synchronization of relational databases with olap cubes | |
WO2018051096A1 (en) | System for importing data into a data repository | |
KR101063625B1 (en) | Methods and Systems for Storing State-Specific Health-Related Episode Data and Computer-readable Storage Media | |
US9665607B2 (en) | Methods and apparatus for organizing data in a database | |
US7979456B2 (en) | Method of managing and providing parameterized queries | |
US20080222129A1 (en) | Inheritance of attribute values in relational database queries | |
Reniers et al. | On the state of nosql benchmarks | |
US20090055418A1 (en) | Automatic cascading copy operations in a database with referential integrity | |
US20170193036A1 (en) | Framework for joining datasets | |
Sreemathy et al. | Data validation in ETL using TALEND | |
Reniers et al. | Schema design support for semi-structured data: Finding the sweet spot between NF and De-NF | |
Prasath et al. | A new approach for cloud data migration technique using talend ETL tool | |
Chen | Database Design and Implementation | |
Nordeen | Learn SQL in 24 Hours | |
Brown et al. | DSDB: An Open-Source System for Database Versioning & Curation | |
Gupta et al. | Database management system Oracle SQL and PL/SQL | |
Haraty et al. | Relational Database Design Patterns | |
Soujanya et al. | Extensible markup language databases: a study |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP01 | Change in the name or title of a patent holder |
Address after: No. 29 Hong Cao Road, Xuhui District, Shanghai Patentee after: Shanghai Nuclear Engineering Research and Design Institute Co.,Ltd. Address before: No. 29 Hong Cao Road, Xuhui District, Shanghai Patentee before: SHANGHAI NUCLEAR ENGINEERING RESEARCH & DESIGN INSTITUTE Co.,Ltd. |
|
CP01 | Change in the name or title of a patent holder |