CN105868384A - Method, device and system for updating shared data - Google Patents
Method, device and system for updating shared data Download PDFInfo
- Publication number
- CN105868384A CN105868384A CN201610225191.0A CN201610225191A CN105868384A CN 105868384 A CN105868384 A CN 105868384A CN 201610225191 A CN201610225191 A CN 201610225191A CN 105868384 A CN105868384 A CN 105868384A
- Authority
- CN
- China
- Prior art keywords
- data
- database
- source
- ownership
- described target
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 33
- 238000012544 monitoring process Methods 0.000 claims description 4
- 230000008859 change Effects 0.000 description 11
- 230000008569 process Effects 0.000 description 5
- 230000008901 benefit Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 230000008878 coupling Effects 0.000 description 2
- 238000010168 coupling process Methods 0.000 description 2
- 238000005859 coupling reaction Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 244000061520 Angelica archangelica Species 0.000 description 1
- 235000001287 Guettarda speciosa Nutrition 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000004321 preservation Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Storage Device Security (AREA)
Abstract
The invention provides a method, device and system for updating shared data. The method comprises the steps of presetting a sharing scheme of each kind of shared data containing source database identifiers and affiliation database identifiers, and setting update trigger conditions and a data updating mode of each sharing scheme; when the update trigger conditions of any sharing scheme are met, first determining a corresponding source database and an affiliation database according to the source database identifiers and affiliation database identifiers therein; obtaining source shared data in the source database, and utilizing the obtained source shared data to update corresponding current shared data in the affiliation database according to the data updating mode of the sharing scheme. Since for each kind of shared data, the shared data can be updated according to a corresponding predetermined update request and the updating mode, the scheme can improve shared data updating practicality.
Description
Technical field
The present invention relates to field of computer technology, update the method for shared data, device particularly to a kind of
And system.
Background technology
In the tide of current informationization development, it is often necessary at the data sharing of disparate databases.Example
As, can the data backup that store in source database in ownership database, exist realizing these data
Sharing between the two database.Owing to the data in source database can change, in order to ensure
The accuracy sharing data used, ownership database needs to be updated the Backup Data of its storage inside.
At present, before the Backup Data in using ownership database, number of originating accordingly can again be obtained
According to the shared data in storehouse, and it is updated replacing to the Backup Data in ownership database.
Owing to the renewal of shared data is to be updated replacing to it before the use, and when source data is not sent out
The unnecessary renewal of data, therefore, the practicality of existing shared data refresh mode can be caused during raw change
Property is relatively low.
Summary of the invention
The invention provides and a kind of update the method for shared data, Apparatus and system, it is possible to increase share number
According to the practicality updated.
In order to achieve the above object, the present invention is achieved through the following technical solutions:
On the one hand, the invention provides a kind of method updating shared data, pre-set each class and share
The secret sharing of data, and described secret sharing comprise the mark of source database and belongs to database
Mark;Renewal trigger condition and the data refresh mode of each described secret sharing are set, also include:
When reaching the renewal trigger condition of target secret sharing, according to the source in described target secret sharing
The mark of database and the mark of ownership database, determine corresponding target source database and target ownership number
According to storehouse;
Data are shared in the source obtained in described target source database;
According to the data refresh mode of described target secret sharing, the described source got is utilized to share data,
Corresponding current shared data in described target ownership database are updated.
Further, described renewal trigger condition includes: clocked flip-flop, and/or, monitor corresponding
Shared data have variation.
Further, described secret sharing, also include: SQL SQL, derived data table
Mark, ownership tables of data the mark SQL field corresponding with described ownership tables of data in appoint
Anticipate one or more;
Described determine corresponding target source database and target ownership database after, also include: according to
The mark of the derived data table in described target secret sharing and the mark of ownership tables of data, determine described target
Target derived data table in source database and the target ownership tables of data in described target ownership database;
Data are shared in source in described acquisition described target source database, including: utilize described target to share
SQL in scheme, obtain in described target derived data table with the SQL word in described target secret sharing
Data are shared in the corresponding source of section;
The described corresponding current shared data belonged to described target in database are updated, including: to institute
The current shared data stated in target ownership tables of data are updated.
Further, described data refresh mode includes: incremental mode, and/or, full dose mode;
The described data refresh mode according to described target secret sharing, utilizes the described source got to share number
According to, the corresponding current shared data in described target ownership database are updated, including:
When the data refresh mode of described target secret sharing is incremental mode, determine that described target belongs to number
According to storehouse shares the current shared data that data are corresponding with described source;Described source is shared in data
Data are shared in each first source, are performed both by: judge whether exist in described current shared data accordingly
First current shared data, if not existing, sharing by described first source with data and preserving to described target ownership number
According in storehouse, if existing, the most again judge that data and described first current shared data are shared in described first source
The up-to-date amendment date is the most identical, and when judged result is for differing, by described first current shared data
It is updated to described first source and shares data;
When the data refresh mode of described target secret sharing is full dose mode, remove described target ownership number
According to storehouse shares the current shared data that data are corresponding with described source;Described source is shared data preserve extremely
In described target ownership database.
Further, before data are shared in the source in described acquisition described target source database, also wrap
Include: pre-set the link information of each database;For each database described, determine unification
Java database connect JDBC interface mode;
Data are shared in source in described acquisition described target source database, including: connect by described JDBC
Mouth mode and the link information of described target source database, be connected to described target source database, and obtain
Data are shared in the source taken in described target source database;
The described corresponding current shared data belonged to described target in database are updated, including: pass through
Described JDBC interface mode and the link information of described target ownership database, be connected to described target ownership
Database, and the corresponding current shared data in described target ownership database are updated.
On the other hand, the invention provides a kind of device updating shared data, including:
Unit is set, shares in the secret sharing of data, and described secret sharing comprise for arranging each class
The mark of source database and the mark of ownership database;The renewal arranging each described secret sharing triggers
Conditions and data update mode;
Determine unit, for when reaching the renewal trigger condition of target secret sharing, be total to according to described target
Enjoy the mark of the source database in scheme and belong to the mark of database, determining corresponding target derived data
Storehouse and target ownership database;
Acquiring unit, shares data for the source obtained in described target source database;
Updating block, for the data refresh mode according to described target secret sharing, utilizes the institute got
Data are shared in the source of stating, and are updated the corresponding current shared data in described target ownership database.
Further, described secret sharing, also include: SQL SQL, derived data table
Mark, ownership tables of data the mark SQL field corresponding with described ownership tables of data in appoint
Anticipate one or more;
Described determine unit, be further used for the mark according to the derived data table in described target secret sharing
With the mark of ownership tables of data, determine the target derived data table in described target source database and described mesh
Target ownership tables of data in mark ownership database;
Described acquiring unit, specifically for utilizing the SQL in described target secret sharing, obtains described target
Data are shared in the source corresponding with the SQL field in described target secret sharing in derived data table;
Described updating block, specifically for carrying out more the current shared data in described target ownership tables of data
Newly.
Further, described data refresh mode includes: incremental mode, and/or, full dose mode;
Described updating block, specifically for being incremental mode at the data refresh mode of described target secret sharing
Time, determine described target ownership database in share the current shared data that data are corresponding with described source;
Each in data the first source is shared for described source and shares data, be performed both by: judge currently to be total to described
Enjoying and whether data exist corresponding first current shared data, if not existing, number is shared in described first source
According to preserve to described target ownership database in, if exist, the most again judge described first source share data and
The up-to-date amendment date of described first current shared data is the most identical, and when judged result is for differing,
Described first current shared data are updated to described first source and share data;
When the data refresh mode of described target secret sharing is full dose mode, remove described target ownership number
According to storehouse shares the current shared data that data are corresponding with described source;Described source is shared data preserve extremely
In described target ownership database.
Further, described unit is set, is additionally operable to arrange the link information of each database;For
Each database described, determines that unified java database connects JDBC interface mode;
Described acquiring unit, specifically for by described JDBC interface mode and described target source database
Link information, be connected to described target source database, and obtain the source in described target source database
Share data;
Described updating block, specifically for belonging to database by described JDBC interface mode and described target
Link information, be connected to described target ownership database, and to described target ownership database in corresponding
Current shared data are updated.
On the other hand, the invention provides a kind of system updating shared data, including: any of the above-described institute
The device of data, at least one source database and at least one ownership database are shared in updating of stating.
The invention provides and a kind of update the method for shared data, Apparatus and system, pre-set each class
That shares data comprises source database mark and the secret sharing of ownership Database Identification, and arranges every
The renewal trigger condition of one secret sharing and data refresh mode;When the renewal reaching arbitrary secret sharing
During trigger condition, first according to source database therein mark and ownership Database Identification, to determine phase
The source database answered and ownership database;Then data, and root are shared in the source obtained in source database
According to the data refresh mode of this secret sharing, the source got is utilized to share data in ownership database
Corresponding current shared data are updated.Owing to sharing data for each class, all can be according to accordingly
Shared data are updated by scheduled update demand and update mode, and therefore, the present invention can improve shared
The practicality that data update.
Accompanying drawing explanation
In order to be illustrated more clearly that the embodiment of the present invention or technical scheme of the prior art, below will be to reality
Execute the required accompanying drawing used in example or description of the prior art to be briefly described, it should be apparent that below,
Accompanying drawing in description is some embodiments of the present invention, for those of ordinary skill in the art, not
On the premise of paying creative work, it is also possible to obtain other accompanying drawing according to these accompanying drawings.
Fig. 1 is the flow chart of a kind of method updating shared data that one embodiment of the invention provides;
Fig. 2 is the another kind of flow chart updating the method sharing data that one embodiment of the invention provides;
Fig. 3 is the schematic diagram of a kind of device updating shared data that one embodiment of the invention provides;
Fig. 4 is the another kind of schematic diagram updating the device sharing data that one embodiment of the invention provides;
Fig. 5 is the schematic diagram of a kind of system updating shared data that one embodiment of the invention provides.
Detailed description of the invention
For making the purpose of the embodiment of the present invention, technical scheme and advantage clearer, below in conjunction with this
Accompanying drawing in bright embodiment, is clearly and completely described the technical scheme in the embodiment of the present invention,
Obviously, described embodiment is a part of embodiment of the present invention rather than whole embodiments, based on
Embodiment in the present invention, those of ordinary skill in the art are institute on the premise of not making creative work
The every other embodiment obtained, broadly falls into the scope of protection of the invention.
As it is shown in figure 1, embodiments provide a kind of method updating shared data, can include
Following steps:
Step 101: pre-set each class and share in the secret sharing of data, and described secret sharing and comprise
The mark of source database and the mark of ownership database;The renewal arranging each described secret sharing triggers
Conditions and data update mode.
Step 102: when reaching the renewal trigger condition of target secret sharing, shares side according to described target
The mark of the source database in case and the mark of ownership database, determine corresponding target source database and
Target ownership database.
Step 103: data are shared in the source obtained in described target source database.
Step 104: according to the data refresh mode of described target secret sharing, utilize the described source got
Share data, the corresponding current shared data in described target ownership database are updated.
Embodiments provide a kind of method updating shared data, pre-set each class and share number
According to comprise source database mark and the secret sharing of ownership Database Identification, and each is set altogether
Enjoy renewal trigger condition and the data refresh mode of scheme;When the renewal reaching arbitrary secret sharing triggers bar
During part, first according to source database therein mark and ownership Database Identification, corresponding next to determine
Source database and ownership database;Then data are shared in the source in source database that obtains, and are total to according to this
Enjoying the data refresh mode of scheme, utilizing the source got to share data should to the phase in ownership database
Front data of sharing are updated.Owing to sharing data for each class, all can make a reservation for more according to corresponding
Shared data are updated by new demand and update mode, and therefore, the embodiment of the present invention can improve shared
The practicality that data update.
In a kind of possible implementation, in order to upgrade demand according to set in advance, there is selection
Carrying out share data renewal, so, described renewal trigger condition includes: clocked flip-flop, and/
Or, monitoring corresponding data of sharing has variation.
In a kind of possible implementation, in order to a kind of shared information updating mode is described, so, described
Secret sharing, farther includes: SQL (Structured Query Language, SQL),
The mark of derived data table, the mark SQL field corresponding with described ownership tables of data of ownership tables of data
In any one or more;
Described determine corresponding target source database and target ownership database after, farther include:
Mark according to the derived data table in described target secret sharing and the mark of ownership tables of data, determine described
Target derived data table in target source database and the target ownership data in described target ownership database
Table;
Data are shared in source in described acquisition described target source database, including: utilize described target to share
SQL in scheme, obtain in described target derived data table with the SQL word in described target secret sharing
Data are shared in the corresponding source of section;
The described corresponding current shared data belonged to described target in database are updated, including: to institute
The current shared data stated in target ownership tables of data are updated.
In a kind of possible implementation, in order to different shared data refresh modes is described, so,
Described data refresh mode includes: incremental mode, and/or, full dose mode;
The described data refresh mode according to described target secret sharing, utilizes the described source got to share number
According to, the corresponding current shared data in described target ownership database are updated, including:
When the data refresh mode of described target secret sharing is incremental mode, determine that described target belongs to number
According to storehouse shares the current shared data that data are corresponding with described source;Described source is shared in data
Data are shared in each first source, are performed both by: judge whether exist in described current shared data accordingly
First current shared data, if not existing, sharing by described first source with data and preserving to described target ownership number
According in storehouse, if existing, the most again judge that data and described first current shared data are shared in described first source
The up-to-date amendment date is the most identical, and when judged result is for differing, by described first current shared data
It is updated to described first source and shares data;
When the data refresh mode of described target secret sharing is full dose mode, remove described target ownership number
According to storehouse shares the current shared data that data are corresponding with described source;Described source is shared data preserve extremely
In described target ownership database.
In a kind of possible implementation, in order to illustrate in shared data updating process, different pieces of information
Concrete connected mode between storehouse, so, the source in described acquisition described target source database is shared
Before data, farther include: pre-set the link information of each database;For described each
Individual database, determines unified JDBC (Java Data Base Connectivity, java database connects)
Interface mode;
Data are shared in source in described acquisition described target source database, including: connect by described JDBC
Mouth mode and the link information of described target source database, be connected to described target source database, and obtain
Data are shared in the source taken in described target source database;
The described corresponding current shared data belonged to described target in database are updated, including: pass through
Described JDBC interface mode and the link information of described target ownership database, be connected to described target ownership
Database, and the corresponding current shared data in described target ownership database are updated.
For making the object, technical solutions and advantages of the present invention clearer, below in conjunction with the accompanying drawings and specifically real
The present invention is described in further detail to execute example.
As in figure 2 it is shown, one embodiment of the invention provides updates the method sharing data, the method can
To comprise the following steps:
Step 201: the link information of each database is set, and determines unified JDBC interface mode.
For example, existing 10 application systems, and common, each application system has one accordingly
Database.In detail, these 10 databases can be respectively database 1, database 2 ..., number
According to storehouse 10, corresponding Database Identification is respectively 001,002 ..., 010.In the present embodiment, this
10 application systems can be same enterprise, it is also possible to is belonging respectively to different enterprise.
In the present embodiment, for ease of the renewal of the data sharing of disparate databases, for these 10 data
Storehouse, it may be determined that a unified interface mode, such as JDBC interface mode.Furthermore, it is possible to safeguard one
Individual database information list, comprises specifically connect corresponding with the database of each application system in this list
Connect information.By the JDBC interface mode that this is unified, and a concrete database connected mode, just
May be coupled to associated databases.
In detail, the link information of database can include URL (the Uniform Resoure of this database
Locator, uniform resource locator), IP port, the mark of database, in account number cipher any one or
Multiple.Wherein, the data update system internal use that account number cipher can only be formed at these 10 databases.
In the present embodiment, by unified JDBC interface mode, and each data predetermined
The connected mode in storehouse, i.e. may be connected to any database, in order to realize the number between any two database
Even synchronize according to sharing, updating.This database connected mode is without setting up spy for each two database
Fixed database connected mode, thus without developing various specific connection interface, without related application system between
Joint debugging is tested, it is not necessary to the cooperation and communication between different vendor, is of value to raising interface exploitation efficiency and effect, joint
Human-saving physical resources and financial resources.Additionally, the data sharing between the database of different application systems runs with application system
Between be in loose coupling state, do not affect the normal use of application system.
Step 202: each class is set and shares the secret sharing of data, and the renewal of each secret sharing is touched
Send out conditions and data update mode.
In the present embodiment, each database can store multiclass and shared data, and each class has been shared
Data are generally held in same tables of data.Sharing data for each class, it can be to other data
Data are shared in the source that storehouse carries out sharing, it is also possible to be that data are shared in the backup shared by other databases.
For a certain class shares data, when it shares data for source, corresponding tables of data is source number
According to table, corresponding database is source database;When it shares data for backup, corresponding tables of data is
Ownership tables of data, corresponding database is ownership database.Therefore, a database both can be source number
According to storehouse, it is also possible to be ownership database.
For all kinds of shared data stored in these 10 databases, each class can be set and share data
Secret sharing.
In detail, secret sharing may include that source database mark, ownership the mark of database, SQL,
The mark of derived data table, ownership tables of data the mark SQL field corresponding with ownership tables of data in
Any one or more.Wherein, acquiescence derived data table is in source database, and ownership tables of data is in ownership
In database.And the job that secret sharing can be corresponding with such shared data describes file.
Such as, for this class of employee compensation shares data, corresponding secret sharing A may include that
Source database be designated 001, ownership database be designated 002, for obtain employee compensation SQL,
Derived data table be designated table 5, ownership tables of data be designated table 1 and ownership database in table 1 phase
Corresponding SQL field.Additionally, in a kind of possible implementation, for a class shares data,
Corresponding source database can be with more than one.
In detail, update trigger condition and may include that clocked flip-flop, and/or, monitor corresponding being total to
Enjoy data and have variation.Wherein, when updating trigger condition and being clocked flip-flop, share data automatically the most more
Newly can be completed by timer, and be configured by the statement of timer.
In the present embodiment, the different of each secret sharing can be set and trigger bar according to the actual requirements
Part.Such as, for this class of employee compensation shares data, due to the application at this shared data place
System every middle of a month, such as No. 15, can be updated the employee compensation in above-mentioned database 1.Therefore,
The renewal trigger condition of corresponding secret sharing can be clocked flip-flop, and the clocked flip time can be
Monthly 16 days 0 time whole.
Additionally, for the application scenarios needing the up-to-date shared data of timely acquisition, can select the most more
New trigger condition is for detecting that corresponding data of sharing have variation, for example, it is possible to monitoring is used for storing in real time
The renewal time of the derived data table of these shared data, change if monitoring the renewal time, can be right
Such shared data are updated.
In detail, data refresh mode includes: incremental mode, and/or, full dose mode.
In the present embodiment, can such as whether retain stale data, selectively determine according to the actual requirements
Corresponding data refresh mode.Such as, data are shared for this class of employee compensation, increment side can be selected
Formula, i.e. when carrying out sharing data renewal, retains stale data, adds newly-increased data, and only will change
Data be updated, and not all update replace.Additionally, for the shared number without retaining stale data
According to, can the most all update replacement to select full dose mode.
Additionally, in addition to considering whether to retain stale data, the selection of data refresh mode it is also conceivable to
Other factors, such as the data volume size of shared data, change degree etc..Such as, for employee compensation this
Class shares data, and owing to its data volume is less big, and data have the number of variation to account for data total amount in a short time
Ratio is relatively small, therefore can select incremental mode, i.e. when carrying out sharing data renewal, only will change
Concrete data be updated, and not all renewal.Additionally, the shared number the biggest for changing degree
According to, the most all can update to select full dose mode.
Therefore, in the present embodiment, for this class of employee compensation shares data, it may be determined that corresponding
The renewal trigger condition of secret sharing A be clocked flip-flop, and the clocked flip time can be monthly 16 days
0 time whole, data refresh mode is incremental mode.
In the present embodiment, for the secret sharing of each shared data, can according to practical application request,
Corresponding suitably renewal trigger condition and data refresh mode are set.By this shared automatically updating data side
Shared data selectively can be timed renewal or real-time update, and selectively carry out complete by formula
Amount updates or incremental update, in order to shared data are utilized by staff.
Step 203: when the time that the clocked flip-flop reached with share option A is corresponding, according to sharing
Option A, determine corresponding source database be database 1, ownership database be database 2, derived data
Table is the table 5 in database 1, and ownership tables of data is the table 1 in database 2.
When reaching the triggered time corresponding with sharing option A, the content according to comprising in secret sharing A:
Source database be designated 001, ownership database be designated 002, derived data table be designated table 5,
Belong to tables of data is designated table 1, it may be determined that corresponding source database is database 1, ownership database
Being the table 5 in database 1 for database 2, derived data table, ownership tables of data is the table 1 in database 2.
Step 204: by JDBC interface mode and the link information of database 1, be connected to database 1.
By predetermined database information list, the source database i.e. company of database 1 can be got
Connect information.By unified JDBC interface mode and this link information, database 1 can be quick connected to.
Step 205: utilize the SQL in secret sharing A, in the table 5 of database 1, obtains and shares
Data are shared in the corresponding source of SQL field in option A.
In detail, for incremental data update mode, when data are shared in acquisition source, owing to total data is same
The implementation of Shi Gengxin is relatively slow, therefore can set up inquiry vernier.By inquiry vernier, can obtain one by one
Source data, and each the source data got is processed one by one.
SQL is a kind of data base querying and programming language, and the SQL in secret sharing A is i.e. specifically used for
The language of inquiry employee compensation, SQL field is i.e. corresponding to the source data that should obtain.Therefore, arrival is being connected
After source database i.e. database 1, table 5 therein can be navigated to, and by running in secret sharing A
SQL, share data obtaining the source corresponding with the SQL field in shared option A in table 5.
Step 206: by JDBC interface mode and the link information of database 2, be connected to database 2.
After data are shared in the source of getting, same, by predetermined database information list, can
To get the ownership database i.e. link information of database 2.By unified JDBC interface mode and should
Link information, can quick connect to database 2.
Step 207: the data refresh mode determining secret sharing A is incremental mode, determines database 2
Current shared data in table 1.
In the present embodiment, the data of the corresponding secret sharing A of data are shared with this class of employee compensation more
New paragon is incremental mode, it is possible to use data are shared in the source got, by incremental mode to ownership data
The current shared data in table 1 in ownership tables of data in storehouse, i.e. database 2 are updated.
Certainly, however, it is determined that go out corresponding data refresh mode when being full dose mode, specifically, table 1 can be removed
In current shared data, then the source got shared data preserve in table 1.
Step 208: the first source of each in data is shared for source and shares data, be performed both by: judge working as
Whether front shared data existing corresponding first current shared data, if existing, performing step 209, if not
Exist, perform step 211.
In the present embodiment, when source share data be employee compensation time, the source got is shared in data
Each source data, if there is not Backup Data corresponding thereto in current shared data, then say
Employee corresponding to this source data bright is probably new employees's work, can directly perform step 211, the most directly will
This source data is added to table 1.Contrary, if there is corresponding Backup Data, then need to perform
Step 209, to judge whether this source data has change.
Step 209: judge that the whether phase of up-to-date amendment date of data and the first current shared data is shared in the first source
With, if it is not, perform step 210.
In detail, when needs carry out data renewal, can arrange according to unique index set in advance, such as member
The name of work, to carry out data renewal operation.
The most identical by the up-to-date amendment date of both contrasts, it can be determined that to go out whether the first source shares data
There is change.If both differ, data are shared in first source that illustrates change, therefore can perform step 210, with
First current shared data renewal is replaced with the first source and shares data.
In a kind of possible implementation, after data are shared in the source of getting, according to practical application request,
Can not also carry out the judgement on up-to-date amendment date, the most whether source data has change, as long as judging to return
Belong in tables of data and there is the first source to share data corresponding with the first current shared data, just currently common by first
Enjoy data to be updated to the first source and share data.
Step 210: the first current shared data are updated to the first source and share data.
Owing to both the thinnest update dates are different, illustrating compared with the first current shared data, the first source is altogether
Enjoy data and have change, therefore the first current shared data can be updated to the first source and share data.
Step 211: the first source is shared data and preserves to the table 1 of database 2.
Angelica tables of data i.e. table 1 do not comprises this first source when sharing data in the current shared data of storage,
Can directly be saved to table 1, and statement can be inserted to complete the preservation of data by generating.
In the present embodiment, by unified JDBC interface mode and the predetermined connected mode of any database,
May be coupled to any database, to realize data sharing, data the most more between any two databases
New and data syn-chronization.This data sharing and update that the method for synchronization is simple, specification, general, do not affect each number
According to the normal use of place, storehouse application system, and be particularly suited for non-mass data between each system share and from
Dynamic renewal.
As it is shown on figure 3, embodiments provide a kind of device 30 updating shared data, including:
Unit 301 is set, shares bag in the secret sharing of data, and described secret sharing for arranging each class
Mark containing source database and the mark of ownership database;The renewal arranging each described secret sharing is touched
Send out conditions and data update mode;
Determine unit 302, for when reaching the renewal trigger condition of target secret sharing, according to described target
The mark of the source database in secret sharing and the mark of ownership database, determine corresponding target source number
Database is belonged to according to storehouse and target;
Acquiring unit 303, shares data for the source obtained in described target source database;
Updating block 304, for the data refresh mode according to described target secret sharing, utilization gets
Data are shared in described source, are updated the corresponding current shared data in described target ownership database.
In one embodiment of the invention, described secret sharing, farther include: SQL, source number
According in the mark of table, the mark SQL field corresponding with described ownership tables of data of ownership tables of data
Any one or more;
Described determine unit 302, be further used for the mark according to the derived data table in described target secret sharing
Know and the mark of ownership tables of data, determine the target derived data table in described target source database and described
Target ownership tables of data in target ownership database;
Described acquiring unit 303, specifically for utilizing the SQL in described target secret sharing, obtains described mesh
Data are shared in the source corresponding with the SQL field in described target secret sharing in mark derived data table;
Described updating block 304, specifically for carrying out the current shared data in described target ownership tables of data
Update.
In one embodiment of the invention, described data refresh mode includes: incremental mode, and/or, entirely
Amount mode;
Described updating block 304, specifically for being increment side at the data refresh mode of described target secret sharing
During formula, determine described target ownership database in share the current shared data that data are corresponding with described source;
Each in data the first source is shared for described source and shares data, be performed both by: judge currently to be total to described
Enjoying and whether data exist corresponding first current shared data, if not existing, number is shared in described first source
According to preserve to described target ownership database in, if exist, the most again judge described first source share data and
The up-to-date amendment date of described first current shared data is the most identical, and when judged result is for differing,
Described first current shared data are updated to described first source and share data;
When the data refresh mode of described target secret sharing is full dose mode, remove described target ownership number
According to storehouse shares the current shared data that data are corresponding with described source;Described source is shared data preserve extremely
In described target ownership database.
In one embodiment of the invention, refer to Fig. 4, described unit 301 is set, be further used for setting
Put the link information of each database;For each database described, determine unified JDBC interface
Mode;
Described acquiring unit 303, specifically for by described JDBC interface mode and described target derived data
The link information in storehouse, is connected to described target source database, and obtains in described target source database
Data are shared in source;
Described updating block 304, specifically for belonging to data by described JDBC interface mode and described target
The link information in storehouse, is connected to described target ownership database, and to the phase in described target ownership database
Current shared data are answered to be updated.
As it is shown in figure 5, embodiments provide a kind of system updating shared data, including: on
State arbitrary described updating share the device 30 of data, at least one source database 40 and at least one
Ownership database 50.
In the present embodiment, in each application system, can there is a corresponding database, be somebody's turn to do to preserve
Total data in application system.When being source data when needing the shared data updated, corresponding database
Can be as source database, when it is Backup Data, corresponding database can be as ownership data
Storehouse.Therefore, same database can be source database in this moment, all right in another moment
It it is ownership database.
By unified JDBC interface mode, and by the concrete connected mode of each database,
May be coupled to any database, to realize between any two database, the most multiple database it
Between data sharing, and the renewal of shared data or synchronization, such that it is able to the data completed between multisystem are altogether
Enjoy and update, synchronizing.
The contents such as the information between each unit in said apparatus is mutual, execution process, due to the present invention
Embodiment of the method is based on same design, and particular content can be found in the narration in the inventive method embodiment, this
Place repeats no more.
In sum, each embodiment of the present invention at least has the advantages that
1, in the embodiment of the present invention, pre-set each class share data comprise source database mark and
The secret sharing of ownership Database Identification, and the renewal trigger condition sum of each secret sharing is set
According to update mode;When reaching the renewal trigger condition of arbitrary secret sharing, first according to source therein
Database Identification and ownership Database Identification, to determine corresponding source database and ownership database;So
Data are shared in source in rear acquisition source database, and according to the data refresh mode of this secret sharing, profit
Share data with the source got the corresponding current shared data in ownership database are updated.Due to
Data are shared for each class, all can be according to corresponding scheduled update demand and update mode to shared number
According to being updated, therefore, the embodiment of the present invention can improve the practicality that shared data update.
2, in the embodiment of the present invention, by unified JDBC interface mode and predetermined each
The connected mode of individual database, i.e. may be connected to any database, in order to realize any two database it
Between data sharing, update even synchronize.This database connected mode is without coming for each two database
Set up specific database connected mode, therefore without developing various specific connection interface, without related application system
Joint debugging test between system, it is not necessary to the cooperation and communication between different vendor, is of value to raising interface exploitation efficiency and effect
Really, use manpower and material resources sparingly financial resources.Additionally, the data sharing between the database of different application systems and application system
System is in loose coupling state between running, and does not affect the normal use of application system.
3, in the embodiment of the present invention, for the secret sharing of each shared data, can answer according to reality
By demand, corresponding suitably renewal trigger condition and data refresh mode are set.By these shared data certainly
Shared data selectively can be timed renewal or real-time update, and have selection by dynamic update mode
Carry out full dose renewal or incremental update, in order to shared data are utilized by staff.
4, in the embodiment of the present invention, by unified JDBC interface mode and the predetermined company of any database
Connect mode, it may be connected to any database, to realize data sharing, number between any two databases
According to regular update and data syn-chronization.This data sharing and update that the method for synchronization is simple, specification, general, no
Affect the normal use of each database place application system, and be particularly suited for non-mass data between each system
Share and automatically update.
It should be noted that in this article, the relational terms of such as first and second etc be used merely to by
One entity or operation separate with another entity or operating space, and not necessarily require or imply this
Relation or the order of any this reality is there is between a little entities or operation.And, term " includes ",
" comprise " or its any other variant is intended to comprising of nonexcludability, so that include that one is
The process of row key element, method, article or equipment not only include those key elements, but also include the brightest
Other key elements really listed, or also include intrinsic for this process, method, article or equipment
Key element.In the case of there is no more restriction, statement " include one " and limit
Key element, it is not excluded that there is also another in including the process of described key element, method, article or equipment
Outer identical factor.
One of ordinary skill in the art will appreciate that: realize all or part of step of said method embodiment
Can be completed by the hardware that programmed instruction is relevant, aforesaid program can be stored in embodied on computer readable
Storage medium in, this program upon execution, performs to include the step of said method embodiment;And it is aforementioned
Storage medium include: various Jie that can store program code such as ROM, RAM, magnetic disc or CD
In matter.
Last it should be understood that the foregoing is only presently preferred embodiments of the present invention, it is merely to illustrate this
The technical scheme of invention, is not intended to limit protection scope of the present invention.All spirit in the present invention and former
Any modification, equivalent substitution and improvement etc. done within then, are all contained in protection scope of the present invention.
Claims (10)
1. one kind updates the method sharing data, it is characterised in that pre-sets each class and shares being total to of data
Enjoy the mark comprising source database in scheme, and described secret sharing and the mark of ownership database;Arrange
The renewal trigger condition of each described secret sharing and data refresh mode, also include:
When reaching the renewal trigger condition of target secret sharing, according to the source in described target secret sharing
The mark of database and the mark of ownership database, determine corresponding target source database and target ownership number
According to storehouse;
Data are shared in the source obtained in described target source database;
According to the data refresh mode of described target secret sharing, the described source got is utilized to share data,
Corresponding current shared data in described target ownership database are updated.
Method the most according to claim 1, it is characterised in that
Described renewal trigger condition includes: clocked flip-flop, and/or, monitoring corresponding data of sharing has
Variation.
Method the most according to claim 1, it is characterised in that
Described secret sharing, farther includes: SQL SQL, the mark of derived data table,
Any one or more in the mark SQL field corresponding with described ownership tables of data of ownership tables of data;
Described determine corresponding target source database and target ownership database after, farther include:
Mark according to the derived data table in described target secret sharing and the mark of ownership tables of data, determine described
Target derived data table in target source database and the target ownership data in described target ownership database
Table;
Data are shared in source in described acquisition described target source database, including: utilize described target to share
SQL in scheme, obtain in described target derived data table with the SQL word in described target secret sharing
Data are shared in the corresponding source of section;
The described corresponding current shared data belonged to described target in database are updated, including: to institute
The current shared data stated in target ownership tables of data are updated.
Method the most according to claim 1, it is characterised in that
Described data refresh mode includes: incremental mode, and/or, full dose mode;
The described data refresh mode according to described target secret sharing, utilizes the described source got to share number
According to, the corresponding current shared data in described target ownership database are updated, including:
When the data refresh mode of described target secret sharing is incremental mode, determine that described target belongs to number
According to storehouse shares the current shared data that data are corresponding with described source;Described source is shared in data
Data are shared in each first source, are performed both by: judge whether exist in described current shared data accordingly
First current shared data, if not existing, sharing by described first source with data and preserving to described target ownership number
According in storehouse, if existing, the most again judge that data and described first current shared data are shared in described first source
The up-to-date amendment date is the most identical, and when judged result is for differing, by described first current shared data
It is updated to described first source and shares data;
When the data refresh mode of described target secret sharing is full dose mode, remove described target ownership number
According to storehouse shares the current shared data that data are corresponding with described source;Described source is shared data preserve extremely
In described target ownership database.
5. according to described method arbitrary in Claims 1-4, it is characterised in that
Before data are shared in source in described acquisition described target source database, farther include: in advance
The link information of each database is set;For each database described, determine unified java data
Storehouse connects JDBC interface mode;
Data are shared in source in described acquisition described target source database, including: connect by described JDBC
Mouth mode and the link information of described target source database, be connected to described target source database, and obtain
Data are shared in the source taken in described target source database;
The described corresponding current shared data belonged to described target in database are updated, including: pass through
Described JDBC interface mode and the link information of described target ownership database, be connected to described target ownership
Database, and the corresponding current shared data in described target ownership database are updated.
6. one kind updates the device sharing data, it is characterised in that including:
Unit is set, shares in the secret sharing of data, and described secret sharing comprise for arranging each class
The mark of source database and the mark of ownership database;The renewal arranging each described secret sharing triggers
Conditions and data update mode;
Determine unit, for when reaching the renewal trigger condition of target secret sharing, be total to according to described target
Enjoy the mark of the source database in scheme and belong to the mark of database, determining corresponding target derived data
Storehouse and target ownership database;
Acquiring unit, shares data for the source obtained in described target source database;
Updating block, for the data refresh mode according to described target secret sharing, utilizes the institute got
Data are shared in the source of stating, and are updated the corresponding current shared data in described target ownership database.
The device of data is shared in renewal the most according to claim 6, it is characterised in that
Described secret sharing, farther includes: SQL SQL, the mark of derived data table,
Any one or more in the mark SQL field corresponding with described ownership tables of data of ownership tables of data;
Described determine unit, be further used for the mark according to the derived data table in described target secret sharing
With the mark of ownership tables of data, determine the target derived data table in described target source database and described mesh
Target ownership tables of data in mark ownership database;
Described acquiring unit, specifically for utilizing the SQL in described target secret sharing, obtains described target
Data are shared in the source corresponding with the SQL field in described target secret sharing in derived data table;
Described updating block, specifically for carrying out more the current shared data in described target ownership tables of data
Newly.
The device of data is shared in renewal the most according to claim 6, it is characterised in that
Described data refresh mode includes: incremental mode, and/or, full dose mode;
Described updating block, specifically for being incremental mode at the data refresh mode of described target secret sharing
Time, determine described target ownership database in share the current shared data that data are corresponding with described source;
Each in data the first source is shared for described source and shares data, be performed both by: judge currently to be total to described
Enjoying and whether data exist corresponding first current shared data, if not existing, number is shared in described first source
According to preserve to described target ownership database in, if exist, the most again judge described first source share data and
The up-to-date amendment date of described first current shared data is the most identical, and when judged result is for differing,
Described first current shared data are updated to described first source and share data;
When the data refresh mode of described target secret sharing is full dose mode, remove described target ownership number
According to storehouse shares the current shared data that data are corresponding with described source;Described source is shared data preserve extremely
In described target ownership database.
9. share the device of data according to described updating arbitrary in claim 6 to 8, its feature exists
In,
Described unit is set, is further used for arranging the link information of each database;For described each
Individual database, determines that unified java database connects JDBC interface mode;
Described acquiring unit, specifically for by described JDBC interface mode and described target source database
Link information, be connected to described target source database, and obtain the source in described target source database
Share data;
Described updating block, specifically for belonging to database by described JDBC interface mode and described target
Link information, be connected to described target ownership database, and to described target ownership database in corresponding
Current shared data are updated.
10. one kind updates the system sharing data, it is characterised in that including: such as claim 6 to 9
In arbitrary described updating share the device of data, at least one source database and at least one ownership number
According to storehouse.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610225191.0A CN105868384A (en) | 2016-04-12 | 2016-04-12 | Method, device and system for updating shared data |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610225191.0A CN105868384A (en) | 2016-04-12 | 2016-04-12 | Method, device and system for updating shared data |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105868384A true CN105868384A (en) | 2016-08-17 |
Family
ID=56636766
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610225191.0A Pending CN105868384A (en) | 2016-04-12 | 2016-04-12 | Method, device and system for updating shared data |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105868384A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109634975A (en) * | 2018-12-10 | 2019-04-16 | 拉扎斯网络科技(上海)有限公司 | Data synchronization method and device, electronic equipment and computer readable storage medium |
CN110741616A (en) * | 2017-06-14 | 2020-01-31 | 北京嘀嘀无限科技发展有限公司 | System and method for data online |
CN110909071A (en) * | 2018-09-17 | 2020-03-24 | 北京国双科技有限公司 | Data synchronization method, device and system |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103064976A (en) * | 2013-01-14 | 2013-04-24 | 浙江水利水电专科学校 | Data for exchanging data among homogenous and heterogenous DBMSs (database management systems) on basis of active database technology |
CN104376017A (en) * | 2013-08-15 | 2015-02-25 | 阿里巴巴集团控股有限公司 | Method and system for inter-database data synchronization |
-
2016
- 2016-04-12 CN CN201610225191.0A patent/CN105868384A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103064976A (en) * | 2013-01-14 | 2013-04-24 | 浙江水利水电专科学校 | Data for exchanging data among homogenous and heterogenous DBMSs (database management systems) on basis of active database technology |
CN104376017A (en) * | 2013-08-15 | 2015-02-25 | 阿里巴巴集团控股有限公司 | Method and system for inter-database data synchronization |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110741616A (en) * | 2017-06-14 | 2020-01-31 | 北京嘀嘀无限科技发展有限公司 | System and method for data online |
CN110909071A (en) * | 2018-09-17 | 2020-03-24 | 北京国双科技有限公司 | Data synchronization method, device and system |
CN109634975A (en) * | 2018-12-10 | 2019-04-16 | 拉扎斯网络科技(上海)有限公司 | Data synchronization method and device, electronic equipment and computer readable storage medium |
CN109634975B (en) * | 2018-12-10 | 2022-02-25 | 拉扎斯网络科技(上海)有限公司 | Data synchronization method and device, electronic equipment and computer readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8799235B2 (en) | Data de-duplication system | |
CN103516591B (en) | The implementation method of enterprise's address list and device in immediate communication platform | |
CN103020058B (en) | A kind of multi-version data acquisition method and device | |
CN110196758A (en) | Data processing method and device, storage medium and electronic device | |
KR20110097921A (en) | Mapping instances of a dataset within a data management system | |
CN105868421A (en) | Data management method and data management device | |
CN101442591B (en) | Method and system for self-checking and updating performance business model discrepancy | |
CN109308258A (en) | Building method, device, computer equipment and the storage medium of test data | |
CN108647357A (en) | The method and device of data query | |
CN108156030B (en) | Method and device for synchronizing configuration strategies | |
CN104679500B (en) | Method and device for realizing automatic generation of entity class | |
CN105868384A (en) | Method, device and system for updating shared data | |
CN103020753A (en) | Document state display system and document state display method | |
CN103810094B (en) | Execution method, device and the testing tool of a kind of test cases | |
CN105915657A (en) | Data synchronization method and device, and client | |
CN106021566A (en) | Method, device and system for improving concurrent processing capacity of single database | |
CN108897686A (en) | It is complete to record separately automated testing method and device | |
CN111061802B (en) | Power data management processing method, device and storage medium | |
CN106802928B (en) | Power grid historical data management method and system | |
CN105550342B (en) | A kind of data processing method of the distributed data base of all-transparent | |
CN113094406A (en) | Power marketing data management method and system | |
CN106469175A (en) | Data processing method and device | |
CN105930354A (en) | Storage model conversion method and device | |
CN103809915B (en) | The reading/writing method of a kind of disk file and device | |
CN108228734A (en) | A kind of system and method for data visualization |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20160817 |
|
RJ01 | Rejection of invention patent application after publication |