CN105550178A - Database processing method and device and system - Google Patents

Database processing method and device and system Download PDF

Info

Publication number
CN105550178A
CN105550178A CN201410593605.6A CN201410593605A CN105550178A CN 105550178 A CN105550178 A CN 105550178A CN 201410593605 A CN201410593605 A CN 201410593605A CN 105550178 A CN105550178 A CN 105550178A
Authority
CN
China
Prior art keywords
type
rollback
database
disposal route
module
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
Application number
CN201410593605.6A
Other languages
Chinese (zh)
Inventor
程文超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by ZTE Corp filed Critical ZTE Corp
Priority to CN201410593605.6A priority Critical patent/CN105550178A/en
Priority to PCT/CN2015/081250 priority patent/WO2016065904A1/en
Publication of CN105550178A publication Critical patent/CN105550178A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention provides a database processing method and device and a system. The database processing method comprises following steps: successively dividing the executing processes of the database into multiple atomic modules needed to be provided with atomicity protection according to the service demand of the database; obtaining the abnormality state of an operating target atomic module in real time, determining the abnormality type of the abnormity according to the abnormality state; if the abnormality type is a rollback type, obtaining a first processing method corresponding to the rollback type, executing the first processing method so that the target atomic module rolls back to the state of the atomic module before operation. According to the method of the invention, when the abnormality type is the rollback type, the corresponding atomic module can execute the corresponding processing method so as to roll back to the state of the atomic module before operation; every atomic module is ensured to have atomicity in executing service; and therefore the whole data executing atomicity is ensured.

Description

