CN106933657A - Database deadlocks processing method and processing device - Google Patents

Database deadlocks processing method and processing device Download PDF

Info

Publication number
CN106933657A
CN106933657A CN201710140957.XA CN201710140957A CN106933657A CN 106933657 A CN106933657 A CN 106933657A CN 201710140957 A CN201710140957 A CN 201710140957A CN 106933657 A CN106933657 A CN 106933657A
Authority
CN
China
Prior art keywords
database
deadlocks
data
file
database deadlocks
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.)
Granted
Application number
CN201710140957.XA
Other languages
Chinese (zh)
Other versions
CN106933657B (en
Inventor
陈亚坤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bank of China Ltd
Original Assignee
Bank of China Ltd
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 Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN201710140957.XA priority Critical patent/CN106933657B/en
Publication of CN106933657A publication Critical patent/CN106933657A/en
Application granted granted Critical
Publication of CN106933657B publication Critical patent/CN106933657B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/466Transaction processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores
    • G06F9/524Deadlock detection or avoidance

Landscapes

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

Abstract

The present invention provides a kind of database deadlocks processing method and processing device, including:Pending file is obtained, and determines the zoning ordinance of pending file;Searched from database with the pending related master record file of file, and determine the zoning ordinance of the master record file;The zoning ordinance of the zoning ordinance of pending file and master record file is compared, when the zoning ordinance of pending file is different with the zoning ordinance of master record file, according to the zoning ordinance of master record file, again subregion is carried out to pending file, the pending file according to subregion again updates master record file.Pending data is processed accordingly before database deadlocks generation, so as to prevention data storehouse deadlock occurs, a wherein side or a few side's affairs need not so be given up, the duration for not influenceing concurrent transaction to process, so that ageing strong, the stability for not influenceing host computer system to run, reduces the maintenance workload of host computer system.

Description

Database deadlocks processing method and processing device
Technical field
The present invention relates to database technical field, more particularly to a kind of database deadlocks processing method and processing device.
Background technology
Existing host computer system has powerful concurrent transaction disposal ability, and described affairs refer to the data in host computer system Storehouse system is accessed and may update the data a program execution unit of various data in storehouse.In the system using database table In, simply by the presence of a large amount of concurrent updates to pooling of resources (data), just unavoidably occur database deadlocks (Deadlock, Refer in Database Systems, it is assumed that there is affairs T1 to block data A, affairs T2 block data B.Afterwards, affairs T1 applications block Data B, affairs T2 also apply blocking data A, and because affairs T1 has blocked data A, affairs T2 has blocked data B, thus The affairs T2 such as affairs T1, and affairs T2 are occurred in that in the situation of wait affairs T1, two affairs can not all terminate, and form dead Lock).Such as, there is boss's subordinate relation between data record, also need to update master record when subrecord is processed, if boss remembers Record is not processed in the industry same not in same partitions of database, then operating room is possible to that deadlock can be produced.Compare again Such as, two entity (data) Table As of renewal continuous for needs and B's (can be multiple), such as sporocarp (data) Table A and B divides Area's rule is inconsistent, then operating room is possible to that deadlock can be produced.Wherein, partitions of database refers to by number according to default condition Section is further subdivided into according to table, the section of these database objects is called subregion.The subregion of tables of data is come real by " subregion key " Existing, subregion key refers to some row, and these arrange the subregion where determining certain a line.It is pre-conditioned can include it is following several Kind:(1) range partition:Each subregion is specified (for one using days column as subregion key by a partitioning key values scope Table, " in January, 2005 " subregion includes the row that partitioning key values are from " on January 1st, 2005 " to " on January 31st, 2005 ").(2) arrange Table subregion:Each subregion is specified by a partitioning key values list and (arranged as the table of subregion key, " North America " point for an area Area may be comprising value " Canada " " U.S. " and " Mexico ").(3) subregion is hashed:Hashing algorithm is used into subregion key to determine Subregion where nominated bank.(4) combination range hash subregion:The combination of scope and hash partitioning technique, by the combination, first Range partition is carried out to table, then reusing hash partitioning technique for each single range partition further segments.(5) group Close range list subregion:The combination of scope and list partition technology, by the combination, carries out range partition, then to table first Further segmented for each single range partition re-using list partitioning technique.
General handling process for database deadlocks is:After database deadlocks are found, will a wherein side or a few side's things Business is carried out giving up rollback release resource, i.e., automatic interruption operation or transaction, it is ensured that remaining side affairs are normally completed;By safeguarding people Member goes to transfer operation error information to note abnormalities, and is then processed according to given emergency method.Such scheme exist with Lower problem:Processed after database deadlocks generation, the stability of influence host computer system operation increases the maintenance of host computer system Workload;Give up a wherein side or a few side's affairs, only one side's affairs for the treatment of, the duration of influence concurrent transaction treatment so that timeliness Property is poor;Attendant can not in time have found that database deadlocks occur, and it is ageing that influence concurrent transaction is processed.
The content of the invention
A kind of database deadlocks processing method is the embodiment of the invention provides, to pending number before database deadlocks generation According to being processed accordingly, so that prevention data storehouse deadlock occurs, need not so give up a wherein side or a few side's affairs, not influence The duration of concurrent transaction treatment so that ageing strong, the stability for not influenceing host computer system to run reduces the dimension of host computer system Shield workload.The method includes:
Pending file is obtained, and determines the zoning ordinance of pending file;
Searched from database with the pending related master record file of file, and determine the master record file Zoning ordinance;
The zoning ordinance of the zoning ordinance of pending file and master record file is compared, when dividing for pending file When area's rule is different with the zoning ordinance of master record file, according to the zoning ordinance of master record file, pending file is carried out Again subregion, the pending file according to subregion again updates master record file.
In one embodiment, also include:It is automatic to obtain renewal operation when renewal operation generation database deadlocks are performed Error message, when determination database deadlocks generation is analyzed to the renewal error in operation information, described renewal is operated Error message is sent to database maintenance personnel.
In one embodiment, after determination database deadlocks generation is analyzed to the renewal error in operation information, Also include:
Database deadlocks processing information is obtained, and the database deadlocks processing information is sent to database maintenance people Member.
In one embodiment, determination database deadlocks are analyzed to the renewal error in operation information to occur, including:
When in the renewal error in operation information comprising specify information, determine that database deadlocks occur.
In one embodiment, the specify information includes deadlock or timeout.
The embodiment of the present invention additionally provides a kind of database deadlocks processing unit, to pending before database deadlocks generation Data processed accordingly so that prevention data storehouse deadlock occur, need not so give up a wherein side or a few side's affairs, no The duration of influence concurrent transaction treatment so that ageing strong, the stability for not influenceing host computer system to run reduces host computer system Maintenance workload.The device includes:
Acquisition module, for obtaining pending file, and determines the zoning ordinance of pending file;
Searching modul, for searched from database with the pending related master record file of file, and determine The zoning ordinance of the master record file;
Comparison module, for the zoning ordinance of the zoning ordinance of pending file and master record file to be compared;
Subregion update module, for when the zoning ordinance of pending file is different with the zoning ordinance of master record file, According to the zoning ordinance of master record file, subregion again is carried out to pending file, the pending file according to subregion again is more New master record file.
In one embodiment, also include:Database deadlocks processing module;
The database deadlocks processing module is used for:It is automatic to obtain more when renewal operation generation database deadlocks are performed New error in operation information, when determination database deadlocks generation is analyzed to the renewal error in operation information, by described in more New error in operation information is sent to database maintenance personnel.
In one embodiment, the database deadlocks processing module is additionally operable to:
After determination database deadlocks generation is analyzed to the renewal error in operation information, obtain at database deadlocks Reason information, and the database deadlocks processing information is sent to database maintenance personnel.
In one embodiment, the database deadlocks processing module specifically for:
Determination database deadlocks are analyzed to the renewal error in operation information as follows to occur:
When in the renewal error in operation information comprising specify information, determine that database deadlocks occur.
In one embodiment, the specify information includes deadlock or timeout.
In embodiments of the present invention, for there is boss's subordinate relation between data record, also needed to when subrecord is processed Master record is updated, if boss's record is not in same partitions of database, and is not processed in the industry same, then operating room just has The situation of deadlock, the present invention may be produced carries out subregion again according to the zoning ordinance of master record file to pending file, Pending file according to subregion again updates master record file.Compared with prior art, the present invention is in database deadlocks hair Pending data is pre-processed accordingly before death, so that prevention data storehouse deadlock occurs, need not so be given up a wherein side Or a few side's affairs, the duration for not influenceing concurrent transaction to process so that ageing strong, the stability for not influenceing host computer system to run, Reduce the maintenance workload of host computer system.
The embodiment of the present invention additionally provides a kind of database deadlocks processing method, to pending before database deadlocks generation Data are processed accordingly, so that prevention data storehouse deadlock occurs, need not so give up a wherein side or a few side's affairs, not shadow Ring the duration of concurrent transaction treatment so that ageing strong, the stability for not influenceing host computer system to run reduces host computer system Maintenance workload.The method includes:
Obtain tables of data and update solicited message;Wherein, tables of data updates solicited message includes data table information to be updated;
Data table information to be updated in solicited message is updated according to tables of data, corresponding many numbers are searched from database According to table, and determine the zoning ordinance of the incidence relation between multiple tables of data and multiple tables of data;
The update sequence of multiple tables of data is determined according to the incidence relation between multiple tables of data;
The zoning ordinance of the adjacent data table in multiple tables of data is compared according to the update sequence, works as consecutive number According to the zoning ordinance of table it is different when, operation is updated to the last data table in the update sequence, it is literary in the middle of generation first Part, the zoning ordinance of the latter data table in update sequence is literary in the middle of generation second to the first intermediate file again subregion Part, operation is updated according to the second intermediate file to latter data table.
In one embodiment, also include:It is automatic to obtain renewal operation when renewal operation generation database deadlocks are performed Error message, when determination database deadlocks generation is analyzed to the renewal error in operation information, described renewal is operated Error message is sent to database maintenance personnel.
In one embodiment, after determination database deadlocks generation is analyzed to the renewal error in operation information, Also include:
Database deadlocks processing information is obtained, and the database deadlocks processing information is sent to database maintenance people Member.
In one embodiment, determination database deadlocks are analyzed to the renewal error in operation information to occur, including:
When in the renewal error in operation information comprising specify information, determine that database deadlocks occur.
In one embodiment, the specify information includes deadlock or timeout.
The embodiment of the present invention additionally provides a kind of database deadlocks processing unit, to pending before database deadlocks generation Data processed accordingly so that prevention data storehouse deadlock occur, need not so give up a wherein side or a few side's affairs, no The duration of influence concurrent transaction treatment so that ageing strong, the stability for not influenceing host computer system to run reduces host computer system Maintenance workload.The device includes:
Acquisition module, solicited message is updated for obtaining tables of data;Wherein, tables of data updates solicited message including to be updated Data table information;
Searching modul, for updating solicited message according to tables of data, searches corresponding multiple tables of data from database, and It is determined that the zoning ordinance of the incidence relation and multiple tables of data between multiple tables of data;
Update sequence determining module, the renewal for determining multiple tables of data according to the incidence relation between multiple tables of data is suitable Sequence;
Comparison module, is compared the zoning ordinance of the adjacent data table in multiple tables of data according to the update sequence Compared with;
Subregion update module, for when the zoning ordinance of adjacent data table is different, to two adjacent in update sequence Last data table in tables of data is updated operation, the first intermediate file is generated, according to two numbers adjacent in update sequence According to the zoning ordinance of the latter data table in table to the first intermediate file again subregion, the second intermediate file is generated, according to second Intermediate file is updated operation to latter data table.
In one embodiment, also include:Database deadlocks processing module;
The database deadlocks processing module is used for:It is automatic to obtain more when renewal operation generation database deadlocks are performed New error in operation information, when determination database deadlocks generation is analyzed to the renewal error in operation information, by described in more New error in operation information is sent to database maintenance personnel.
In one embodiment, the database deadlocks processing module is additionally operable to:
After determination database deadlocks generation is analyzed to the renewal error in operation information, obtain at database deadlocks Reason information, and the database deadlocks processing information is sent to database maintenance personnel.
In one embodiment, the database deadlocks processing module specifically for:
Determination database deadlocks are analyzed to the renewal error in operation information as follows to occur:
When in the renewal error in operation information comprising specify information, determine that database deadlocks occur.
In one embodiment, the specify information includes deadlock or timeout.
In embodiments of the present invention, two entity (data) Table As and B, such as sporocarp (data) are updated for needs are continuous The zoning ordinance of Table A and B is inconsistent, then operating room is possible to produce the situation of deadlock, and the present invention can be in adjacent data table Zoning ordinance it is different when, operation is updated to last data table, the first intermediate file is generated, according to dividing for latter data table Area's rule generates the second intermediate file to the first intermediate file again subregion, and latter data table is entered according to the second intermediate file Row updates operation.Compared with prior art, the present invention is pending data to be carried out before database deadlocks generation accordingly in advance Treatment, so that prevention data storehouse deadlock occurs, need not so give up a wherein side or a few side's affairs, not influence concurrent transaction to process Duration so that ageing strong, the stability for not influenceing host computer system to run, reduce the maintenance workload of host computer system.
In addition, after database deadlocks occur, the error message that operation is updated to database can be automatically obtained, and will Update error in operation information to send to database maintenance personnel, such attendant can in time have found that database deadlocks occur, no It is ageing that influence concurrent transaction is processed.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing The accompanying drawing to be used needed for having technology description is briefly described, it should be apparent that, drawings in the following description are only this Some embodiments of invention, for those of ordinary skill in the art, on the premise of not paying creative work, can be with Other accompanying drawings are obtained according to these accompanying drawings.
Fig. 1 is a kind of database deadlocks process flow figure one provided in an embodiment of the present invention;
Fig. 2 is a kind of database deadlocks processing device structure diagram one provided in an embodiment of the present invention;
Fig. 3 is a kind of database deadlocks process flow figure two provided in an embodiment of the present invention;
Fig. 4 is a kind of database deadlocks processing device structure diagram two provided in an embodiment of the present invention.
Specific embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Site preparation is described, it is clear that described embodiment is only a part of embodiment of the invention, rather than whole embodiments.Based on this Embodiment in invention, the every other reality that those of ordinary skill in the art are obtained under the premise of creative work is not made Example is applied, the scope of protection of the invention is belonged to.
For there is boss's subordinate relation between data record, also need to update master record when subrecord is processed, if main Subrecord is not processed in the industry same not in same partitions of database, then operating room is possible to that deadlock can be produced Situation, the present invention proposes a kind of database deadlocks processing method, is prevented in advance, and data are pre-processed, and redistributes Pending data, prevents database deadlocks from occurring.
Fig. 1 is a kind of database deadlocks process flow figure one provided in an embodiment of the present invention, flow as shown in Figure 1 Understand, in embodiments of the present invention, a kind of database deadlocks processing method includes:
Step 101:Pending file is obtained, and determines the zoning ordinance of pending file;
Step 102:Searched from database with the pending related master record file of file, and determine the master The zoning ordinance of log file;
Step 103:The zoning ordinance of the zoning ordinance of pending file and master record file is compared, when pending When the zoning ordinance of file is different with the zoning ordinance of master record file, according to the zoning ordinance of master record file, to pending File carries out subregion again, and the pending file according to subregion again updates master record file.
During specific implementation, according to the characteristics of pending data, such as, and the application of subrecord (data in pending file) Operation is only write, and master record application operating is renewal, the input file that will now be split by the scope of subrecord originally (pending file), should find corresponding master record file, again according to the model of master record file by boss's record relation pair (zoning ordinance) is enclosed, combination, fractionation (subregion again) is re-started to pending file and is formed new input file, according to new input File is updated to master record file, so operates the renewal of each operation and concentrates in a subregion, so as to keep away Exempt from database deadlocks.
During specific implementation, the general handling process for database deadlocks is:Go to transfer operation by attendant to report an error letter Cease to note abnormalities, then processed according to given emergency method.So because attendant can not in time have found data Storehouse deadlock occurs, and it is ageing that influence concurrent transaction is processed.Based on this, the inventive method can also be adopted after database deadlocks generation Take following manner:Automatic acquisition updates error in operation information (such as log information), is analyzed when to updating error in operation information When determining that database deadlocks occur, the renewal error in operation information is sent to database maintenance personnel.Specifically, determining number According to storehouse deadlock occur, be when update error in operation information in comprising specify information when, wherein specify information can include Deadlock (deadlock) or timeout (time-out) etc..
During specific implementation, after determination database deadlocks generation is analyzed to renewal error in operation information, also include:Obtain Database deadlocks processing information is taken, and database deadlocks processing information is sent to database maintenance personnel.
Determination database deadlocks are analyzed to the renewal error in operation information to occur, including:
A kind of database deadlocks processing unit is additionally provided based on same inventive concept, in the embodiment of the present invention, it is such as following Embodiment described in.Because the principle of database deadlocks processing unit solve problem is similar to database deadlocks processing method, because The implementation of this database deadlocks processing unit may refer to the implementation of database deadlocks processing method, repeats part and repeats no more. Used below, term " unit " or " module " can realize the combination of the software and/or hardware of predetermined function.Although with Device described by lower embodiment is preferably realized with software, but hardware, or the combination of software and hardware realization May and be contemplated.
Fig. 2 is a kind of database deadlocks processing device structure diagram one provided in an embodiment of the present invention, as shown in Fig. 2 In embodiments of the present invention, a kind of database deadlocks processing unit includes:
Acquisition module 202, for obtaining pending file, and determines the zoning ordinance of pending file;
Searching modul 204, for searched from database with the pending related master record file of file, and really The zoning ordinance of the fixed master record file;
Comparison module 206, for the zoning ordinance of the zoning ordinance of pending file and master record file to be compared;
Subregion update module 208 is different with the zoning ordinance of master record file for the zoning ordinance when pending file When, according to the zoning ordinance of master record file, subregion again is carried out to pending file, according to the pending file of subregion again Update master record file.
The structure is illustrated below.
During specific implementation, the database deadlocks processing unit also includes:Database deadlocks processing module;
The database deadlocks processing module is used for:It is automatic to obtain more when renewal operation generation database deadlocks are performed New error in operation information, when determination database deadlocks generation is analyzed to the renewal error in operation information, by described in more New error in operation information is sent to database maintenance personnel.
During specific implementation, database deadlocks processing module is additionally operable to:
After determination database deadlocks generation is analyzed to the renewal error in operation information, obtain at database deadlocks Reason information, and the database deadlocks processing information is sent to database maintenance personnel.
During specific implementation, database deadlocks processing module specifically for:
Determination database deadlocks are analyzed to the renewal error in operation information as follows to occur:
When in the renewal error in operation information comprising specify information, determine that database deadlocks occur.
During specific implementation, specify information includes deadlock or timeout.
Two entity (data) Table As and B (can be multiple), such as sporocarp (data) Table A and B are continuously updated for needs Zoning ordinance it is inconsistent, then operating room is possible to produce the situation of deadlock, and the present invention proposes another database deadlocks Processing method, enters and is transformed in acting, and exactly carries out asynchronous process, and continuous update action is disassembled, and prevents database dead Lock occurs.
Fig. 3 is a kind of database deadlocks process flow figure two provided in an embodiment of the present invention, flow as shown in Figure 3 Understand, in embodiments of the present invention, the database deadlocks processing method includes:
Step 301:Obtain tables of data and update solicited message;Wherein, tables of data updates solicited message includes data to be updated Table information;
Step 302:Data table information to be updated in solicited message is updated according to tables of data, is searched from database corresponding Multiple tables of data, and determine the zoning ordinance of the incidence relation between multiple tables of data and multiple tables of data;
Step 303:The update sequence of multiple tables of data is determined according to the incidence relation between multiple tables of data;
Step 304:The zoning ordinance of the adjacent data table in multiple tables of data is compared according to the update sequence, When the zoning ordinance of adjacent data table is different, operation is updated to the last data table in the update sequence, generates the One intermediate file, the zoning ordinance of the latter data table in update sequence to the first intermediate file again subregion, generation the Two intermediate files, operation is updated according to the second intermediate file to latter data table.
During specific implementation, the zoning ordinance of the adjacent data table in multiple tables of data is compared according to update sequence, Refer to comparing two-by-two.Such as, there are three data Table As, B, C, the zoning ordinance of tables of data A and tables of data B is compared, will The zoning ordinance of tables of data B and tables of data C is compared.When the zoning ordinance difference of adjacent data table refer to tables of data A and The zoning ordinance of tables of data B is different, and tables of data B is different with the zoning ordinance of tables of data C.And the subregion of tables of data A and tables of data C Rule can be with identical, it is also possible to differs.
Below the method process is illustrated to update two tables of data and three tables of data of renewal.
For example, for needing continuous renewal two entity Table As and B.The tables of data for obtaining first is wrapped in updating solicited message The information of entity Table A and B is included, such as data message, the letter to be updated the data in Table A and B in data table name, tables of data Breath etc..The information of the entity Table A and B in solicited message is updated according to tables of data, corresponding tables of data A is searched from database And B, it is then determined that the zoning ordinance of the incidence relation and data Table A and B between tables of data A and B, according to the pass between tables of data A and B Connection relation determines the update sequence of tables of data A and B, such as can first update A updates B again.Then dividing for tables of data A and B is compared Area's rule, when both are identical, then updates the data Table A and B simultaneously;When the zoning ordinance of tables of data A and B is inconsistent, take Substep updates, i.e. concurrent processing (renewal) Table A normal first, completes to update operation for the first time, produces destination file group a, then To by intermediate file group a in file a1, a2 ... an, recombinated according to the zoning ordinance of tables of data B, generation in the middle of text Part group b, wherein file group b include b1, b2 ... bn, then by b1, b2 ... bn is updated operation to tables of data B, completion Update operation second.
For example, for needing continuous renewal three data Table As, B and C.The tables of data for obtaining first is updated in solicited message Information including entity Table A, B and C, entity Table A, the information of B and C in solicited message is updated according to tables of data, from database It is middle to search corresponding tables of data A, B and C, it is then determined that the subregion of the incidence relation between tables of data A, B and C, tables of data A, B and C Rule, the update sequence of tables of data A, B and C is determined according to the incidence relation between tables of data A, B and C, such as can first update A again B is updated, then updates C.Then the zoning ordinance of tables of data A and B, the zoning ordinance of tables of data B and C, when the subregion of A and B are compared When rule is identical, then Table A and B are updated the data simultaneously, when tables of data B is identical with the zoning ordinance of C, then update the data table simultaneously B and C.When the zoning ordinance of tables of data A and B is inconsistent, substep is taken to update, i.e. concurrent processing (renewal) table normal first A, complete for the first time update operation, produce destination file group a, then to by intermediate file group a in file a1, a2 ... an, Zoning ordinance according to tables of data B is recombinated, generation intermediate file group b, wherein file group b include b1, b2 ... bn, then By b1, b2 ... bn is updated operation to tables of data B, completes second and updates operation.When the zoning ordinance of tables of data B and C When inconsistent, equally take substep to update, i.e. by b1, b2 ... bn normal concurrent processing (renewals) table B, completion is for the second time more New operation, produces destination file group c, then to by the file c1 in intermediate file group c, c2 ... cn, according to tables of data C's Zoning ordinance is recombinated, generation intermediate file group d, wherein file group d include d1, d2 ... dn, then by d1, d2 ... dn Operation is updated to tables of data C, third time is completed and is updated operation.
During specific implementation, for it is above-mentioned the fact that perform update operation occur database deadlocks when, the method equally can Automatic acquisition updates error in operation information (such as log information), when being analyzed determination database to updating error in operation information When deadlock occurs, the renewal error in operation information is sent to database maintenance personnel, while can also obtain database deadlocks Processing information, and database deadlocks processing information is sent to database maintenance personnel.Specifically, when renewal error in operation information In comprising specify information when, just can determine whether database deadlocks occur, wherein specify information can include deadlock or timeout Etc..
A kind of database deadlocks processing unit is additionally provided based on same inventive concept, in the embodiment of the present invention, it is such as following Embodiment described in.The implementation of the database deadlocks processing unit equally may refer to the reality of above-mentioned database deadlocks processing method Apply, repeat part and repeat no more.
Fig. 4 is a kind of database deadlocks processing device structure diagram two provided in an embodiment of the present invention, as shown in figure 4, In embodiments of the present invention, the database deadlocks processing unit includes:
Acquisition module 402, solicited message is updated for obtaining tables of data;Wherein, tables of data updates solicited message and includes treating Update the data table information;
Searching modul 404, for updating solicited message according to tables of data, searches corresponding multiple data from database Table, and determine the zoning ordinance of the incidence relation between multiple tables of data and multiple tables of data;
Update sequence determining module 406, for determining multiple tables of data more according to the incidence relation between multiple tables of data New sequences;
Comparison module 408, is carried out the zoning ordinance of the adjacent data table in multiple tables of data according to the update sequence Compare;
Subregion update module 410, for when the zoning ordinance of adjacent data table is different, in update sequence adjacent two Last data table in individual tables of data is updated operation, the first intermediate file is generated, according to two adjacent in update sequence The zoning ordinance of the latter data table in tables of data generates the second intermediate file to the first intermediate file again subregion, according to the Two intermediate files are updated operation to latter data table.
The structure is illustrated below.
During specific implementation, the database deadlocks processing unit also includes:Database deadlocks processing module;
The database deadlocks processing module is used for:It is automatic to obtain more when renewal operation generation database deadlocks are performed New error in operation information, when determination database deadlocks generation is analyzed to the renewal error in operation information, by described in more New error in operation information is sent to database maintenance personnel.
During specific implementation, database deadlocks processing module is additionally operable to:
After determination database deadlocks generation is analyzed to the renewal error in operation information, obtain at database deadlocks Reason information, and the database deadlocks processing information is sent to database maintenance personnel.
During specific implementation, database deadlocks processing module specifically for:
Determination database deadlocks are analyzed to the renewal error in operation information as follows to occur:
When in the renewal error in operation information comprising specify information, determine that database deadlocks occur.
During specific implementation, specify information includes deadlock or timeout.
In sum, compared with prior art, method proposed by the present invention can from advance, in thing, afterwards enter in terms of three Hand, from being pre-processed accordingly to pending data in advance, in thing, so that prevention data storehouse deadlock occurs, so without give up A wherein side or a few side's affairs are abandoned, the duration for not influenceing concurrent transaction to process so that ageing strong, do not influence host computer system to run Stability, reduce the maintenance workload of host computer system.After database deadlocks occur, can obtain automatically is carried out to database Update the error message of operation, and error in operation information will be updated and send to database maintenance personnel, such attendant can and Shi Faxian database deadlocks occur, and the ageing of concurrent transaction treatment is not influenceed.In addition, the inventive method also has the advantage that:
(1) easy to implement, increased subregion update module, principle is uncomplicated, writes easily, and implementation cost is low.
(2) reusable, subregion update module can be applied to many scenes, for example need and meanwhile more New Account and client or The several scenes such as person's account and card family, durability is good.
(3) it is a large amount of to reduce batch interruption times.After the operation of subregion update module, the deadlock of the day batch processing that only bears interest is interrupted Number of times is reduced to 0 from nearly 50 times.
(4) maintenance work becomes simple, and automatically captures deadlock information and is pushed to console, very clear.
It should be understood by those skilled in the art that, embodiments of the invention can be provided as method, system or computer program Product.Therefore, the present invention can be using the reality in terms of complete hardware embodiment, complete software embodiment or combination software and hardware Apply the form of example.And, the present invention can be used and wherein include the computer of computer usable program code at one or more The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) is produced The form of product.
The present invention is the flow with reference to method according to embodiments of the present invention, equipment (system) and computer program product Figure and/or block diagram are described.It should be understood that every first-class during flow chart and/or block diagram can be realized by computer program instructions The combination of flow and/or square frame in journey and/or square frame and flow chart and/or block diagram.These computer programs can be provided The processor of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce A raw machine so that produced for reality by the instruction of computer or the computing device of other programmable data processing devices The device of the function of being specified in present one flow of flow chart 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 other programmable data processing devices with spy In determining the computer-readable memory that mode works so that instruction of the storage in the computer-readable memory is produced and include finger Make the manufacture of device, the command device realize in one flow of flow chart or multiple one square frame of flow and/or block diagram or The function of being specified in multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that in meter Series of operation steps is performed on calculation machine or other programmable devices to produce computer implemented treatment, so as in computer or The instruction performed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one The step of function of being specified in individual square frame or multiple square frames.
The preferred embodiments of the present invention are the foregoing is only, is not intended to limit the invention, for the skill of this area For art personnel, the embodiment of the present invention can have various modifications and variations.It is all within the spirit and principles in the present invention, made Any modification, equivalent substitution and improvements etc., should be included within the scope of the present invention.

