Specific embodiment
The embodiment of the present application provides the method and database, application system that a kind of application system loads data.
In order that those skilled in the art more fully understand the technical scheme in the application, below in conjunction with this
Accompanying drawing in application embodiment, is clearly and completely described to the technical scheme in the embodiment of the present application,
Obviously, described embodiment is only some embodiments of the present application, rather than whole embodiments.Base
Embodiment in the application, those of ordinary skill in the art are obtained under the premise of creative work is not made
The every other embodiment for obtaining, should all belong to the scope of the application protection.
The method that a kind of application system of the application introduced below loads data, the step of Fig. 1 shows the method,
As shown in Figure 1:
S110:First application system carries out write operation to MDL, and increased in the MDL
The value of sequence number is carried out into increment operator in sequence number table.
There is provided the access request of extensive region application system could be arranged to the first application system and second should
With system, the 3rd application system etc..Here illustrated by taking the first application system and second system as an example.For
Offer access, each application system needs the data in loading of databases.Usually, database can be set
For cross-region access can not be carried out.So, the first application system typically loads local MDL;Second
Application system typically loads local backup database.Certainly, under some application scenarios, it is also possible to set
Three application systems can access the corresponding backup database of the second application system with cross-region, and the application is not precluded from
Such case.Mainly illustrated as a example by the former below.
As it was previously stated, application system provides the access of thousands of per hour times, can usually occur to database
In data the operation such as read and write.Generally, MDL is read/write database, you can to provide the
The read/write operation that one application system is carried out;Backup database is from MDL synchrodata, and offer second should
With the read operation of system, without providing write operation, with avoid with MDL and other backup databases
Data are inconsistent.
It is when the data in MDL occur write operation, such as right according to the write operation of the first application system
MDL carries out the write-in of data, when updating or the operation such as deleting, it is necessary to by data after operation is completed
It is synchronized to backup database.
In MDL data are carried out with the order of write operation in order to identify, sequence number table can be set, wherein
The sequence number (Seq) of mark write operation can be deposited.Seq in sequence number table can be one or more.
As a example by there is a Seq in sequence number table, in the embodiment of the present application, can be in the first application system to master
After database carries out write operation, the sequence number is carried out into increment operator.For example, the initial value of Seq values is
1000, after certain first application system carries out write operation to master data, the value of the Seq is carried out from increasing
Operation, such as Seq values after increment operator are updated to 1001.
In the sequence number table increased in MDL, it is also possible to multiple sequence numbers are set, are represented respectively
To the write operation of different pieces of information content.So, by sequence in the sequence number table increased in MDL
Number value carry out increment operator, specifically, can be in MDL in increased sequence number table by maximum
The value of value sequence number carries out increment operator.For example, have 3 different sequence numbers in sequence number table, Seq1=1100,
Seq2=1101, Seq3=1102.After certain first application system carries out write operation to master data, by this
The value of the sequence number Seq3 of maximum carries out increment operator, such as Seq3 after increment operator in sequence number table
Value is updated to 1103.Certainly, after certain first application system carries out write operation to master data, it is also possible to
The value of other sequence numbers in the sequence number table is carried out into increment operator, such as the Seq1 values after increment operator are more
Newly for 1101, Seq2 values are updated to 1102.
In addition it is also possible to after being the request that the first application system receives the second application system, to MDL
Carry out write operation.For example, the second application system needs to carry out write operation to database.As it was previously stated, the feelings
Under condition, the local backup database of the second application system is read from database, does not possess write permission.So,
Two application systems can send to the first application system and ask, i.e. request carries out write operation.First application system
After receiving the request of the second application system transmission, write operation further can be carried out to MDL.It is described
In request, the particular content that write operation is carried out to database can be typically included.First application system is to main number
The process of write operation is carried out according to storehouse, it is similar, as set forth above, it is possible to be carried out to the Seq values in MDL
Increment operator, repeats no more.
S120:First application system sends a notification message to the second application system, and the notification message includes
Sequence number after the increment operator.
After first application system carries out write operation to MDL, notice can be sent to the second application system and disappeared
Breath, to notify that the second application system updates local backup database.Usually, in addition to the second application system,
The 3rd application system, the 4th application system etc. are there is likely to be, therefore, the first application system can be to other
Application system sends a notification message in a broadcast manner.
First application system can be sent a notification message by message-oriented middleware technology to other application system.
Message-oriented middleware (Message Oriented Middleware, MOM, it is also referred to as message-oriented in
Between part) technology, there is provided a kind of middleware mechanism of message transmission is carried out with the flexi mode of loose couplings.
Fig. 2 shows a kind of schematic diagram that message transmission is carried out using message-oriented middleware technology.As shown in Fig. 2 should
With program A and application program B by using MOM application programming interface (Application
Programming Interface, API) send message communicated.So, MOM can be realized in difference
Communication between platform, it is often used to mask the characteristic between various platforms and agreement, and journey is applied in realization
Collaboration between sequence.The message-oriented middleware product of current main flow includes International Business Machine Corporation (IBM)
The MQSeries of (International Business Machines Corporation, IBM), Bank of East Asia Ltd.
The MessageQ of (Bank of East Asia, BEA) and the Java Message Service of Sun Company, Inc. (Sun)
(Java Message Service, JMS) etc..MOM is included between the application based on storage and forwarding
Asynchronous message transfer or synchronization message are transmitted.In Asynchronous message transfer, the not direct communication each other between,
But with the MOM server communications as intermediary.Asynchronous middleware Technology includes point-to-point mode and hair again
The class of cloth-subscribing manner two.
In Publish-subscribe mode as an example, as shown in Figure 3, utilized using the MOM of publish-subscribe architecture
The content of referred to as theme (topic) carrys out sending and receiving for completion message.Send application program (hereinafter referred to as
Publisher) issue the message of oneself, it is indicated that and message semantic definition is relevant certain topic (generally corresponding to the publisher)
Information.Wish that the application program (hereinafter referred to as subscriber) for receiving these message have subscribed this topic.
The subscriber for subscribing to the topic can receive the message on the theme.MOM servers play the work of agency
With the announced message of theme to be routed to all subscribers of the theme.
In embodiments herein, using MOM technologies, such as Publish-subscribe mode, the first application system
System can be publisher, and the second application system and other application systems can be subscriber.
S130:Second application system receives the notification message, therefrom reads the sequence number from after increasing, and
Notify that local backup database is carried out synchronous with the MDL.
As it was previously stated, the second application system typically reads local backup database.Second application system is received
To after the notification message, can notify that local backup database is carried out synchronous with MDL.It is described
It is synchronous, data syn-chronization and the sequence number table synchronization can be included.
Similar with MDL, the local backup database can increase SYN
(Copy_Seq).The Copy_Seq can identify the synchronous order of the local backup database.For example,
Before this is subsynchronous, the Copy_Seq of the backup database is 1000.Likewise, in local backup number
According to storehouse complete it is synchronous with MDL after, the Seq in MDL can be saved as local
Copy_Seq.For example in the sequence number table of MDL there is a Seq, the Seq values after increment operator
Be updated to 1001, then after backup database completes the data syn-chronization with MDL, can be by MDL
Seq values save as the value of local Copy_Seq, such as Copy_Seq=1001 after preservation.
Receive the second application system (and the 3rd application system, the 4th application system of the notification message
Deng), the sequence number from after increasing in the notification message, for example, Seq=1000 can be read.
Similar, the local backup database can increase multiple Copy_Seq, represent respectively to not
With the write operation of data content.For example, there is 3 different synchronizations in the SYN table of backup database
Sequence number, Copy_Seq1=1100, Copy_Seq2=1101, Copy_Seq3=1102.At certain one time
After two application systems receive the notification message, can notify that local backup database is carried out and master data
The synchronization in storehouse.Local backup database carry out it is synchronous with MDL after, MDL can be preserved
In maximum serial number, and as local SYN.The SYN can be existing same
Step sequence number, it is, for example, to cover the existing SYN to preserve operation, such as covering Copy_Seq3, is covered
Copy_Seq3=1103 after lid.In addition it is also possible to be newly-built operation, such as a newly-built Copy_Seq4,
The Copy_Seq4=1103, while the value of Copy_Seq3 can keep constant.
S140:With the presence or absence of the sequence number with the reading in the second application system checking backup database
The SYN of matching;If it does, the second application system loads the data in the backup database.
Second application system can be before the data in loading local well-behaved database, and checking is local standby
With the presence or absence of the SYN with the sequence numbers match of the reading in part database.
As it was previously stated, local backup database can increase multiple Copy_Seq, represent respectively to difference
The write operation of data content.After certain second application system receives the notification message, can notify
Local backup database carries out synchronous with MDL.Local backup database is carried out and MDL
Synchronization after, the sequence number in MDL can be preserved, and as local SYN.So,
In S140, by verifying in Local backup data storehouse with the presence or absence of synchronous with the sequence numbers match of the reading
Sequence number, it can be determined that it is synchronous with MDL whether backup database completes.
As it was previously stated, after the second application system receives the notification message, local backup number can be notified
Carried out according to storehouse synchronous with MDL.And local backup database is synchronized with MDL and typically needed
Will a period of time.Before the time, i.e., before local backup database is synchronous with MDL completion,
Because data not yet complete synchronization, then now second application system loads the number in the backup database
Cannot be loaded successfully according to possibly, it is impossible to which normal Operational Visit is provided;Or add only carried partial data, and
Data after being updated completely without loading, so, can not ensure correct Operational Visit.
Data can be loaded in application system using Service Component.The Service Component has in application system
There is wide application.Service Component is usually a series of functional module including indivisible business activities.
The advantage of Service Component largely possesses two correlations but completely different characteristic from it:First,
Linked by loose coupling method between component, possessed flexibly, the characteristics of response is fast, to be applicable ability strong;
Secondly, the cohesiveness of each activity is strong in component, can externally provide efficiency high, matter measured service.
Second application system loads the data in the backup database, specifically, can be second should
The data in the backup database are loaded with the Service Component in system.
By the above embodiments of the present application, the SYN with the sequence numbers match for reading is judged whether,
May determine that whether backup database is synchronously newest data, so that the second application system is standby
Part database synchronization is the data in newest rear loading backup database, it is ensured that the second application system is loaded
Data it is consistent with the data that the first application system is loaded, that is, ensure the normal operation of business.
After the S140, below step can also be included:
S150:If mismatched, the second application system every preset duration checking it is local whether there is with it is described
The SYN of the sequence numbers match of reading, and the number in the backup database is loaded after verifying presence
According to.
Synchronized in view of backup database and MDL it is synchronous to completion, substantially several ms to number
Hundred milliseconds, therefore, preset duration could be arranged to 5ms or 10ms etc.
So, by judging whether the SYN with the sequence numbers match for reading, it can be determined that standby
Whether part database is synchronously newest data, judged result for it is no be every judging again after certain hour,
And loaded in the presence of the result is, so that the second application system is synchronously in backup database
Data after newest in loading backup database, it is ensured that the data of the second application system loading should with first
Data with system loads are consistent.
A kind of embodiment of the method for updating the data of the application introduced below, such as Fig. 4, it is characterised in that including:
S410:First application system carries out write operation, and the increased sequence in MDL to MDL
The value of sequence number is carried out into increment operator in number table;
S420:First application system sends a notification message to the second application system, and the notification message includes
Sequence number after the increment operator.
The value of sequence number is carried out into increment operator in the sequence number table increased in MDL, including:
The value of maximum serial number is carried out into increment operator in increased sequence number table in MDL.
The main application system sends a notification message to node application system, including:
First application system is sent a notification message by message-oriented middleware to the second application system.
First application system sends a notification message to the second application system, including:
First application system is sent a notification message by message-oriented middleware to the second application system.
A kind of embodiment of the method for application system loading data of the application introduced below, such as Fig. 5, including:
S510:Application system receives notification message, and the sequence after increasing is read from from the notification message of the reception
Row number, and it is synchronous with MDL to notify that local backup database is carried out;
S520:With the presence or absence of the sequence with the reading in the local backup database of the application system checking
Number matching SYN;
S530:If it does, the application system loads the data in the backup database.
The application system loads the data in the backup database, can specifically include:
Service Component in the application system loads the data in the backup database.
Methods described can also include:
If it does not, the application system verifies that local backup database whether there is every preset duration
With the SYN of the sequence numbers match of the reading, and the result presence after load the backup number
According to the data in storehouse.
A kind of application system embodiment of the application introduced below, Fig. 6 shows the module map of the system embodiment,
As illustrated, including:
R/w cell 61, for carrying out write operation to MDL;
Operating unit 62, for carrying out from increasing the value of sequence number in increased sequence number table in MDL
Operation;
Notification unit 63, for being sent a notification message to the second application system, the notification message includes institute
State the sequence number after increment operator.
Preferably, the value of sequence number is carried out increment operator by the operating unit 62 in MDL, bag
Include:Operating unit 62 is carried out certainly the value of maximum serial number in increased sequence number table in MDL
Increase operation.
Preferably, the notification unit 63 is sent a notification message by message-oriented middleware to the second application system.
A kind of application system embodiment of the application introduced below, Fig. 7 shows the mould of the application system embodiment
Block figure, as illustrated, including:
Receiving unit 71, for receiving notification message;
Reading unit 72, for reading from the sequence number after increasing in the notification message of the reception;
Notification unit 73, for notifying that it is synchronous with MDL that local backup database is carried out;
Matching unit 74, for verifying in local backup database with the presence or absence of the sequence number with the reading
The SYN of matching;
Loading unit 75, in the presence of the result of matching unit 94 is, loads the backup database
In data.
Preferably, the loading unit 75 can include the Service Component in the application system.
Preferably, the result of the matching unit 74 be in the absence of when, every preset duration verify this
With the presence or absence of the SYN with the sequence numbers match of the reading in the backup database on ground.
In the nineties in 20th century, it is changing on hardware that can clearly be distinguished for the improvement of a technology
The improvement entered on (for example, the improvement to circuit structures such as diode, transistor, switches) or software is (right
In the improvement of method flow).However, with the development of technology, the improvement of current many method flows is
Through directly improving for hardware circuit can be considered as.Designer is nearly all by by improved method flow
It is programmed into hardware circuit to obtain corresponding hardware circuit.Therefore, it cannot be said that method flow
Improvement cannot be realized with hardware entities module.For example, PLD (Programmable
Logic Device, PLD) (for example field programmable gate array (Field Programmable Gate Array,
FPGA it is exactly)) such a integrated circuit, its logic function is determined by user to device programming.By setting
Meter personnel are voluntarily programmed a digital display circuit " integrated " on a piece of PLD, without asking chip manufacturing
Manufacturer designs and makes special IC chip.And, nowadays, substitution manually makes integrated electricity
Road chip, this programming also uses " logic compiler (logic compiler) " software instead to realize mostly, it
Software compiler used is similar when being write with program development, and the source code before compiling is also handy
Specific programming language is write, and this is referred to as hardware description language (Hardware Description
Language, HDL), and HDL is also not only a kind of, but have many kinds, such as ABEL (Advanced
Boolean Expression Language)、AHDL(Altera Hardware Description Language)、
Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL
(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL
(Ruby Hardware Description Language) etc., that most commonly use at present is VHDL
(Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog.
Those skilled in the art also will be apparent to the skilled artisan that only need to by method flow with above-mentioned several hardware description languages slightly
Programming in logic is simultaneously programmed into integrated circuit, it is possible to be readily available the hardware for realizing the logical method flow
Circuit.
Controller can be implemented in any suitable manner, for example, controller can take such as microprocessor
Or processor and storage can be by computer readable program code (such as softwares of (micro-) computing device
Or firmware) computer-readable medium, gate, switch, application specific integrated circuit (Application Specific
Integrated Circuit, ASIC), the form of programmable logic controller (PLC) and embedded microcontroller, controller
Example include but is not limited to following microcontroller:ARC 625D、Atmel AT91SAM、Microchip
PIC18F26K20 and Silicone Labs C8051F320, Memory Controller is also implemented as depositing
A part for the control logic of reservoir.It is also known in the art that except with pure computer-readable program
Code means are realized beyond controller, can cause to control by the way that method and step is carried out into programming in logic completely
Device is with the shape of gate, switch, application specific integrated circuit, programmable logic controller (PLC) and embedded microcontroller etc.
Formula realizes identical function.Therefore this controller is considered a kind of hardware component, and to bag in it
The structure that the device for realizing various functions for including can also be considered as in hardware component.Or even, can be with
To be used to realizing that the device of various functions is considered as not only being the software module of implementation method but also can be hardware
Structure in part.
System, device, module or unit that above-described embodiment is illustrated, specifically can be by computer chip or reality
Body is realized, or is realized by the product with certain function.
For convenience of description, it is divided into various units with function during description apparatus above to describe respectively.Certainly,
The function of each unit can be realized in same or multiple softwares and/or hardware when the application is implemented.
It should be understood by those skilled in the art that, embodiments of the invention can be provided as method, system or meter
Calculation machine program product.Therefore, the present invention can be using complete hardware embodiment, complete software embodiment or knot
Close the form of the embodiment in terms of software and hardware.And, the present invention can be used and wherein wrapped at one or more
Containing computer usable program code computer-usable storage medium (including but not limited to magnetic disk storage,
CD-ROM, optical memory etc.) on implement computer program product form.
The present invention is produced with reference to method according to embodiments of the present invention, equipment (system) and computer program
The flow chart and/or block diagram of product is described.It should be understood that can by computer program instructions realize flow chart and
/ or block diagram in each flow and/or the flow in square frame and flow chart and/or block diagram and/
Or the combination of square frame.These computer program instructions to all-purpose computer, special-purpose computer, insertion can be provided
The processor of formula processor or other programmable data processing devices is producing a machine so that by calculating
The instruction of the computing device of machine or other programmable data processing devices is produced for realizing in flow chart one
The device of the function of being specified in individual flow or multiple one square frame of flow and/or block diagram or multiple square frames.
These computer program instructions may be alternatively stored in can guide computer or the treatment of other programmable datas to set
In the standby computer-readable memory for working in a specific way so that storage is in the computer-readable memory
Instruction produce include the manufacture of command device, the command device realization in one flow of flow chart or multiple
The function of being specified in one square frame of flow and/or block diagram or multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices, made
Obtain and series of operation steps is performed on computer or other programmable devices to produce computer implemented place
Reason, so as to the instruction performed on computer or other programmable devices is provided for realizing in flow chart one
The step of function of being specified in flow or multiple one square frame of flow and/or block diagram or multiple square frames.
In a typical configuration, computing device includes one or more processors (CPU), input/output
Interface, network interface and internal memory.
Internal memory potentially includes the volatile memory in computer-readable medium, random access memory
And/or the form, such as read-only storage (ROM) or flash memory (flash RAM) such as Nonvolatile memory (RAM).It is interior
Deposit be computer-readable medium example.
Computer-readable medium includes that permanent and non-permanent, removable and non-removable media can be by appointing
What method or technique realizes information Store.Information can be computer-readable instruction, data structure, program
Module or other data.The example of the storage medium of computer include, but are not limited to phase transition internal memory (PRAM),
It is static RAM (SRAM), dynamic random access memory (DRAM), other kinds of random
Access memory (RAM), read-only storage (ROM), Electrically Erasable Read Only Memory (EEPROM),
Fast flash memory bank or other memory techniques, read-only optical disc read-only storage (CD-ROM), digital multi light
Disk (DVD) or other optical storages, magnetic cassette tape, the storage of tape magnetic rigid disk or other magnetic storage apparatus
Or any other non-transmission medium, can be used to store the information that can be accessed by a computing device.According to herein
Define, computer-readable medium does not include temporary computer readable media (transitory media), such as modulates
Data-signal and carrier wave.
Also, it should be noted that term " including ", "comprising" or its any other variant be intended to non-row
His property is included, so that process, method, commodity or equipment including a series of key elements not only include
Those key elements, but also other key elements including being not expressly set out, or also include for this process,
Method, commodity or the intrinsic key element of equipment.In the absence of more restrictions, by sentence " including
One ... " key element that limits, it is not excluded that in the process including the key element, method, commodity or set
Also there is other identical element in standby.
It will be understood by those skilled in the art that embodiments herein can be provided as method, system or computer journey
Sequence product.Therefore, the application can using complete hardware embodiment, complete software embodiment or combine software and
The form of the embodiment of hardware aspect.And, the application can be used and wherein include calculating at one or more
Machine usable program code computer-usable storage medium (including but not limited to magnetic disk storage, CD-ROM,
Optical memory etc.) on implement computer program product form.
The application can be described in the general context of computer executable instructions, example
Such as program module.Usually, program module includes performing particular task or realizes particular abstract data type
Routine, program, object, component, data structure etc..This can also in a distributed computing environment be put into practice
Application, in these DCEs, by the remote processing devices connected by communication network come
Execution task.In a distributed computing environment, program module may be located at including local including storage device
In remote computer storage medium.
Each embodiment in this specification is described by the way of progressive, identical phase between each embodiment
As part mutually referring to what each embodiment was stressed is the difference with other embodiment.
For especially for system embodiment, because it is substantially similar to embodiment of the method, so the comparing of description
Simply, the relevent part can refer to the partial explaination of embodiments of method.
Embodiments herein is the foregoing is only, the application is not limited to.For this area skill
For art personnel, the application can have various modifications and variations.All institutes within spirit herein and principle
Any modification, equivalent substitution and improvements of work etc., within the scope of should be included in claims hereof.