CN104408058B - A kind of method and device of data access - Google Patents

A kind of method and device of data access Download PDF

Info

Publication number
CN104408058B
CN104408058B CN201410594200.4A CN201410594200A CN104408058B CN 104408058 B CN104408058 B CN 104408058B CN 201410594200 A CN201410594200 A CN 201410594200A CN 104408058 B CN104408058 B CN 104408058B
Authority
CN
China
Prior art keywords
data
mark
value
data base
force
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.)
Active
Application number
CN201410594200.4A
Other languages
Chinese (zh)
Other versions
CN104408058A (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.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
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 China Construction Bank Corp filed Critical China Construction Bank Corp
Priority to CN201410594200.4A priority Critical patent/CN104408058B/en
Publication of CN104408058A publication Critical patent/CN104408058A/en
Application granted granted Critical
Publication of CN104408058B publication Critical patent/CN104408058B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses a kind of method and devices of data access.Wherein, this method comprises: receiving data access request;The mark that comes into force of the copy data in local data base is read, the mark that comes into force includes the first value of statistical indicant or the second value of statistical indicant;Whether the mark that comes into force described in judgement is first value of statistical indicant;If so, accessing the local data base according to the data access request;If it is not, then accessing remote database according to the data access request.Implement the embodiment of the present invention, the efficiency of called side access data can be improved, and realizes that the automation between more parts of data sources switches.

Description

A kind of method and device of data access
Technical field
The present invention relates to computer application technologies, and in particular to a kind of method and device of data access.
Background technique
In complicated enterprise-level application environment, a large amount of called side generally requires the remote data to storage common data Library carries out high concurrent access.For the pressure for reducing remote database, it usually needs replicate the main notebook data in remote database Into the local data base where multiple called sides, called side is obtained with copy data by access local database, enterprise Industry common practice is the special data replicated product of purchase to realize the duplication of data.
Called side is numerous, in main notebook data and the simultaneous enterprise-level environment of copy data, works as data synchronization updating When local data base failure where failure or stored copies data is repaired, in order to guarantee that the data of access are just True data generally require manual intervention to select access remote database.As it can be seen that when there is failure of data synchronization or local number When the problem of breaking down according to library, called side require manual intervention and can not automatically switch to access remote data library inquiry it is correct Data reduce the efficiency of called side access data.
Summary of the invention
The embodiment of the present invention provides a kind of method and device of data access, and the effect of called side access data can be improved Rate, and realize that the automation between more parts of data sources switches.
First aspect of the embodiment of the present invention discloses a kind of method of data access, comprising:
Receive data access request;
The mark that comes into force of the copy data in local data base is read, the mark that comes into force includes the first value of statistical indicant or second Value of statistical indicant, wherein the copy data that first value of statistical indicant is used to identify in local data base is effective, and second value of statistical indicant is used Copy data in mark local data base is invalid;
Whether the mark that comes into force described in judgement is first value of statistical indicant;
If so, accessing the local data base according to the data access request;
If it is not, then accessing remote database according to the data access request.
Second aspect of the embodiment of the present invention discloses a kind of device of data access, comprising:
Receiving unit, for receiving data access request;
Reading unit, for reading the mark that comes into force of the copy data in local data base, the mark that comes into force includes the One value of statistical indicant or the second value of statistical indicant, wherein the copy data that first value of statistical indicant is used to identify in local data base is effective, institute It is invalid to state copy data of second value of statistical indicant for identifying in local data base;
First judging unit, for judging whether the mark that comes into force is first value of statistical indicant;
First access unit, for the mark that comes into force described in judging in first judging unit as first value of statistical indicant When, the local data base is accessed according to the data access request;
Second access unit, for the mark that comes into force described in judging in first judging unit as second value of statistical indicant When, remote database is accessed according to the data access request.
The implementation of the embodiments of the present invention has the following beneficial effects:
In the embodiment of the present invention, after receiving data access request, the copy data in local data base is read Come into force mark, if the mark that comes into force of the copy data in local data base is the first value of statistical indicant, access local database, if originally The mark that comes into force of copy data in ground database is the second value of statistical indicant, then accesses remote database, call so as to improve The efficiency of side's access data, and realize that the automation between more parts of data sources switches.
Detailed description of the invention
It in order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, below will be to institute in embodiment Attached drawing to be used is needed to be briefly described, it should be apparent that, the accompanying drawings in the following description is only some implementations of the invention Example, for those of ordinary skill in the art, without creative efforts, can also obtain according to these attached drawings Obtain other attached drawings.
Fig. 1 is a kind of flow diagram of the method for data access provided in an embodiment of the present invention;
Fig. 2 is the flow diagram of the method for another data access provided in an embodiment of the present invention;
Fig. 3 is the flow diagram of the method for another data access provided in an embodiment of the present invention;
Fig. 4 is a kind of structure chart of data access device provided in an embodiment of the present invention;
Fig. 5 is the structure chart of another data access device provided in an embodiment of the present invention;
Fig. 6 is the structure chart of another data access device provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other Embodiment shall fall within the protection scope of the present invention.
The embodiment of the invention discloses a kind of method and devices of data access, and the effect of called side access data can be improved Rate.
Referring to Fig. 1, Fig. 1 is a kind of flow diagram of data access method provided in an embodiment of the present invention, such as Fig. 1 institute Show, the method for the data access may comprise steps of:
S101, data access request is received.
In the embodiment of the present invention, data access request may include that copy data access request and the access of main notebook data are asked It asks, wherein copy data is located locally in database, and main notebook data is located in remote database, and main notebook data is all effective Data.
In the embodiment of the present invention, it can be received by data access device and be requested from the copy data for calling method, apparatus to send Or main notebook data request, wherein the data access device independence called side deployed with devices is in local.The data access device can To include but is not limited to component, which may include remote access interface package module, data simultaneous module and access routing Module.Remote access interface package module, which is used for when local replica data invalid, direct by remote access interface Access remote database;Data simultaneous module, the module is automatic and remote database communicates, and carries out data synchronization updating, and supervise Controlling local data base, whether synchronized update is completed with remote database.Routing module is accessed, which is used for synchronous according to data Module judges whether the result that synchronized update is completed selects access remote database or local data base to local data base.
S102, read local data base in copy data the mark that comes into force.
In the embodiment of the present invention, when receiving data access request, access local database is paid the utmost attention to.
In the embodiment of the present invention, the mark that comes into force may include the first value of statistical indicant or the second value of statistical indicant, wherein the first value of statistical indicant It is effective for identifying the copy data in local data base, the second value of statistical indicant be used to identify copy data in local data base without Effect.For example, the first value of statistical indicant can identify that copy data is effective, and the second value of statistical indicant can be used with " TRUE " or " 0 " etc. " FALSE " or " 1 " etc. are invalid to identify copy data.
Whether S103, the judgement mark that comes into force are the first value of statistical indicant.
In the embodiment of the present invention, if the mark that judges to come into force is the first value of statistical indicant, show the pair in current local data base Notebook data is effective, thens follow the steps S104, if the mark that judges to come into force is the second value of statistical indicant, shows in current local data base Copy data is invalid, thens follow the steps S105.
S104, according to data access request access local database.
In the embodiment of the present invention, data access device can first obtain local data base mark ID, be then passed to and work as the day before yesterday Phase (such as September 28 in 2014) and local data base mark ID (such as 10234), according to data access request, pass through local IP access Interface carrys out access local database.
S105, remote database is accessed according to data access request.
In the embodiment of the present invention, when the copy data in local data base is invalid, the data access device is according to data Access request can directly access remote database by remote access interface.
Method provided in an embodiment of the present invention can be applied to component, but it should be recognized that the above method is not limited to Applied to component, all device, equipment and systems that can implement method provided in an embodiment of the present invention belong to protection of the present invention Range.
In the method depicted in fig. 1, data access device first reads local number after receiving data access request According to the mark that comes into force of the copy data in library, if the mark that comes into force of the copy data in local data base is the first value of statistical indicant, Access local database accesses remote data if the mark that comes into force of the copy data in local data base is the second value of statistical indicant Library, so as to improve the efficiency of called side access data.
Referring to Fig. 2, Fig. 2 is the flow diagram of the method for another data access provided in an embodiment of the present invention, such as Shown in Fig. 2, the method for the data access the following steps are included:
S201, data access request is received.
In the embodiment of the present invention, data access request may include that copy data access request and the access of main notebook data are asked It asks, wherein copy data is located locally in database, and main notebook data is located in remote database, and main notebook data is all effective Data.
S202, judge copy data to be visited whether be real-time update data.
In the embodiment of the present invention, if copy data to be visited is the data of real-time update, S203 is thened follow the steps, if wait visit It asks that copy data is the data of non-real-time update, thens follow the steps S204.
In the embodiment of the present invention, copy data to be visited be according to whether real-time update occurs in the daytime and be divided into real time More new data and non-real-time update data.For example, the permission and task of employee can occur to change in real time, and employee's data can With the data as real-time update, the branch, department of mechanism is generally fixed and invariable, and organization data can be as non real-time The data of update.
In the embodiment of the present invention, data access device pre-defines different service interface numbers, service interface number For identifying the type of copy data to be visited, data access device can obtain number of copies to be visited according to the interface index According to real-time update information.For example, when called side calls service interface number A0861E022, because A0861E022 interface is Employee's data access interface, therefore the copy data to be called is the data of real-time update.
In the embodiment of the present invention, real-time update data are having the application that comes into force in real time in the daytime, and non-real-time update data are in day Between without coming into force application in real time.Assuming that local data base is to synchronize update at night and remote database, if to be visited Copy data be it is non-implement update data, then would not be updated in the copy data to be visited in the daytime, in the daytime When access local database, the copy data in local data base is exactly effective data;If copy data to be visited is The data of real-time update, then real-time update can occur in the daytime for the copy data to be visited, since local data base is only at night Between with remote database synchronize update, if when real-time update data in access local database in the daytime, it is same at night It is invalid in the daytime for the copy data that step updates, at this time in order to ensure the data of access are correct, it is necessary to access distal end Database.
S203, remote database is accessed according to data access request.
In the embodiment of the present invention, when judging copy data to be visited for the data of real-time update, show local number at this time According to the copy data failure in library, need to access the main notebook data in remote database by remote access interface.
S204, read local data base in copy data the mark that comes into force.
In the embodiment of the present invention, when judging copy data to be visited not is the data of real-time update, accessible local Database.
In the embodiment of the present invention, the mark that comes into force may include the first value of statistical indicant or the second value of statistical indicant, wherein the first value of statistical indicant It is effective for identifying the copy data in local data base, the second value of statistical indicant be used to identify copy data in local data base without Effect.For example, the first value of statistical indicant can identify that copy data is effective, and the second value of statistical indicant can be used with " TRUE " or " 0 " etc. " FALSE " or " 1 " etc. are invalid to identify copy data.
Whether S205, the judgement mark that comes into force are the first value of statistical indicant.
In the embodiment of the present invention, if the mark that judges to come into force is the first value of statistical indicant, S206 is thened follow the steps, if judging to come into force When mark is the second value of statistical indicant, then S203 is returned to step.
S206, according to data access request access local database.
In the embodiment of the present invention, after receiving data access request, first judge whether copy data to be visited is real The data of Shi Gengxin, if so, access remote database, if it is not, then reading the mark that comes into force of the copy data in local data base Will, if the mark that comes into force is the first value of statistical indicant, access local database accesses if the mark that comes into force is the second value of statistical indicant Remote database, to improve the efficiency of called side access data.
Referring to Fig. 3, Fig. 3 is the method for another data access provided in an embodiment of the present invention, as shown in figure 3, the party Method the following steps are included:
S301, data access request is received.
S302, judge whether copy data to be visited is the data of real-time update, if so, S303 is thened follow the steps, if it is not, Then follow the steps S304.
S303, remote database is accessed according to data access request.
S304, the mark that comes into force is initialized.
In the embodiment of the present invention, the mark that comes into force may include the first value of statistical indicant or the second value of statistical indicant, wherein the first value of statistical indicant It is effective for identifying the copy data in local data base, the second value of statistical indicant be used to identify copy data in local data base without Effect.For example, the first value of statistical indicant can identify that copy data is effective, and the second value of statistical indicant can be used with " TRUE " or " 0 " etc. " FALSE " or " 1 " etc. are invalid to identify copy data.
Specifically, the mark that comes into force of the copy data in local data base is initialized, the initial value of the mark that comes into force is the Two values of statistical indicant.
S305, present system time is obtained.
In the embodiment of the present invention, present system time includes current system date and current system time point.Such as: 2014 September 28 days, at 11 points in the morning 10 minutes.
S306, judge whether present system time reaches the initial time of the local data base synchronized update of current record.
In the embodiment of the present invention, the initial time of local data base synchronized update can be fixed time point, such as morning 1 Point or 2:00 AM, the embodiment of the present invention is without limitation.
In the embodiment of the present invention, local data base and remote database are all synchronizing update daily, thus, in difference When time accesses data, the time of local data base synchronized update is different, needs to judge whether present system time reaches and works as The initial time of the local data base synchronized update of preceding record.For example, the initial time of local data base synchronized update is daily 1:00 AM, if present system time is at 11 points in No. 28 mornings 10 minutes, the local data base synchronized update of current record is risen Time beginning is No. 29 1:00 AMs, if present system time is No. 29 20 points of evening, the local data base of current record is synchronous more New initial time is No. 30 1:00 AMs.
In the embodiment of the present invention, if present system time reaches the starting of the local data base synchronized update of current record Between, show that local data base starts with remote database synchronized update, thens follow the steps S305.
Whether synchronized update is completed for S307, monitoring local data base.
In the embodiment of the present invention, if monitoring local data base synchronized update is completed, S308 is thened follow the steps, if monitoring is local Database does not have synchronized update completion, thens follow the steps S309.
In the embodiment of the present invention, monitor whether local data base synchronizes by the data simultaneous module in data access device It updates and completes.
S308, the mark that will come into force are set to the first value of statistical indicant.
S309, during the local data base synchronized update, come into force described in holding mark be the second value of statistical indicant.
S310, read local data base in copy data the mark that comes into force.
Whether S311, the judgement mark that comes into force are the first value of statistical indicant.
In the embodiment of the present invention, if judge the mark that comes into force of the copy data in local data base for the first value of statistical indicant, S312 is thened follow the steps, if judge the mark that comes into force of the copy data in local data base for the second value of statistical indicant, executes step Rapid S303.
S312, according to data access request access local database.
In the embodiment of the present invention, after receiving data access request, by coming into force for the copy data in local data base Mark is initialized as the second value of statistical indicant.Present system time is obtained, and judges whether present system time reaches current record The initial time of local data base synchronized update, if reaching, monitoring local data base, whether synchronized update is completed, if synchronizing more New to complete, then the mark that will come into force is set to the first value of statistical indicant, if synchronized update is not completed, in local data base synchronized update mistake Cheng Zhong, the holding mark that comes into force is the second value of statistical indicant, then reads and comes into force mark, and whether the mark that judges to come into force is the first value of statistical indicant, Indicate according to coming into force and select access remote database or local data base, to improve the efficiency of data access.
Referring to Fig. 4, Fig. 4 is a kind of structure chart of data access device provided in an embodiment of the present invention, as shown in figure 4, The device includes:
Receiving unit 401, for receiving data access request;
Reading unit 402, for reading the mark that comes into force of the copy data in local data base, which includes the One value of statistical indicant or the second value of statistical indicant, wherein the copy data that the first value of statistical indicant is used to identify in local data base is effective, the second mark The copy data that will value is used to identify in local data base is invalid;
First judging unit 403, for judging whether the mark that comes into force of the copy data in local data base is the first mark Will value;
First access unit 404, for judging the mark that comes into force of copy data for the first mark in the first judging unit 403 When value, according to data access request access local database;
Second access unit 405, for judging the mark that comes into force of copy data for the second mark in the first judging unit 403 When value, remote database is accessed according to data access request.
In the data access device of Fig. 4 description, receiving unit 401 is after receiving data access request, first by reading The mark that comes into force for the copy data for taking unit 402 to read in local data base, then local data is judged by the first judging unit 403 Whether the mark that comes into force of the copy data in library is the first value of statistical indicant, if the first value of statistical indicant, is then visited by the first access unit 404 It asks local data base, if the second value of statistical indicant, then remote database is accessed by the second access unit 405, adjusted so as to improve With the efficiency of side's access data.
Referring to Fig. 5, Fig. 5 is the structure chart of another data access device provided in an embodiment of the present invention, such as Fig. 5 institute Show, which includes:
Receiving unit 501, for receiving data access request;
Second judgment unit 502, for reading the mark that comes into force of the copy data in local data base in reading unit 503 Before, judge copy data to be visited whether be real-time update data;
Reading unit 503, for judging copy data to be visited not and being the data of real-time update in second judgment unit 502 When, the mark that comes into force of the copy data in local data base is read, which includes the first value of statistical indicant or the second value of statistical indicant, Wherein, the copy data that the first value of statistical indicant is used to identify in local data base is effective, and the second value of statistical indicant is for identifying local data Copy data in library is invalid;
Second access unit 504, for judging copy data to be visited for the number of real-time update in second judgment unit 502 According to when, according to data access request access remote database;
First judging unit 505, for judging whether the mark that comes into force of the copy data in local data base is the first mark Will value;
First access unit 506, for judging the mark that comes into force of copy data for the first mark in the first judging unit 505 When value, according to data access request access local database;
Second access unit 504 is also used to judge the mark that comes into force of copy data for the in the first judging unit 505 When two values of statistical indicant, remote database is accessed according to data access request.
In the data access device of Fig. 5 description, receiving unit 501 is after receiving data access request, first by the Two judging units judge whether copy data to be visited is the data of real-time update, if so, being visited by the second access unit 504 Ask remote database, if it is not, then by reading unit 503 read local data base in copy data come into force mark and then Whether the mark that comes into force that the copy data in local data base is judged by the first judging unit 505 is the first value of statistical indicant, if One value of statistical indicant, then by the first access unit, 506 access local databases, if the second value of statistical indicant, then by the second access unit 504 access remote databases, so as to improve the efficiency of called side access data.
Referring to Fig. 6, Fig. 6 is the structure chart of another data access device provided in an embodiment of the present invention, such as Fig. 6 institute Show, which includes:
Receiving unit 601, for receiving data access request;
Second judgment unit 602, for judge copy data to be visited whether be real-time update data;
Second access unit 603, for judging copy data to be visited for the number of real-time update in second judgment unit 602 According to when, access remote database;
Initialization unit 604, for judging copy data to be visited not and being the number of real-time update in second judgment unit 602 According to when, initialize local data base in copy data the mark that comes into force;Wherein, the initial value of the mark that comes into force is the second mark Value, the mark that comes into force include the first value of statistical indicant or the second value of statistical indicant, and the first value of statistical indicant is used to identify the copy in local data base Data are effective, and the copy data that the second value of statistical indicant is used to identify in local data base is invalid;
Acquiring unit 605, for obtaining present system time;
Whether third judging unit 606, the present system time for judging that acquiring unit 605 obtains reach current record Local data base synchronized update initial time;
Monitoring unit 607, the present system time for judging that acquiring unit 605 obtains in third judging unit 606 arrive Up to the local data base synchronized update of current record initial time when, monitoring local data base whether synchronized update complete;
Marking unit 608, for after the completion of monitoring unit 607 monitors local data base synchronized update, will to come into force mark It is set to the first value of statistical indicant;
The marking unit 608 is also used to during local data base synchronized update, and holding comes into force mark for the second mark Will value;
Reading unit 608, for reading the mark that comes into force of the copy data in local data base;
First judging unit 610, for judging whether the mark that comes into force is the first value of statistical indicant;
First access unit 611, for when the first judging unit 610 judges to come into force mark as the first value of statistical indicant, according to Data access request access local database;
Second access unit 603 is also used to judge to come into force mark in the first judging unit 610 as the second value of statistical indicant When, remote database is accessed according to data access request.
In the data access device of Fig. 6 description, after receiving unit 601 receives data access request, first by second Judging unit 602 judges whether copy data to be visited is the data of real-time update, if so, being visited by the second access unit 603 Ask remote database, if it is not, then by initialization unit 604 by the mark that comes into force of copy data be set to the second value of statistical indicant and then Judge whether present system time that acquiring unit 605 obtains reaches the local data of current record by third judging unit 605 The initial time of library synchronized update, if reaching, monitoring local data base by monitoring unit 607, whether synchronized update is completed, if It completes, then the first value of statistical indicant is set to by the mark that will come into force of marking unit 608, if it is not, then in local data base synchronized update process In, holding comes into force mark for the second value of statistical indicant.The reading of reading unit 609 comes into force after mark, judges to give birth to by the first judging unit 610 Whether valid flag is the first value of statistical indicant, if so, by 611 access local database of the first access unit, if it is not, then being visited by second Ask that unit 603 accesses remote database, to improve the efficiency of called side access data.
It should be noted that for simple description, therefore, it is stated as a systems for each embodiment of the method above-mentioned The combination of actions of column, but those skilled in the art should understand that, the application is not limited by the described action sequence, because For according to the application, certain some step be can be performed in other orders or simultaneously.Secondly, those skilled in the art also should Know, the embodiments described in the specification are all preferred embodiments, related actions and modules not necessarily this Shen It please be necessary.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in some embodiment Part, reference can be made to the related descriptions of other embodiments.
Those of ordinary skill in the art will appreciate that all or part of the steps in the various methods of above-described embodiment is can It is completed with instructing relevant hardware by program, which can be stored in a computer readable storage medium, storage Medium include read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), programmable read only memory (Programmable Read-only Memory, PROM), erasable programmable is read-only deposits Reservoir (Erasable Programmable Read Only Memory, EPROM), disposable programmable read-only memory (One- Time Programmable Read-Only Memory, OTPROM), the electronics formula of erasing can make carbon copies read-only memory (Electrically-Erasable Programmable Read-Only Memory, EEPROM), CD-ROM (Compact Disc Read-Only Memory, CD-ROM) or other disc memories, magnetic disk storage, magnetic tape storage or can For carrying or any other computer-readable medium of storing data.
It is provided for the embodiments of the invention a kind of data access method above and device is described in detail, herein Apply that a specific example illustrates the principle and implementation of the invention, the explanation of above example is only intended to help Understand method and its core concept of the invention;At the same time, for those skilled in the art, according to the thought of the present invention, There will be changes in the specific implementation manner and application range, in conclusion the content of the present specification should not be construed as to this The limitation of invention.

