Specific embodiment
In order to make those skilled in the art more fully understand the technical solution in this specification embodiment, below in conjunction with this
Attached drawing in specification embodiment is described in detail the technical solution in this specification embodiment, it is clear that described
Embodiment is only a part of the embodiment of this specification, instead of all the embodiments.The embodiment of base in this manual,
Those of ordinary skill in the art's every other embodiment obtained, all should belong to the range of protection.
Illustrate first, the backup method for the asset data that this specification embodiment provides is based on active/standby backup mechanism, i.e., will
Asset data in primary database backs up in standby database, to guarantee the availability and reliability of asset data.Also need
Bright, the backup method is using async backup mode, i.e., the asset data in primary database changes, Ye Jiying
After selling business processing success, then the asset data after change backed up into standby database.It is handled by this kind, then it can be to avoid master
When database and standby database be in strange land, due to by the asset data backed up in synchronization in primary database to for after database,
Sales service is just handled successfully, and the development for the every sales service that will lead to has serious time-consuming.
It referring to Figure 1, is the structural schematic diagram of the Database Systems shown in one exemplary embodiment of this specification, in Fig. 1
Including city A and city B, wherein city A has a computer room and b computer room, and city B has c computer room, with the master data in a computer room
For library 110, the primary database 110 is in the different computer rooms in same city, such as b computer room has corresponding standby database 111, also,
Computer room in strange land, such as c computer room also have corresponding standby database 112.
It, then can be using the standby of the asset data that this specification embodiment provides based on Database Systems exemplified by Fig. 1
Asset data in primary database 110 is backed up to standby database 111 and standby database 112 by part method respectively.
It is as follows, following embodiments are shown, the backup method of asset data is described in detail:
Fig. 2 is referred to, is a kind of implementation of the backup method for asset data that one exemplary embodiment of this specification provides
Example flow chart, method includes the following steps:
Step 202: after the asset data in primary database changes, judging whether to meet the assets number by after change
According to the condition for backing up to standby database.
Step 204: if satisfied, then the asset data after change is written multiplied by after preset first ratio value for data
Library, first ratio value are the decimal less than 1.
It is as follows, step 202 and step 204 are described in detail:
It is every successfully to carry out a sales service by taking asset data is budget surplus amount as an example, then it can be to budget surplus
Amount carries out reducing operation namely every successfully sales service of development, and the asset data in primary database will change.
In this specification embodiment, after the asset data in primary database changes, Database Systems are not direct
Asset data after change is backed up into standby database, but backs up to the asset data after change it is first determined whether meeting
The condition of standby database, if meeting the condition, then by the asset data after change multiplied by being written again after preset first ratio value
Standby database, first ratio value are the decimal less than 1.Illustrate herein, for convenience, the assets of standby database will be written
Data are known as backup asset data.
In one embodiment, the condition that the above-mentioned asset data by after change backs up to standby database can be with are as follows: after change
Asset data be no more than current change threshold value, wherein current change threshold value can be determined as follows: utilize standby number
According to the backup asset data in library divided by preset second ratio value, which is less than 1 and to be greater than above-mentioned first ratio
The decimal of example value.
As an example it is assumed that standby database 111 is 80 with the backup asset data in standby database 112, and assume second
Ratio value is 0.8, and the first ratio value is 0.6, then, as described above, current change threshold value is 100;Assuming that primary
After reducing operation, the asset data in primary database 110 is changed to 99, then, as described above, meet the money after change
The condition of data backup to standby database is produced, at this point, then standby number can be backed up to respectively by asset data 99 multiplied by after 0.6
According in library 111 and standby database 112, at this point, standby database 111 is 59 with respective backup asset data in standby database 112
(99*0.6≈59)。
Continue to assume that the asset data in primary database 110 is changed to 97, change threshold value current at this time is 74 (59/0.8
≈ 74), as described above, it is unsatisfactory for backing up to the asset data after change into the condition of standby database, then can not will becomes
Asset data 97 after more backs up in standby database 111 and standby database 112, subsequent, until the assets in primary database 110
When data change to 74 or 74 or less, then carry out data backup.
It is not that the asset data in primary database occurs once by foregoing description as it can be seen that in this specification embodiment
Change, is carried out a data backup, so as to save Internet resources;In addition, due to by the asset data in primary database
Value backs up in standby database according to a certain percentage, so as to be effectively ensured in primary database delay machine, based on standby data
Asset data in library carries out business processing, is not in excess processing phenomenon, such as the remaining amount that excesses budget.
In addition, in this specification embodiment, in order to realize above-mentioned steps 202 and step 204, primary database can be directed to
In asset data backup attribute position is set, the occurrence on the backup attribute position indicates for the backup assets number in database
According to for convenience, by the occurrence referred to as backup attribute value.Based on this, in this specification embodiment, after it will change
Asset data multiplied by standby database is written after preset first ratio value after, then can be in primary database, more new assets
The backup attribute value of data.
For example, in the foregoing description, after asset data 59 being backed up to standby database 111 and standby database 112,
Then the backup attribute value of asset data in primary database 110 can be updated to 59.
It is handled by this kind, after the asset data in next primary database changes, then can directly acquire standby number
According to the backup asset data in library, to judge whether to meet the condition that the asset data after change is backed up to standby database.
In addition, Status of Backups position can also be set for the asset data in primary database in this specification embodiment,
Value on the Status of Backups position can be used for recording whether the asset data successfully backs up to standby database, for example, if the backup shape
Value on state position is failover-asyn-success, then it represents that asset data successfully backs up to standby database, if the backup shape
Value on state position is failover-asyn-null, then it represents that asset data is not backed up to standby database.
Correspondingly, Status of Backups position, similarly, the backup shape can also be arranged for the backup asset data in standby database
Value on state position can be used for recording whether the asset data in primary database successfully backs up to standby database, for convenience,
Value on Status of Backups position is known as Status of Backups value, for example, the asset data after it will change is multiplied by preset first ratio
It is written after value after standby database, in standby database, the Status of Backups value that ought back up asset data is updated to be used to indicate
First preset value of active and standby synchronization, such as failover-asyn-success.
It is subsequent, realize that the detailed process of failover is illustrated to based on above-mentioned backup method:
In this specification embodiment, after primary database delay machine, first by modification drainage pathway, by service request stream
Amount is drained to standby database, at this point, every service request is then completed based on the backup asset data in standby database, for example, often
A service request is completed, then the backup asset data in standby database is carried out reducing operation, and record every business and ask
The specifying information asked.
Specifically, if the Status of Backups value of the backup asset data in standby database is above-mentioned first preset value, then it represents that
The backup asset data is available, at this point, can then be requested based on the backup asset data processing business, wait be based on the backup assets
After data processing service request, the Status of Backups value of the backup asset data can be changed to be used for from above-mentioned first preset value
It indicates the second preset value that the backup asset data has been called, is handled, can be represented in backup database by this kind
Backup asset data has changed.
It may be implemented by above-mentioned processing, be second pre- based on Status of Backups value after primary database restores normal use
If the asset data in the backup asset data modification primary database of value, that is, being called based on during primary database delay machine
The backup asset data crossed realizes that the data of primary database are moved back.
Further, since after primary database restores normal use, i.e., by modification drainage pathway, again by service request flow
Primary database is drained back, and realizes that the data of primary database are moved back and needs certain time, within this period, in order to avoid going out
Existing excess processing, can be changed to third preset value for the Status of Backups value of asset data in primary database, to indicate the assets
Data are in state of moving back, wherein under the state of moving back, do not allow the asset data lower than its corresponding backup asset data.
As an example it is assumed that the asset data in primary database is 90, backup attribute value is 60, then, primary database
Delay machine, called for the backup asset data in database, later, primary database restores normal use, but does not complete data also
It moves back, i.e., can not learn during primary database delay machine, the specifying information that backup asset data is reduced, thus if to master data
Asset data in library is reduced, then does not allow to reduce the asset data to 60 hereinafter, moving back until completing data.
Technical solution provided by this specification embodiment, after being changed by the asset data in primary database,
Judge whether to meet the condition that the asset data after change is backed up to standby database, if satisfied, then by the assets number after change
According to multiplied by standby database is written after preset first ratio value, which is the decimal less than 1, may be implemented effectively to protect
The problem of it is available to demonstrate,prove master/slave data library, and avoids the occurrence of to the processing of asset data excess, while can also effectively avoid in master
When database and standby database are in strange land, there is serious time-consuming in business processing.
Corresponding to above method embodiment, this specification embodiment also provides a kind of back-up device of asset data, referring to
It is a kind of embodiment block diagram of the back-up device for asset data that one exemplary embodiment of this specification provides, the dress shown in Fig. 3
Set may include: judgment module 31, backup module 32.
Wherein, judgment module 31, after changing for the asset data in primary database, judging whether to meet will become
Asset data after more backs up to the condition of standby database;
Backup module 32 will if backing up to the condition of standby database for meeting the asset data by after change
Asset data after the change is small multiplied by the standby database, first ratio value are written after preset first ratio value
In 1 decimal.
It is in one embodiment, described to meet the condition that the asset data after change is backed up to standby database, comprising:
Asset data after change is no more than current change threshold value;
Described device further includes (being not shown in Fig. 3):
Threshold determination module, for utilizing the backup asset data in the standby database divided by preset second ratio
Value, second ratio value are the decimal less than 1 and greater than first ratio value.9, device according to claim 7,
Described device further include: attribute position update module, for the backup attribute value of asset data in the primary database to be updated to
Current backup asset data in the standby database.
In one embodiment, described device further includes (being not shown in Fig. 3):
First state position update module, for the Status of Backups value of backup asset data in the standby database to be updated to
First preset value, first preset value is for indicating active and standby synchronization.
In one embodiment, described device further includes (being not shown in Fig. 3):
Second mode bit update module, if for the backup during the primary database failure, in the standby database
Asset data is called, then changes the Status of Backups value of backup asset data in the standby database from first preset value
For the second preset value, second preset value is for indicating that the backup asset data has been called.
Data are moved back module, for according in the standby database, backing up after the primary database restores normal use
State value is that the backup asset data of second preset value modifies the asset data in the primary database.
In one embodiment, described device further includes (being not shown in Fig. 3):
Third state position update module, for the Status of Backups value of asset data in the primary database to be changed to third
Preset value, the third preset value are used to indicate that the asset data in the primary database to be in state of moving back, the shape of moving back
State indicates not allowing the asset data in the primary database lower than the backup asset data in the standby database.
It is understood that judgment module 31 and module of the backup module 32 as two kinds of functional independences, it both can be such as Fig. 3
Shown while configuration in a device, can also be configured individually in a device, therefore structure shown in Fig. 3 should not be construed as pair
The restriction of this specification example scheme.
In addition, the function of modules and the realization process of effect are specifically detailed in the above method corresponding step in above-mentioned apparatus
Rapid realization process, details are not described herein.
This specification embodiment also provides a kind of service server, includes at least memory, processor and is stored in
On reservoir and the computer program that can run on a processor, wherein processor realizes assets above-mentioned when executing described program
The method of backup.This method includes at least: after the asset data in primary database changes, judging whether to meet will be changed
Asset data afterwards backs up to the condition of standby database;If satisfied, then by the asset data after the change multiplied by preset
The standby database is written after one ratio value, first ratio value is the decimal less than 1.
Fig. 4 shows one kind provided by this specification embodiment, and more specifically service server hardware configuration is illustrated
Figure, which may include: processor 10, memory 420, input/output interface 430, communication interface 440 and bus 450.Its
Middle processor 410, memory 420, input/output interface 430 and communication interface 440 by bus 450 realize between
Communication connection inside equipment.
Processor 410 can use general CPU (Central Processing Unit, central processing unit), micro process
Device, application specific integrated circuit (Application Specific Integrated Circuit, ASIC) or one or
The modes such as multiple integrated circuits are realized, for executing relative program, to realize technical solution provided by this specification embodiment.
Memory 420 can use ROM (Read Only Memory, read-only memory), RAM (Random Access
Memory, random access memory), static storage device, the forms such as dynamic memory realize.Memory 420 can store
Operating system and other applications are realizing technical solution provided by this specification embodiment by software or firmware
When, relevant program code is stored in memory 420, and execution is called by processor 410.
Input/output interface 430 is for connecting input/output module, to realize information input and output.Input and output/
Module can be used as component Configuration (not shown) in a device, can also be external in equipment to provide corresponding function.Wherein
Input equipment may include keyboard, mouse, touch screen, microphone, various kinds of sensors etc., output equipment may include display,
Loudspeaker, vibrator, indicator light etc..
Communication interface 440 is used for connection communication module (not shown), to realize the communication of this equipment and other equipment
Interaction.Wherein communication module can be realized by wired mode (such as USB, cable etc.) and be communicated, can also be wirelessly
(such as mobile network, WIFI, bluetooth etc.) realizes communication.
Bus 450 includes an access, in various components (such as the processor 410, memory 420, input/output of equipment
Interface 430 and communication interface 440) between transmit information.
It should be noted that although above equipment illustrates only processor 410, memory 420, input/output interface
430, communication interface 440 and bus 450, but in the specific implementation process, which can also include realizing to operate normally
Necessary other assemblies.In addition, it will be appreciated by those skilled in the art that, it can also be only comprising realizing in above equipment
Component necessary to this specification example scheme, without including all components shown in figure.
This specification embodiment also provides a kind of computer readable storage medium, is stored thereon with computer program, the journey
The backup method of asset data above-mentioned is realized when sequence is executed by processor.This method includes at least: the money in primary database
After production data change, judge whether to meet the condition that the asset data after change is backed up to standby database;If satisfied, then
It is multiplied by the standby database, first ratio value are written after preset first ratio value by the asset data after the change
Decimal less than 1.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method
Or technology come realize information store.Information can be computer readable instructions, data structure, the module of program or other data.
The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory (SRAM), moves
State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable
Programmable read only memory (EEPROM), flash memory or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM),
Digital versatile disc (DVD) or other optical storage, magnetic cassettes, tape magnetic disk storage or other magnetic storage devices
Or any other non-transmission medium, can be used for storage can be accessed by a computing device information.As defined in this article, it calculates
Machine readable medium does not include temporary computer readable media (transitory media), such as the data-signal and carrier wave of modulation.
As seen through the above description of the embodiments, those skilled in the art can be understood that this specification
Embodiment can be realized by means of software and necessary general hardware platform.Based on this understanding, this specification is implemented
Substantially the part that contributes to existing technology can be embodied in the form of software products the technical solution of example in other words,
The computer software product can store in storage medium, such as ROM/RAM, magnetic disk, CD, including some instructions are to make
It is each to obtain computer equipment (can be personal computer, server or the network equipment etc.) execution this specification embodiment
Method described in certain parts of a embodiment or embodiment.
System, device, module or the unit that above-described embodiment illustrates can specifically realize by computer chip or entity,
Or it is realized by the product with certain function.A kind of typically to realize that equipment is computer, the concrete form of computer can
To be personal computer, laptop computer, cellular phone, camera phone, smart phone, personal digital assistant, media play
In device, navigation equipment, E-mail receiver/send equipment, game console, tablet computer, wearable device or these equipment
The combination of any several equipment.
All the embodiments in this specification are described in a progressive manner, same and similar portion between each embodiment
Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for device reality
For applying example, since it is substantially similar to the method embodiment, so describing fairly simple, related place is referring to embodiment of the method
Part explanation.The apparatus embodiments described above are merely exemplary, wherein described be used as separate part description
Module may or may not be physically separated, can be each module when implementing this specification example scheme
Function realize in the same or multiple software and or hardware.Can also select according to the actual needs part therein or
Person's whole module achieves the purpose of the solution of this embodiment.Those of ordinary skill in the art are not the case where making the creative labor
Under, it can it understands and implements.
The above is only the specific embodiment of this specification embodiment, it is noted that for the general of the art
For logical technical staff, under the premise of not departing from this specification embodiment principle, several improvements and modifications can also be made, this
A little improvements and modifications also should be regarded as the protection scope of this specification embodiment.