A kind of disposal route of database, Apparatus and system
Technical field
The present invention relates to database technical field, particularly a kind of disposal route, Apparatus and system of database.
Background technology
The atomicity of database manipulation is the essential characteristic of transactional database, for ensureing the integrality of a certain operating result to database, being namely performed completely or not being performed completely.The database of current number of different types does not support issued transaction, as analytic type database and the storage engines of some database.The atomicity ensureing a certain implementation may be needed, as the warehouse-in process of data, the pre-statistics implementation of form in the process using these database processing data.When these business of database processing of affairs are not supported in use, the atomicity of data handling procedure can not be ensured.
Summary of the invention
The object of the present invention is to provide a kind of disposal route of database, Apparatus and system, the result that database is performed is performed completely or is not performed, and ensure that the atomicity that database performs.
In order to achieve the above object, the invention provides a kind of disposal route of database, comprising:
1. a disposal route for database, is characterized in that, comprising:
The execution flow process of described database is divided into multiple atom module needing to provide atomicity to protect by business demand according to described database successively;
The abnormality of the object atom module that Real-time Obtaining is running, according to described abnormality determination Exception Type;
If described Exception Type is rollback type, obtain first disposal route corresponding with described rollback type and perform described first disposal route make described object atom module return back to this object atom module run before state.
Wherein, described method also comprises:
If described Exception Type is not rollback type, obtains second disposal route corresponding with this Exception Type and perform described second disposal route described Exception Type is processed.
Wherein, if described Exception Type is rollback type, obtain first disposal route corresponding with described rollback type and perform described first disposal route make described object atom module return back to this object atom module run before the step of state comprise:
If described Exception Type is rollback type, obtain the rollback code of first disposal route corresponding with this rollback type prestored;
Perform described rollback code, the state before making described object atom module return back to the operation of this object atom module, and process ends.
Wherein, if described Exception Type is not rollback type, obtains second disposal route corresponding with this Exception Type and perform described second disposal route the step that described exception processes is comprised:
If described Exception Type is not rollback type, obtain the process code of second disposal route corresponding with this Exception Type prestored;
After performing described process code, obtain the abnormality of described object atom module further;
If described object atom module does not exist exception, then described database continues to perform next atom module; If described object atom module exists abnormal, then process ends.
Further, described rollback code is cancel statement.
The embodiment of the present invention also provides a kind for the treatment of apparatus of database, comprising:
Segmentation module, is divided into multiple atom module needing to provide atomicity to protect for the business demand according to described database successively by the execution flow process of described database;
Abnormal acquisition module, for the abnormality of the object atom module that Real-time Obtaining is running, determines described abnormal Exception Type according to described abnormality;
First execution module, if be rollback type for described Exception Type, obtain first disposal route corresponding with described rollback type and perform described first disposal route make described object atom module return back to this object atom module run before state.
Wherein, above-mentioned treating apparatus also comprises:
Second execution module, if be not rollback type for described Exception Type, obtain second disposal route corresponding with this Exception Type and performs described second disposal route and process described Exception Type.
Wherein, described first execution module comprises:
First acquiring unit, if be rollback type for described Exception Type, obtains the rollback code of first disposal route corresponding with this rollback type prestored;
Performance element, for performing described rollback code, the state before making described object atom module return back to the operation of this object atom module, and process ends.
Wherein, described second execution module comprises:
Second acquisition unit, if be not rollback type for described Exception Type, obtains the process code of second disposal route corresponding with this Exception Type prestored;
3rd acquiring unit, after performing described process code, obtains the abnormality of described object atom module further;
Judging unit, if there is not exception for described object atom module, then described database continues to perform next atom module; If described object atom module exists abnormal, then process ends.
Further, described rollback code is cancel statement.
The embodiment of the present invention also provides a kind of system, comprises database, and described database comprises multiple atom module needing to provide atomicity to protect, and described system also comprises the treating apparatus of the database as described in any one of claim 6 to 10;
When described atom module occurs that Exception Type is the exception of rollback type, the treating apparatus of described database calls the rollback code corresponding with described rollback type and performs, make described database return back to this atom module perform before state.
Technique scheme of the present invention at least has following beneficial effect:
In the disposal route of the database of the embodiment of the present invention, by arranging corresponding disposal route for the Exception Type of each atom module, ensure that when Exception Type is rollback type, corresponding atom module can perform corresponding disposal route return back to this atom module run before state, ensure that each atom module has atomicity in execution business, thus ensure that the atomicity that whole data perform.
Accompanying drawing explanation
Fig. 1 represents the basic step schematic diagram of the disposal route of the database of the embodiment of the present invention;
Fig. 2 represents the execution step schematic diagram of the second disposal route in the disposal route of the database of the embodiment of the present invention;
Fig. 3 represents the embody rule schematic flow sheet of the disposal route of the database of the embodiment of the present invention;
Fig. 4 represents the structural representation of the treating apparatus of the database of the embodiment of the present invention.
Embodiment
For making the technical problem to be solved in the present invention, technical scheme and advantage clearly, be described in detail below in conjunction with the accompanying drawings and the specific embodiments.
The present invention is directed in prior art and much do not support that transaction data storehouse cannot ensure the problem of atomicity in the process of implementation, a kind of disposal route of database, Apparatus and system are provided, by arranging corresponding disposal route for the Exception Type of each atom module, ensure that when Exception Type is rollback type, corresponding atom module can perform corresponding disposal route return back to this atom module run before state, ensure that each atom module has atomicity in execution business, thus ensure that the atomicity that whole data perform.
As shown in Figure 1, the embodiment of the present invention provides a kind of disposal route of database, comprising:
Step 10, the execution flow process of described database is divided into multiple atom module needing to provide atomicity to protect by business demand according to described database successively;
Step 11, the abnormality of the object atom module that Real-time Obtaining is running, determines described abnormal Exception Type according to described abnormality;
Step 12, if described Exception Type is rollback type, obtain first disposal route corresponding with described rollback type and perform described first disposal route make described object atom module return back to this object atom module run before state.
In the above embodiment of the present invention, the execution flow process of database is the whole implementation of this database, and this whole implementation can be divided into multiple atom module business demand, and the plurality of atom module needs to ensure atomicity in execution business.Concrete, the business demand of atom module can be a series of process of the warehouse-in process of data, the pre-statistics implementation of form, the outbound process of data etc., does not enumerate at this.
Concrete, in the practical application of the embodiment of the present invention, such as one section of run time version is as follows:
Make mistakes when such as performing update statement, col2's and col3 and beyond the scope etc. of col1 field; State before at this time just needing whole code block to return back to, needs all data dumps inserted to fall, and performing delete statement can realize.
In the above embodiment of the present invention, described method also comprises:
Step 13, if described Exception Type is not rollback type, obtains second disposal route corresponding with this Exception Type and performs described second disposal route and process described Exception Type.
In the specific embodiment of the invention, in database operational process, various exception may be there is, if Exception Type is not rollback type, when namely there is this exception, without the need to database is return back to previous state, but repaired by additive method, if repaired, continue runtime database; If cannot repair, then report an error and exit, carry out subsequent treatment by other staff or equipment.
Mainly in the present invention Exception Type is divided into rollback type and not rollback type, it should be noted that, the abnormal conditions of rollback type are also divided into various situation, need provide different branch process flow processs, but its final purpose are return back to previous state according to different situations; Rollback type is not divided into various situation yet equally, and database root processes respectively according to different situations.
Concrete, in the above embodiment of the present invention, as shown in Figure 2, step 13 comprises:
Step 131, if described Exception Type is not rollback type, obtains the process code of second disposal route corresponding with this Exception Type prestored;
Step 132, after performing described process code, obtains the abnormality of described object atom module further;
Step 133, if described object atom module does not exist exception, then described database continues to perform next atom module; If described object atom module exists abnormal, then process ends.
In the above embodiment of the present invention, if the Exception Type of object atom module is not rollback type, also obtains corresponding disposal route, and it is processed, if this object atom module does not exist exception after having processed, then continue to run next atom module; If this object atom module also exists other exceptions and cannot process after having processed, then report an error and exit database, be further processed by follow-up personnel or program.
In the above embodiment of the present invention, step 12 comprises:
Step 121, if described Exception Type is rollback type, obtains the rollback code of first disposal route corresponding with this rollback type prestored;
Step 122, performs described rollback code, the state before making described object atom module return back to the operation of this object atom module, and process ends.
In the specific embodiment of the invention, the back off procedure of atom module is by performing the corresponding rollback codes implement write for each abnormal conditions; This rollback code is write preservation in advance for the abnormal conditions that may exist, directly call run this rollback code, make object atom module return back to operation before state.
In the disposal route of the database of the above embodiment of the present invention, by each atom module carry out monitoring, if there is the exception of rollback type in atom module, then perform the first disposal route database is return back to this atom module perform before state; If the exception that atom module occurs is not rollback type simultaneously, also performs the second corresponding disposal route and process abnormal; Ensure that the atomicity in each atom module implementation.
In order to be more preferably the disposal route describing the database that the embodiment of the present invention provides, below in conjunction with Fig. 3, the detailed step of the embodiment of the present invention is further described:
Step S301, business processing atom module 1 starts to perform;
Step S302, judges whether there are abnormal conditions in business processing atom module 1 implementation;
Step S303, if whole code implementation completes smoothly, then there are not abnormal conditions in atom module 1, then continue to perform the code in atom module 2;
Step S304, if there are abnormal conditions in atom module 1, obtains abnormal state information;
Step S305, judges whether according to current state information the rollback operation needing run time version;
Step S306, if needed, performs the rollback operation for basis submodule, the state of database is return back to the state before performing the execution of basis submodule, and program is exited;
Step S307, if do not need to perform rollback operation, then utilizes this abnormal information of the second disposal methods;
Step S308, judges whether continue to perform through the process post code of step S307;
Step S309, performs if can continue, then continue to perform atom module 2;
Step S310, perform if cannot continue, then direct program being reported an error is exited, process ends.
In order to better realize above-mentioned purpose, as shown in Figure 4, the embodiment of the present invention also provides a kind for the treatment of apparatus of database, comprising:
Segmentation module 41, is divided into multiple atom module needing to provide atomicity to protect for the business demand according to described database successively by the execution flow process of described database;
Abnormal acquisition module 42, for the abnormality of the object atom module that Real-time Obtaining is running, determines described abnormal Exception Type according to described abnormality;
First execution module 43, if be rollback type for described Exception Type, obtain first disposal route corresponding with described rollback type and perform described first disposal route make described object atom module return back to this object atom module run before state.
Further, in the above embodiment of the present invention, above-mentioned treating apparatus also comprises:
Second execution module, if be not rollback type for described Exception Type, obtain second disposal route corresponding with this Exception Type and performs described second disposal route and process described Exception Type.
Further, in the above embodiment of the present invention, described first execution module 43 comprises:
First acquiring unit, if be rollback type for described Exception Type, obtains the rollback code of first disposal route corresponding with this rollback type prestored;
Performance element, for performing described rollback code, the state before making described object atom module return back to the operation of this object atom module, and process ends.
In the above embodiment of the present invention, described second execution module comprises:
Second acquisition unit, if be not rollback type for described Exception Type, obtains the process code of second disposal route corresponding with this Exception Type prestored;
3rd acquiring unit, after performing described process code, obtains the abnormality of described object atom module further;
Judging unit, if there is not exception for described object atom module, then described database continues to perform next atom module; If described object atom module exists abnormal, then process ends.
Further, in the specific embodiment of the invention, described rollback code is cancel statement.
In the disposal route of the database of the specific embodiment of the invention, by arranging corresponding disposal route for the Exception Type of each atom module, ensure that when Exception Type is rollback type, corresponding atom module can perform corresponding disposal route return back to this atom module run before state, ensure that each atom module has atomicity in execution business, thus ensure that the atomicity that whole data perform.
It should be noted that, the treating apparatus that the embodiment of the present invention provides is the device applying above-mentioned disposal route, then all embodiments of above-mentioned disposal route are all applicable to this treating apparatus, and all can reach same or analogous beneficial effect.
In order to better realize above-mentioned purpose, the embodiment of the present invention also provides a kind of system, comprises database, described database comprises multiple atom module needing to provide atomicity to protect, and described system also comprises the treating apparatus of database as above;
When described atom module occurs that Exception Type is the exception of rollback type, the treating apparatus of described database calls the rollback code corresponding with described rollback type and performs, make described database return back to this atom module perform before state.
It should be noted that, the system that the embodiment of the present invention provides is the system comprising above-mentioned treating apparatus and database, then all embodiments of above-mentioned treating apparatus and beneficial effect thereof are all applicable to this system.
The above is the preferred embodiment of the present invention; it should be pointed out that for those skilled in the art, under the prerequisite not departing from principle of the present invention; can also make some improvements and modifications, these improvements and modifications also should be considered as protection scope of the present invention.

