CN1862542A - Method of shared object attribute - Google Patents
Method of shared object attribute Download PDFInfo
- Publication number
- CN1862542A CN1862542A CN 200610083592 CN200610083592A CN1862542A CN 1862542 A CN1862542 A CN 1862542A CN 200610083592 CN200610083592 CN 200610083592 CN 200610083592 A CN200610083592 A CN 200610083592A CN 1862542 A CN1862542 A CN 1862542A
- Authority
- CN
- China
- Prior art keywords
- attribute
- name
- attributes object
- attributes
- index
- 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.)
- Pending
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present invention relates to a method of attribute share, including method for creating attribute library and method for searching object attribute data. The method for creating attribute library includes the steps of extracting attribute of object, associating attribute name with correspondent numerical value to form attribute object, writing all the attribute objects into data base and creating index for attribute objects. The method for searching object attribute data includes the steps of obtaining attribute name of object, accessing attribute library, searching correspondent attribute object and obtaining attribute data of object.
Description
Technical field
The present invention relates to a kind of method of shared attribute, particularly a kind ofly set up the attribute library of object by extracting the attribute of object, the method that can come the attribute of shared object by the access attribute storehouse when making the executive routine operation.
Background technology
In the prior art, according to OO thought, according to the encapsulation of object, the attribute of object generally is the territory (Field) that is stored as object inside, in application, be provided for the reading/writing method of himself attribute by object itself, such territory (Field) is called " Attribute domain ".
For example, " frame " object has frame type attribute and border width attribute.The line style of frame is generally the integer value, and 1 this frame of expression is a linear pattern, and 2 these frames of expression are dotted line types, and the width of frame also is the integer value, and its unit is a pixel.According to general OO mode, these two attribute definitions be the frame object " Attribute domain ", as shown in Table 1:
The frame object | borderStyle |
borderWith |
Table one
In the table one, borderStyle is the type attribute of frame; BorderWith is the width attribute of frame.In a frame object, need to be provided with this two Attribute domains at least, and when program run, object itself can provide method that these two " Attribute domains " are read and write.
Yet, in larger program, the general more complicated of object definition, Attribute domain is generally more; And during program run, number of objects is numerous usually, and each object has a large amount of Attribute domains, and this has caused Attribute domain to consume very big internal memory, has reduced the operational efficiency of program.
Summary of the invention
The objective of the invention is to consume big, the inefficient defective of program run of internal memory at the Attribute domain that exists in the above-mentioned prior art, propose a kind of method of the shared attribute based on attributes object, this method comprises based on attributes object sets up the method for attribute library and the method for searching object attribute data based on attribute library.The method of sharing attribute can extract these Attribute domains, and realizes sharing, and reduces the internal memory that consumes during the program run, thereby improves the operational efficiency of program.
For achieving the above object, provided by the present inventionly a kind ofly set up the method for attribute library, may further comprise the steps based on attributes object:
Step 11, attributes object are created the attribute that process extracts object respectively, each attribute-name and the pairing numerical value of this attribute-name are carried out with several right forms related, the formation attributes object;
Step 12, described attributes object are created process transfer attributes object storage process, all attributes object are write in the database, and be that described attributes object is created index, finish the foundation of attribute library.
A kind of method of searching object attribute data based on attribute library provided by the present invention may further comprise the steps:
Step 21, obtain the attribute-name of object;
Step 22, visit described attribute library, and search the described attributes object corresponding with this attribute-name according to described attribute-name;
Step 23, from described attributes object, obtain the attribute data of described object;
Step 24, end.
The present invention comes out by the attribute extraction with object, and it is right for setting up numerical value between each attribute-name and this attribute-name value corresponding, set up attribute library after the encapsulation, realized separating of attributes object and object itself, having eliminated needs in the conventional art a large amount of Attribute domains is set, thereby consumes the drawback of a large amount of internal memories.During program run, if a plurality of object has identical attribute, then these objects can use identical attributes object, thereby realize sharing of attribute, save internal memory and consume.
Below by drawings and Examples, technical scheme of the present invention is described in further detail.
Description of drawings
Fig. 1 sets up the process flow diagram of an embodiment of attribute library method for the present invention;
Fig. 2 searches the process flow diagram of a specific embodiment of the method for object attribute data for the present invention;
Fig. 3 searches the process flow diagram of another specific embodiment of the method for object attribute data for the present invention;
Fig. 4 searches the process flow diagram of another specific embodiment of the method for object attribute data for the present invention.
Embodiment
Figure 1 shows that the process flow diagram of a specific embodiment setting up attribute library, this specific embodiment is realized the foundation of attribute library by following steps:
Step 101, attributes object are created the attribute that process extracts object respectively, obtain the numerical value of attribute-name and this attribute.
Step 102, each attribute-name and the pairing numerical value of this attribute-name are carried out related with several right forms, form attributes object.
Step 103, attributes object are created process transfer attributes object storage process, and all attributes object are write in the database.
Step 104, be that attributes object creates index.
Step 125, finish the foundation of attribute library.
In the above-described embodiments, because the complete attribute of object is made up of the data of many aspects, therefore, for the data of each aspect, can be right with an ID-Value, promptly " key, value " right form forms described several rightly, and one " key; value " is several to describing a composition information of described attribute, key is described attribute-name, is worth to be the pairing numerical value of this attribute-name, as shown in Table 2.
ID(1) | Value(1) |
ID(2) | Value(2) |
ID(3) | Value(3) |
…… | |
ID(n) | Value(n) |
Table two
In the table two, the attribute-name of certain aspect that ID representative is concrete, corresponding Value represents the numerical value of this attribute-name, like this, with one group of ID-Value to a complete attribute that just can description object.
For example, the frame attribute of object is made up of many aspects, as line style (comprising linear pattern, dotted line type) and border width, in order to be the frame attribute extraction frame attributes object, (its value is integer 1 and 2,1 expression linear patterns can to define two ID (constant) border-Style, 2 expression dotted line types), (its value is an integer to border-With, unit is a pixel), then the frame attributes object of " line style is the dotted line type, and width is 10 pixels " is:
border-Style | 2 |
border-With | 10 |
In the foregoing description, the concrete operations of step 103 can be taked following mode:
At first, all attributes object are classified; Then, the attributes object that will belong to same type leaves in same the table in the described database, and the table name of described table is the classification constant of attributes object.
After writing database, attributes object is created process and index can also be encapsulated in the described attribute library.
Among the present invention, the attributes object that extracts is put together, unified management, the set of a such attributes object just becomes an attributes object storehouse, and it can realize the visit and the setting of attributes object, sets up getting in touch of object and attributes object; By the Classification Management of attributes object, the retrieval rate when improving visit.
Attributes object is created process described attributes object is classified, and the attributes object that belongs to same type leaves in same the table in the described attribute library, and the table name of described table is the attributive classification constant; At this moment, safeguarded two kinds of tables in attribute library, a kind of is to belong to of a sort attributes object table, and a kind of is the class table of attributes object, preservation be the index of attributive classification constant and corresponding table thereof.
As shown in Figure 2, search the process flow diagram of a specific embodiment of the method for object attribute data for the present invention, this embodiment specifically carries out following steps:
Step 201, obtain the attribute-name of object.Object Operations according to the program run needs are carried out obtains the attribute-name relevant with this object.
Step 202, visit described attribute library, and search the described attributes object corresponding with this attribute-name according to attribute-name.
Step 203, from described attributes object, obtain the attribute data of described object.
Step 204, finish and search object properties.
The attributes object storehouse that the present invention set up can be a two-dimensional array table.In the two-dimensional array table, attributive classification of every line display (using the attributive classification constant definition), this row is used to deposit this type of attributes object, and like this, attribute is unique definite by classification constant and column index, thereby realizes sharing of attributes object.
Figure 3 shows that the present invention searches the process flow diagram of another specific embodiment of the method for object attribute data, this embodiment specifically carries out following steps:
The numerical value that step 304, retrieval system or program are made an appointment.
This method has realized that attributes object and object are separated, and during the program run, if a plurality of object has identical attribute, then these objects can use identical attributes object, thereby realizes sharing of attribute, saves internal memory and consumes.
In the foregoing description, to the concrete visit of carrying out a bivariate table of the visit of described attribute library, this bivariate table storage be the one or more several right of each attributes object correspondence, described several be the index of described attributes object to the position in bivariate table.
Figure 4 shows that the present invention searches the process flow diagram of another specific embodiment of the method for object attribute data, this embodiment specifically carries out following steps:
Step 401, obtain the attribute-name of object.Object Operations according to the program run needs are carried out obtains the attribute-name relevant with this object.
Step 402, visit class table in the described attribute library, judge whether there is such corresponding generic attribute table in the described attribute library, if then execution in step 403 according to the class under the attributes object of attribute-name correspondence; Otherwise execution in step 405;
Step 403, according to the described generic attribute table of index accesses of the attributes object of described attribute-name correspondence, judge the attributes object whether described index correspondence is arranged in the generic attribute table, if having, then execution in step 404; Otherwise execution in step 405;
Step 404: judge whether there is described attribute-name in the described attributes object, if then return the several right of described attribute-name correspondence; Otherwise execution in step 405;
Step 405, return about definite value, for example INVALID_VALUE.
In the method, the attributes object storehouse is by the attributes object in the unique index home banking, this index is the bridge between object and the attributes object, by in object, preserving a property index, make object and attributes object set up contact, object relies on index can be provided with and the access attribute object.
It is several right to judge whether had in the bivariate table, if, the index of return attribute object then, this index is encapsulated in the object, like this, for a plurality of objects with same alike result, the attributes object storehouse will distribute identical index to give them, make these objects use same attributes object jointly.So just realized sharing of attributes object.
It should be noted last that, above embodiment is only unrestricted in order to technical scheme of the present invention to be described, although the present invention is had been described in detail with reference to preferred embodiment, those of ordinary skill in the art is to be understood that, can make amendment or be equal to replacement technical scheme of the present invention, and not break away from the spirit and scope of technical solution of the present invention.
Claims (9)
1, a kind ofly set up the method for attribute library, wherein, may further comprise the steps based on attributes object:
Step 11, attributes object are created the attribute that process extracts object respectively, each attribute-name and the pairing numerical value of this attribute-name are carried out with several right forms related, the formation attributes object;
Step 12, described attributes object are created process transfer attributes object storage process, all attributes object are write in the database, and be that described attributes object is created index, finish the foundation of attribute library.
2, method according to claim 1, wherein, in the described step 11, when with several right forms described attribute-name and the pairing numerical value of this attribute-name being carried out association, it is described several right that " key, value " the right form of employing forms, one " key; value " is several, and key is described attribute-name to describing a composition information of described attribute, is worth to be the pairing numerical value of this attribute-name.
3, method according to claim 1, wherein, in the described step 12, described attributes object storage process with the concrete operations that all attributes object write database is:
Step 121, all attributes object are classified;
Step 122, the attributes object that will belong to same type leave in same the table in the described database, and the table name of described table is the classification constant of attributes object.
4,, wherein, also be provided with described attributes object after the described step 12 and create process described index is encapsulated in step in the described attribute library according to claim 1,2 or 3 described methods.
5, a kind of method of searching object attribute data based on attribute library wherein, may further comprise the steps:
Step 21, obtain the attribute-name of object;
Step 22, visit described attribute library, and search the described attributes object corresponding with this attribute-name according to described attribute-name;
Step 23, from described attributes object, obtain the attribute data of described object;
Step 24, end.
6, method according to claim 5, wherein, described step 22 is specially;
Step 221, according to the index of the pairing attributes object of described attribute-name, visit the table in the described attribute library, judge the attributes object whether described index correspondence is arranged in the described table, if having, then execution in step 222; Otherwise execution in step 223;
Step 222, judge whether there is described attribute-name in the described attributes object, if then return the several right of described attribute-name correspondence; Otherwise execution in step 223;
Step 223, return a numerical value of setting approximately earlier.
7, method according to claim 6, wherein, in the described step 221 to the concrete visit of carrying out a bivariate table of the visit of described attribute library, the storage of this bivariate table be the one or more several right of each attributes object correspondence, described several be the index of described attributes object to the position in bivariate table.
8, method according to claim 5, wherein, described step 22 is specially:
Step 221 ', visit described attribute library according to the class under the attributes object of an attribute-name correspondence, judge whether there is such corresponding generic attribute table in the described attribute library, if, execution in step 222 ' then; Otherwise execution in step 224 ';
Step 222 ', according to the described generic attribute table of index accesses of the attributes object of described attribute-name correspondence, judge in the described generic attribute table whether the attributes object of described index correspondence is arranged, if having, execution in step 223 ' then; Otherwise execution in step 224 ';
Step 223 ', judge whether there is described attribute-name in the described attributes object, if then return the several right of described attribute-name correspondence; Otherwise execution in step 224 ';
Step 224 ', return a numerical value of setting approximately earlier.
9, method according to claim 8, wherein, step 221 ' in, the detailed process of visiting described attribute library is the visit to class table and these two bivariate tables of generic attribute table, what store in the described class table is the index of the generic attribute table of the class of attributes object correspondence and described class correspondence, store in the described generic attribute table to be that each belongs to such attributes object pairing one or more several right, described several be the index of described attributes object to the position in described generic attribute table.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 200610083592 CN1862542A (en) | 2006-06-09 | 2006-06-09 | Method of shared object attribute |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 200610083592 CN1862542A (en) | 2006-06-09 | 2006-06-09 | Method of shared object attribute |
Publications (1)
Publication Number | Publication Date |
---|---|
CN1862542A true CN1862542A (en) | 2006-11-15 |
Family
ID=37389972
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN 200610083592 Pending CN1862542A (en) | 2006-06-09 | 2006-06-09 | Method of shared object attribute |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN1862542A (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102004633A (en) * | 2009-09-03 | 2011-04-06 | 阿里巴巴集团控股有限公司 | Method and device for processing control property |
US8126850B2 (en) | 2008-08-13 | 2012-02-28 | Alibaba Group Holding Limited | Method and system for saving database storage space |
CN102930112A (en) * | 2012-11-12 | 2013-02-13 | 北京数码大方科技股份有限公司 | Setting method and setting device of object properties |
CN105094790A (en) * | 2014-05-22 | 2015-11-25 | 腾讯科技(深圳)有限公司 | Standardized structure based application running method and system |
CN105830025A (en) * | 2013-12-20 | 2016-08-03 | 微软技术许可有限责任公司 | Property accesses in dynamically typed programming languages |
CN105955727A (en) * | 2016-04-22 | 2016-09-21 | 广东凯通软件开发有限公司 | Creation method and access method for universal memory entity |
CN106951427A (en) * | 2016-01-07 | 2017-07-14 | 阿里巴巴集团控股有限公司 | A kind of data pick-up method and device of business object |
CN107908727A (en) * | 2017-11-14 | 2018-04-13 | 郑州云海信息技术有限公司 | Storage object cloning process, device, equipment and computer-readable recording medium |
CN109101595A (en) * | 2018-07-27 | 2018-12-28 | 郑州云海信息技术有限公司 | A kind of information query method, device, equipment and computer readable storage medium |
-
2006
- 2006-06-09 CN CN 200610083592 patent/CN1862542A/en active Pending
Cited By (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8126850B2 (en) | 2008-08-13 | 2012-02-28 | Alibaba Group Holding Limited | Method and system for saving database storage space |
US9471440B2 (en) | 2008-08-13 | 2016-10-18 | Alibaba Group Holding Limited | Method and system for processing product properties |
CN102004633A (en) * | 2009-09-03 | 2011-04-06 | 阿里巴巴集团控股有限公司 | Method and device for processing control property |
CN102004633B (en) * | 2009-09-03 | 2013-04-24 | 阿里巴巴集团控股有限公司 | Method and device for processing control property |
CN102930112B (en) * | 2012-11-12 | 2015-10-14 | 北京数码大方科技股份有限公司 | The method to set up of object properties and device |
CN102930112A (en) * | 2012-11-12 | 2013-02-13 | 北京数码大方科技股份有限公司 | Setting method and setting device of object properties |
CN105830025A (en) * | 2013-12-20 | 2016-08-03 | 微软技术许可有限责任公司 | Property accesses in dynamically typed programming languages |
CN105830025B (en) * | 2013-12-20 | 2019-05-07 | 微软技术许可有限责任公司 | Attribute access in the programming language of dynamic typing |
CN105094790A (en) * | 2014-05-22 | 2015-11-25 | 腾讯科技(深圳)有限公司 | Standardized structure based application running method and system |
CN105094790B (en) * | 2014-05-22 | 2019-05-07 | 腾讯科技(深圳)有限公司 | A kind of operation method and system of the application program based on standardized structural body |
CN106951427A (en) * | 2016-01-07 | 2017-07-14 | 阿里巴巴集团控股有限公司 | A kind of data pick-up method and device of business object |
CN106951427B (en) * | 2016-01-07 | 2020-08-18 | 阿里巴巴集团控股有限公司 | Data extraction method and device for business object |
CN105955727A (en) * | 2016-04-22 | 2016-09-21 | 广东凯通软件开发有限公司 | Creation method and access method for universal memory entity |
CN107908727A (en) * | 2017-11-14 | 2018-04-13 | 郑州云海信息技术有限公司 | Storage object cloning process, device, equipment and computer-readable recording medium |
CN107908727B (en) * | 2017-11-14 | 2021-06-29 | 郑州云海信息技术有限公司 | Storage object cloning method, device, equipment and computer readable storage medium |
CN109101595A (en) * | 2018-07-27 | 2018-12-28 | 郑州云海信息技术有限公司 | A kind of information query method, device, equipment and computer readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN1862542A (en) | Method of shared object attribute | |
Binna et al. | HOT: A height optimized trie index for main-memory database systems | |
Weber et al. | An approximation based data structure for similarity search | |
Kondylakis et al. | Coconut: A scalable bottom-up approach for building data series indexes | |
CN110188108B (en) | Data storage method, device, system, computer equipment and storage medium | |
CN1838124A (en) | Method for rapidly positioning grid + T tree index in mass data memory database | |
CN1955958A (en) | Sort data storage and split catalog inquiry method based on catalog tree | |
CN1536509A (en) | Inverted index storage method, inverted index mechanism and on-line updating method | |
Sarwat et al. | Generic and efficient framework for search trees on flash memory storage systems | |
CN1464436A (en) | Data storing and query combination method in a flush type system | |
CN108021702A (en) | Classification storage method, device, OLAP database system and medium based on LSM-tree | |
CN101587484B (en) | Index method for main storage database based on T-lt tree | |
CN1845093A (en) | Attribute extensible object file system | |
CN1896972A (en) | Method and device for converting virtual address, reading and writing high-speed buffer memory | |
CN1811759A (en) | Method for building information increment index | |
CN102521304A (en) | Hash based clustered table storage method | |
CN100347705C (en) | Method for file merge | |
CN116257523A (en) | Column type storage indexing method and device based on nonvolatile memory | |
CN108446399A (en) | A kind of dynamic memory optimization method of structuring magnanimity real time data | |
CN103399915A (en) | Optimal reading method for index file of search engine | |
CN1889080A (en) | Method for searching character string | |
CN101833511A (en) | Data management method, device and system | |
Roumelis et al. | Bulk-loading and bulk-insertion algorithms for xBR^+-trees xBR+-trees in Solid State Drives | |
CN1545047A (en) | Metadata hierarchy management method and system of storage virtualization system | |
CN101034416A (en) | Method for file seek track using file allocation table and system frame thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C12 | Rejection of a patent application after its publication | ||
RJ01 | Rejection of invention patent application after publication |