Summary of the invention
In view of this, fundamental purpose of the present invention is to provide a kind of more method of new data that realizes in real-time data base, another object of the present invention is to provide a kind of more system of new data that in real-time data base, realizes, to avoid the fixed code in the modification system, the stability of increase system operation.
In order to achieve the above object, technical scheme of the present invention is achieved in that
A kind of more method of new data that realizes in real-time data base may further comprise the steps:
A, at all relation tables in the database one section fixed code is set, this fixed code writes down the information that the incidence relation of required execution is checked;
B, a record that is used to represent incidence relation between this target relationship table and other relation table is set respectively at each target relationship table;
C, the need new data and upgrade the information of related relation table more that receives outside input, record according to set fixed code and the related relation table correspondence of renewal, carry out the incidence relation inspection, and according to the result of incidence relation inspection in upgrading related relation table to described need more new data upgrade;
D, the pairing record of relation table that incidence relation is changed are revised.
In step B, the described step that record is set comprises:
B1, target relationship table identification field and associate field district are set;
B2, the sign of target relationship table is write in the set target relationship table identification field, and the incidence relation information of target relationship table is write in the set associate field district.
In step B1, comprise the major key field district in the set associate field district;
The critical field of described target relationship table is the major key of target relationship table;
In step B2, the step that described incidence relation information with target relationship table writes the associate field district comprises: the information of major key in this target relationship table of target relationship table is write in the set major key field district.
Comprise dependence table identification field, relative position field, reference position field and correlation length field in the described major key field district;
The step that the described information of major key in this target relationship table with target relationship table writes the major key field district comprises: the sign of target relationship table is write dependence table identification field in the major key field district, major key field location of living in target relationship table of target relationship table is write relative position field in the major key field district, major key residing field reference position in target relationship table of target relationship table is write in the reference position field in the major key field district, and the field length that the major key of target relationship table takies in target relationship table is write in the correlation length field in the major key field district.
In step B1, comprise the major key field district in the set associate field district;
The critical field of described target relationship table is the external key of target relationship table;
In step B2, the step that described incidence relation information with target relationship table writes the associate field district comprises: information and the information in target relationship table institute dependence table of external key in this target relationship table of target relationship table is write in the described major key field district.
Comprise dependence table identification field, relative position field, reference position field and correlation length field in the described major key field district;
The step that the described information of external key in this target relationship table and institute's dependence table thereof with target relationship table writes the major key field district comprises: the sign of target relationship table institute dependence table is write dependence table identification field in the major key field district, external key residing field location in target relationship table institute dependence table of target relationship table is write relative position field in the major key field district, external key residing field reference position in target relationship table of target relationship table is write in the reference position field in the major key field district, and the field length that the external key of target relationship table takies in target relationship table is write in the correlation length field in the major key field district.
In step B1, comprise the major key field district in the set associate field district;
The major key and the external key that comprise target relationship table in the critical field of described target relationship table;
In step B2, the step that described incidence relation information with target relationship table writes the associate field district comprises: information in this target relationship table of the major key of target relationship table, the external key of target relationship table are write respectively in the set major key field district in this target relationship table and the information in target relationship table institute dependence table.
The number in described major key field district is greater than 1;
Comprise dependence table identification field, relative position field, reference position field and correlation length field in the described major key field district;
The described step that the major key and the external key of target relationship table are write the major key field district respectively comprises: the sign of target relationship table is write dependence table identification field in the first major key field district, major key field location of living in target relationship table of target relationship table is write relative position field in the first major key field district, major key residing field reference position in target relationship table of target relationship table is write in the reference position field in the first major key field district, and the field length that the major key of target relationship table takies in target relationship table is write in the correlation length field in the first major key field district; The sign of target relationship table institute dependence table is write dependence table identification field in the second major key field district, external key residing field location in target relationship table institute dependence table of target relationship table is write relative position field in the second major key field district, external key residing field reference position in target relationship table of target relationship table is write in the reference position field in the second major key field district, and the field length that the external key of target relationship table takies in target relationship table is write in the correlation length field in the second major key field district.
Described major key field comprises the major key number field in the district;
Described step B2 further comprises: the number of the critical field of target relationship table is write in the described major key number field.
In step B1, comprise the reference field district in the set associate field district;
Described target relationship table by reference associate field and other relation table between produce incidence relation;
In step B2, the step that described incidence relation information with target relationship table writes the associate field district comprises: the information of described associate field in target relationship table and institute's dependence table thereof is write in the set reference field district.
Comprise dependence table identification field, relative position field, reference position field and correlation length field in the described reference field district;
The described step that the information of associate field in target relationship table and institute's dependence table thereof is write the reference field district comprises: the sign of target relationship table institute dependence table is write dependence table identification field in the reference field district, associate field residing field location in target relationship table institute dependence table is write relative position field in the reference field district, associate field residing field reference position in target relationship table is write in the reference position field in the reference field district, and the field length that associate field takies in target relationship table is write in the correlation length field in the reference field district.
Comprise in the described reference field district and quote number field;
Described step B2 further comprises: the number of target relationship table institute dependence table is write described quoting in the number field.
When new data more is when increasing data in a target relationship table, in step C, described step of carrying out incidence relation inspection and Data Update comprises: according to set fixed code, carry out the record that obtains corresponding to the related relation table of Data Update from each set record; According to set fixed code, carry out and from the record that is obtained, find critical field information, judge whether the numerical value of the critical field of required increase data exists in the related relation table of Data Update, if then return failure result; Otherwise, according to set fixed code, carry out to utilize institute to obtain the relation table that dependence table identification field in the record finds the related relation table dependence of Data Update, and judge whether the data that increased have existed in the relation table that is found, if exist, then in the related relation table of Data Update, increase these data, otherwise, failure result returned.
When new data more is in a target relationship table during deleted data, in step C, described step of carrying out incidence relation inspection and Data Update comprises:
C1, according to set fixed code, carry out the record that from each set record, obtains corresponding to the related relation table of Data Update;
C2, according to set fixed code, carry out in the record that is obtained, obtain comprising in the critical field of the related relation table of Data Update the major key of self according to dependence table identification field;
C3, according to dependence table identification field in other record, judge whether to exist reference data to upgrade other relation table of related relation table major key, if exist, execution in step C4 then, if there is no, execution in step C5 then;
C4, in this other relation table the deletion described data, finish current flow process;
C5, in the related relation table of Data Update the deletion described data.
When new data more is in a target relationship table during deleted data, in step C, described step of carrying out incidence relation inspection and Data Update comprises: according to set fixed code, carry out the record that obtains corresponding to the related relation table of Data Update from each set record; According to set fixed code, carry out in the record that is obtained, obtain the external key of the critical field of the related relation table of Data Update according to dependence table identification field, the described data of deletion in the related relation table of Data Update for self.
When new data more is when revising data in a target relationship table, in step C, described step of carrying out incidence relation inspection and Data Update comprises: according to set fixed code, carry out the record that obtains corresponding to the related relation table of Data Update from each set record; According to set fixed code, execution is in the record that is obtained, find the related relation table that relation table relied on of Data Update according to dependence table identification field, and judge that the data revised are whether in the codomain scope in finding relation table, if, then in the related relation table of Data Update, revise described data, otherwise, failure result returned.
Described step D comprises: in the record of the related relation table correspondence of Data Update, according to the value of each set field of the current incidence relation correction of the related relation table of Data Update and other relation table.
A kind of more system of new data that in real-time data base, realizes, this system comprises: data manipulation unit and storage unit in applying unit and the real-time data base, wherein,
Applying unit, the need that are used for receiving management personnel input be new data and upgrade the information of related relation table more, and more the information of new data and the information of upgrading related relation table are sent to the data manipulation unit with need;
The data manipulation unit, be used for preserving at all relation tables of real-time data base set, write down the fixed code of required execution incidence relation fox message, after receiving the information of upgrading related relation table, carry out from memory module in each record according to the fixed code of being preserved corresponding to different relation tables, find the record corresponding with upgrading related relation table, and in each relation table from memory module, find and upgrade related relation table, carry out the incidence relation inspection according to fixed code of being preserved and the record that is found to upgrading related relation table then, in upgrading related relation table, carry out Data Update according to the incidence relation check result, and the pairing record of relation table that incidence relation in the storage unit changes is revised;
Storage unit is used for preserving each relation table of real-time data base and at each relation table each record set, that represent incidence relation information between this relation table and other relation table.
Described data manipulation unit is further used for will upgrading failure information and being sent to applying unit when Data Update is failed;
Described applying unit is further used for when receiving the failure information of sending the data manipulation unit, will upgrade failure information and be shown to managerial personnel.
This shows that because the incidence relation checked operation of carrying out for all relation tables all is identical, therefore, the present invention only is provided with one section general fixed code for all relation tables, writes down the incidence relation inspection of required execution by this fixed code; And, then a record is set realizes by being respectively each relation table for mutually different concrete incidence relation.Like this, after system carried out data updating process, the present invention only needed corresponding record correction is got final product, and need not to revise set fixed code, therefore, has improved the stability of system's operation and the flatness of upgrading greatly.In addition, in the present invention, owing to only be provided with one section general fixed code for all relation tables, therefore, code quantity is less, thereby greatly reduces the probability of makeing mistakes of system, has improved the performance of system.
Embodiment
The present invention proposes a kind of in real-time data base the method for new data more, its core concept is: at all relation tables in the database one section fixed code is set, this fixed code writes down the information that the incidence relation of required execution is checked; Each target relationship table is provided with a record that is used to represent incidence relation between this target relationship table and other relation table respectively; Receive the outside need of importing more new data and the information of upgrading related relation table, record according to set fixed code and the related relation table correspondence of renewal, carry out the incidence relation inspection, and according to the result of incidence relation inspection in upgrading related relation table to described need more new data upgrade; The pairing record of relation table that incidence relation changes is revised.
The present invention correspondingly also proposed a kind of in real-time data base the system of new data more.Fig. 2 is the structural representation of system of the present invention.Referring to Fig. 2, system of the present invention comprises: data manipulation unit and storage unit in applying unit and the real-time data base, wherein,
Applying unit, the need that are used for receiving management personnel input be new data and upgrade the information of related relation table more, and more the information of new data and the information of upgrading related relation table are sent to the data manipulation unit with need;
The data manipulation unit, be used for preserving at all relation tables of real-time data base set, write down the fixed code of required execution incidence relation fox message, after receiving the information of upgrading related relation table, carry out from memory module in each record according to the fixed code of being preserved corresponding to different relation tables, find the record corresponding with upgrading related relation table, and in each relation table from memory module, find and upgrade related relation table, carry out the incidence relation inspection according to fixed code of being preserved and the record that is found to upgrading related relation table then, in upgrading related relation table, carry out Data Update according to the incidence relation check result, and the pairing record of relation table that incidence relation in the storage unit changes is made amendment;
Storage unit is used for preserving each relation table of real-time data base and at each relation table each record set, that represent incidence relation information between this relation table and other relation table.
For making the purpose, technical solutions and advantages of the present invention clearer, the present invention is described in further detail below in conjunction with drawings and the specific embodiments.
Fig. 3 is the process flow diagram of the embodiment of the invention.Referring to Fig. 2 and Fig. 3, in the present invention, realize that the process that the data in the real-time data base relation table are upgraded specifically may further comprise the steps:
Step 301: at all relation tables in the real-time data base one section fixed code is set in advance, and set fixed code is kept in the data manipulation unit, wherein, set fixed code writes down the information of the incidence relation inspection of required execution.
Step 302: in advance in real-time data base, at each relation table a record that is used to represent incidence relation between this relation table and other relation table is set respectively, and each set bar recorded and stored is preserved in the memory module of each relation table of real-time data base being used for.
Here, Fig. 4 is the process flow diagram that record is set at each relation table in embodiments of the present invention.Referring to Fig. 4, in the present invention, the process that a record is set at each relation table respectively described in the step 302 specifically may further comprise the steps:
Step 401: in real-time data base, increase the table Keylist that is used to put down in writing incidence relation.
Step 402: in the Keylist table, target relationship table sign (ID) field is set.
Here, the target relationship table id field being set is in order to show the relation table of the record correspondence at its place, i.e. target relationship table by this field in subsequent process.
Step 403: in the Keylist table, the major key field district is set.
Here, set major key field district comprises major key number field and major key associate field district.Wherein, the major key number field shows the number of major key.For ease of describing, below set major key number field is corresponded to parameter K eyFldNum.Major key associate field district specifically comprises following field:
One, major key dependence Table I D field.For ease of describing, below set major key dependence Table I D field is corresponded to parameters R elationID.
Two, major key relative position field.For ease of describing, below the major key associate field is corresponded to parameter K eyFld.
Three, major key reference position field.For ease of describing, below major key reference position field is corresponded to parameter F ldBgnPos.
Four, major key correlation length field.For ease of describing, below major key correlation length field is corresponded to parameter F ldLen.
Need to prove,, therefore, in this step, can in the Keylist table, a plurality of major key associate fields district be set, such as comprising 4 major key associate field districts because often and between other a plurality of relation tables there is incidence relation in a relation table.
Step 404: in the Keylist table, the reference field district is set.
Here, because target relationship table may not be critical field and other relation table generation incidence relation by self, that is to say that described associate field is not the critical field of target relationship table and quoting as just target relationship table, therefore, this step is provided with the reference field district.Set reference field district comprises and quotes number field and quote the associate field district.Wherein, quote the bright number of quoting of number field list, just the number of the relation table that target relationship table relied on for ease of describing, below corresponds to parameters R efFldNum with the set number field of quoting.Quote the associate field district and specifically comprise following field:
One, quotes dependence Table I D field.
Here, quote the ID that dependence Table I D field shows the relation table that target relationship table relies on.For ease of describing, below the set dependence Table I D field of quoting is corresponded to parameters R efRelationID.
Two, quote the relative position field.
Here, quoting the relative position field shows: associate field is residing field location in target relationship table institute dependence table.For ease of describing, below will quote associate field and correspond to parameters R efFld.
Three, quote the reference position field.
Here, quoting the reference position field shows: the field reference position of associate field in target relationship table.For ease of describing, below will quote the reference position field and correspond to parameters R efFldBgnPos.
Four, quote the correlation length field.
Here, quoting the correlation length field shows: the field length that associate field takies in target relationship table.For ease of describing, below will quote the correlation length field and correspond to parameters R efFldLen.
Need to prove, because often and between other a plurality of relation tables there is incidence relation in a relation table, therefore, in this step, can in the Keylist table, a plurality of associate field districts that quote be set, such as comprising that 4 are quoted the associate field district, the 1st to the 4th respectively record be the positional information of associate field in the 1st to the 4th relation table that target relationship table relied on.
According to above description, the Keylist of the present invention's set record incidence relation of finishing in real-time data base table can be as follows:
Table Name | KeyList | |
Field Name | Field Type | Field Size |
RelationID | UINTl6 | Relation table only 2 has a record in this table |
KeyFldNum | UINT8 | 1 critical field number |
RelationID1 | UINT16 | The relation table ID that is relied on, if=RelationID, then represent 2 non-external keys |
KeyFld1 | UINT8 | 1 critical field ID |
FldBgnPos1 | UINT8 | 1 reference position at every record |
FldLen1 | UINT8 | 1 this field length |
RelationID2 | UINT16 | The relation table ID that is relied on, if=RelationID, then represent 2 non-external keys |
KeyFld2 | UINT8 | 1 critical field ID |
FldBgnPos2 | UINT8 | 1 reference position at every record |
FldLen2 | UINT8 | 1 this field length |
RelationID3 | UINT16 | The relation table ID that is relied on, if=RelationID, then represent 2 non-external keys |
KeyFld3 | UINT8 | 1 critical field ID |
FldBgnPos3 | UINT8 | 1 reference position at every record |
FldLen3 | UINT8 | 1 this field length |
RelationID4 | UINT16 | The relation table ID that is relied on, if=RelationID, then represent 2 non-external keys |
KeyFld4 | UINT8 | 1 critical field ID |
FldBgnPos4 | UINT8 | 1 reference position at every record |
FldLen4 | UINT8 | 1 this field length |
Reserved | UINT32 | 4 reserved fields |
RefFldNum | UINT8 | Associate field number, maximal value are 4, represent irrelevant 1 field when being zero |
RefRelationID1 | UINT16 | 2 associated relation table ID |
RefFld1 | UINT8 | 1 critical field ID |
RefFldBgnPos1 | UINT8 | 1 reference position at every record |
RefFldLen1 | UINT8 | 1 this field length |
RefRelationID2 | UINT16 | 2 associated relation table ID |
RefFld2 | UINT8 | 1 critical field ID |
RefFldBgnPos2 | UINT8 | 1 reference position at every record |
RefFldLen2 | UINT8 | 1 this field length |
RefRelationID3 | UINT16 | 2 associated relation table ID |
RefFld3 | UINT8 | 1 critical field ID |
RefFldBgnPos3 | UINT8 | 1 reference position at every record |
RefFldLen3 | UINT8 | 1 this field length |
RefRelationID4 | UINT16 | 2 associated relation table ID |
RefFld4 | UINT8 | 1 critical field ID |
RefFldBgnPos4 | UINT8 | 1 reference position at every record |
RefFldLen4 | UINT8 | 1 this field length |
The Keylist table
Above-mentioned steps 402 to the set content of step 404 be in the record the content that should comprise.
Step 405: in the Keylist that increased table, the target relationship table id field write current at the ID of target relationship table.
Here, need carry out record at aforesaid target relationship table SC such as current, that is to say, the current incidence relation that needs between record relation table SC and other relation table, then write the ID of target relationship table in the target relationship table id field, be SC, that is to say that the pairing field of parameters R elationID in above-mentioned Keylist table writes SC.
Step 406:, the number of the critical field of target relationship table is write major key number field in the major key field district in the major key field district.
Step 407: judge in the critical field of target relationship table whether only comprise the major key of this target relationship table, if only comprise major key, then execution in step 408, if only comprise external key, then execution in step 409, also comprise external key if promptly comprise major key, and then execution in step 410.
Here, if the critical field of target relationship table is the major key of self, the critical field that then shows target relationship table is not the major key of other relation table, so, should in set major key field district, write the information of critical field in target relationship table, promptly carry out subsequent step 408, if the critical field of target relationship table is the external key of self, the critical field that then shows target relationship table is the major key of other relation table, so, should in set major key field district, write the information of critical field in target relationship table and institute's dependence table, promptly carry out subsequent step 409.
Step 408: in the major key field district, write the positional information of critical field in target relationship table in each field in major key associate field district, turn to execution in step 411.
When carrying out this step, because the critical field of target relationship table is the major key of this target relationship table, so the just positional information of critical field in target relationship table that writes, its specific implementation process is: the ID of target relationship table is write major key dependence Table I D field; Critical field residing field location in target relationship table is write major key relative position field; Critical field residing field reference position in target relationship table is write major key reference position field; The field length that critical field is taken in target relationship table writes major key correlation length field.
Step 409: in the major key field district, write the positional information of critical field in target relationship table and institute's dependence table in each field in major key associate field district, turn to execution in step 411.
When carrying out this step, because the critical field of target relationship table is the external key of this target relationship table, that is to say, described critical field is the associate field of target relationship table and other relation table, so what write is the critical field positional information of associate field in target relationship table and institute's dependence table just, its specific implementation process is: the ID of target relationship table institute dependence table is write major key dependence Table I D field; Associate field is write major key relative position field in residing field location in target relationship table institute dependence table; Associate field residing field reference position in target relationship table is write major key reference position field; The field length that associate field is taken in target relationship table writes major key correlation length field.
Step 410: in the major key field district, write the positional information of major key in target relationship table of target relationship table in the critical field in each field in the first major key associate field district, and write the positional information of external key in target relationship table and institute's dependence table of target relationship table in the critical field in each field in the second major key associate field district.
The specific implementation process of this step is: the sign of target relationship table is write major key dependence table identification field in the first major key field district, major key field location of living in target relationship table of target relationship table is write major key relative position field in the first major key field district, major key residing field reference position in target relationship table of target relationship table is write in the major key reference position field in the first major key field district, and the field length that the major key of target relationship table takies in target relationship table is write in the major key correlation length field in the first major key field district; The sign of target relationship table institute dependence table is write major key dependence table identification field in the second major key field district, external key residing field location in target relationship table institute dependence table of target relationship table is write major key relative position field in the second major key field district, external key residing field reference position in target relationship table of target relationship table is write in the major key reference position field in the second major key field district, and the field length that the external key of target relationship table takies in target relationship table is write in the major key correlation length field in the second major key field district.
Step 411: judge whether exist associate field between target relationship table and other relation table as the quoting of target relationship table, if then execution in step 412, otherwise, finish current flow process.
Here,, and only quote, then carry out the process of subsequent step 412 to subsequent step 413 if associate field is not a critical field in target relationship table SC.
Step 412: in the reference field district, the number of the relation table that target relationship table relied on is write the number field of quoting in the reference field district.
Step 413: in the reference field district, write the positional information of associate field in each field in quoting the associate field district.
The specific implementation process of this step is: will exist the ID of the relation table of incidence relation to write with target relationship table and quote dependence Table I D field; Associate field residing field location in target relationship table institute dependence table write quote the relative position field; Associate field residing field reference position in target relationship table write quote the reference position field; The field length that associate field is taken in target relationship table writes quotes the correlation length field.
Above-mentioned steps 405 to step 413 item has realized being provided for putting down in writing at a relation table in the real-time data base process of the record of incidence relation between this relation table and other relation table.
Step 414: repeated execution of steps 405 is to step 413, until all set up the record that is used to put down in writing incidence relation between this relation table and other relation table at each relation table in the real-time data base.
Step 303: when the data in managerial personnel need be to real-time data base in relation table are upgraded, managerial personnel will need new data more and upgrade the information input applying unit of related relation table.
Step 304: more the information of new data and the information of upgrading related relation table are sent to the data manipulation unit to applying unit with received need.
Step 305: the data manipulation unit in each record corresponding to different relation tables, finds the record corresponding with upgrading related relation table according to the fixed code execution of being preserved from memory module after receiving the information of upgrading related relation table.
Step 306: the data manipulation unit finds and upgrades related relation table according in fixed code execution each relation table from memory module of being preserved.
Step 307: the data manipulation unit is carried out the incidence relation inspection according to fixed code of being preserved and the record that is found to upgrading related relation table.
Step 308: the data manipulation unit is carried out according to the incidence relation check result according to the fixed code of being preserved and carry out Data Update in being upgraded related relation table.
Step 309: the data manipulation unit is carried out the pairing record of relation table that incidence relation in the storage unit is changed according to the fixed code of being preserved and is revised.
In step 308, described renewal can be to increase in the existing relation table of real-time data base, delete or the modification data.Like this, in step 309, then be that the pairing record of relation table that upgrades the incidence relation variation that is caused is made amendment, that is to say, in the pairing record of relation table that incidence relation changes, revise the value of each set field.
Need to prove that the record of preserving incidence relation between record relation table and other relation table with the form of Keylist table is a kind of implementation of the present invention, the present invention also can realize by other form.
Fig. 5 carries out the process flow diagram that increases data in embodiments of the present invention.Referring to Fig. 5, in the present invention, when new data more is to upgrade related relation table hereinafter referred to as target relationship table, when increasing data among the target relationship table SC, above-mentioned steps 307 to the implementation procedure of step 308 specifically comprises:
Step 501: the data manipulation unit is carried out the target relationship table SC in the storage unit is carried out the uniqueness inspection according to the fixed code of being preserved, and judges whether the data that increased are legal, if then execution in step 502, otherwise, execution in step 505.
The specific implementation process of this step is: whether the numerical value of the critical field of the required increase data of data manipulation unit judges exists in target relationship table SC, if, think that then the data that increased are illegal, otherwise, think that the data that increased are legal.
Step 502: the data manipulation unit is according to the fixed code of being preserved, and carries out in storage unit in the record that is found, and obtains the information of each relation table that target relationship table SC relied at dependence Table I D field.
Dependence Table I D field described herein is major key dependence Table I D field and quotes dependence Table I D field.
Step 503: the data manipulation unit is according to set fixed code, execution utilizes the information of each relation table that target relationship table SC relied on that is obtained in storage unit, check in each relation table that is relied on to target relationship table SC, judge the data whether field exists required increase that relied in each relation table that target relationship table SC relied on, if, then execution in step 504, otherwise, execution in step 505.
Step 504: the data manipulation unit is according to set fixed code, and carrying out increases these data in target relationship table SC in storage unit, finish current flow process.
Above-mentioned steps 502 to the specific implementation process of step 504 can be exemplified as: according to RelationID1 and the RelationID2 in the major key field district in the Keylist table, obtaining the relation table that target relationship table relies on is relation table S and relation table C, and according to relation table S and relation table C respectively in the Keylist table major key relative position field KeyFld1 and the KeyFld2 in the major key field district obtain associate field residing field location information in relation table S and relation table C respectively, in relation table S and relation table C, carry out the incidence relation inspection according to each information of being obtained then, if the data that increased exist at relation table S and in relation table C, then in target relationship table SC, increase these data, if the data that increased do not exist in relation table S or relation table C, then failure.
Step 505: the data manipulation unit will upgrade failure information and send to applying unit, and applying unit will upgrade failure information and be shown to managerial personnel.
Fig. 6 is a process flow diagram of carrying out deleted data in embodiments of the present invention.Referring to Fig. 6, in the present invention, when new data more is to upgrade related relation table hereinafter referred to as target relationship table, such as among the target relationship table SC during deleted data, above-mentioned steps 307 to the implementation procedure of step 308 specifically comprises:
Step 601: the data manipulation unit is carried out and in storage unit target relationship table SC is carried out the uniqueness inspection according to the fixed code of being preserved, and judges whether the data of being deleted are legal, if then execution in step 602, otherwise, execution in step 606.
The specific implementation process of this step is: whether the data of the required deletion of data manipulation unit judges exist in target relationship table SC, if there is no, then think illegal, if exist, it is legal then to think.
Step 602: the data manipulation unit comprises self major key or external key according to the fixed code of being preserved in the critical field of judgement target relationship table SC, if only comprise external key, then execution in step 603, if include major key, then execution in step 604.
Here, if include the pairing situation of major key in the critical field of target relationship table SC can be: the critical field of target relationship table SC be the major key of self, or the critical field of target relationship table SC is major key and the external key of self.
Step 603: the data of directly deleting this required deletion in storage unit in target relationship table SC are carried out according to the fixed code of being preserved in the data manipulation unit, finish current flow process.
Step 604: the data manipulation unit is according to the fixed code of being preserved, execution in storage unit in the record that is found, according to dependence Table I D field, judge whether to exist other relation table of REFER object relation table major key, if, then execution in step 605, otherwise, return step 603.
Dependence Table I D field described herein is major key dependence Table I D field and quotes dependence Table I D field.
Step 605: the data manipulation unit is carried out and delete all data of quoting this key word numerical value in storage unit in other relation table of this REFER object relation table major key according to the fixed code of being preserved, and finishes current flow process.
Step 606: the data manipulation unit will upgrade failure information and send to applying unit, and applying unit will upgrade failure information and be shown to managerial personnel.
Fig. 7 carries out the process flow diagram of revising data in embodiments of the present invention.Referring to Fig. 7, in the present invention, when new data more is to upgrade related relation table hereinafter referred to as target relationship table, when revising data among the target relationship table SC, above-mentioned steps 307 to the implementation procedure of step 308 specifically comprises:
Step 701: the data manipulation unit is carried out and in storage unit target relationship table SC is carried out the uniqueness inspection according to the fixed code of being preserved, and judges whether the data of being revised are legal, if then execution in step 702, otherwise, execution in step 706.
The specific implementation process of this step is: whether the data of judging required modification exist in target relationship table SC, if there is no, then think illegal, otherwise, think legal.
Step 702: the data manipulation unit is according to the fixed code of being preserved, and whether execution in the record that is found, judges the data of being revised in the reference field district in storage unit, if then execution in step 703, otherwise, direct execution in step 705.
Step 703: the data manipulation unit is according to the fixed code of being preserved, and carries out in storage unit in the record that is found, and according to dependence Table I D field, obtains the information of each relation table that target relationship table SC relied on.
Dependence Table I D field described herein is major key dependence Table I D field and quotes dependence Table I D field.
Step 704: the data manipulation unit is according to the fixed code of being preserved, execution in storage unit according to the information of each relation table that target relationship table SC relied on that is obtained, check in each relation table that is relied on to target relationship table SC, whether the data of judging required modification are in the codomain scope in each relation table that target relationship table SC is relied on, if, then execution in step 705, otherwise, execution in step 706.
Step 705: the data manipulation unit is according to the fixed code of being preserved, and carries out in storage unit in target relationship table SC the data to required modification and makes amendment, and finishes current flow process.
Step 706: the data manipulation unit will upgrade failure information and send to applying unit, and applying unit will upgrade failure information and be shown to managerial personnel.
In a word, the above is preferred embodiment of the present invention only, is not to be used to limit protection scope of the present invention.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.