Claims (11)

1. a disposal route for database, is characterized in that, comprising:
The execution flow process of described database is divided into multiple atom module needing to provide atomicity to protect by business demand according to described database successively;
The abnormality of the object atom module that Real-time Obtaining is running, according to described abnormality determination Exception Type;
If described Exception Type is rollback type, obtain first disposal route corresponding with described rollback type and perform described first disposal route make described object atom module return back to this object atom module run before state.
2. the disposal route of database according to claim 1, is characterized in that, described method also comprises:
If described Exception Type is not rollback type, obtains second disposal route corresponding with this Exception Type and perform described second disposal route described Exception Type is processed.
3. the disposal route of database according to claim 1, it is characterized in that, if described Exception Type is rollback type, obtain first disposal route corresponding with described rollback type and perform described first disposal route make described object atom module return back to this object atom module run before the step of state comprise:
If described Exception Type is rollback type, obtain the rollback code of first disposal route corresponding with this rollback type prestored;
Perform described rollback code, the state before making described object atom module return back to the operation of this object atom module, and process ends.
4. the disposal route of database according to claim 2, it is characterized in that, if described Exception Type is not rollback type, obtains second disposal route corresponding with this Exception Type and perform described second disposal route the step that described exception processes is comprised:
If described Exception Type is not rollback type, obtain the process code of second disposal route corresponding with this Exception Type prestored;
After performing described process code, obtain the abnormality of described object atom module further;
If described object atom module does not exist exception, then described database continues to perform next atom module; If described object atom module exists abnormal, then process ends.
5. the disposal route of database according to claim 3, is characterized in that, described rollback code is cancel statement.
6. a treating apparatus for database, is characterized in that, comprising:
Segmentation module, is divided into multiple atom module needing to provide atomicity to protect for the business demand according to described database successively by the execution flow process of described database;
Abnormal acquisition module, for the abnormality of the object atom module that Real-time Obtaining is running, determines described abnormal Exception Type according to described abnormality;
First execution module, if be rollback type for described Exception Type, obtain first disposal route corresponding with described rollback type and perform described first disposal route make described object atom module return back to this object atom module run before state.
7. the treating apparatus of database according to claim 6, is characterized in that, also comprises:
Second execution module, if be not rollback type for described Exception Type, obtain second disposal route corresponding with this Exception Type and performs described second disposal route and process described Exception Type.
8. the treating apparatus of database according to claim 6, is characterized in that, described first execution module comprises:
First acquiring unit, if be rollback type for described Exception Type, obtains the rollback code of first disposal route corresponding with this rollback type prestored;
Performance element, for performing described rollback code, the state before making described object atom module return back to the operation of this object atom module, and process ends.
9. the treating apparatus of database according to claim 7, is characterized in that, described second execution module comprises:
Second acquisition unit, if be not rollback type for described Exception Type, obtains the process code of second disposal route corresponding with this Exception Type prestored;
3rd acquiring unit, after performing described process code, obtains the abnormality of described object atom module further;
Judging unit, if there is not exception for described object atom module, then described database continues to perform next atom module; If described object atom module exists abnormal, then process ends.
10. the treating apparatus of database according to claim 8, is characterized in that, described rollback code is cancel statement.
11. 1 kinds of systems, comprise database, it is characterized in that, described database comprises multiple atom module needing to provide atomicity to protect, and described system also comprises the treating apparatus of the database as described in any one of claim 6 to 10;
When described atom module occurs that Exception Type is the exception of rollback type, the treating apparatus of described database calls the rollback code corresponding with described rollback type and performs, make described database return back to this atom module perform before state.
CN201410593605.6A 2014-10-29 2014-10-29 Database processing method and device and system Pending CN105550178A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201410593605.6A CN105550178A (en) 2014-10-29 2014-10-29 Database processing method and device and system
PCT/CN2015/081250 WO2016065904A1 (en) 2014-10-29 2015-06-11 Database processing method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410593605.6A CN105550178A (en) 2014-10-29 2014-10-29 Database processing method and device and system