Claims (6)

1. a kind of method of data access characterized by comprising
It receives from the data access request for calling method, apparatus, the data access request includes copy data access request and master Notebook data access request, wherein copy data is located locally in database, and main notebook data is located in remote database;
According to the service interface of the called side equipment calls number, judge copy data to be visited whether be real-time update number According to, wherein the service interface numbers the type for identifying copy data to be visited;
If copy data to be visited is the data of non-real-time update, the life of the copy data in the local data base is initialized Valid flag;Wherein, the initial value of the mark that comes into force is the second value of statistical indicant;
Monitoring local data base, whether synchronized update is completed, if so, the mark that comes into force is set to the first value of statistical indicant, if it is not, Then during the local data base synchronized update, the mark that comes into force described in holding is second value of statistical indicant;
The mark that comes into force of the copy data in local data base is read, the mark that comes into force includes first value of statistical indicant or described Second value of statistical indicant, wherein the copy data that first value of statistical indicant is used to identify in local data base is effective, second mark Value is invalid for identifying the copy data in local data base;
Whether the mark that comes into force described in judgement is first value of statistical indicant;
If the mark that comes into force is first value of statistical indicant, the local data base is accessed according to the data access request;
If copy data to be visited is the data of real-time update or the mark that comes into force is second value of statistical indicant, show it is described to It is invalid to access copy data, then remote database is accessed according to the data access request.
2. the method according to claim 1, wherein whether synchronized update completes it to the monitoring local data base Before, the method also includes:
Obtain present system time;
Judge whether the present system time reaches the initial time of the local data base synchronized update of current record;
If so, execute the monitoring local data base whether synchronized update completion the step of.
3. method according to claim 1 or 2, which is characterized in that the access local data base, comprising:
It obtains local data base and identifies ID;
ID, which is identified, according to the local data base accesses the local data base.
4. a kind of device of data access characterized by comprising
Receiving unit, for receiving from the data access request for calling method, apparatus, the data access request includes number of copies According to access request and main notebook data access request, wherein copy data is located locally in database, and main notebook data is located at distal end number According in library;
First judging unit judges copy data to be visited for numbering according to the service interface of the called side equipment calls Whether be real-time update data, wherein the service interface numbers the type for identifying copy data to be visited;
Initialization unit, for when first judging unit judges copy data to be visited for the data of non-real-time update, Initialize the mark that comes into force of the copy data in the local data base;Wherein, the initial value of the mark that comes into force is the second mark Will value;
Monitoring unit, for monitoring local data base, whether synchronized update is completed;
Marking unit, for after the completion of the monitoring unit monitors local data base synchronized update, the mark that comes into force to be set For the first value of statistical indicant;
The marking unit is also used to during the local data base synchronized update, and the mark that comes into force described in holding is described Second value of statistical indicant;
Reading unit, for reading the mark that comes into force of the copy data in local data base, the mark that comes into force includes described the One value of statistical indicant or second value of statistical indicant, wherein the copy data that first value of statistical indicant is used to identify in local data base has Effect, the copy data that second value of statistical indicant is used to identify in local data base are invalid;
Second judgment unit, for judging whether the mark that comes into force is first value of statistical indicant;
First access unit, when for the mark that comes into force described in judging in the second judgment unit as first value of statistical indicant, root The local data base is accessed according to the data access request;
Second access unit, for judging copy data to be visited for the data of real-time update or institute in first judging unit State second judgment unit judge described in come into force mark as second value of statistical indicant, when showing that the copy data to be visited is invalid, Remote database is accessed according to the data access request.
5. device according to claim 4, which is characterized in that described device further include:
Acquiring unit, for obtaining present system time;
Whether third judging unit, the present system time for judging that the acquiring unit obtains reach current record The initial time of local data base synchronized update;
The monitoring unit, specifically for judging the present system time that the acquiring unit obtains in the third judging unit When reaching the initial time of the local data base synchronized update of current record, monitoring local data base whether complete by synchronized update.
6. device according to claim 5, which is characterized in that
The acquiring unit is also used to obtain local data base mark ID;
First access unit, specifically for the local data base mark ID access institute obtained according to the acquiring unit State local data base.
CN201410594200.4A 2014-10-29 2014-10-29 A kind of method and device of data access Active CN104408058B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410594200.4A CN104408058B (en) 2014-10-29 2014-10-29 A kind of method and device of data access

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410594200.4A CN104408058B (en) 2014-10-29 2014-10-29 A kind of method and device of data access

