CN110162428A - Method of data synchronization and device, electronic equipment and computer readable storage medium - Google Patents
Method of data synchronization and device, electronic equipment and computer readable storage medium Download PDFInfo
- Publication number
- CN110162428A CN110162428A CN201910414686.1A CN201910414686A CN110162428A CN 110162428 A CN110162428 A CN 110162428A CN 201910414686 A CN201910414686 A CN 201910414686A CN 110162428 A CN110162428 A CN 110162428A
- Authority
- CN
- China
- Prior art keywords
- database
- standby
- current
- current database
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1458—Management of the backup or restore process
-
- 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/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- 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/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
- G06F16/275—Synchronous replication
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2201/00—Indexing scheme relating to error detection, to error correction, and to monitoring
- G06F2201/80—Database-specific techniques
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Data Mining & Analysis (AREA)
- Quality & Reliability (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention proposes a kind of method of data synchronization and devices, electronic equipment and computer readable storage medium, wherein this method comprises: obtaining the working condition of current database;According to the working condition of the current database, determine whether the current database breaks down;In the case where the current database breaks down, target standby database is elected from several standby databases;Standby database is set by the current database, and sets new current database for the target standby database;Database synchronization copy services and external copy services are created for the new current database.Technical solution of the present invention, so that the service application of Railway Passenger Ticket System is not influenced completely by the database failure that backstage occurs, the user experience is improved, simultaneously, the data net synchronization capability for realizing entire Information-based Railway system maintains the stability and safety of entire Information-based Railway system.
Description
[technical field]
The present invention relates to field of computer technology more particularly to a kind of method of data synchronization and device, electronic equipment and meter
Calculation machine readable storage medium storing program for executing.
[background technique]
As what the development of railway construction and rail service were reformed gos deep into, Information-based Railway is used widely, with
The operation of the systems such as 12306, Chinese Railway informationization technology have been introduced into the forward position neck of technology as Chinese high-speed rail technology
Domain.
Wherein, Railway Passenger Ticket System and optimized based on PostgreSQL and customized and form the database of autonomy-oriented,
PostgreSQL is a free Object-relational Database server (data base management system), it is provided with respect to other
Another selection except open source code Database Systems and proprietary system.Due to catering system, integrating system, face service
Multiple systematic differences such as system, two-dimentional code service system, back-up system all rely on the database of Railway Passenger Ticket System, because
This, the database of Railway Passenger Ticket System it is available whether be related to the normal operation of entire Information-based Railway system.
However, the database of Railway Passenger Ticket System can also encounter hardware fault, data file lacks as other databases
The failures such as mistake, once these failures occur, the database of Railway Passenger Ticket System is just become unavailable, and in turn, relies on this database
A large amount of other systems such as catering system, integrating system can not resynchronize the data for getting this database, to influence whole
The data validity and normal operation of a Information-based Railway system.
Therefore, how Railway Passenger Ticket System occur database failure when ensure that the data of entire Information-based Railway system have
Effect property, becomes a technical problem to be solved urgently.
[summary of the invention]
The embodiment of the invention provides a kind of method of data synchronization and devices, electronic equipment and computer-readable storage medium
Matter, it is intended to solve to influence the number in entire Information-based Railway system because of the database failure of Railway Passenger Ticket System in the related technology
It in real time can be Railway Passenger Ticket System in the case where the database of Railway Passenger Ticket System breaks down according to synchronous technical problem
Cut-in stand-by database, and data replication service is established for standby database.
In a first aspect, the embodiment of the invention provides a kind of method of data synchronization, comprising: obtain the work of current database
State;According to the working condition of the current database, determine whether the current database breaks down;In the current number
In the case where breaking down according to library, target standby database is elected from several standby databases;By the current database
It is set as standby database, and sets new current database for the target standby database;It is described new current
Database creates database synchronization copy services and external copy services.
In the above embodiment of the present invention, optionally, in the case where the current database breaks down, it is described from
Before the step of electing target standby database in several standby databases, further includes: carry out weight to the current database
It opens;Judge whether the current database restarts success, wherein in the case where the current database does not restart successful situation, into
Enter described the step of target standby database is elected from several standby databases.
It is optionally, described to set standby database for the current database in the above embodiment of the present invention, and
The step of setting new current database for the target standby database, specifically includes: by the number of the current database
Standby node is set as according to transmission node;Host node is set by the data transmission nodal of the target standby database, with number
According to library access middleware connection, to receive the database access request from the Database-access Middleware Based.
It is optionally, described to be answered for the new current database creation database synchronization in the above embodiment of the present invention
It the step of uniform business and external copy services, specifically includes: the database synchronization copy services and the external duplication is taken
Business switches to the corresponding host node of the new current database.
In the above embodiment of the present invention, optionally, further includes: setting described new for the target standby database
Current database when, from several standby databases access middleware in selection target Database-access Middleware Based;It will be described
Target database access middleware is connected to the host node of the new current database, for the new current data
Library accesses middleware by the target database and receives the database access request.
Second aspect, the embodiment of the invention provides a kind of data synchronization units, comprising: working condition acquiring unit is used
In the working condition for obtaining current database;Fault detection unit is determined for the working condition according to the current database
Whether the current database breaks down;Database elects unit, for the case where the current database breaks down
Under, target standby database is elected from several standby databases;Database switch unit is used for the current database
It is set as standby database, and sets new current database for the target standby database;Copy services switching is single
Member, for creating database synchronization copy services and external copy services for the new current database.
In the above embodiment of the present invention, optionally, in the case where the current database breaks down, further includes:
Database restarts unit, is used for before database election unit elects the target standby database, to described current
Database is restarted;Judging unit, for judging whether the current database restarts success, wherein in the current number
Do not restart in successful situation according to library, is elected described in unit elects from several described standby databases by the database
Target standby database.
In the above embodiment of the present invention, optionally, the database switch unit is used for: by the current database
Data transmission nodal is set as standby node, and, it will save based on the setting of the data transmission nodal of the target standby database
Point, connect with Database-access Middleware Based, to receive the database access request from the Database-access Middleware Based.
In the above embodiment of the present invention, optionally, the copy services switch unit is specifically used for: by the database
Synchronous copy services and the external copy services switch to the corresponding host node of the new current database.
In the above embodiment of the present invention, optionally, further includes: middleware selecting unit, for the target is standby
When being set as the new current database with database, the selection target data from several standby databases access middleware
Library accesses middleware;Middleware switch unit, it is described new current for target database access middleware to be connected to
The host node of database, so that the new current database is accessed described in middleware reception by the target database
Database access request.
The third aspect, the embodiment of the invention provides a kind of electronic equipment, comprising: at least one processor;And with institute
State the memory of at least one processor communication connection;Wherein, be stored with can be by least one described processor for the memory
The instruction of execution, described instruction are arranged to be used for executing method described in any one of above-mentioned first aspect.
Fourth aspect, the embodiment of the invention provides a kind of computer readable storage mediums, and it is executable to be stored with computer
Instruction, the computer executable instructions are for executing method flow described in any one of above-mentioned first aspect.
Above technical scheme is believed for entire railway is influenced because of the database failure of Railway Passenger Ticket System in the related technology
The technical problem that data in breathization system synchronize, can be according to the database (hereinafter referred to as current database) of Railway Passenger Ticket System
Working condition, to judge whether it breaks down, working condition includes hardware running information, priority assignation information, data
Document change etc. is likely occurred corresponding failure, such as hardware damage if the working condition of current database is abnormal
Bad, access authority is tampered with data missing documents etc..
Trouble-free operation is remained to when database failure occurs for Railway Passenger Ticket System, several settable standby databases,
And copy services are established between current database and several standby databases, so that current database and several spare numbers
It is synchronous according to library data.Therefore, when detecting that current database occurs hardware damage, access authority and be tampered and data missing documents
When etc. the failure for causing current database can not work normally, a mesh can be selected in several existing standby databases
Mark standby database, the replacer as current database.In other words, set new current for the target standby database
Database, and standby database is set by former current database.
So, the switching of database has been carried out while breaking down, due to standby database and former current number
According to library, data are synchronous always, after database switching occurs, target standby database i.e. new current database with do not send out
The data of former current database before raw failure are completely the same, therefore do not influence the operation of Railway Passenger Ticket System, and make railway passenger
The service application of bill system is not influenced completely by the database failure that backstage occurs, i.e., switches unaware to database.
In addition, needing after the switching for completing database for new current database creation and several standby databases
Database synchronization copy services and external copy services.After new current database enters operating status, still need to data
Situations such as variation, is synchronized in corresponding standby database, to guarantee the data one of new current database and standby database
Cause property, so as to still be able to switch to the fully synchronized preliminary data of data when new current database breaks down in real time
Library.And establish external copy services, then for continuing to be synchronized to situations such as data variation in entire Information-based Railway system
In the other systems such as interior catering system, integrating system, the data net synchronization capability of entire Information-based Railway system ensure that, tie up
The stability and safety of entire Information-based Railway system are protected.
By above technical scheme, spare number can be switched in real time when the database of Railway Passenger Ticket System breaks down
User is improved so that the service application of Railway Passenger Ticket System is not influenced completely by the database failure that backstage occurs according to library
Experience, simultaneously, additionally it is possible to database switching while for new current database establish database synchronization copy services and
External copy services, situations such as ensure that data variation be synchronized to standby database for coping with database failure and with
In the other systems such as catering system, integrating system in entire Information-based Railway system, entire Information-based Railway system is realized
The data net synchronization capability of system maintains the stability and safety of entire Information-based Railway system.
[Detailed description of the invention]
In order to illustrate the technical solution of the embodiments of the present invention more clearly, below will be to needed in the embodiment attached
Figure is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, for this field
For those of ordinary skill, without creative efforts, it can also be obtained according to these attached drawings other attached drawings.
Fig. 1 shows the flow chart of the method for data synchronization of one embodiment of the present of invention;
Fig. 2 shows the flow charts of the method for data synchronization of another embodiment of the invention;
Fig. 3 shows the block diagram of the data synchronization unit of one embodiment of the present of invention;
Fig. 4 shows the block diagram of the data synchronization unit of another embodiment of the invention;
Fig. 5 shows the block diagram of the electronic equipment of one embodiment of the present of invention.
[specific embodiment]
For a better understanding of the technical solution of the present invention, being retouched in detail to the embodiment of the present invention with reference to the accompanying drawing
It states.
It will be appreciated that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.Base
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts it is all its
Its embodiment, shall fall within the protection scope of the present invention.
The term used in embodiments of the present invention is only to be not intended to be limiting merely for for the purpose of describing particular embodiments
The present invention.In the embodiment of the present invention and the "an" of singular used in the attached claims, " described " and "the"
It is also intended to including most forms, unless the context clearly indicates other meaning.
Fig. 1 shows the flow chart of the method for data synchronization of one embodiment of the present of invention.
As shown in Figure 1, the process of the method for data synchronization of one embodiment of the present of invention includes:
Step 102, the working condition of current database is obtained.
Step 104, according to the working condition of the current database, determine whether the current database breaks down.
For being influenced in entire Information-based Railway system because of the database failure of Railway Passenger Ticket System in the related technology
The synchronous technical problem of data, can according to the working condition of the database (hereinafter referred to as current database) of Railway Passenger Ticket System,
Judging whether it breaks down, working condition includes hardware running information, priority assignation information, data file change etc.,
If the working condition of current database is abnormal, it is likely occurred corresponding failure, such as hardware damage, access authority quilt
Distort with data missing documents etc..
Step 106, in the case where the current database breaks down, target is elected from several standby databases
Standby database.
Multiple databases that Railway Passenger Ticket System has data synchronous first can be more in Railway Passenger Ticket System starting
Random one database of vote by ballot makees other remaining databases of multiple databases as current database in a database
For standby database.And this is elected, then is that random vote is looked in all standby databases other than current database
Mark standby database, as the replacement person of current database, business that adapter tube current database is currently running.
Step 108, standby database is set by the current database, and by the target preliminary data lab setting
For new current database.
Trouble-free operation is remained to when database failure occurs for Railway Passenger Ticket System, several settable standby databases,
And copy services are established between current database and several standby databases, so that current database and several spare numbers
It is synchronous according to library data.Therefore, when detecting that current database occurs hardware damage, access authority and be tampered and data missing documents
When etc. the failure for causing current database can not work normally, a mesh can be selected in several existing standby databases
Mark standby database, the replacer as current database.In other words, set new current for the target standby database
Database, and standby database is set by former current database.
So, the switching of database has been carried out while breaking down, due to standby database and former current number
According to library, data are synchronous always, after database switching occurs, target standby database i.e. new current database with do not send out
The data of former current database before raw failure are completely the same, therefore do not influence the operation of Railway Passenger Ticket System, and make railway passenger
The service application of bill system is not influenced completely by the database failure that backstage occurs, i.e., switches unaware to database.
Step 110, database synchronization copy services and external copy services are created for the new current database.
In addition, needing after the switching for completing database for new current database creation and several standby databases
Database synchronization copy services and external copy services.After new current database enters operating status, still need to data
Situations such as variation, is synchronized in corresponding standby database, to guarantee the data one of new current database and standby database
Cause property, so as to still be able to switch to the fully synchronized preliminary data of data when new current database breaks down in real time
Library.And establish external copy services, then for continuing to be synchronized to situations such as data variation in entire Information-based Railway system
In the other systems such as interior catering system, integrating system, the data net synchronization capability of entire Information-based Railway system ensure that, tie up
The stability and safety of entire Information-based Railway system are protected.
By above technical scheme, spare number can be switched in real time when the database of Railway Passenger Ticket System breaks down
User is improved so that the service application of Railway Passenger Ticket System is not influenced completely by the database failure that backstage occurs according to library
Experience, simultaneously, additionally it is possible to database switching while for new current database establish database synchronization copy services and
External copy services, situations such as ensure that data variation be synchronized to standby database for coping with database failure and with
In the other systems such as catering system, integrating system in entire Information-based Railway system, entire Information-based Railway system is realized
The data net synchronization capability of system maintains the stability and safety of entire Information-based Railway system.
Fig. 2 shows the flow charts of the method for data synchronization of another embodiment of the invention.
As shown in Fig. 2, the process of the method for data synchronization of another embodiment of the invention includes:
Step 202, the working condition of current database is obtained.
Step 204, according to the working condition of the current database, determine whether the current database breaks down.
The working condition of current database includes hardware running information, priority assignation information, data file change etc., if working as
The working condition of preceding database is abnormal, then is likely occurred corresponding failure, for example hardware damage, access authority are tampered
With data missing documents etc..
Step 206, the current database is restarted.
Step 208, judge whether the current database restarts success, when judging result be the current database not
Restart in successful situation, enter step 210, when judging result is the knot in the case where the current database restarts successful situation
Shu Jincheng.
When current database breaks down even delay machine, first attempt to restart pull-up current database, if current data
Library can restart success, enter normal operating condition once again, then can continue to use current database.Conversely, if current database
Success is not restarted, then illustrating current database really can not continue to work normally, at this point, carrying out the step of database switching again
Suddenly.Need to know, restart and judge to restart the time consumed by successful step it is extremely short, to Railway Passenger Ticket System or even entire
The influence of the operation of Information-based Railway system can be ignored.
Step 210, target standby database is elected from several standby databases.
Multiple databases that Railway Passenger Ticket System has data synchronous first can be more in Railway Passenger Ticket System starting
Random one database of vote by ballot makees other remaining databases of multiple databases as current database in a database
For standby database.And this is elected, then is that random vote is looked in all standby databases other than current database
Mark standby database, as the replacement person of current database, business that adapter tube current database is currently running.
Step 212, standby node is set by the data transmission nodal of the current database, by the spare number of the target
It is set as host node according to the data transmission nodal in library, is connect with Database-access Middleware Based, is visited with receiving from the database
Ask the database access request of middleware.
Multiple databases that Railway Passenger Ticket System has data synchronous, each database have a data access section
Point, service application request access the data access node of a database by Database-access Middleware Based to realize to the data
The access in library.And the data access node of current database is the addressable host node of all service applications requests, and it is spare
The data access node of database is standby node.Therefore, target standby database is being switched over current database
Afterwards, the identity of the two node is also required to switch, therefore needs to set standby node for the data transmission nodal of former current database,
Host node is set by the data transmission nodal of target standby database again, is passed through in database access to service application request
Between part access to new host node.
Step 214, the database synchronization copy services and the external copy services are switched to described new current
The corresponding host node of database.
After the switching for completing database, the data for new current database creation and several standby databases are needed
The synchronous copy services in library and external copy services, in other words, as the database synchronization of the node of former current data is answered
Uniform business and external copy services, are switched to the corresponding host node of new current database and are executed.
After new current database enters operating status, still need to situations such as data variation being synchronized to corresponding preliminary data
In library, to guarantee the data consistency of new current database and standby database, so as in new current database hair
It still is able to switch to the fully synchronized standby database of data in real time when raw failure.And establish external copy services, then for after
It is continuous that situations such as data variation is synchronized to other systems such as catering system, integrating systems in entire Information-based Railway system
In, it ensure that the data net synchronization capability of entire Information-based Railway system, maintain the stability of entire Information-based Railway system
With safety.
Fig. 3 shows the block diagram of the data synchronization unit of one embodiment of the present of invention.
As shown in figure 3, the data synchronization unit 300 of one embodiment of the present of invention includes: primary database 302, spare number
According to library 304, Database-access Middleware Based 306, standby database access middleware 308, database positioning monitoring modular 310, number
According to library switching module 312 and election module 314.
In system starting, data synchronization unit 300 is started to work, and election module 314 elects in all databases
The data transmission nodal of primary database 302 is as host node, by the standby database other than primary database 302 in all databases
304 data transmission nodal is used as from node.
After electing successfully, Database-access Middleware Based 306 is connected to the host node of primary database 302, to realize that business is answered
Pass through access of the Database-access Middleware Based 306 to primary database 302 with request.Meanwhile creating host node and between node
Database synchronization copy services, guarantee primary database 302 and standby database 304 data consistency.If used externally
If duplication, at this time, it is also desirable to create the external copy services of host node.
Database positioning monitoring modular 310 is monitored the working condition of primary database 302, when database positioning monitors
Module 310 monitors that primary database 302 breaks down or when delay machine, system can first attempt to restart and pull-up primary database
302。
Fail if restarting with pull-up primary database 302, monitoring result is sent to database switching module 312 and election
Module 314 elects module 314 to re-elect out target in several standby databases 304 according to the monitoring result received
Standby database, database switching module 312 then set new main section for the data transmission nodal of the target standby database
Point, and Database-access Middleware Based 306 is connected to new host node.
In addition, database switching module 312 can also pass for the data of new host node to other remaining standby databases 304
Defeated node establishes database synchronization copy services, if new host node is inactive, synchronous copy services is temporarily changed to different
Copy services are walked, until new host node starting, to preferentially ensure the availability of database node.Certainly, database
Switching module 312 can also establish external copy services for new host node, with realize new host node to external equipment data
It is synchronous.
You need to add is that in the case of database access failure, in addition to database failure or delay machine, it is also possible to be
Failure has occurred in Database-access Middleware Based 306, for the failure for excluding Database-access Middleware Based 306, effectively realizes that data are same
Currently used Database-access Middleware Based 306 can be switched to standby database and visited by step duplication while switch data library
It asks middleware 308, further ensures the stability of the synchronous duplication of data.
Above-mentioned technical proposal can switch in real time preliminary data when the database of Railway Passenger Ticket System breaks down
Library improves user's body so that the service application of Railway Passenger Ticket System is not influenced completely by the database failure that backstage occurs
It tests, simultaneously, additionally it is possible to establish database synchronization copy services and right while database switching for new current database
Outer copy services, situations such as ensure that data variation, are synchronized to standby database for coping with database failure and with whole
In the other systems such as catering system, integrating system in a Information-based Railway system, entire Information-based Railway system is realized
Data net synchronization capability, maintain the stability and safety of entire Information-based Railway system.
Fig. 4 shows the block diagram of the data synchronization unit of another embodiment of the invention.
As shown in figure 4, the data synchronization unit 400 of another embodiment of the invention, comprising: working condition acquiring unit
402, for obtaining the working condition of current database;Fault detection unit 404, for the work according to the current database
State, determines whether the current database breaks down;Database elects unit 406, for sending out in the current database
In the case where raw failure, target standby database is elected from several standby databases;Database switch unit 408, is used for
Standby database is set by the current database, and sets new current data for the target standby database
Library;Copy services switch unit 410, for creating database synchronization copy services for the new current database and externally answering
Uniform business.
Therefore the data synchronization unit 400 is had using scheme described in any one of embodiment shown in Fig. 1 to Fig. 3
Above-mentioned all technical effects, details are not described herein.Data synchronization unit 400 also has following technical characteristic:
In the above embodiment of the present invention, optionally, in the case where the current database breaks down, further includes:
Database restarts unit, for working as before database election unit 406 elects the target standby database to described
Preceding database is restarted;Judging unit, for judging whether the current database restarts success, wherein described current
Database is not restarted in successful situation, elects unit to elect institute from several described standby databases by the database
State target standby database.
In the above embodiment of the present invention, optionally, the database switch unit 408 is used for: by the current data
The data transmission nodal in library is set as standby node, and, it sets the data transmission nodal of the target standby database to
Host node is connect with Database-access Middleware Based, to receive the database access request from the Database-access Middleware Based.
In the above embodiment of the present invention, optionally, the copy services switch unit 410 is specifically used for: by the number
The corresponding host node of the new current database is switched to according to the synchronous copy services in library and the external copy services.
In the above embodiment of the present invention, optionally, further includes: middleware selecting unit, for the target is standby
When being set as the new current database with database, the selection target data from several standby databases access middleware
Library accesses middleware;Middleware switch unit, it is described new current for target database access middleware to be connected to
The host node of database, so that the new current database is accessed described in middleware reception by the target database
Database access request.
Fig. 5 shows the block diagram of the electronic equipment of one embodiment of the present of invention.
As shown in figure 5, the electronic equipment 500 of one embodiment of the present of invention, including at least one processor 502;And
With the processor 504 of at least one processor 502 communication connection;Wherein, the memory be stored with can by it is described at least
The instruction that one processor 504 executes, described instruction are arranged to be used for executing above-mentioned Fig. 1 to any one of Fig. 3 embodiment institute
The scheme stated.Therefore, which has and Fig. 1 is to the identical technical effect of any one of Fig. 3 embodiment, herein not
It repeats again.
The electronic equipment of the embodiment of the present invention exists in a variety of forms, including but not limited to:
(1) mobile communication equipment: the characteristics of this kind of equipment is that have mobile communication function, and to provide speech, data
Communication is main target.This Terminal Type includes: smart phone (such as iPhone), multimedia handset, functional mobile phone and low
Hold mobile phone etc..
(2) super mobile personal computer equipment: this kind of equipment belongs to the scope of personal computer, there is calculating and processing function
Can, generally also have mobile Internet access characteristic.This Terminal Type includes: PDA, MID and UMPC equipment etc., such as iPad.
(3) portable entertainment device: this kind of equipment can show and play multimedia content.Such equipment include: audio,
Video player (such as iPod), handheld device, e-book and intelligent toy and portable car-mounted navigation equipment.
(4) server: providing the equipment of the service of calculating, and the composition of server includes that processor, hard disk, memory, system are total
Line etc., server is similar with general computer architecture, but due to needing to provide highly reliable service, in processing energy
Power, stability, reliability, safety, scalability, manageability etc. are more demanding.
(5) other electronic devices with data interaction function.
In addition, computer executable instructions are stored with the embodiment of the invention provides a kind of computer readable storage medium,
The computer executable instructions are used to execute above-mentioned Fig. 1 to the method flow described in any one of Fig. 3 embodiment.
The technical scheme of the present invention has been explained in detail above with reference to the attached drawings, according to the technical solution of the present invention, can be in iron
The database of road Ticketing and Reservation System switches to standby database when breaking down in real time, so that the service application of Railway Passenger Ticket System is complete
It is not influenced entirely by the database failure that backstage occurs, the user experience is improved, simultaneously, additionally it is possible to while database switching
Situations such as establishing database synchronization copy services and external copy services for new current database, ensure that data variation is same
Walk standby database for coping with database failure and with catering system, the integral in entire Information-based Railway system
In the other systems such as system, the data net synchronization capability of entire Information-based Railway system is realized, entire railway information is maintained
The stability and safety of change system.
It should be appreciated that term "and/or" used herein is only a kind of incidence relation for describing affiliated partner, indicate
There may be three kinds of relationships, for example, A and/or B, can indicate: individualism A, exist simultaneously A and B, individualism B these three
Situation.In addition, character "/" herein, typicallys represent the relationship that forward-backward correlation object is a kind of "or".
Depending on context, word as used in this " if " can be construed to " ... when " or " when ...
When " or " in response to determination " or " in response to detection ".Similarly, depend on context, phrase " if it is determined that " or " if detection
(condition or event of statement) " can be construed to " when determining " or " in response to determination " or " when the detection (condition of statement
Or event) when " or " in response to detection (condition or event of statement) ".
In several embodiments provided by the present invention, it should be understood that disclosed systems, devices and methods, it can be with
It realizes by another way.For example, the apparatus embodiments described above are merely exemplary, for example, the unit
It divides, only a kind of logical function partition, there may be another division manner in actual implementation, for example, multiple units or group
Part can be combined or can be integrated into another system, or some features can be ignored or not executed.Another point, it is shown
Or the mutual coupling, direct-coupling or communication connection discussed can be through some interfaces, device or unit it is indirect
Coupling or communication connection can be electrical property, mechanical or other forms.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit
It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list
Member both can take the form of hardware realization, can also realize in the form of hardware adds SFU software functional unit.
The above-mentioned integrated unit being realized in the form of SFU software functional unit can store and computer-readable deposit at one
In storage media.Above-mentioned SFU software functional unit is stored in a storage medium, including some instructions are used so that a computer
It is each that device (can be personal computer, server or network equipment etc.) or processor (Processor) execute the present invention
The part steps of embodiment the method.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (Read-
Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic or disk etc. it is various
It can store the medium of program code.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all in essence of the invention
Within mind and principle, any modification, equivalent substitution, improvement and etc. done be should be included within the scope of the present invention.
Claims (10)
1. a kind of method of data synchronization characterized by comprising
Obtain the working condition of current database;
According to the working condition of the current database, determine whether the current database breaks down;
In the case where the current database breaks down, target standby database is elected from several standby databases;
Standby database is set by the current database, and sets new current number for the target standby database
According to library;
Database synchronization copy services and external copy services are created for the new current database.
2. method of data synchronization according to claim 1, which is characterized in that in the feelings that the current database breaks down
Under condition, described before the step of electing target standby database in several standby databases, further includes:
The current database is restarted;
Judge whether the current database restarts success, wherein in the case where the current database does not restart successful situation, into
Enter described the step of target standby database is elected from several standby databases.
3. method of data synchronization according to claim 1 or 2, which is characterized in that described by the current data lab setting
For standby database, and the step of setting new current database for the target standby database, specifically include:
Standby node is set by the data transmission nodal of the current database;
Host node is set by the data transmission nodal of the target standby database, is connect with Database-access Middleware Based, with
Receive the database access request from the Database-access Middleware Based.
4. method of data synchronization according to claim 3, which is characterized in that described for the new current database creation
It the step of database synchronization copy services and external copy services, specifically includes:
It is corresponding that the database synchronization copy services and the external copy services are switched into the new current database
The host node.
5. method of data synchronization according to claim 3, which is characterized in that further include:
When setting the new current database for the target standby database, from the access of several standby databases
Between selection target Database-access Middleware Based in part;
Target database access middleware is connected to the host node of the new current database, for described new
Current database pass through the target database and access middleware and receive the database access request.
6. a kind of data synchronization unit characterized by comprising
Working condition acquiring unit, for obtaining the working condition of current database;
Fault detection unit determines whether the current database occurs for the working condition according to the current database
Failure;
Database elects unit, in the case where the current database breaks down, from several standby databases
Elect target standby database;
Database switch unit, for setting standby database for the current database, and by the spare number of the target
It is new current database according to lab setting;
Copy services switch unit, for creating database synchronization copy services and externally duplication for the new current database
Service.
7. data synchronization unit according to claim 6, which is characterized in that in the feelings that the current database breaks down
Under condition, further includes:
Database restarts unit, is used for before database election unit elects the target standby database, to described
Current database is restarted;
Judging unit, for judging whether the current database restarts success, wherein do not restart into the current database
In the case where function, unit is elected to elect the target preliminary data from several described standby databases by the database
Library.
8. data synchronization unit according to claim 6 or 7, which is characterized in that the database switch unit is used for:
Standby node is set by the data transmission nodal of the current database, and, by the target standby database
Data transmission nodal is set as host node, connect with Database-access Middleware Based, to receive among the database access
The database access request of part.
9. a kind of electronic equipment characterized by comprising at least one processor;And it is logical at least one described processor
Believe the memory of connection;
Wherein, the memory is stored with the instruction that can be executed by least one described processor, and described instruction is arranged to use
Method described in any one of execution the claims 1 to 5.
10. a kind of computer readable storage medium, which is characterized in that be stored with computer executable instructions, the computer can
It executes instruction for executing the method flow as described in any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910414686.1A CN110162428A (en) | 2019-05-17 | 2019-05-17 | Method of data synchronization and device, electronic equipment and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910414686.1A CN110162428A (en) | 2019-05-17 | 2019-05-17 | Method of data synchronization and device, electronic equipment and computer readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110162428A true CN110162428A (en) | 2019-08-23 |
Family
ID=67631240
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910414686.1A Pending CN110162428A (en) | 2019-05-17 | 2019-05-17 | Method of data synchronization and device, electronic equipment and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110162428A (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110955647A (en) * | 2019-12-04 | 2020-04-03 | 世纪龙信息网络有限责任公司 | Database assistance method, database assistance device, computer equipment and storage medium |
CN111200532A (en) * | 2020-01-02 | 2020-05-26 | 广州虎牙科技有限公司 | Method, device, equipment and medium for master-slave switching of database cluster node |
CN111291021A (en) * | 2020-01-21 | 2020-06-16 | 北京奇艺世纪科技有限公司 | Database management method and device, electronic equipment and storage medium |
CN111552637A (en) * | 2020-04-20 | 2020-08-18 | 北京顺达同行科技有限公司 | Database state detection method and device, electronic equipment and storage medium thereof |
CN112256707A (en) * | 2020-12-18 | 2021-01-22 | 上海爱可生信息技术股份有限公司 | Flow management method of database middleware and database middleware node |
CN114020357A (en) * | 2021-11-04 | 2022-02-08 | 湖北美和易思教育科技有限公司 | Method, device, system and medium for starting namenode node |
CN114520809A (en) * | 2022-03-04 | 2022-05-20 | 浪潮云信息技术股份公司 | Method and device for realizing load balancing of back-end request |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101183377A (en) * | 2007-12-10 | 2008-05-21 | 华中科技大学 | High availability data-base cluster based on message middleware |
US7440977B2 (en) * | 2005-05-11 | 2008-10-21 | Inha-Industry Partnership Institute | Recovery method using extendible hashing-based cluster logs in shared-nothing spatial database cluster |
US9110851B2 (en) * | 2011-09-29 | 2015-08-18 | Oracle International Corporation | System and method for persisting transaction records in a transactional middleware machine environment |
CN105224637A (en) * | 2015-09-24 | 2016-01-06 | 珠海许继芝电网自动化有限公司 | A kind of based on PostgreSQL database active and standby/the comprehensive method of cluster application |
CN106130763A (en) * | 2016-06-24 | 2016-11-16 | 平安科技(深圳)有限公司 | Server cluster and be applicable to the database resource group method for handover control of this cluster |
CN106156318A (en) * | 2016-07-05 | 2016-11-23 | 武汉斗鱼网络科技有限公司 | A kind of system and method realizing multinode data base's High Availabitity |
CN106301938A (en) * | 2016-08-25 | 2017-01-04 | 成都索贝数码科技股份有限公司 | A kind of high availability and the data base cluster system of strong consistency and node administration method thereof |
CN109471759A (en) * | 2018-11-21 | 2019-03-15 | 北京谷数科技有限公司 | A kind of database failure switching method and equipment based on SAS dual control equipment |
-
2019
- 2019-05-17 CN CN201910414686.1A patent/CN110162428A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7440977B2 (en) * | 2005-05-11 | 2008-10-21 | Inha-Industry Partnership Institute | Recovery method using extendible hashing-based cluster logs in shared-nothing spatial database cluster |
CN101183377A (en) * | 2007-12-10 | 2008-05-21 | 华中科技大学 | High availability data-base cluster based on message middleware |
US9110851B2 (en) * | 2011-09-29 | 2015-08-18 | Oracle International Corporation | System and method for persisting transaction records in a transactional middleware machine environment |
CN105224637A (en) * | 2015-09-24 | 2016-01-06 | 珠海许继芝电网自动化有限公司 | A kind of based on PostgreSQL database active and standby/the comprehensive method of cluster application |
CN106130763A (en) * | 2016-06-24 | 2016-11-16 | 平安科技(深圳)有限公司 | Server cluster and be applicable to the database resource group method for handover control of this cluster |
CN106156318A (en) * | 2016-07-05 | 2016-11-23 | 武汉斗鱼网络科技有限公司 | A kind of system and method realizing multinode data base's High Availabitity |
CN106301938A (en) * | 2016-08-25 | 2017-01-04 | 成都索贝数码科技股份有限公司 | A kind of high availability and the data base cluster system of strong consistency and node administration method thereof |
CN109471759A (en) * | 2018-11-21 | 2019-03-15 | 北京谷数科技有限公司 | A kind of database failure switching method and equipment based on SAS dual control equipment |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110955647A (en) * | 2019-12-04 | 2020-04-03 | 世纪龙信息网络有限责任公司 | Database assistance method, database assistance device, computer equipment and storage medium |
CN111200532A (en) * | 2020-01-02 | 2020-05-26 | 广州虎牙科技有限公司 | Method, device, equipment and medium for master-slave switching of database cluster node |
CN111291021A (en) * | 2020-01-21 | 2020-06-16 | 北京奇艺世纪科技有限公司 | Database management method and device, electronic equipment and storage medium |
CN111291021B (en) * | 2020-01-21 | 2024-04-26 | 北京奇艺世纪科技有限公司 | Database management method and device, electronic equipment and storage medium |
CN111552637A (en) * | 2020-04-20 | 2020-08-18 | 北京顺达同行科技有限公司 | Database state detection method and device, electronic equipment and storage medium thereof |
CN112256707A (en) * | 2020-12-18 | 2021-01-22 | 上海爱可生信息技术股份有限公司 | Flow management method of database middleware and database middleware node |
CN112256707B (en) * | 2020-12-18 | 2021-04-09 | 上海爱可生信息技术股份有限公司 | Flow management method of database middleware and database middleware node |
CN114020357A (en) * | 2021-11-04 | 2022-02-08 | 湖北美和易思教育科技有限公司 | Method, device, system and medium for starting namenode node |
CN114020357B (en) * | 2021-11-04 | 2024-05-03 | 湖北美和易思教育科技有限公司 | Starting method, device, system and medium of naminode node |
CN114520809A (en) * | 2022-03-04 | 2022-05-20 | 浪潮云信息技术股份公司 | Method and device for realizing load balancing of back-end request |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110162428A (en) | Method of data synchronization and device, electronic equipment and computer readable storage medium | |
CN113014634B (en) | Cluster election processing method, device, equipment and storage medium | |
US8131860B1 (en) | Serialization and deserialization | |
CN109743358A (en) | Asynchronous message interface fusing control method, device, computer equipment and storage medium | |
CN113489691B (en) | Network access method, network access device, computer readable medium and electronic equipment | |
EP2723017A1 (en) | Method, apparatus and system for implementing distributed auto-incrementing counting | |
CN113051110A (en) | Cluster switching method, device and equipment | |
CN112291082B (en) | Disaster recovery processing method, terminal and storage medium for machine room | |
CN111459749A (en) | Prometous-based private cloud monitoring method and device, computer equipment and storage medium | |
CN104753987B (en) | A kind of distributed conversation management method and system | |
CN105426213A (en) | Software update method and system | |
CN111240806A (en) | Distributed container mirror image construction scheduling system and method | |
CN110209526A (en) | A kind of accumulation layer synchronization system and storage medium | |
EP4060514A1 (en) | Distributed database system and data disaster backup drilling method | |
CN117076196A (en) | Database disaster recovery management and control method and device | |
CN114598594B (en) | Method, system, medium and equipment for processing application faults under multiple clusters | |
CN116668269A (en) | Arbitration method, device and system for dual-activity data center | |
CN105763944B (en) | Module TV and its screen end upgrade method | |
JP6107159B2 (en) | Database system and database system control method | |
CN116827966B (en) | Data processing method and system | |
CN111416726A (en) | Resource management method, sending end equipment and receiving end equipment | |
CN114915545B (en) | Application scheduling deployment management method based on DHCP network cluster | |
CN112532440B (en) | Super-fusion node expansion method and device, storage medium and electronic equipment | |
CN113568710B (en) | High availability realization method, device and equipment for virtual machine | |
CN103036744A (en) | Method for monitoring multi-machine distributed replicated block device and equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190823 |