Summary of the invention
Consider the problem of the technical scheme that does not define information model and structure thereof in the correlation technique and propose the present invention; For this reason; Fundamental purpose of the present invention is to provide a kind of information model configuration and memory storage, method, to solve the problems referred to above that exist in the correlation technique.
To achieve these goals, according to an aspect of the present invention, a kind of information model configuration and memory storage are provided.
Comprise according to information model configuration of the present invention and memory storage: confirm the unit; Be used for as required the canned data entity and confirm information model; And the configuration information structure of models, wherein, the structure of information model comprises: information model title, information model attributes; Taxon is used for information model attributes is classified; Dispensing unit is used for the structure according to the type configuration information model attributes of information model attributes; Database is used for the structure canned data model attributes of pre-defined rule according to information model attributes.
Preferably, confirm that the unit specifically comprises: first names module, is used to be provided with the title of information model attributes; First configuration module is used for the relation between value type, span and each information model attributes of configuration information model attributes.
Preferably, confirm that the unit further comprises: determination module is used for confirming information entity according to specific industry; Mark module is used to use the xml document model that the hierarchical relationship between information model title, information model attributes and the information model attributes is carried out mark.
Preferably, taxon specifically is used for information model attributes is divided into three types of simple attributes, list attribute, complex properties at least.
Preferably, dispensing unit specifically is used for the relation between configured list attribute, complex properties and the simple attributes, and carries out mark with the form of relative path.
Preferably, dispensing unit specifically comprises: second names module, is used to be provided with the title of simple attributes; Second configuration module is used to utilize the relative path between title configured list attribute, complex properties and the simple attributes of information model attributes of title and other types of simple attributes; The 3rd name module is used for the table name according to relative path named data storehouse table, wherein, is the table name of wide area information server master meter with the information model name nominating; The 3rd configuration module is used for simple attributes is configured to a field of database table, and the information model title is configured to a field of database master meter; The 4th configuration module is used for disposing the type that simple attributes is stored at database table.
Preferably; The 3rd name module specifically is used for according to relative path the last layer information model attributes of the simple attributes table name as database table; And the last layer of other simple attributes except that simple attributes of storing in the database table is this information model attributes.
Preferably, the 4th configuration module is further used for: if the storage class of simple attributes is configured to character string type, the maximum length that simple attributes is stored is set then in database table, and whether the value of sign simple attributes is empty; If the storage class of simple attributes is configured to the master data type, the vocabulary type of the master data of simple attributes is set then.
Preferably, pre-defined rule comprises: the information model attributes that stores in the database table is a simple attributes; Confirm whether needs storage of information model attributes according to the value of the relative path of information model attributes and information model attributes, and when confirming to need storage, according to the table name and the row name of the database table of relative path configuration store information model attributes; If there is not relative path in information model attributes, then information model attributes is stored in the database master meter; If there is relative path in information model attributes, then information model attributes is stored in the database sublist; Database master meter and database sublist are associated with the form of main external key.
To achieve these goals, according to an aspect of the present invention, a kind of information model configuration and storage means are provided.
Comprise according to information model configuration of the present invention and storage means: the canned data entity is confirmed information model as required, and the configuration information structure of models, and wherein, the structure of information model comprises: information model title, information model attributes; Information model attributes is classified; Structure according to the type configuration information model attributes of information model attributes; With the structure canned data model attributes of pre-defined rule according to information model attributes.
By means of technical scheme of the present invention; Through the attribute of information model being classified and the structure of attribute being defined; And according to the structure of attribute information model attributes is stored according to certain rule; Solved the problem that does not define the technical scheme of information model and structure thereof in the correlation technique, can make things convenient for the information model of the needs that the user defines, and the information model after will defining has stored in the database into.
Other features and advantages of the present invention will be set forth in instructions subsequently, and, partly from instructions, become obvious, perhaps understand through embodiment of the present invention.The object of the invention can be realized through the structure that in the instructions of being write, claims and accompanying drawing, is particularly pointed out and obtained with other advantages.
Embodiment
Functional overview
In correlation technique; In order to reach the shared purpose of information, must define unified information model, and define the structure of this information model; The embodiment of the invention provides the configuration of a kind of CIS information model and memory storage and method; In the technical scheme of the embodiment of the invention, emphasis has been described and has been the title and its corresponding attribute that how to take out information model, and confirms the relativeness between them according to these information.In technical scheme of the present invention, confirm that the unit is used for as required the canned data entity and confirms information model, and the configuration information structure of models, wherein, the structure of information model comprises: information model title, information model attributes; Taxon is used for information model attributes is classified; Dispensing unit is used for the structure according to the type configuration information model attributes of information model attributes; Database is used for the structure canned data model attributes of pre-defined rule according to information model attributes.
Before the technical scheme to the embodiment of the invention is elaborated, at first the noun that can relate in the embodiment of the invention is made an explanation, comprising:
1, information model title: to the unique identification of information model.2, information model attributes: the descriptor of information model, this descriptor is described with the attribute form of information entity.3, simple attributes: its value is a simple types, and for example, the type of value is shaping (int), floating-point (float), character string (String) etc.4, list attribute: its value is a plurality of, and the type between a plurality of value is identical, i.e. simple types.5, complex properties: it does not have direct value, has comprised the attribute of one deck or multilayer under the complex properties, and the value of attribute is a simple types in last node layer.
Below in conjunction with accompanying drawing the preferred embodiments of the present invention are described, should be appreciated that preferred embodiment described herein only is used for explanation and explains the present invention, and be not used in qualification the present invention.
In the following description, for the purpose of explaining, a plurality of specific details have been described, to provide to thorough of the present invention.Yet, obviously, do not having can to realize the present invention under the situation of these specific detail yet, in addition, under the situation that does not deviate from spirit that accompanying claims illustrates and scope, among following embodiment and the embodiment each details can be carried out various combinations.
Device embodiment
According to embodiments of the invention; A kind of information model configuration and memory storage are provided; Fig. 1 is the block diagram according to configuration of the information model of the embodiment of the invention and memory storage, and is as shown in Figure 1, comprises according to the information model configuration of the embodiment of the invention and memory storage and confirms unit 2, taxon 4, dispensing unit 6, database 8; Wherein, Confirm that unit 2 can also comprise: first name module 20, first configuration module 22, determination module 24, mark module 26, dispensing unit 6 can also comprise: the second name module 60, second configuration module 62, the 3rd name module 64, the 3rd configuration module 66, the 4th configuration module 68.Below, above-mentioned each module is carried out detailed explanation.
Confirm that unit 2 is mainly used in as required the canned data entity and confirms information model; And dispose the structure of this information model; Wherein, the structure that disposes this information model comprises: dispose the information model title of this information model and the information model attributes that disposes this information model.
Particularly; At first, confirm unit 2 really cover half piece 24 need need confirm the canned data entity according to concrete industry field; After determination module 24 has been confirmed information entity; Confirm that unit 2 just can take out general information model according to this information entity, and information model is configured, when the configuration information model; Confirm that the name of first in the unit 2 module 20 at first need be provided with the title of this information model attributes, the purpose of definition information model title is all to define a unique sign for each information model.In the application of reality, the information model title can be with following formal description: nameSpace#infoModelName, and wherein, nameSpace is a name space, cuts apart with # between domain name and the information model title.
When the configuration information model; Confirm that first configuration module 22 in the unit 2 needs to confirm in order to describe the information model attributes (Attribute) that this information model needs; Information model attributes is the description to information entity; After having confirmed information model attributes, first configuration module 22 also need be configured the relation between value type, span and each information model attributes of each information model attributes.When first configuration module, 22 configuration information models; Confirm that the mark module 26 in the unit 2 can use extending mark language (eXtensionMarkup Language; Abbreviate XML as) the mode of document model (schema); Hierarchical relationship between information model title, information model attributes and the information model attributes is carried out mark, can make things convenient for the user more to know the relation between each attribute like this.
After the first name module 20 has confirmed that information model title, first configuration module 22 have been confirmed information model attributes; Taxon 4 just can be classified information model attributes; In practical application, information model attributes can be divided into simple attributes, list attribute and complex properties at least; Wherein, the value in the simple attributes all is a fundamental type, for example, and int, float, double precision types such as (double); The value of list attribute is the form of tabulation (list); The value of complex properties is a complex form, that is, the nested relation of multilayer, the leaf node of its bottom is a simple attributes.
After 4 pairs of information model attributes of taxon are classified; Dispensing unit 6 just can be according to the structure of the type configuration information model attributes of information model attributes; That is to say; Dispensing unit 6 needs the relation between configured list attribute, complex properties and the simple attributes, and carries out mark with the form of relative path.Particularly; In the dispensing unit 6 second name module 60 at first need be provided with the title of simple attributes; Subsequently; Second configuration module 62 just can utilize the relative path between title configured list attribute, complex properties and the simple attributes of information model attributes of the title of simple attributes and the other types (list attribute and complex properties) that the first name module 20 is confirmed; So-called path i.e. the path of this information model attributes in the document of the XML of information model, and the form with relative path provides usually.In practical application, if this information model attributes is expressed as the attribute of certain node in XML, then in relative path since sign, shape is like extension/child/tag, wherein, tag is the attribute of child; The ground floor of this relative path then is the information model title.
After second configuration module 62 has disposed relative path; In the dispensing unit 6 the 3rd name module 64 just can be according to the table name of relative path named data storehouse table; Wherein, need be the table name of wide area information server master meter with the information model name nominating that the first name module 20 is confirmed; In practical application, with the last layer attribute of this information model attributes table name as this database table, shape as: extension/child/tag, then the 3rd name module 64 just can be with showing called after child.Need to prove that the last layer of other simple attributes except that simple attributes of storing in the database table is unified information model attributes, that is, the last layer path of all information model attributes of this table storage all is chip.
Subsequently, the 3rd configuration module 66 in the dispensing unit 6 need be configured to the field (that is, row) in the database table with simple attributes, and the information model title is configured to a field of database master meter.And the 4th configuration module 68 in the dispensing unit 6 also need dispose the type that simple attributes is stored in database table.Particularly,, then also the maximum length that simple attributes is stored need be set in database table, and whether the value of sign simple attributes is empty if the 4th configuration module 68 is configured to the String type with the storage class of simple attributes; If the 4th configuration module 68 is configured to the master data type with the storage class of simple attributes, the vocabulary type of the master data of simple attributes then is set, shape is like urn:epcglobal:epcis:vtype:ReadPoint.
After the structure of 6 pairs of information model attributes of dispensing unit had been carried out configuration, database 8 just can be with the structure canned data model attributes of pre-defined rule according to information model attributes.Particularly, above-mentioned pre-defined rule can comprise:
1, the information model attributes that stores in the database table is simple attributes, i.e. leaf node;
2, confirm whether needs storage of information model attributes according to the value of the relative path of information model attributes and information model attributes; And when confirming to need storage; Table name and row name according to the database table of relative path configuration store information model attributes; Wherein, the row name is consistent with the title of information model attributes (simple attributes) usually;
If there is not relative path in 3 information model attributes, promptly be the ground floor of information model, then information model attributes is stored in the database master meter;
If there is relative path in 4 information model attributes, then information model attributes is stored in the database sublist; Wherein, the information model attributes in the sublist all is the consistent or node under same root path of relative path;
5, database master meter and database sublist are associated with the form of main external key, that is to say, all sublists all are associated with master meter through external key,, preserve the id information of master meter in the sublist that is.
Can find out from top description; The structure of database table is very simple; Have only double-layer structure: one deck is a master meter; Master meter has only one, and a field that must have in the master meter is the information model title, and other fields determine whether to contain this field according to the table name that defines in the information model attributes in the master meter.Another layer is a sublist, and sublist can have a plurality of, has no relation between the sublist, and master meter and sublist are associated with main external key, and the field in master meter and the sublist is the simple attributes in the XML document.
Need to prove, in practical application, must follow define earlier the order of afterwards using,, just do not allow at will to make amendment or delete, still can increase attribute for information model when in a single day the information model of this definition is used.
Description above the following foundation provides a concrete table, it will be apparent to those skilled in the art that the given list structure of different implementors maybe be different, but can not break away from the category that adopts database table to write down.Below, this instance is described.
The table of NameSpace is described:
NAME_SPACE(id,prefix,nameSpace)
Wherein, prefix is a prefix, and namespace is a NameSpace.It is under some NameSpaces that the title of each element all requires; Each NameSpace all has the prefix prefix of oneself again; Consider from the angle of database design; For fear of data redundancy, in the design NAME_SPACE is taken out separately as a table, but this namespace also can be put into attribute-name.
Master meter:
INFOMODE_EVENT(id,eventName,<CoulmnName>)
Wherein, id is the event identifier that generates automatically; EventName is the incident title; < CoulmnName>is dynamic row, promptly to the defined concrete information model attributes of this information model (simple attributes).
Sublist:
ATTRIBUTE(id,event_id,<CoulmnName>,path)
Wherein, id is the attribute-bit that generates automatically; Event_id is incident id; < CoulmnName>is dynamic row, promptly to the defined concrete information model attributes of this information model; Because these < CoulmnName>all under identical path, therefore, write down the upper layer path of these < ColumnName>with path.
Through technique scheme of the present invention, the user can define the information model that needs easily, can be discerned by the CIS system easily simultaneously, and the storage warehouse-in.
Method embodiment
According to embodiments of the invention, a kind of information model configuration and storage means are provided, Fig. 2 is according to the information model configuration of the embodiment of the invention and the process flow diagram of storage means, and is as shown in Figure 2, comprises following processing (step S202-step S208):
Step S202, the canned data entity is confirmed information model as required, and the configuration information structure of models, wherein, the structure of information model comprises: information model title, information model attributes;
Particularly, in step S202, before taking out general information model, at first need need confirm the canned data entity according to concrete industry field according to information entity; When the configuration information structure of models, the title of this information model attributes at first need be set, the purpose of definition information model title is to be unique sign of each information model definition.In the application of reality, the information model title can be with following formal description: nameSpace#infoModelName, and wherein, nameSpace is a name space, divides with # between domain name and the information model title.
When the configuration information structure of models; Also need confirm in order to describe the information model attributes (Attribute) that this information model needs; Attribute is the description to information entity; After having confirmed information model attributes, just can dispose the relation between value type, span and each information model attributes of each information model attributes.Subsequently, use XMLschema that the hierarchical relationship between information model title, information model attributes and the information model attributes is carried out mark, can make things convenient for the user more to know the relation between each attribute like this.
Step S204 classifies information model attributes; In practical application, information model attributes can be divided into simple attributes, list attribute and complex properties at least; Wherein, the value in the simple attributes all is a fundamental type, for example, and int, float, types such as double; The value of list attribute is the form of list; The value of complex properties is a complex form, the promptly nested relation of multilayer, and the leaf node of its bottom is a simple attributes.
Step S206 is according to the structure of the type configuration information model attributes of information model attributes; That is to say, need the relation between configured list attribute, complex properties and the simple attributes, and carry out mark with the form of relative path.
Particularly; The title of simple attributes at first need be set; And utilize the relative path between title configured list attribute, complex properties and the simple attributes of information model attributes of title and other types (list attribute and complex properties) of simple attributes; So-called path i.e. the path of this information model attributes in the document of the XML of information model, and the form with relative path provides usually.For example, if this information model attributes is expressed as the attribute of certain node in XML, then in relative path since sign, shape is like extension/child/tag, wherein, tag is the attribute of child; If ground floor then is the information model title.
After having disposed relative path, can wherein, need with the information model name nominating table name of wide area information server master meter just according to the table name of relative path named data storehouse table; In practical application, with the last layer attribute of this information model attributes table name as this database table, for example, existing is extension/child/tag to the path, then can be with database table called after child, and tag then is the field of child in showing.Need to prove that the last layer of other simple attributes except that simple attributes of storing in the database table is unified information model attributes, that is, the last layer path of all information model attributes of this table storage all is child.
Subsequently, simple attributes is configured to the field (that is, row) in the database table, and the information model title is configured to a field of database master meter.And, also need dispose the type that simple attributes is stored in database table.Particularly,, then the maximum length that simple attributes is stored need be set in database table, and whether the value of sign simple attributes is empty if the storage class of simple attributes is configured to the String type; If the storage class of simple attributes is configured to the master data type, the vocabulary type of the master data of simple attributes then need be set, for example: urn:epcglobal:epcis:vtype:ReadPoint.
Step S208 is with the structure canned data model attributes of pre-defined rule according to information model attributes.Particularly, above-mentioned pre-defined rule comprises:
1, the information model attributes that stores in the database table is simple attributes, i.e. leaf node;
2, confirm whether needs storage of information model attributes according to the value of the relative path of information model attributes and information model attributes; And when confirming to need storage; Table name and row name according to the database table of relative path configuration store information model attributes; Wherein, the title with information model attributes (simple attributes) is consistent usually for the row name;
If there is not relative path in 3 information model attributes, promptly be the ground floor of information model, then information model attributes is stored in the database master meter;
If there is relative path in 4 information model attributes, then information model attributes is stored in the database sublist; Wherein, the information model attributes in the sublist all is the consistent or node under same root path of relative path;
5, database master meter and database sublist are associated with the form of main external key, that is to say, all sublists all are associated with master meter through external key,, preserve the id information of master meter in the sublist that is.
To combine accompanying drawing below, technique scheme of the present invention is described, Fig. 3 is according to the information model configuration of the embodiment of the invention and the detailed process process flow diagram of storage means, and is as shown in Figure 3, comprises following processing:
Step S302 to certain specific industry, defines the information model of describing the sector information.At first confirm the title of the sector information model and for the attribute of the information of describing this industry, and describe this structure (corresponding to the step S202 among Fig. 2) with XML.
Step S304 confirms the title of master meter, and the title of master meter is named with the title of information model usually.
Step S306, according to the attribute of confirming among the step S302, the type of defined attribute is divided into simple attributes, list attribute and complex properties with attribute.And provide the restriction of aspects such as attribute value.
Step S308 according to the characteristics of industry, and according to step S302, confirms the relative position of this attribute in XML Schema document.
Step S310 confirms that which attribute will store.The principle of storage is following: simple attributes and list attribute are bound to store in the database table; Complex properties can be when the simple attributes below preserving its node, provides with the form of relative path.
Step S312 confirms that which database table attribute will be stored in, and principle is following: complex properties need be stored the simple attributes under its node, and the hierarchy nesting relation of complex properties can provide with the form of relative path.
Step S314 confirms the relative path of this attribute and the database table name and row name of this attribute of storage according to S306 and S308, its principle is: the title of a canned data model, attribute are that the relative path of simple attributes and attribute is a ground floor in the master meter; Leaf node attribute in the sublist under the storage complex properties.
In sum; By means of technical scheme of the present invention; Through the attribute of information model being classified and the structure of attribute is defined, and according to the structure of attribute information model attributes is stored, solved the problem that does not define the technical scheme of information model and structure thereof in the correlation technique according to certain rule; Can make things convenient for the information model of the needs that the user defines, and the information model after will defining stores in the database into.
Obviously, it is apparent to those skilled in the art that above-mentioned each module of the present invention or each step can realize with the general calculation device; They can concentrate on the single calculation element; Perhaps be distributed on the network that a plurality of calculation element forms, alternatively, they can be realized with the executable program code of calculation element; Thereby; Can they be stored in the memory storage and carry out, perhaps they are made into each integrated circuit modules respectively, perhaps a plurality of modules in them or step are made into the single integrated circuit module and realize by calculation element.Like this, the present invention is not restricted to any specific hardware and software combination.
The above is merely the preferred embodiments of the present invention, is not limited to the present invention, and for a person skilled in the art, the present invention can have various changes and variation.All within spirit of the present invention and principle, any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.