Publications (2)

Publication Number Publication Date
CN104408058A CN104408058A (en) 2015-03-11
CN104408058B true CN104408058B (en) 2019-11-05

Family

ID=52645690

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410594200.4A Active CN104408058B (en) 2014-10-29 2014-10-29 A kind of method and device of data access

Country Status (1)

Country Link
CN (1) CN104408058B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107341163B (en) * 2016-05-03 2020-08-14 阿里巴巴集团控股有限公司 Data synchronization method and device
CN109491830A (en) * 2017-09-12 2019-03-19 北京京东尚科信息技术有限公司 The method and system in switch data source
CN108959940B (en) * 2018-06-19 2024-01-19 杭州网易数之帆科技有限公司 Data access control method, medium, device and computing equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102779132A (en) * 2011-05-12 2012-11-14 阿里巴巴集团控股有限公司 Data updating method, system and database server
CN103714163A (en) * 2013-12-30 2014-04-09 中国科学院信息工程研究所 Pattern management method and system of NoSQL database

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9953099B2 (en) * 2010-12-17 2018-04-24 Dst Health Solutions, Llc Repackageable virtualized transparent access to heterogeneous data sources
CN103106200B (en) * 2011-11-09 2017-08-01 上海盛大网络发展有限公司 Non-relational database synchronization system and double write synchronous method
CN103647829B (en) * 2013-12-11 2017-04-05 北京荣之联科技股份有限公司 A kind of cloud disc file sychronisation and method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102779132A (en) * 2011-05-12 2012-11-14 阿里巴巴集团控股有限公司 Data updating method, system and database server
CN103714163A (en) * 2013-12-30 2014-04-09 中国科学院信息工程研究所 Pattern management method and system of NoSQL database

