CN100565519C - Data bank service disposal route based on the uniform data sign - Google Patents

Data bank service disposal route based on the uniform data sign Download PDF

Info

Publication number
CN100565519C
CN100565519C CNB2006101732017A CN200610173201A CN100565519C CN 100565519 C CN100565519 C CN 100565519C CN B2006101732017 A CNB2006101732017 A CN B2006101732017A CN 200610173201 A CN200610173201 A CN 200610173201A CN 100565519 C CN100565519 C CN 100565519C
Authority
CN
China
Prior art keywords
class
data
sign
disposal route
bank service
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.)
Expired - Fee Related
Application number
CNB2006101732017A
Other languages
Chinese (zh)
Other versions
CN1996308A (en
Inventor
陈�峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chen Feng
Original Assignee
Individual
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Individual filed Critical Individual
Priority to CNB2006101732017A priority Critical patent/CN100565519C/en
Publication of CN1996308A publication Critical patent/CN1996308A/en
Application granted granted Critical
Publication of CN100565519C publication Critical patent/CN100565519C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A kind of data bank service disposal route based on the uniform data sign, database comprises a plurality of data that comprise business information, the business information of each data is relatively independent, may further comprise the steps: each data is provided with ID as major key, wherein, ID is set to integer or the character that length is the N+M position, N and M are the positive integer greater than 0, N represents the position class sign, M position representative object sign, the class sign is used for identifying uniquely the affiliated class of these data, and object identity is used for identifying these data uniquely at a plurality of object instances of this class; Mapping relations between class sign and the class are described, mapping relations between class and the table and the derived relation between each class; Inquire corresponding class according to the sign of the class among the ID; Dynamically create out the program object of this class and inquire the table of this class correspondence; From table, inquire the record that major key equals ID and come to be the program object loading data; The method of working procedure object is to finish corresponding service processing.

Description

Data bank service disposal route based on the uniform data sign
Technical field
The present invention relates to database, in particular to a kind of data bank service disposal route based on the uniform data sign.
Background technology
In relational database theory and object-oriented method, need to use the object identity technology.Three key elements of relational database theory are the relations between entity, entity attribute and the entity.Normally, an entity is corresponding to a record in the table, and an attribute of entity is corresponding to a field in the record, and one of them specific attribute can play the effect of an entity of unique identification, is called major key.And the mode that to be the Major key of a property value (becoming external key) by an entity and another entity equate of the relation between two entities is set up.
At the design of database major key, adopt two kinds of schemes usually.
The one, adopting has the field of professional implication to make major key, such as client identity authentication card number, and the numbering of order.This scheme is at the characteristics difference different-format of each table and the major key of length, thereby can save storage space and can improve the performance of correlation inquiry, but harm also is conspicuous: in case the rule of major key field changes and can cause catastrophic consequence in the life cycle of system, this point is believed has the reader of enterprise's application and development experience that common recognition is all arranged.And this major key form differs, and can not be presented as the unified sign of all objects, so can not satisfy the needs of object-oriented method.
The 2nd, id field of design is used as major key in addition, and the value of this ID is without any implication, as long as guarantee that its value is unique.Can call this scheme " ID pattern ", it has solved the problem of last scheme, more and more becomes the main flow of enterprise's application and development at present.
But the ID pattern is also imperfect under many circumstances.With OO viewpoint, the ID that does not have any implication only carries out the differentiation of data recording usually in the category of a tables of data, and can not describe a subject system structure of overall importance.
On the other hand, in object-oriented method, use its address value to realize to the sign of the object in the computer program usually, and relation between objects is also by using pointer or quoting to wait and embody.
In relational database, object identity and object relationship are expressed main at present adopt GUID (globally unique identifier, Globally Unique Identifier) technology and O/RMapping (object-relationship map, object-relational mapping) technology.
The GUID technology uses a digital GUID who generates at random to be used as the major key of data, because GUID is very big, can guarantee in theory that each Major key that generates is unique in system.But the major defect of GUID is not comprise valuable informedness, can not realize embodying OO advantage, and is difficult to realize effective management.
O/R Mapping technology is the technology that is used to make up relationship map between relational database and the object.O/R Mapping technology is not considered the improvement of database structure itself, but attempts setting up loose coupling association on the database structure that has had and between the class of program development and the object.
The major defect of GUID is not comprise valuable informedness, can not realize embodying OO advantage, and be difficult to realize effective management.Get access to a GUID, can not know simply that what class it is.Write down the GUID of all object of overall importance and have the corresponding relation between the class to need a very large table under them, this in fact is infeasible.
The object and the database of programming are mapped, and are exactly the thought of basic O/R Mapping.Its shortcoming is: O/R Mapping technology is not considered the improvement of database structure itself, but on a database structure that has had, combine with OO program, the SQL statement of database manipulation has been transformed into OO statement, mainly be that a kind of grammer is convenient and can not bring more deep thought to change, concrete effect also can be very restricted.If database itself does not have a kind of OO physical design, O/R Mapping can can't realize valuable thing to the back so, and causes O/RMapping inner structure complexity.
On the other hand, O/R Mapping is static, need be before compiling generating code.
In the object-oriented database that adopts object-oriented method, it is complete that object identity and object relationship are expressed, and has guaranteed the unitarity of object identity, of overall importance and polymorphism.The method that does not then have equity in the relational database.Normally, the major key of relational Database Design is towards table, and a Major key is unique in the scope of a table, and is not unique in total system.With OO viewpoint, such sign can not be described a subject system structure of overall importance.So in the system of a complexity, the routine data storehouse is in the face of the entity object kind of management is often very many, and when relation is complicated each other, himself structure becomes complicated unusually, is difficult to management and expansion, thereby is difficult to manage business.
Summary of the invention
The present invention aims to provide a kind of data bank service disposal route based on the uniform data sign, the problem that is difficult to manage business when being used to solve the routine data storehouse in the face of complication system.
The invention provides a kind of data bank service disposal route based on the uniform data sign, database comprises a plurality of data that comprise business information, the business information of each data is relatively independent, may further comprise the steps: each data is provided with ID as major key, wherein, ID is set to integer or the character that length is the N+M position, wherein, N and M are the positive integer greater than 0, N represents the position class sign, M position representative object sign, the class sign is used for identifying uniquely the affiliated class of these data, and object identity is used for identifying these data uniquely at a plurality of object instances of this class; Mapping relations between class sign and the class are described, mapping relations between class and the table and the derived relation between each class; Inquire corresponding class according to the sign of the class among the ID; Dynamically create out the program object of this class and inquire the table of this class correspondence; Inquiring from table that record that major key equals ID is that program object loads complete data; The whole bag of tricks of working procedure object is to finish corresponding service processing.
In the system of a complexity, the entity object kind of management is often very many, and relation is complicated each other, and these entity class that main is and the rule that concerns each other all may change at any time, are very suitable for application of the present invention in this case.After technology among the present invention was used in this system, effect was very good, make system architecture very clear, be easy to the management and the expansion, thereby improved traffic handing capacity.
Other features and advantages of the present invention will be set forth in the following description, and, partly from instructions, become apparent, perhaps understand by implementing the present invention.Purpose of the present invention and other advantages can realize and obtain by specifically noted structure in the instructions of being write, claims and accompanying drawing.
Description of drawings
Accompanying drawing described herein is used to provide further understanding of the present invention, constitutes the application's a part, and illustrative examples of the present invention and explanation thereof are used to explain the present invention, do not constitute improper qualification of the present invention.In the accompanying drawings:
Fig. 1 shows the database structure synoptic diagram according to second embodiment of the invention.
Embodiment
Describe the present invention below with reference to the accompanying drawings in detail.Though it should be noted that it is to set forth at relational database that the present invention's partial content is described below, the present invention obviously can be applicable to other databases.In addition, in the present invention, database is not limited to tables of data set itself, should comprise database product and is the design and the exploitation at center with the relational database, for example relates to middle unit development, applied software development etc.The present invention can be mainly used in the design of relational database product and center on relational database is the applied software development of core.
According to embodiments of the invention, a kind of data bank service disposal route based on the uniform data sign is provided, database comprises a plurality of data that comprise business information, the business information of each data is relatively independent, this method may further comprise the steps: each data is provided with ID as major key, so that a plurality of data map are become separate object.
Each object is provided with ID can be may further comprise the steps: it is unique that each ID all is arranged in the entire database.
Can in entire database, adopt unified rule and data type that each ID is set.
Adopting unified rule and data type that each ID is set in entire database can may further comprise the steps: ID is set to integer or the character that length is the N+M position, wherein, N and M are the positive integer greater than 0, N represents the position class sign, M position representative object sign, the class sign is used to identify own affiliated class, and object identity is used for identifying oneself uniquely at a plurality of object instances of this class.
According to embodiments of the invention, ID is set to the integer of 128 binary representations, wherein: N=64, M=64.ID is set to the integer of scale-of-two or decimal representation, and wherein: the value of entire I D is no more than 64 binary number.
In above-mentioned data bank service disposal route, also can may further comprise the steps: equal the value of major key by the value that external key is set, to shine upon a plurality of relation between objects.
For example, the value that equals major key by the value that external key is set comes between to set up association to may further comprise the steps: by store major key in external key, external key does not repeat, to shine upon 1: 1 relation between a plurality of objects; Perhaps by store major key in external key, external key has repetition, to shine upon 1 between a plurality of objects: many relations; Relation table perhaps is set, wherein contains the major key that a plurality of external keys are stored the multiclass object, external key has repetition, to shine upon many between a plurality of objects: many relations.
The present invention carries out the sign of data in the Database Systems with the two-part of this Unified Form sign as major key, makes the data in the system can unique identification and form OO identification system.This sign overall situation, simple, can discern, be easy to management.
The form of this sign is OO, and it has comprised the information of class sign and object identity, can overall unique identification in a system.It is presented as a monodrome in storage, is easy to handle.
The present invention can provide a kind of data structure, is used for writing down the class sign that has been assigned with use, and each class sign corresponding distribute object identity and available object identity.At the excessive problem of data volume also can with record optimization for the data of a minimum ident value and maximum ident value to writing down a segment identification value.
In above-mentioned data bank service disposal route, also can may further comprise the steps: describe the mapping relations between class sign and the class, mapping relations between class and the table and the derived relation between each class.
According to embodiments of the invention, in the time of obtaining the class sign,, get access to the class sign of N position by decomposition according to ID; Obtain corresponding time-like,, from mapping, get access to corresponding class according to the class sign; When obtaining corresponding one or more table,, from mapping, get access to one or more tables of correspondence according to class; When obtaining the pairing a plurality of table of one or more classes of its derivation, according to class, thereby the one or more classes that get access to its derivation from mapping are obtained a plurality of tables that correspond to.
The present invention can provide a kind of computer program, creates the distribution that a mechanism comes maintenance and management class ident value and object identity value.Total system has the class sign interval of size for the long specific numeral system in N position, and each class sign can have size again respectively and be an object identity interval of the long specific numeral system in M position.This mechanism can manually or automatically be that different classes is distributed different class signs as required, also can manually or automatically be that the different objects of same class distribute different object identities as required.
The present invention can provide a kind of computer program, describes and the mapping relations of mapping relations, class and the tables of data of administrative class sign and class, derivation and the syntagmatic between each class with a mechanism.Utilize this mechanism, system can be between above-mentioned ID sign, class sign, class and tables of data transitional information mutually.
In above-mentioned data bank service disposal route, also can may further comprise the steps: inquire corresponding class according to the sign of the class among the ID; Dynamically create out the program object of this class and inquire the table of this class correspondence; Inquiring from table that record that major key equals ID is that program object loads complete data; The whole bag of tricks of working procedure object is to finish corresponding service processing.
In above-mentioned data bank service disposal route, further comprising the steps of: storage has the object of same item sign in a table; Perhaps storage has the object that inhomogeneity identifies in a table; Perhaps the data content with the object of a class is distributed in the different tables.
In above-mentioned data bank service disposal route, further comprising the steps of: as in the time of inquiring about the object of concrete class,, to get access to the table of this class correspondence, generate towards the query statement of table according to the table system and come query object according to the name of this class; When inquiring about the object of a plurality of classes, then each class is handled as stated above, then the result is gathered the long and collection of formation; When inquiring about the object of a base class, go out all derived class that base class derives from, be aggregated into a long and collection by above-mentioned method then according to the descriptive analysis that concerns between the class.
In above-mentioned data bank service disposal route, also can may further comprise the steps: the format memory data according to ID in interface control realizes the related of interface and object.The present invention can provide a kind of computer program, and the data of storage COID form realize the related of interface and object in interface control.Particularly, in controls such as TextBox, CheckBox, TreeView, ListView, utilize a built-in implicit data storage mechanism of control to store the COID data.In needs, program can regenerate object reliably according to this COID value and finish processing from database.
The present invention can provide a kind of computer program, can realize that dynamic object generates, and according to an above-mentioned ID value, system can generate an OO interface object.System can inquire corresponding class according to the sign of the class in the above-mentioned ID value by above-mentioned system, program can dynamically be created out the program object of this class and inquire the tables of data of this class correspondence then, can to inquire from tables of data that record that major key equals above-mentioned ID be that program object loads complete data to program then, and final program just can move the whole bag of tricks of this program object and finish business processing.
The present invention has defined a sets of data structure and described and manage in system: the class of having distributed sign and available class sign, each class sign are corresponding distributes the mapping relations of mapping relations, class and the tables of data of object identity and available object identity, class sign and class, derivation and the syntagmatic between each class.
Design a cover program around said structure and carry out each other information translation and processing, comprise the distribution that realizes class sign and object identity, for class is distributed the class sign, the object instance distribution object identity for class carries out information translation etc. between several persons of class sign, class and tables of data.
The COID sign of same form is used as the relation between the external key statement data object, and this relation is compared with traditional data relationship expression to be had and the advantage that changes is pointed to, adapted to easily to tables of data de, polymorphic sensing, the overall situation.In a word, this technology has realized describing OO information systems with relational database in Physical layer.In these information systems, to data is to treat with the viewpoint of class in a kind of object-oriented and object fully, each object storage that different classes produces is in different tables of data, but these objects all have the major key of unified COID to identify, and relation between objects is expressed by the COID value that destination object is set in the external key attribute.This individual system realizes very complicated data relationship and expansion easily easily, and this is the advantage that traditional relational database expression method does not have fully.
With the uncoupled implication of tables of data be: the foreign key value of a COID form has comprised the information of class sign, so its implication is " pointing to certain object in certain class ", is " pointing to certain bar record in the particular table " and do not resemble traditional foreign key value.
The implication of polymorphic sensing is: because the length of the foreign key value of each COID form is identical with implication, and the identifying information that has comprised class and object, so a COID variable can point to inhomogeneous object by getting different values, this is the realization basis of polymorphism in the object-oriented method.
The implication that the overall situation is pointed to is: because each data object in the system all adopts COID to do the major key sign in principle, therefore the foreign key value of a COID form can be pointed to any one data object in the total system.
Adapting to the implication that changes easily is: under the situation that a lot of business change, utilize above-mentioned technology, just the value of COID itself changes, and does not need the structure of modification table just can adapt to professional variation.
Improving with the relational database with above-mentioned technology is the design of the application and development of core, and new data structure all possesses OO characteristic in conceptual design, logical design and physical Design and last runtime.Compare, it is local that traditional method for designing is used OO thought, and basic exists at conceptual phase, has just lost OO feature and advantage behind later stage of designing and final specific Physical data model.
In above-mentioned data bank service disposal route, also can may further comprise the steps: set up index at class by decomposing N position class ID among the ID, index is used for selecting the object that belongs to some or a plurality of classes from many records.
In above-mentioned data bank service disposal route, also can may further comprise the steps: the ID that gathers the data of a plurality of tables generates index, and index only is used for finding pairing table of its object and record according to the ID of an object.
ID according to the present invention can be referred to as COID, the ID key of following above-mentioned Rule Design can abbreviate COID as, and deducing out relevant design and development technique on this basis is exactly the COID pattern.
The present invention can utilize the COID system, designs polymorphic database model, such as a field of a table, can hint obliquely to a class.Rather than be mapped to a concrete table.Utilize the COID pattern, realize polymorphic data relationship description, like this, a foreign key field in the database can be associated with any one object in the system neatly on implication, no longer with concrete table binding.Utilize the COID pattern can realize O/R Mapping technology easily, realize single table schema.
Core concept of the present invention is COID, and the implication of COID pattern is Class-ObjectIdentifier, and Chinese is class one object markers.The invention provides and be applicable to that a kind of complete object-oriented thought of enterprise's application and development carries out the method for database design, can to enterprise application system design and develop in addition the design concept of database product produces appreciable impact.
COID (Class-Object Identifier) pattern is in the exploitation of enterprise application system, carry out the design and the realization of logical data base with a kind of OO thought and method, and carrying out system architecture design and systemic-function realization based on this, its key feature is to adopt the overall unique COID major key that is combined into class sign+object identity to come identified data object.
The theory that the COID pattern at first is embodied in the database design aspect changes.
One: the data in the database are treated as object, adopted not comprise the major key of the COID field of business information as data.
Two: the COID key of each object adopts unified name and data type in the total system.
Three: one concrete COID key values are made up of two parts, and the N position is that the class sign is the class sign, and the M position is that object identity is an object identity.The different object instances of same class have identical class sign, are the object identity difference, and the COID key assignments of each object is unique in total system like this.
Adopt the COID pattern to produce remarkable influence to database design concept and the exploitation of systemic-function framework.
The present invention makes system development become clear and easy.Because database object all uses the COID form to carry out unique identification, such rule is also followed in program development around database, program language can come unique and designation data object reliably with the single numeral of a unanimity or string variable, this makes, and transmission information becomes unified and easy in the system, single COID value is between each function inside of a program, the different computer program, between the different computing machine, and it is all very simple and efficient to transmit COID on the network, has reduced work and problem a large amount of in the classic method.
The present invention also makes becoming alternately of database data and user interface simple and easy.Because COID is presented as a simple numerical value, computer program can easily be stored the COID value of impliedly storing related object in window control, make interface and object association, in needs, program can regenerate object reliably according to this COID value and finish processing from database.Traditional method is always done different processing at different situations, has increased unnecessary complexity.
With the present technique is that core can realize the ORM technology better, and the ORM technology uses OO program to handle operation to data in the relational database.Realized the unique identification and the relationship description of data with the COID form, thus obtained ORM can the traditional realization of force rate be eager to excel much bigger.For example:
Unified, simple dynamic object generates: if whenever get access to a COID value, can inquire corresponding class according to the sign of the class in the COID value by above-mentioned system, program can dynamically be created out the program object of this class and inquire the tables of data of this class correspondence then, can to inquire from tables of data that record that major key equals COID be that program object loads complete data to program then, and final program just can move the whole bag of tricks of this program object and finish business processing.This process just provides the contact tie between unified COID numerical value, data and the program object, can be applied in the exploitation of whole procedure and realize various OO functions.This process is robotization fully, does not need the developer to do any work again.
Can realize the inquiry of OO inquiry or even base class: such as all examples that may need to inquire about a base class, and a base class has a plurality of derived class, and the object of these derived class is distributed in respectively in the different tables of data.Utilize above-mentioned technology, system can analyze all derived class, gets access to all tables of data of their correspondences then, the data of these tables is all checked out then can be merged together the result who just forms these all examples of base class.Key in this process is: each object instance of each derived class all has same form and COID that numerical value differs sign, so can amalgamation result and uniquely in follow-up processing identify each object.And traditional database design is difficult to satisfy this condition.
The present invention can realize and optimize with above-mentioned thought and method is the various support functions at center.Realize particularly:
Realize the query grammar of object-oriented form.
The optimization of inquiring about at the data of COID form.
Carrying out special index at COID form data realizes.
Realize other some non-productive operations.
Further, these technology can be applicable in the design of relational database, and are built-in in relational database product.Relational database product can directly be supported the field type of shape as COID, and above-mentioned metadata management system and relevant processing and optimization, for application and development provides strong support.
And COID at first is the identified problems that has solved object from the data description layer, and data are designed by the mode of object fully, and the theory aspect is different with O/R Mapping product.
The organizing on the basis that is processed into the object system of data in database, the contact that utilizes O/R Mapping mapping mechanism to set up between the object of the object of programming language and database again has bigger value.The simple dynamic object generation of above-mentioned unification, OO base class inquiry etc. all demonstrate fully this difference.
Theory of the present invention will mainly realize dynamic ORM, can dynamically adjust behavior according to metadata configurations when operation.The usage of COID is described at two examples of this measure.
Embodiment one: the example of database design
Suppose that a company needs a crm system to come the information of managing customer and relation each other, client's type has multiple, may be a people, also may be an organizational structure such as commercial enterprise, government department etc., simultaneously, also manage order in the system, the client under every order need write down.
When using the COID pattern, being embodied in needs definition of data table TPerson, TCorporation, Tdepartment and TorderFrom on the database, will define the behavior that class CPerson, CCorporation, Cdepartment, CorderFrom realize these data objects and realize in system.According to the principle of COID, distribute the class sign for different classes, be specially: Cperson=000001, CCorporation=000002, CDepartment=000003, CorderFrom=000004.The class sign of a concrete object is determined that by the class under it its object identity value is produced by system's independent increment since 1, supposes to be designed to 12.An example snapshot data of Chan Shenging is as follows like this:
Figure C20061017320100181
From these data, can see: the major key of object and the form of external key complete unity, has identical form, and possesses the feature of polymorphic data important in the object-oriented method, such as the client COID field that it is apparent that this table of TorderFrom is a polymorphic external key, can store dissimilar clients, be respectively ten thousand Xiang science and technology (000002000000000001) of commercial enterprise's type the client of three orders of sample data, the Wang Fang (000003000000000002) of individual's type and the city Bureau of Land and Resources (000003000000000001) of government department.In fact the COID Major key of the object of other any type also can be filled up to the client who becomes order in this foreign key field in the system, and this has demonstrated fully the dirigibility of COID pattern in design data and expression.
From the angle of system evolution, if the strength of which day this company promotes, business development has been arrived on the Mars, need to increase new a kind of customer type in the system, can set up a new class CMars and TMars table so and be attached in the system simply.This table of TOrderFrom is without any need for variation! Thereby system just can admit the adding of such new data to carry out vigorous Mars marketing program, this structural Scalable Performance solves a lot of similarly system extension and differentiation problems, under comparing, the ID pattern is not all right, thereby, the ID of different types produces ambiguity because can producing repetition, and professional major key pattern has just been said nothing of, the data type of the major key of new data may may be exactly inconsistent fully with intrinsic structure, can't fill in under the situation that does not change existing structure at all.
Embodiment two: the example that business function is realized
Embodiment one has expressed the extensibility of succinct, the flexible and height of the following database design of COID pattern, and the bigger value of COID may be embodied in the business development of system.
Imagination said system need represent a lot of different classes of objects with a TreeView control, can be an order, people client, a corporate client one by one at each node of this tree-shaped control ... or the like.System can both trigger the operation of this object when the user double-clicks any one node with mouse.
Seem simple, but in fact the realization difficulty of this function is quite big, key issue is to discern objects stored in each node as a kind of uniform way how.Generally be the identifying information of form storage objects such as the icon that utilizes the TreeView node, character string, this method is obviously not general, and often there are problems such as ambiguity in the explanation of identifying information.
It then is very simple and reliable adopting the COID pattern now, because the node of each treeview can impliedly be preserved a numeral, so just the COID of object can be preserved, the unitarity of COID, terseness and overall uniqueness and identifiability can guarantee the general, convenient and reliable of this method.
Fig. 1 shows the database structure synoptic diagram according to second embodiment of the invention.Code will be shown below how handle, when the user double-clicked a node, treeview was as follows to the processing code of double-clicking incident:
{
Long COID=treenode->value; // take out implicit from the tree-shaped control node of double-clicking
The COID that preserves;
CBaseObject*p=GetObject (COID); // usefulness COID calling system function
GetObject creates concrete object
P->OnOpen (); The Virtual Function of the OnOpen of // allocating object
}
Here remark additionally, system by the COID mode development follows the advantage that certain class architecture demonstrates fully object-oriented method, in figure, the CBaseObject class is the base class of a system definition, and the class that other database is correlated with is as all CPerson, Ccorporation derive from from it.
Note CbaseObject*GetObject (long COID), this function has embodied the feature of developing around the COID pattern, specifically, the effect of this function is to import a coID into, create and return a concrete object, it utilizes metadata to realize, comes the corresponding relation of storage class, class sign in the system with metadata table.
The GetObject function analyzes the class sign in 6 in front after obtaining COID, so just can be in the system metadata table the counter class of finding correspondence, just can create the instance objects of class afterwards, then method such as allocating object initialization and loading data and returning.The code (being the event code of treeview here) that receives this object just can call its Virtual Function OnOpen after receiving this object, class of the every increase of system is as long as realize its OnOpen function like this, and the event handling code of tree-shaped control is once finished the back just not as changing.
This is OO completely design and implementation method.Because database design has adopted OO system, it and object oriented language system cooperate, and just make this process become easy and art up.
The basis of COID pattern is the lifting and the unification of database major key design, and two kinds of traditional major key Design Modes are the ID mode schemes that comprise the major key scheme of business information and do not comprise any information fully.Seem that like this COID pattern contains a class sign of two information and an object identity.Should be understood that, former model is not done any standard to comprising information, so the supposition of the information of doing be non-type, do not have ubiquity and may be unsettled, and be the expression on the basis of object-oriented thought for the description of the such ubiquity of class sign and object identity, so its generality, universality and stability all are very strong.Can feel obviously that class sign+object identity possesses a kind of " brief aesthetic feeling ".It should be more rational that ID is comprised the degree that information is balanced to class sign+object identity, and out of Memory is responsibility rather than the ID that other attribute field be should bear, and the sign of ID carrying class and object is that it just falls the duty-bound of benefit.
According to the present invention, COID has several comparatively concrete schemes:
1, adopt the form of the class sign of N position tens digit in conjunction with the object identity of M position tens digit, total size of the decimal system numerical value of N+M length is no more than the size of 64 bits.Size total under the scheme can be represented with the integer type of one 8 byte long, under 32 computing environment, realizes easily, and superior performance, and can save the space, and also metric expression mode has certain reading property.Shortcoming is that some calculating will influence efficient with the multiplication and division computing, and the value space of ID is limited in addition, consider that ID distributes the problem of overflowing.
2, adopt the form of 64 binary class signs in conjunction with 64 binary object identities, the digital total length of this form is 128 binary digits, length is the same with GUID, and Chang numeral reduces the possibility that class sign and object identity value are overflowed greatly like this.Main is, when decomposing a COID, do not need to do division arithmetic, because computing machine is normally stored this numeral with 16 bytes, obtaining class sign and object identity, only to need directly to extract each self-corresponding eight byte just passable, calculated performance has significantly and promotes, and database product also can be realized data directory better according to such data type.The shortcoming of this scheme is to take up room greatly, but along with this weakness of continuous lifting of hardware will die down.
3, adopt the form of the class sign of N position character string in conjunction with the object identity of M position character string.This mode is used string operation without digit manipulation, aspect of performance is relatively poor, also needs to take more storage space.Main benefit is to have readability preferably.
To analyze the benefit that the present invention brings below.
The present invention has carried out standardization with the sign of all data objects.The key sign of all data objects all has identical field name, data type and size, has so just greatly simplified database design and development.Because three key elements of the design of database are exactly the relation between entity, entity attribute, the entity, COID has unified the unified sign of entity, be equivalent to the unified problem of implementation that has solved entity and two key elements of entity relationship, this makes database structure not be used in this respect and works hard.
The present invention carry out uniqueization with the key sign of all data objects in the system.Object of a COID numeral unique identification equals to have solved object body identified problems in the object-oriented method opinion in the aspect of database.We can say a COID for database like a pointer value for ten, one effects of quoting for Java of C+.Below this is done a comparison:
● each C++ pointer all is 32 a integer, and all COID are the numerals of unified size, and both are equal to.
● each C++ pointer all points to an object in a process, and COID identifies a data object as main external key in a database, and both are equal to.
● the C++ pointer is polymorphic, the numeral that is one 32 equally can be pointed to dissimilar objects, COID has so polymorphic feature equally, owing to comprise class sign and object id information, the COID key assignments of a same form can pointing system in any one data of different types object.
● the C++ pointer has simple form, is exactly a numeral, and COID also is presented as a numeral generally, and this point is extremely important.Can recall: conventional I D key assignments can not go out object by independent identification.The words that identify are normally in implicit classification under the ID key assignments, the problem of bringing design and code not to reuse like this stipulated in the concrete context environmental; The words that want to reuse will be mixed " type " field again will for the ID key assignments and be finished sign to object, this expense that work with ubiquity is brought is huge, if if you not letter imagine each C++ pointer what situation all needs with two numeral expressions be.
This makes the method for database design that basic variation take place.Whole storehouse no longer is the combination of table, record, but the linking that concerns between a series of object and the object.OODB Object Oriented Data Base design in the past just in the early stage the stage use OO instrument such as UML to come indirect activities analysis and design, after the later stage is mapped as table, field, just abandoned the subject system structure at initial stage.The COID pattern then database initial stage design, later stage realize and the whole life of operation in all is OO completely system, even also can express effectively and realize for OO feature such as inheriting, polymorphic.
The benefit of bringing in the exploitation is the bigger value place of COID pattern.Code development in the past need be done work a large amount of, that repeat in the processing of aspect such as aspect object identity, the object relationship, and these contents can extract unified the realization as the thing of general characterization now, and left work has just just concentrated on the real business field.And COID sign is brief, and it is 1 numeral, and the convenience and the efficient that produce at aspects such as design, exploitation, system interactions are all very good! Such as under the multi-layer framework development mode, if the sign of any one data object can be represented by a numeral, just can be reduced at the form and the difficulty of Data transmission object between different layers, different module and the different computing machine, complicated system business structure becomes simple relatively before making, and the system design of EAI, the such theory of SOA makes up and also becomes more easy.
The above is the preferred embodiments of the present invention only, is not limited to the present invention, and for a person skilled in the art, the present invention can have various changes and variation.Within the spirit and principles in the present invention all, any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (12)

1. data bank service disposal route based on uniform data sign, described database comprises a plurality of data that comprise business information, the business information of each described data is relatively independent, it is characterized in that, may further comprise the steps:
Each described data is provided with ID as major key, wherein, described ID is set to integer or the character that length is the N+M position, wherein, N and M are the positive integer greater than 0, and N represents the position class sign, M position representative object sign, described class sign is used for identifying uniquely the affiliated class of these data, and described object identity is used for identifying these data uniquely at a plurality of object instances of this class;
Mapping relations between class sign and the class are described, mapping relations between class and the table and the derived relation between each class;
Inquire corresponding class according to the sign of the class among the described ID;
Dynamically create out the program object of this class and inquire the table of this class correspondence; Inquiring from described table that record that major key equals described ID is that described program object loads complete data;
The whole bag of tricks that moves described program object is to finish corresponding service processing; And
When inquiring about the object of concrete class,, get access to the table of this class correspondence, generate towards the query statement of table according to the table system and come query object according to the name of this class;
When inquiring about the object of a plurality of classes, then each class is handled as stated above, then the result is gathered the long and collection of formation;
When inquiring about the object of a base class, go out all derived class that base class derives from, be aggregated into a long and collection by above-mentioned method then according to the descriptive analysis that concerns between the class.
2. the data bank service disposal route based on the uniform data sign according to claim 1 is characterized in that described ID is set to the integer of 128 binary representations, wherein: N=64, M=64.
3. the data bank service disposal route based on the uniform data sign according to claim 1 is characterized in that described ID is set to the integer of scale-of-two or decimal representation, and the value of entire I D is no more than 2 64
4. the data bank service disposal route based on the uniform data sign according to claim 1 is characterized in that, and is further comprising the steps of:
Equal the value of described ID by the value that external key is set, to describe described a plurality of relation between objects.
5. the data bank service disposal route based on uniform data sign according to claim 4 is characterized in that, the value that equals described major key by the value that external key is set comes between to set up association to may further comprise the steps:
By the described ID of storage in described external key, external key does not repeat, to shine upon 1: 1 relation between described a plurality of object; Perhaps
By the described ID of storage in described external key, described external key has repetition, to shine upon 1 between described a plurality of object: many relations; Perhaps
Relation table is set, wherein contains a plurality of external keys and store described ID, described external key has repetition, to shine upon many between described a plurality of object: many relations.
6. the data bank service disposal route based on the uniform data sign according to claim 5 is characterized in that, and is further comprising the steps of:
When obtaining the class sign,, get access to the described class sign of N position by decomposition according to described ID;
Obtain corresponding time-like,, from described mapping, get access to corresponding class according to described class sign;
When obtaining corresponding one or more table,, from described mapping, get access to one or more tables of correspondence according to described class;
When obtaining the pairing a plurality of table of one or more classes of its derivation, according to described class, thereby the one or more classes that get access to its derivation from mapping are obtained a plurality of tables that correspond to.
7. the data bank service disposal route based on the uniform data sign according to claim 1 is characterized in that, and is further comprising the steps of:
Storage has the object of same item sign in a table; Perhaps
Storage has the object of inhomogeneity sign in a table; Perhaps
The data content of the object of a class is distributed in the different tables.
8. the data bank service disposal route based on the uniform data sign according to claim 1 is characterized in that each the bar data in the result set all comprise a described ID.
9. the data bank service disposal route based on the uniform data sign according to claim 1 is characterized in that, and is further comprising the steps of:
The described ID of storage realizes the related of interface and described object in interface control;
When inquiring corresponding time-like, from interface control, take out the described ID of storage according to the sign of the class among the described ID.
10. the data bank service disposal route based on the uniform data sign according to claim 1 is characterized in that, and is further comprising the steps of:
Set up index at class by decomposing N position class ID among the described ID, described index is used for selecting the object that belongs to one or more classes from many records.
11. the data bank service disposal route based on the uniform data sign according to claim 1 is characterized in that, and is further comprising the steps of:
The described ID that gathers the data of a plurality of tables generates index, and described index only is used for finding pairing table of its object and record according to the ID of an object.
12., it is characterized in that described database comprises relational database according to each described data bank service disposal route in the claim 1 to 11 based on the uniform data sign.
CNB2006101732017A 2006-12-30 2006-12-30 Data bank service disposal route based on the uniform data sign Expired - Fee Related CN100565519C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2006101732017A CN100565519C (en) 2006-12-30 2006-12-30 Data bank service disposal route based on the uniform data sign

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2006101732017A CN100565519C (en) 2006-12-30 2006-12-30 Data bank service disposal route based on the uniform data sign

Publications (2)

Publication Number Publication Date
CN1996308A CN1996308A (en) 2007-07-11
CN100565519C true CN100565519C (en) 2009-12-02

Family

ID=38251399

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2006101732017A Expired - Fee Related CN100565519C (en) 2006-12-30 2006-12-30 Data bank service disposal route based on the uniform data sign

Country Status (1)

Country Link
CN (1) CN100565519C (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105871960B (en) * 2015-01-22 2020-02-28 阿里巴巴集团控股有限公司 Method, device and equipment for calling data sharing
CN109815242B (en) * 2019-02-02 2021-04-02 中国农业银行股份有限公司 Data processing method and system
CN113285816B (en) * 2020-02-19 2022-10-28 华为技术有限公司 Control request sending method, device and system based on key value configuration
CN113742334A (en) * 2020-06-29 2021-12-03 北京沃东天骏信息技术有限公司 Data processing method and device
CN113342908B (en) * 2021-06-30 2022-03-11 北京天融信网络安全技术有限公司 Object-oriented kernel layer database construction method

Also Published As

Publication number Publication date
CN1996308A (en) 2007-07-11

Similar Documents

Publication Publication Date Title
Karnitis et al. Migration of relational database to document-oriented database: structure denormalization and data transformation
CN108038222B (en) System of entity-attribute framework for information system modeling and data access
US7599948B2 (en) Object relational mapping layer
CN101036141B (en) A database management system with persistent, user- accessible bitmap values
CN110929042B (en) Knowledge graph construction and query method based on power enterprise
CN108228817A (en) Data processing method, device and system
CN101609473B (en) Method and device for reconstructing structured query language of report inquiry
CN102426582B (en) Data manipulation management devices and data manipulation management method
CN103577590A (en) Data query method and system
US9547646B2 (en) User-created members positioning for OLAP databases
CN100565519C (en) Data bank service disposal route based on the uniform data sign
CN109408906B (en) BIM model-based engineering quantity expression and statistics method
CN103914290A (en) Operating command processing method and device
CN104182484A (en) Method and device for realizing mapping of HBase data and Java domain objects
CN101872449A (en) Customer information screening method
CN103559189A (en) Power simulation training resource management system and method based on metadata integration model
CN103186628A (en) Method for mapping between common information model and relational database
CN104317964A (en) Object-relational mapping method and system based on iBatis
JP2002182970A (en) Object integral management system
CN103186620A (en) CIM mapping method
CN113987626A (en) Extensible building full life BIM modeling method
CN103107919A (en) Method and system for network resource modeling
CN112800143A (en) Structure of data object and method for dynamically managing data object
CN102426680A (en) Logical chart of accounts with hashing
CN108399188A (en) A kind of general foundation of the strong business object based on genre metadata and processing method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
ASS Succession or assignment of patent right

Owner name: GANSU HUADI INFORMATION TECHNOLOGY CO., LTD.

Effective date: 20150814

C41 Transfer of patent application or patent right or utility model
TR01 Transfer of patent right

Effective date of registration: 20150814

Address after: 730030, 2532, Yan Bei Road, Chengguan District, Gansu, Lanzhou

Patentee after: Chen Feng

Patentee after: Gansu China Mdt InfoTech Ltd

Address before: 100080, No. 19, No. 09, block B, century trade building, No. 66, Zhongguancun East Road, Beijing, Haidian District

Patentee before: Chen Feng

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20190301

Address after: 730030 No. 2532 Yanbei Road, Chengguan District, Lanzhou City, Gansu Province

Patentee after: Chen Feng

Address before: 730030 No. 2532 Yanbei Road, Chengguan District, Lanzhou City, Gansu Province

Co-patentee before: Gansu China Mdt InfoTech Ltd

Patentee before: Chen Feng

CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20091202

Termination date: 20191230

CF01 Termination of patent right due to non-payment of annual fee