Publications (1)

Publication Number Publication Date
CN105550178A true CN105550178A (en) 2016-05-04

Family

ID=55829367

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410593605.6A Pending CN105550178A (en) 2014-10-29 2014-10-29 Database processing method and device and system

Country Status (2)

Country Link
CN (1) CN105550178A (en)
WO (1) WO2016065904A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102156700A (en) * 2010-02-12 2011-08-17 华为技术有限公司 Database accessing method and device and system
CN102682117A (en) * 2012-05-15 2012-09-19 浪潮电子信息产业股份有限公司 Method for quickly copying cluster data in database
CN103294787A (en) * 2013-05-21 2013-09-11 成都市欧冠信息技术有限责任公司 Multi-copy storage method and multi-copy storage system for distributed database system
CN103617195A (en) * 2013-11-05 2014-03-05 杭州沃趣网络科技有限公司 Data synchronization system and data synchronization method used for MySQL database
CN103678532A (en) * 2013-12-02 2014-03-26 中国移动(深圳)有限公司 Alternation statement reverse analysis method, database alternating and backspacing method and database alternating and backspacing system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102156735B (en) * 2011-04-11 2012-12-26 中国有色矿业集团有限公司 Implementation method and device of business method based on database transaction
CN102857357B (en) * 2011-06-29 2017-04-26 中兴通讯股份有限公司 Method and device for implementing network management configuration
US9081597B2 (en) * 2012-11-27 2015-07-14 Red Hat Israel, Ltd. Database change compensation after a transaction commit
CN103279358B (en) * 2013-06-08 2016-04-27 北京首钢自动化信息技术有限公司 A kind of explanation type Service Component dynamic fixing method of Industry-oriented application

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102156700A (en) * 2010-02-12 2011-08-17 华为技术有限公司 Database accessing method and device and system
CN102682117A (en) * 2012-05-15 2012-09-19 浪潮电子信息产业股份有限公司 Method for quickly copying cluster data in database
CN103294787A (en) * 2013-05-21 2013-09-11 成都市欧冠信息技术有限责任公司 Multi-copy storage method and multi-copy storage system for distributed database system
CN103617195A (en) * 2013-11-05 2014-03-05 杭州沃趣网络科技有限公司 Data synchronization system and data synchronization method used for MySQL database
CN103678532A (en) * 2013-12-02 2014-03-26 中国移动(深圳)有限公司 Alternation statement reverse analysis method, database alternating and backspacing method and database alternating and backspacing system