Also Published As

Publication number Publication date
CN104408058A (en) 2015-03-11

Similar Documents

Publication Publication Date Title
US9372908B2 (en) Merging an out of synchronization indicator and a change recording indicator in response to a failure in consistency group formation
EP3477914B1 (en) Data recovery method and device, and cloud storage system
CN102611745B (en) On-line file moving method, device and system
CN104156361B (en) A kind of method and system for realizing data syn-chronization
CN105843702B (en) A kind of method and device for data backup
US9251230B2 (en) Exchanging locations of an out of synchronization indicator and a change recording indicator via pointers
CN103595807B (en) A kind of data synchronization updating method and device
US10747776B2 (en) Replication control using eventually consistent meta-data
CN110532123B (en) Fault transfer method and device of HBase system
US20090007136A1 (en) Time management control method for computer system, and computer system
CN104750755B (en) A kind of data covering method and system after database active-standby switch
CN104408058B (en) A kind of method and device of data access
CN107451172A (en) Method of data synchronization and equipment for edition management system
CN103970834A (en) Recovery method for incremental data synchronization fault in isomerous database synchronizing system
CN106293846A (en) The upgrade method of analog processor and device
CN112131196A (en) Distributed log processing method and device, terminal equipment and storage medium
CN105607968B (en) A kind of incremental backup method and equipment
CN105354102B (en) A kind of method and apparatus of file system maintenance and reparation
CN105760251B (en) A kind of method and apparatus of Backup Data
CN109343863B (en) Interface configuration method and system for HDFS (Hadoop distributed File System) permission
CN106682021A (en) Database migration method and device
US20160170869A9 (en) Systems and methods for in-place reorganization of device storage
CN103985053A (en) Time zone conversion method and device in bank transaction system
CN104636086A (en) HA storage device and HA state managing method
CN109976944B (en) Data processing method and system, storage medium and electronic 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
GR01 Patent grant
GR01 Patent grant