Claims (20)

1. a kind of database deadlocks processing method, it is characterised in that including:
Pending file is obtained, and determines the zoning ordinance of pending file;
Searched from database with the pending related master record file of file, and determine the master record file point Area's rule;
The zoning ordinance of the zoning ordinance of pending file and master record file is compared, when the subregion of pending file is advised When zoning ordinance then with master record file is different, according to the zoning ordinance of master record file, pending file is carried out again Subregion, the pending file according to subregion again updates master record file.
2. database deadlocks processing method as claimed in claim 1, it is characterised in that also include:Operation hair is updated when performing During raw database deadlocks, automatic acquisition updates error in operation information, when being analyzed determination to the renewal error in operation information When database deadlocks occur, the renewal error in operation information is sent to database maintenance personnel.
3. database deadlocks processing method as claimed in claim 2, it is characterised in that to the renewal error in operation information After being analyzed determination database deadlocks generation, also include:
Database deadlocks processing information is obtained, and the database deadlocks processing information is sent to database maintenance personnel.
4. database deadlocks processing method as claimed in claim 2, it is characterised in that enter to the renewal error in operation information Row analysis determines that database deadlocks occur, including:
When in the renewal error in operation information comprising specify information, determine that database deadlocks occur.
5. database deadlocks processing method as claimed in claim 4, it is characterised in that the specify information includes deadlock Or timeout.
6. a kind of database deadlocks processing unit, it is characterised in that including:
Acquisition module, for obtaining pending file, and determines the zoning ordinance of pending file;
Searching modul, for searched from database with the pending related master record file of file, and determine described The zoning ordinance of master record file;
Comparison module, for the zoning ordinance of the zoning ordinance of pending file and master record file to be compared;
Subregion update module, for when the zoning ordinance of pending file is different with the zoning ordinance of master record file, according to The zoning ordinance of master record file, subregion again is carried out to pending file, and the pending file according to subregion again updates master Log file.
7. database deadlocks processing unit as claimed in claim 6, it is characterised in that also include:Database deadlocks process mould Block;
The database deadlocks processing module is used for:It is automatic to obtain renewal behaviour when renewal operation generation database deadlocks are performed Make error message, when determination database deadlocks generation is analyzed to the renewal error in operation information, described renewal is grasped Sent to database maintenance personnel as error message.
8. database deadlocks processing unit as claimed in claim 7, it is characterised in that the database deadlocks processing module is also For:
After determination database deadlocks generation is analyzed to the renewal error in operation information, database deadlocks treatment letter is obtained Breath, and the database deadlocks processing information is sent to database maintenance personnel.
9. database deadlocks processing unit as claimed in claim 6, it is characterised in that the database deadlocks processing module tool Body is used for:
Determination database deadlocks are analyzed to the renewal error in operation information as follows to occur:
When in the renewal error in operation information comprising specify information, determine that database deadlocks occur.
10. database deadlocks processing unit as claimed in claim 9, it is characterised in that the specify information includes Deadlock or timeout.
A kind of 11. database deadlocks processing methods, it is characterised in that including:
Obtain tables of data and update solicited message;Wherein, tables of data updates solicited message includes data table information to be updated;
Data table information to be updated in solicited message is updated according to tables of data, corresponding multiple data are searched from database Table, and determine the zoning ordinance of the incidence relation between multiple tables of data and multiple tables of data;
The update sequence of multiple tables of data is determined according to the incidence relation between multiple tables of data;
The zoning ordinance of the adjacent data table in multiple tables of data is compared according to the update sequence, when adjacent data table Zoning ordinance it is different when, operation, the first intermediate file of generation, root are updated to the last data table in the update sequence According to the zoning ordinance of the latter data table in update sequence to the first intermediate file again subregion, the second intermediate file, root are generated Operation is updated to latter data table according to the second intermediate file.
12. database deadlocks processing methods as claimed in claim 11, it is characterised in that also include:Operation is updated when performing During generation database deadlocks, automatic acquisition updates error in operation information, is analyzed really when to the renewal error in operation information When determining database deadlocks generation, the renewal error in operation information is sent to database maintenance personnel.
13. database deadlocks processing methods as claimed in claim 12, it is characterised in that to the renewal error in operation letter After breath is analyzed determination database deadlocks generation, also include:
Database deadlocks processing information is obtained, and the database deadlocks processing information is sent to database maintenance personnel.
14. database deadlocks processing methods as claimed in claim 12, it is characterised in that to the renewal error in operation information Determination database deadlocks are analyzed to occur, including:
When in the renewal error in operation information comprising specify information, determine that database deadlocks occur.
15. database deadlocks processing methods as claimed in claim 14, it is characterised in that the specify information includes Deadlock or timeout.
A kind of 16. database deadlocks processing units, it is characterised in that including:
Acquisition module, solicited message is updated for obtaining tables of data;Wherein, tables of data updates solicited message includes data to be updated Table information;
Searching modul, for updating solicited message according to tables of data, searches corresponding multiple tables of data, and determine from database The zoning ordinance of incidence relation and multiple tables of data between multiple tables of data;
Update sequence determining module, the update sequence for determining multiple tables of data according to the incidence relation between multiple tables of data;
, be compared for the zoning ordinance of the adjacent data table in multiple tables of data according to the update sequence by comparison module;
Subregion update module, for when the zoning ordinance of adjacent data table is different, to two data adjacent in update sequence Last data table in table is updated operation, the first intermediate file is generated, according to two tables of data adjacent in update sequence In latter data table zoning ordinance to the first intermediate file again subregion, the second intermediate file is generated, in the middle of second File is updated operation to latter data table.
17. database deadlocks processing units as claimed in claim 16, it is characterised in that also include:Database deadlocks treatment Module;
The database deadlocks processing module is used for:It is automatic to obtain renewal behaviour when renewal operation generation database deadlocks are performed Make error message, when determination database deadlocks generation is analyzed to the renewal error in operation information, described renewal is grasped Sent to database maintenance personnel as error message.
18. database deadlocks processing units as claimed in claim 17, it is characterised in that the database deadlocks processing module It is additionally operable to:
After determination database deadlocks generation is analyzed to the renewal error in operation information, database deadlocks treatment letter is obtained Breath, and the database deadlocks processing information is sent to database maintenance personnel.
19. database deadlocks processing units as claimed in claim 16, it is characterised in that the database deadlocks processing module Specifically for:
Determination database deadlocks are analyzed to the renewal error in operation information as follows to occur:
When in the renewal error in operation information comprising specify information, determine that database deadlocks occur.
20. database deadlocks processing units as claimed in claim 19, it is characterised in that the specify information includes Deadlock or timeout.
CN201710140957.XA 2017-03-10 2017-03-10 Database deadlock processing method and device Active CN106933657B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710140957.XA CN106933657B (en) 2017-03-10 2017-03-10 Database deadlock processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710140957.XA CN106933657B (en) 2017-03-10 2017-03-10 Database deadlock processing method and device

