CN100383793C - Method and system for realizing update data in real time data bank - Google Patents

Method and system for realizing update data in real time data bank Download PDF

Info

Publication number
CN100383793C
CN100383793C CNB2006100570994A CN200610057099A CN100383793C CN 100383793 C CN100383793 C CN 100383793C CN B2006100570994 A CNB2006100570994 A CN B2006100570994A CN 200610057099 A CN200610057099 A CN 200610057099A CN 100383793 C CN100383793 C CN 100383793C
Authority
CN
China
Prior art keywords
field
target relationship
relationship table
relation
major key
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CNB2006100570994A
Other languages
Chinese (zh)
Other versions
CN1858742A (en
Inventor
季小俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Tinno Wireless Technology Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CNB2006100570994A priority Critical patent/CN100383793C/en
Publication of CN1858742A publication Critical patent/CN1858742A/en
Application granted granted Critical
Publication of CN100383793C publication Critical patent/CN100383793C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Abstract

The present invention discloses a method and a system for realizing data update in a real time database. The system comprises an application unit, a data control unit and a storage unit. The method has the technical scheme that a section of fixed codes is designed against all relation tables in the database and records information of association relation check to be carried out; a recording for expressing the association relation between a target relation table and other relation tables is set against each target relation table; the association relation check is carried out according to the set codes and the recording corresponding to the relation table related by data update; the data update is carried out according to check results of the association relation; the recording corresponding to the relation table related by data update is amended. The set fixed codes are no need of amendment during the data update procedure via the present invention, and therefore, the flatness properties of system upgrade and the stability of running are greatly improved.

Description

A kind of more method and system of new data of in real-time data base, realizing
Technical field
The present invention relates to database technology, particularly relate to a kind of more method and system of new data of in real-time data base, realizing.
Background technology
At present, for realizing the fast access data so that carry out the fast processing of data, real-time data base arises at the historic moment.The same with other database commonly used, real-time data base has also adopted " relation " to be used as the expression way of data, and described relation is exactly a table of describing usually.For ease of expressing, below the expression way " relation " of data all is called relation table.In real-time data base, relation table has been represented a kind of all properties set of business function, and in essence can not be independent fully in data between the business function but have general incidence relation, correspondingly, also has general incidence relation between each relation table.Incidence relation may be present between two relation tables, also may be present between a relation table and other many relation tables.Such as, relation table S as follows has represented student's relation,
Student number SNO Student name SN Under be other SD Students ' age SA
100 Li Hong Department of computer science 18
... ... ... ...
Relation table S
Relation table C as follows has been for having represented the course relation,
Course CNO Course name CN Class hour CT
1 Principles of Microcomputers 18
... ... ...
Relation table C
Relation table SC as follows has represented the study relation.
Student number SNO Course CNO School grade GR
100 1 88
... ... ...
Relation table SC
By above-mentioned relation table S, relation table C and relation table SC as can be seen, owing to do not have associate field between relation table S and the relation table C, that is to say, identical information or complementary field are not described between relation table S and the relation table C, so do not have incidence relation between relation table S and the relation table C, owing to have associate field " student number " between relation table SC and the relation table S, and there is associate field " course number " between relation table SC and the relation table C, therefore, there is incidence relation in relation table SC with relation table S and relation table SC respectively.
Fig. 1 is the process flow diagram that prior art is upgraded the data in the real-time data base relation table.Referring to Fig. 1, in the prior art, the process that the data in the real-time data base relation table are upgraded mainly may further comprise the steps:
Step 101: in advance at a relation table, one section fixed code is set, the information that writes down the incidence relation information between other relation table in this relation table and the real-time data base and check by set fixed code at the incidence relation of the required execution of this relation table.
Step 102: the process of repeated execution of steps 101, until all set out the information that one section fixed code writes down the incidence relation information between other relation table in this relation table and the real-time data base and checks at the incidence relation of the required execution of this relation table at each relation table.
Step 103: finish the incidence relation inspection according to set fixed code, and realize process that the data in the real-time data base are upgraded.
Here, described Data Update can be to increase in relation table, delete or the modification data.
Step 104: the fixed code of the relation table that incidence relation is changed is made amendment.
Here, because after carrying out Data Update, such as, the deletion or revise the data in the relation table after, then cause the incidence relation of this relation table to change possibly, like this, then must carry out the process that its corresponding fixed code is made amendment in this step, thereby write down the current incidence relation of this relation table and at the incidence relation inspection of the required execution of this relation table.
By above description as can be seen, in the process of existing techniques in realizing Data Update, because the incidence relation information between a relation table and other relation table is to write extremely in the pairing fixed code of this relation table, so, system is after carrying out data updating process, and then the fixed code of the relation table that must change at incidence relation is made amendment, owing to be that the fixed code of system is made amendment, the instability that therefore, can cause system's operation.In addition, in the process of existing techniques in realizing Data Update, must fixed code be set respectively at each relation table, that is to say, set each section fixed code concrete relation table that places one's entire reliance upon, the relation table difference, its corresponding fixed code is then inequality, like this, has then caused code quantity more, thereby increased the probability of makeing mistakes of system greatly, reduced the performance of system.
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 data upgraded other relation table that the major key of related relation table is quoted, 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.
Description of drawings
Fig. 1 is the process flow diagram that prior art is upgraded the data in the real-time data base relation table.
Fig. 2 is the structural representation of system of the present invention.
Fig. 3 is the process flow diagram of the embodiment of the invention.
Fig. 4 is the process flow diagram that record is set at each relation table in embodiments of the present invention.
Fig. 5 carries out the process flow diagram that increases data in embodiments of the present invention.
Fig. 6 is a process flow diagram of carrying out deleted data in embodiments of the present invention.
Fig. 7 carries out the process flow diagram of revising data in embodiments of the present invention.
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:
Figure C20061005709900191
Figure C20061005709900201
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.

Claims (19)

1. in real-time data base, realize the more method of new data for one kind, it is characterized in that this method 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.
2. method according to claim 1 is characterized in that, 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.
3. method according to claim 2 is characterized in that, in step B1, comprises 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.
4. method according to claim 3 is characterized in that, comprises 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.
5. method according to claim 2 is characterized in that, in step B1, comprises 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.
6. method according to claim 5 is characterized in that, comprises 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.
7. method according to claim 2 is characterized in that, in step B1, comprises 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.
8. method according to claim 7 is characterized in that, 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.
9. method according to claim 3 is characterized in that, 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.
10. method according to claim 2 is characterized in that, in step B1, comprises 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.
11. method according to claim 10 is characterized in that, comprises 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.
12. method according to claim 11 is characterized in that, comprises in the described reference field district and quotes number field;
Described step B2 further comprises: the number of target relationship table institute dependence table is write described quoting in the number field.
13. according to claim 4,6,8 or 11 described methods, it is characterized in that, 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.
14., it is characterized in that 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 claim 4 or 8 described methods:
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 data upgraded other relation table that the major key of related relation table is quoted, 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.
15. method according to claim 6, it is characterized in that, 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.
16. according to claim 4,6,8 or 11 described methods, it is characterized in that, 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.
17. according to claim 4,6,8,11 or 12 described methods, it is characterized in that, 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.
18. in real-time data base, realize the more system of new data for one kind, it is characterized in that 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 the related relation table of renewal are sent to the data manipulation unit with these 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.
19. system according to claim 18 is characterized in that, 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.
CNB2006100570994A 2006-03-17 2006-03-17 Method and system for realizing update data in real time data bank Expired - Fee Related CN100383793C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2006100570994A CN100383793C (en) 2006-03-17 2006-03-17 Method and system for realizing update data in real time data bank

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2006100570994A CN100383793C (en) 2006-03-17 2006-03-17 Method and system for realizing update data in real time data bank

Publications (2)

Publication Number Publication Date
CN1858742A CN1858742A (en) 2006-11-08
CN100383793C true CN100383793C (en) 2008-04-23

Family

ID=37297651

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2006100570994A Expired - Fee Related CN100383793C (en) 2006-03-17 2006-03-17 Method and system for realizing update data in real time data bank

Country Status (1)

Country Link
CN (1) CN100383793C (en)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102446183A (en) * 2010-10-12 2012-05-09 上海可鲁系统软件有限公司 Industrial data storage method
CN102542029A (en) * 2011-12-22 2012-07-04 沈阳中科博微自动化技术有限公司 Block compressed storage method of industrial data
CN103198132B (en) * 2013-04-12 2016-09-28 中国农业银行股份有限公司 Data processing method and device
CN105701112A (en) * 2014-11-26 2016-06-22 华为软件技术有限公司 Data processing method, apparatus and system
CN105653677A (en) * 2015-12-31 2016-06-08 盛科网络(苏州)有限公司 Realization method and realization apparatus for many-to-one index distribution
CN107239467B (en) * 2016-03-29 2020-04-10 北京神州泰岳软件股份有限公司 Database-based data processing method and device
CN106778044B (en) * 2017-02-21 2019-12-03 北京数码大方科技股份有限公司 The method and apparatus of data processing
CN107169003B (en) * 2017-03-31 2020-05-22 北京奇艺世纪科技有限公司 Data association method and device
CN108269184B (en) * 2018-01-04 2021-09-07 福建省农村信用社联合社 Bank institution change management method and system supporting uninterrupted service
CN109951339B (en) * 2019-03-29 2022-02-01 烽火通信科技股份有限公司 Configuration reverse-brushing method and system between configuration blocks
CN112100990A (en) * 2019-06-18 2020-12-18 阿里巴巴集团控股有限公司 Chart processing method and device, and data processing method and device
CN110909016B (en) * 2019-10-12 2023-06-16 中国平安财产保险股份有限公司 Repeated association detection method, device, equipment and storage medium based on database
CN111477312B (en) * 2020-04-27 2023-02-24 上海联影医疗科技股份有限公司 Data list adjusting method and device, computer equipment and storage medium
CN112948400A (en) * 2020-09-17 2021-06-11 深圳市明源云科技有限公司 Database management method, database management device and terminal equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000276386A (en) * 1999-03-25 2000-10-06 Hitachi Ltd Method and device for generating program utilizing relation of relational data base
US6339777B1 (en) * 1999-07-30 2002-01-15 International Business Machines Corporation Method and system for handling foreign key update in an object-oriented database environment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000276386A (en) * 1999-03-25 2000-10-06 Hitachi Ltd Method and device for generating program utilizing relation of relational data base
US6339777B1 (en) * 1999-07-30 2002-01-15 International Business Machines Corporation Method and system for handling foreign key update in an object-oriented database environment

Also Published As

Publication number Publication date
CN1858742A (en) 2006-11-08

Similar Documents

Publication Publication Date Title
CN100383793C (en) Method and system for realizing update data in real time data bank
CN102934114B (en) For the checkpoint of file system
US7934211B2 (en) Multi-level patching operation
US20090049086A1 (en) System and method for providing an object to support data structures in worm storage
US7313572B2 (en) Attribute partitioning for user extensibility
CN107016047A (en) Document query, document storing method and device
US20100023562A1 (en) Extended system for accessing electronic documents with revision history in non-compatible repositories
CN110555770B (en) Block chain world state checking and recovering method based on incremental hash
CN102156717B (en) Method and device for mapping entity object into database
US20010051954A1 (en) Data updating apparatus that performs quick restoration processing
CN104850565A (en) Metadata management method based on K-V storage system
US9026557B2 (en) Schema mapping based on data views and database tables
CN101364166A (en) Method and device for simulating Nand flash of 2048 byte page into hard disk
CN103106218A (en) Plug-in type online transaction processing system and plug-in type online transaction processing method
CN112149419B (en) Method, device and system for normalized automatic naming of fields
US20100138454A1 (en) Tracking of object versions in different project stages
US11100092B2 (en) Database tool
CN106326014A (en) Resource access method and device
CN102024051B (en) Data updating method for distributed memory database
US20060129520A1 (en) System and method for automatically updating a program in a computer
US20080098013A1 (en) Data access and communication system
CN105556486A (en) Method and system for automatic management of dynamically allocated memory in a computing unit
CN104317660A (en) Bank parameter managing system
EP3779755A1 (en) A computer-implemented method for cross-chain-interoperability
CN112817931B (en) Incremental version file generation method and device

Legal Events

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

Owner name: SHENZHEN TINNO WIRELESS TECHNOLOGY CO., LTD.

Free format text: FORMER OWNER: HUAWEI TECHNOLOGY CO., LTD.

Effective date: 20140527

C41 Transfer of patent application or patent right or utility model
COR Change of bibliographic data

Free format text: CORRECT: ADDRESS; FROM: 518129 SHENZHEN, GUANGDONG PROVINCE TO: 518053 SHENZHEN, GUANGDONG PROVINCE

TR01 Transfer of patent right

Effective date of registration: 20140527

Address after: 4, A, building 518053, building H-3, East China Town, 1, Xiangshan East Street, Shenzhen, Guangdong, Nanshan District

Patentee after: Shenzhen Tinno Wireless Technology Co., Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee before: Huawei Technologies Co., Ltd.

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

Granted publication date: 20080423

Termination date: 20190317

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