CN106649631A - System and method for flexibly configuring additional field - Google Patents
System and method for flexibly configuring additional field Download PDFInfo
- Publication number
- CN106649631A CN106649631A CN201611116974.1A CN201611116974A CN106649631A CN 106649631 A CN106649631 A CN 106649631A CN 201611116974 A CN201611116974 A CN 201611116974A CN 106649631 A CN106649631 A CN 106649631A
- Authority
- CN
- China
- Prior art keywords
- field
- data
- client
- value
- additional attribute
- 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
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2282—Tablespace storage structures; Management thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/21—Design, administration or maintenance of databases
- G06F16/211—Schema design and management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention relates to the field of database design of system software, and in particular relates to a system and a method for flexibly configuring an additional field. The system provided by the invention comprises an additional attribute table and an additional value table. The method provided by the invention comprises the steps of firstly building the additional attribute table, and using data in the additional attribute table to virtually serve as the additional field of a main table; then building the additional value table, and using the data in the additional value table to virtually serve as the value of one additional field of a line of data in the main table; and at last, setting one field of the additional value table to be redundant for storing the data in the additional attribute table after being subjected to JSON. According to the system and the method provided by the invention, even if the data of the additional attribute table is added or deleted later, the current attribute can also be taken out from the redundant field of the additional value.
Description
Technical field
The present invention relates to the database design field of systems soft ware, is system and its side of a kind of flexible configuration extra field
Method.
Technical background
In the exploitation of system, a system may be applied to multiple projects, but the table structure of multiple projects is not
It is certain identical, lift a simply example:User's table of A projects needs user's table of the field of mailbox, B projects to need mailbox
Field and phone number field, user's table of C projects both do not needed the field of mailbox also without the word of phone number
Section;In this case, general system is required for changing the structure of tables of data, and corresponding code is then changed again, each
Project is required for modification, and accumulative workload is very big.In addition, when data list structure is changed, it is also contemplated that
, if legacy data is incompatible, can there are many unexpected mistakes in system operation in the compatibility of legacy data.
The content of the invention
Present invention solves the technical problem that one of be that a kind of system of flexible configuration extra field is provided, realization do not change
Code, only changes the data inside additional attribute table.
Present invention solves the technical problem that two be that a kind of method of flexible configuration extra field is provided, realize when newly-increased
Or when editor, newest additional attribute can be taken out from additional attribute table, and when checking, can be from bonus values table
Redundant field takes out the additional attribute of history.
The present invention solves the technical scheme of one of above-mentioned technical problem, the system, including additional attribute table and extra
Value table;
Described additional attribute table, the i.e. extra field of master meter, comprising:The corresponding master meter of tableName, i.e. additional attribute
Title;The field name of code, i.e. additional attribute;Name, the field Chinese name of additional attribute;Type, that is, generate page elements
Type;The validity check of valid, i.e. field value;Disabled, indicates whether disabling;The exhaustion of datas, i.e. field value
Scope;Sort, that is, put in order;Deletable, indicates whether to delete;
Described bonus values table, comprising:ExtraKeyId, that is, correspond to the ID of additional attribute;ExtraKeyjson, that is, correspond to
The json data of additional attribute;TableName, that is, correspond to the title of master meter, belongs to redundant field;TableDataId, that is, correspond to
The ID of the data of master meter;Value in content, as bonus values table.
Described extra field, is to be present in the field beyond master meter, when master meter is in need, can be made by master meter
With not affecting the integrality of master meter structure;
Described redundant field, refers to extraKeyJson, that is, correspond to the JSON data of additional attribute;
It is that described method comprises the steps that the present invention solves the technical scheme of the two of above-mentioned technical problem:
Step 1:An additional attribute table is set up, for virtually serving as the extra field of master meter, while setting up a volume
Outer value table, using the data inside bonus values table, for virtually serving as an extra field of the data line in master meter
Value;
Step 2:In bonus values table redundant field, for depositing additional attribute JSONization after data, check at that time
Attribute.
Described sets up additional attribute table, refers to configuration special field, including:Configuration tableName, can be used in system
In all of table;Configuration type, client can generate different types of html according to aforesaid type;Configuration valid, client
End or service end can carry out data validation according to the value of valid;Configuration datas, client can be according to datas
Value, list data exhaustion scope;Configuration disabled, keeper can control whether extra field prohibits by disabled
With;Configuration sort, client determines putting in order for extra field by judging the size of sort;Configuration deletable,
Service end judges whether extra field allows to delete by the value of deletable;
It is described to set up bonus values table, critical field is can configure, including:Configuration extraKeyId, marks the bonus values institute right
The additional attribute answered;Configuration tableName, belongs to redundant field, rapidly individually from bonus values table search data;Configuration
TableDataId, marks the concrete data line of the master meter belonging to the bonus values;
Described step 1, specifically includes:Client can carry out different operating in the extra field of master meter, change comprising additions and deletions,
Add value and modified values;
Described additions and deletions change, and refer to that directly can carry out additions and deletions to extra attribute list changes;
Described add value, refers to and first read data from additional attribute table and return, client is specified according to data genaration
The html of form, client is filled in after submission, and value is saved in bonus values table;
Described modified values, refer to from additional attribute table and fetch data, and according to additional attribute, find corresponding bonus values and return
Return, client after client modification is submitted to, value bonus values is modified to according to the html of the data genaration specified format for returning
Table;When client needs to check the extra field of master meter and value, first read data from bonus values table and return;
Described step 2, specifically also includes:Client extracts the extra of history from JSON redundant fields in bonus values table
Attribute, according to value and the additional attribute of history, generates the html of specified format, shows for client.
The present invention has the beneficial effect that:
The system of the present invention, can make extra field allow to be changed by additions and deletions and look into, when a system be used for multiple projects and
When table structure is not exclusively the same, realization can not change code, only the data inside modification additional attribute table.
The method of the present invention, there is provided redundancy scheme, realizes when newly-increased or editor, to take out most from additional attribute table
New additional attribute, when checking, can take out the additional attribute of history from the redundant field of bonus values table, and this is caused additionally
Compatibling problem of the management of field without the concern for legacy data.
Description of the drawings
Below in conjunction with the accompanying drawings the present invention is further described:
Fig. 1 is the data list structure of the present invention;
Fig. 2 is the use flow chart of the present invention;
Specific embodiment
Fig. 1 is the data list structure of the present invention, refers to Fig. 1, additional attribute table, with the data inside additional attribute table,
Virtually serve as the extra field of master meter, be listed below the field of its Special Significance:
The title of the corresponding master meter of tableName, i.e. additional attribute, tableName allows the present invention to act on system
In all of table;
Type, that is, generate the type of page elements, and client can generate different types of html according to this type;
The validity check of valid, i.e. field value, client or service end can carry out data according to the value of valid
Validity check;
The exhaustive scope of datas, i.e. field value, client can list data exhaustion scope according to the value of datas;
Whether disabled, i.e., disable, and keeper can control whether extra field disables by disabled;
Sort, that is, put in order, and client determines putting in order for extra field by judging the size of sort;
Whether deletable, i.e., can delete, and service end judges whether extra field permits by the value of deletable
Perhaps delete;
Bonus values table, with the data inside bonus values table, virtually serve as data line inside master meter one is extra
The value of field, its critical field is as follows:
ExtraKeyId, that is, correspond to the ID of additional attribute, for marking the additional attribute corresponding to the bonus values;
TableName, that is, correspond to the title of master meter, belongs to redundant field, in order to rapidly individually from bonus values table
Searching data;
TableDataId, that is, correspond to the ID of the data of master meter, for marking concrete a line of the master meter belonging to the bonus values
Data;
ExtraKeyJson, that is, correspond to the JSON data of additional attribute, even if the data of additional attribute table are later by additions and deletions
Change, also can take out attribute at that time from the redundant field of bonus values;
Fig. 2 uses flow process, idiographic flow to realize as follows for the present invention:
When client needs the extra field for master meter to carry out additions and deletions and change, directly carry out additions and deletions to extra attribute list and change i.e.
Can;
When client needs the extra field add value for master meter, first read data from additional attribute table and return
Return, client according to the html of data genaration specified format, fill in after submission, and value is saved in bonus values table by client;
When client needs the extra field modified values for master meter, first fetch data from additional attribute table, further according to
Additional attribute, finds corresponding bonus values and returns, client according to return data genaration specified format html, client
After modification is submitted to, value is modified to bonus values table;
When client needs to check the extra field of master meter and value, first read data from bonus values table and return
Return, client extracts the additional attribute of history from bonus values the inside JSON redundant fields, extra with history finally according to value
Attribute, generates the html of specified format, shows for client.
Claims (7)
1. a kind of system of flexible configuration extra field, it is characterised in that described including additional attribute table and bonus values table;
Described additional attribute table, the i.e. extra field of master meter, comprising:The name of the corresponding master meter of tableName, i.e. additional attribute
Claim;The field name of code, i.e. additional attribute;Name, the field Chinese name of additional attribute;Type, that is, generate the class of page elements
Type;The validity check of valid, i.e. field value;Disabled, indicates whether disabling;The exhaustive scope of datas, i.e. field value;
Sort, that is, put in order;Deletable, indicates whether to delete;
Described bonus values table, comprising:ExtraKeyId, that is, correspond to the ID of additional attribute;ExtraKeyjson, that is, correspond to extra
The json data of attribute;TableName, that is, correspond to the title of master meter, belongs to redundant field;TableDataId, that is, correspond to master meter
Data ID;Value in content, as bonus values table.
2. system according to claim 1, it is characterised in that described extra field, refers to and is present in beyond master meter
Field, when master meter is in need, can be used by master meter, not affect the integrality of master meter structure;
Described redundant field, refers to extraKeyJson, that is, correspond to the JSON data of additional attribute.
3. the method for realizing a kind of flexible configuration extra field described in claim 1, it is characterised in that described includes:Step
Rapid 1:An additional attribute table is set up, for virtually serving as the extra field of master meter, while setting up a bonus values table, is used
Data inside bonus values table, for virtually serving as the value of an extra field of the data line in master meter;
Step 2:In bonus values table redundant field, for depositing additional attribute JSONization after data, check attribute at that time.
4. method according to claim 3, it is characterised in that described sets up additional attribute table, refers to the special word of configuration
Section, including:Configuration tableName, can be used in all of table in system;Configuration type, client can according to aforesaid type,
Generate different types of html;Configuration valid, client or service end can carry out data validity according to the value of valid
Verification;Configuration datas, client can list data exhaustion scope according to the value of datas;Configuration disabled, keeper can lead to
Cross disabled to control whether extra field disables;Configuration sort, client is determined extra by judging the size of sort
Field puts in order;Configuration deletable, service end judges whether extra field allows to delete by the value of deletable
Remove;
It is described to set up bonus values table, critical field is can configure, including:Configuration extraKeyId, marks corresponding to the bonus values
Additional attribute;Configuration tableName, belongs to redundant field, rapidly individually from bonus values table search data;Configuration tableI)
AtaId, marks the concrete data line of the master meter belonging to the bonus values.
5. method according to claim 3, it is characterised in that described step 1, specifically includes:Client can be in master meter
Extra field carry out different operating, change comprising additions and deletions, add value and modified values;
Described additions and deletions change, and refer to that directly can carry out additions and deletions to extra attribute list changes;
Described add value, refers to and first read data from additional attribute table and return, client is according to data genaration specified format
Html, client fill in submission after, value is saved in bonus values table;
Described modified values, refer to from additional attribute table and fetch data, and according to additional attribute, find corresponding bonus values and return,
Client after client modification is submitted to, value bonus values table is modified to according to the html of the data genaration specified format for returning;When
When client needs extra field and the value of checking master meter, first read data from bonus values table and return.
6. method according to claim 4, it is characterised in that described step 1, specifically includes:Client can be in master meter
Extra field carry out different operating, change comprising additions and deletions, add value and modified values;
Described additions and deletions change, and refer to that directly can carry out additions and deletions to extra attribute list changes;
Described add value, refers to and first read data from additional attribute table and return, client is according to data genaration specified format
Html, client fill in submission after, value is saved in bonus values table;
Described modified values, refer to from additional attribute table and fetch data, and according to additional attribute, find corresponding bonus values and return,
Client after client modification is submitted to, value bonus values table is modified to according to the html of the data genaration specified format for returning;When
When client needs extra field and the value of checking master meter, first read data from bonus values table and return.
7. the method according to any one of claim 3-6, it is characterised in that described step 2, specifically also includes:Client
End extracts the additional attribute of history from JSON redundant fields in bonus values table, and according to value and the additional attribute of history, generation refers to
The html of the formula that fixes, shows for client.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611116974.1A CN106649631A (en) | 2016-12-07 | 2016-12-07 | System and method for flexibly configuring additional field |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611116974.1A CN106649631A (en) | 2016-12-07 | 2016-12-07 | System and method for flexibly configuring additional field |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106649631A true CN106649631A (en) | 2017-05-10 |
Family
ID=58819636
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611116974.1A Pending CN106649631A (en) | 2016-12-07 | 2016-12-07 | System and method for flexibly configuring additional field |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106649631A (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070112733A1 (en) * | 2005-11-14 | 2007-05-17 | Beyer Dirk M | Method and system for extracting customer attributes |
CN102750268A (en) * | 2012-06-19 | 2012-10-24 | 山东中创软件商用中间件股份有限公司 | Object serializing method as well as object de-serializing method, device and system |
CN104679880A (en) * | 2015-03-13 | 2015-06-03 | 朱浩晔 | Device and method for dynamically storing and displaying dynamic input items and business data thereof |
CN105630898A (en) * | 2015-12-18 | 2016-06-01 | 国云科技股份有限公司 | Method applicable to switch application database table data version |
CN105930390A (en) * | 2016-04-14 | 2016-09-07 | 北京三快在线科技有限公司 | Relation-type database expansion method and relation-type database expansion system |
-
2016
- 2016-12-07 CN CN201611116974.1A patent/CN106649631A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070112733A1 (en) * | 2005-11-14 | 2007-05-17 | Beyer Dirk M | Method and system for extracting customer attributes |
CN102750268A (en) * | 2012-06-19 | 2012-10-24 | 山东中创软件商用中间件股份有限公司 | Object serializing method as well as object de-serializing method, device and system |
CN104679880A (en) * | 2015-03-13 | 2015-06-03 | 朱浩晔 | Device and method for dynamically storing and displaying dynamic input items and business data thereof |
CN105630898A (en) * | 2015-12-18 | 2016-06-01 | 国云科技股份有限公司 | Method applicable to switch application database table data version |
CN105930390A (en) * | 2016-04-14 | 2016-09-07 | 北京三快在线科技有限公司 | Relation-type database expansion method and relation-type database expansion system |
Non-Patent Citations (1)
Title |
---|
想总结却停留不前?: "数据库设计中常见表结构的设计技巧", 《博客园》 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10706036B2 (en) | Systems and methods to optimize multi-version support in indexes | |
US10572442B2 (en) | Systems and methods for providing distributed tree traversal using hardware-based processing | |
CN106126540B (en) | Data base access system and its access method | |
CN110196971A (en) | Online document edit methods, device, terminal device and storage medium | |
CN103402194B (en) | A kind of method recommending software when software upgrading and realize the system of the method | |
US10496618B2 (en) | Managing data replication in a data grid | |
CN102254029B (en) | View-based data access system and method | |
CN103744982A (en) | Method for importing Excel data into database | |
CN103678556A (en) | Method for processing column-oriented database and processing equipment | |
JP2005259115A5 (en) | ||
CN106528647B (en) | One kind carrying out the matched method of term based on cedar even numbers group dictionary tree algorithm | |
WO2012034440A1 (en) | Method and device for generating database upgrading script | |
CN101814090A (en) | Batch data insertion method of relational database | |
CN102156744A (en) | Method for eliminating repetition of memory dialog list | |
CN103593459A (en) | Case history file type-in system and method | |
JP2009145972A (en) | Database system and control method for database system | |
CN103020318A (en) | Method for maintenance of database tables in database | |
CN102855305B (en) | Data upgrading method and device | |
CN104573083B (en) | A kind of cache map services automatic update method | |
CN103123638A (en) | Data searching method and data searching device | |
CN106649631A (en) | System and method for flexibly configuring additional field | |
CN107451154B (en) | Data table processing method, device and system | |
CN106487567A (en) | A kind of managed element model management method and device | |
EP4213034A1 (en) | Data processing system, data processing method based on blockchain, and device | |
CN102857355B (en) | A kind of method and device of message adaptation |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20170510 |
|
WD01 | Invention patent application deemed withdrawn after publication |