Publications (2)

Publication Number Publication Date
CN106933657A true CN106933657A (en) 2017-07-07
CN106933657B CN106933657B (en) 2020-12-04

Family

ID=59433842

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710140957.XA Active CN106933657B (en) 2017-03-10 2017-03-10 Database deadlock processing method and device

Country Status (1)

Country Link
CN (1) CN106933657B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021012819A1 (en) * 2019-07-22 2021-01-28 中兴通讯股份有限公司 Database deadlock detection method and apparatus

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101661402A (en) * 2008-08-29 2010-03-03 国际商业机器公司 Deadlock treatment method and system for databank management system
CN101876983A (en) * 2009-04-30 2010-11-03 国际商业机器公司 Method for partitioning database and system thereof
CN102890720A (en) * 2012-10-16 2013-01-23 南京通达海信息技术有限公司 Database inspection and maintenance method
CN105373541A (en) * 2014-08-22 2016-03-02 博雅网络游戏开发(深圳)有限公司 Processing method and system for data operation request of database

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101661402A (en) * 2008-08-29 2010-03-03 国际商业机器公司 Deadlock treatment method and system for databank management system
CN101876983A (en) * 2009-04-30 2010-11-03 国际商业机器公司 Method for partitioning database and system thereof
CN102890720A (en) * 2012-10-16 2013-01-23 南京通达海信息技术有限公司 Database inspection and maintenance method
CN105373541A (en) * 2014-08-22 2016-03-02 博雅网络游戏开发(深圳)有限公司 Processing method and system for data operation request of database

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021012819A1 (en) * 2019-07-22 2021-01-28 中兴通讯股份有限公司 Database deadlock detection method and apparatus