Also Published As

Publication number Publication date
WO2016065904A1 (en) 2016-05-06

Similar Documents

Publication Publication Date Title
CN103942073B (en) Realize the method and device of system hot patch
CN106603264A (en) Method and equipment for positioning fault root
CN103927338A (en) Log information storage processing method and log information storage processing device
IN2015CH04673A (en)
CN109190776B (en) Method and device for rechecking automobile fault, terminal equipment and storage medium
CN105162632A (en) Automatic processing system for server cluster failures
JP2018523220A5 (en)
CN110069929B (en) Vulnerability disposal analysis method and construction method and device of analysis model thereof
CN104504495A (en) Operation and maintenance abnormity processing method, device and equipment
CN111539696A (en) Two-ticket omnibearing electronic monitoring method and system
CN107357619B (en) Method, device, equipment and storage medium for generating card configuration file
CN109933337A (en) A kind of key deployment strategy method that single machine services more
ATE407394T1 (en) DATA PROCESSING DEVICE WITH REAL-TIME MEMORY PAGE MANAGEMENT AND METHOD FOR OPERATING THE SAME
CN113886590A (en) Data summarizing method and device, computer equipment and storage medium
CN105550178A (en) Database processing method and device and system
CN111105113A (en) Nuclear power plant disaster probability safety analysis method and device
CN105204929A (en) Batch processing scheduling method, device and system
CN116541195A (en) Abnormality processing method and related device for robot flow automation program RPA
CN103914027B (en) Utilize the method that expression parsing realizes industry spot underlying device monitoring management
WO2019126797A3 (en) System and method for executing instructions
CN108763172A (en) The method and device of customization sequence number is automatically generated under a kind of linux system
CN111752600B (en) Code anomaly detection method and device, computer equipment and storage medium
CN110866150B (en) Method for rapidly generating ledger data map and overhauling defects of pre-control equipment family
CN111177241A (en) Data processing method, device and system, electronic equipment and storage medium thereof
DE102015211458A1 (en) A method and apparatus for securing a program counter structure of a processor system and for monitoring the handling of an interrupt request

Legal Events

Date Code Title Description
C06 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: 20160504