Also Published As

Publication number Publication date
CN106933657B (en) 2020-12-04

Similar Documents

Publication Publication Date Title
EP3120261B1 (en) Dependency-aware transaction batching for data replication
Mohebi et al. Iterative big data clustering algorithms: a review
US9529881B2 (en) Difference determination in a database environment
US7752299B2 (en) Segmentation and processing of continuous data streams using transactional semantics
US10990628B2 (en) Systems and methods for performing a range query on a skiplist data structure
US8271416B2 (en) Method for dynamically determining a predetermined previous condition of a rule-based system
EP4029191B1 (en) Supporting blockchain collections in a database
CN109643310B (en) System and method for redistribution of data in a database
EP3674918B1 (en) Column lineage and metadata propagation
Ke et al. Optimus: a dynamic rewriting framework for data-parallel execution plans
US20110082832A1 (en) Parallelized backup and restore process and system
US10366075B2 (en) Database management system and method
US10783163B2 (en) Instance-based distributed data recovery method and apparatus
CN112579586A (en) Data processing method, device, equipment and storage medium
CN110188103A (en) Data account checking method, device, equipment and storage medium
EP1314100A2 (en) Segmentation and processing of continuous data streams using transactional semantics
GB2574282A (en) Data consistency verification method and system minimizing load of original database
Li et al. ASLM: Adaptive single layer model for learned index
CN114817243A (en) Method, device and equipment for establishing database joint index and storage medium
US20230394027A1 (en) Transaction execution method, computing device, and storage medium
Mestre et al. Efficient entity matching over multiple data sources with mapreduce
CN104885060B (en) Data leakage updates and checks that the leakage of device, data updates inspection method
CN106933657A (en) Database deadlocks processing method and processing device
US12001570B2 (en) Big data distributed processing and secure data transferring with resource allocation and rebate
Dong et al. GAT: A unified GPU-accelerated framework for processing batch trajectory queries

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
GR01 Patent grant
GR01 Patent grant