CN109033301A - A kind of db transaction execution method based on graphics processor - Google Patents

A kind of db transaction execution method based on graphics processor Download PDF

Info

Publication number
CN109033301A
CN109033301A CN201810778840.9A CN201810778840A CN109033301A CN 109033301 A CN109033301 A CN 109033301A CN 201810778840 A CN201810778840 A CN 201810778840A CN 109033301 A CN109033301 A CN 109033301A
Authority
CN
China
Prior art keywords
affairs
group
transaction
vertex
depth
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
CN201810778840.9A
Other languages
Chinese (zh)
Other versions
CN109033301B (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.)
University of Science and Technology of China USTC
Original Assignee
University of Science and Technology of China USTC
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 University of Science and Technology of China USTC filed Critical University of Science and Technology of China USTC
Priority to CN201810778840.9A priority Critical patent/CN109033301B/en
Publication of CN109033301A publication Critical patent/CN109033301A/en
Application granted granted Critical
Publication of CN109033301B publication Critical patent/CN109033301B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Processing Or Creating Images (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a kind of, and the db transaction based on graphics processor executes method, is characterized in the step of taking affairs fractionation, building transaction dependency figure, the division of Lothrus apterus affairs set, basic operation grouping and affairs to execute;By the way that affairs are split as basic operation, the dependence between affairs is obtained according to the conflict between basic operation, constructs transaction dependency figure;When executing affairs, each basic operation is executed by a GPU thread, compared with existing each GPU thread executes the execution method of an affairs, under the premise of guaranteeing that affairs execute correctly, the concurrency for improving affairs execution shortens affairs and executes the time, improves throughput of system.

Description

A kind of db transaction execution method based on graphics processor
Technical field
The invention belongs to calculator memory database technical fields, and in particular in widely used graphics processor (GPU) realize that quick db transaction executes method on.
Background technique
In August, 1999, NVIDIA company have issued the graphic chips Geforce 256 that a code name is NV10.It is A product for proposing GPU (Graphics Processing Unit) concept, is mainly used to carry out image procossing.In recent years, As the computing capability of GPU is stronger and stronger, its application field gradually expands to general-purpose computations field.It has already appeared at present Accelerate the technology of Transaction Processing (OLTP) memory database with GPU, but current scheme is executed using a thread The sequence executive mode of one affairs.Since an affairs are made of multiple basic operations, and part basic operation can be parallel It executes, single thread sequence execution pattern cannot sufficiently excavate the concurrency inside affairs, so that the calculating of GPU cannot be made full use of Resource and memory bandwidth.
Summary of the invention
The purpose of the present invention is to propose to a kind of, and the db transaction based on graphics processor executes method, to overcome existing skill The drawbacks described above of art, in the case where guaranteeing low overhead, the concurrency that enhancing affairs execute shortens affairs and executes the time, improves The handling capacity of system execution affairs.
The present invention is based on the db transactions of graphics processor to execute method, it is characterised in that the following steps are included:
Step 1: affairs are split
According to the input data of a collection of affairs, affairs are split into basic operation set, a basic operation is by [data , transaction number, action type (reading or writing)] it indicates, if two basic operations access the same data item, and wherein at least One basic operation is write operation, then it is assumed that the two data item conflicts;At least with a number in two affairs t1 and t2 It is conflict according to item, then it is assumed that the two affairs have dependence;
Step 2: building transaction dependency figure
Initial transaction dependency graph is sky, by the sequence of transaction number from small to large successively add all affairs and accordingly according to Rely transaction dependency figure;Vertex represents an affairs;When meeting following three conditions, one is added between affairs t1 and t2 Side: 1. there are dependences between two affairs t1 and t2, and 2. the transaction number of affairs t1 is less than the transaction number of affairs t2,3. do not deposit In another affairs t, so that the transaction number of affairs t is between affairs t1 and t2 and affairs t and affairs t1, t2 have dependence Relationship, affairs t1 are known as the prefix vertex of affairs t2;
Step 3: Lothrus apterus affairs set divides
In the transaction dependency figure constructed, source summit is the vertex on no prefix vertex, corresponding affairs independent of Any other affairs;The depth of vertex v is the longest path length from source summit to vertex v, and the depth of source summit is zero;Have The affairs of same depth are put into the same set, and the collection that the vertex that depth is k is constituted is collectively referred to as k-set, the depth of transaction dependency figure Degree is the maximum value of all vertex depth;
Step 4: operation grouping
In each k-set, all read operations are added same group and call 0- group, all write operations is added same Group is known as 1- group;Without dependence between operation in 0- group, without dependence between the operation in 1- group;1- group depends on 0 Group;
Step 5: affairs execute
GPU successively executes affairs according to 0-set, the sequence of 1-set ..., k-set;Inside each set, according to 0- Group, the sequence of 1- group execute operation, and an operation is executed by a GPU thread.
The affairs based on graphics processor of aforementioned present invention execute method, take affairs and split, construct transaction dependency The step of figure, Lothrus apterus affairs set divide, operation is grouped, affairs execute;By the way that affairs are split as basic operation, according to base Conflict between this operation obtains the dependence between affairs, transaction dependency figure is constructed, to know between global transaction Dependence;Transaction phase is being executed, each basic operation is executed by a GPU thread, with existing each affairs by one The method that a GPU thread executes is compared, and under the premise of guaranteeing that affairs execute correctly, improves the concurrency of affairs execution, contracting Short affairs execute the times, improve throughput of system.
Detailed description of the invention
Fig. 1 is that the present invention is based on the implementation operating process schematic diagrams that the affairs of graphics processor execute method.
Fig. 2 is input affairs composition schematic diagram.
Fig. 3 is the basic operation schematic diagram in data item.
Fig. 4 is that transaction dependency diagram is intended to.
Fig. 5 is Lothrus apterus affairs assembly diagram.
Fig. 6 is that basic operation is grouped schematic diagram.
Fig. 7 is affairs implementation procedure schematic diagram.
Specific embodiment
With reference to the accompanying drawing by specific embodiment to the present invention is based on the affairs of graphics processor execution methods to make into one The detailed description of step.
Embodiment 1:
Fig. 1 is that the present invention is based on the implementation operating process schematic diagrams that the affairs of graphics processor execute method.
The present embodiment executes method based on the affairs of graphics processor, specifically includes the following steps:
Step 1: affairs are split
Fig. 2 gives the input affairs composition of embodiment, and every a line indicates an affairs in figure.This batch of affairs include affairs It number is T1, T2, T3, four incremental affairs of T4 and transaction number, R indicates read operation, and W indicates that write operation, a, b, c are three need The data item to be accessed, such as Ra indicate item of read data a.The composition of affairs T1 operates are as follows: Ra, Wa, Rb, Wb.The group of affairs T2 At operation are as follows: Rc, Wc, Ra.The composition of affairs T3 operates are as follows: Rb, Wb.The composition of affairs T4 operates are as follows: Rc, Wc, Wb.This implementation Affairs input of the example based on attached drawing 1 carries out the affairs based on graphics processor and executes method.
Fig. 3 indicates the operation chart of input affairs.
One basic operation is indicated by [data item, transaction number, action type], and according to the input of affairs, affairs are split For basic operation (1. referring to the flow operations frame in Fig. 1).The basic behaviour for needing to carry out in each data item is listed in attached drawing 3 Make, every a line indicates all basic operations for needing to carry out in a data item.Two basic operations access the same data item, And wherein at least one basic operation is write operation, then the two data item conflicts;It is at least closed in two affairs t1 and t2 It is conflict in a data item, then the two affairs have dependence.
Step 2: building transaction dependency figure
Fig. 4 is that transaction dependency diagram is intended to.
Originally transaction dependency figure is empty.Affairs T1 is added in transaction dependency figure (referring to the flow operations in Fig. 1 first Frame is 2.), due to not adding side without the affairs with affairs T1 conflict.Then, affairs T2 is added to transaction dependency figure In, the operation [a, T2, R] of affairs T2 and the operation [a, T1, W] of T1 conflict with each other, and the transaction number of affairs T1 is less than affairs T2, no There are transaction numbers between affairs T1, affairs T2 and and their affairs for all conflicting, add an affairs T1 and be directed toward affairs The side (3. referring to the flow operations frame in Fig. 1) of T2.Affairs T3 can be similarly added in transaction dependency figure figure.Finally, affairs T4 and T2 conflicts about data item c and affairs T1, T3 conflict about data item b, due to having affairs T3 between affairs T1 and T4, So not adding side between affairs T1 and T4, side only is added between affairs T2 and T4, T3 and T4.The transaction dependency built Figure is as shown in Fig. 4.
Step 3: Lothrus apterus affairs set divides
Fig. 5 is Lothrus apterus affairs assembly diagram.
In the transaction dependency figure that second step is built, the depth of affairs T1 is 0, and 0-set is added in affairs T1.Affairs The depth of T2, T3 are 1, and 1-set is added in affairs T2, T3.The depth of affairs T4 is 2, and 2-set is added in affairs T4.To complete At the division (4. referring to the flow operations frame in Fig. 1) of Lothrus apterus affairs set.Attached drawing 5 gives ready-portioned k-set set.
Step 4: basic operation is grouped
Fig. 6 is that basic operation is grouped schematic diagram.
Each k-set is the affairs set of Lothrus apterus, and gathering internal affairs can execute parallel, is needed at this time into one The dependence of basic operation inside step analysis affairs.Analysis is found, read-write dependency is only existed inside affairs, other shapes are not present The dependence of formula.Therefore the read operation in each k-set is divided into 0- group, write operation is divided into 1- group.1- group depends on 0- group.After segmentation in 0-set 0- group content are as follows: [a, T1, R], [b, T1, R], the content of 1- group are as follows: [a, T1, W], [b, T1, W] (5. referring to the flow operations frame in Fig. 1).Whole basic operation grouping situations is given in attached drawing 6.
Step 5: affairs execute
Fig. 7 is affairs implementation procedure schematic diagram.
In order to guarantee that affairs correctly execute, need according to 0-set, 1-set, the sequence of 2-set successively executes affairs, this hair The bright concurrency that in such a way that a thread executes an operation, raising affairs are executed.Meanwhile inside set, operation is pressed It is executed according to 0- group, the sequence of 1- group.According to the basic operation division result of the 4th step, the execution that affairs are given in attached drawing 6 is suitable One read operation is indicated with a reading word in Fig. 7, is write for the ease of expression by sequence (6. referring to the flow operations frame in Fig. 1) Operation is write with one and is indicated.
In the present embodiment, method is executed by the affairs based on graphics processor, by being split as grasping substantially by affairs Make and an operation is executed by a thread, while guaranteeing that affairs execute correct, enhances the concurrency of affairs execution. In the sequence execution pattern that a thread executes an affairs, the affairs of the present embodiment were needed by 10 read-write stages.? A thread proposed by the present invention executes in the execution pattern of a basic operation, it is only necessary to pass through 6 read-write stages, shorten Affairs execute the time, and improve resource utilization ratio, improve throughput of system.

Claims (1)

1. a kind of db transaction based on graphics processor executes method, it is characterised in that the following steps are included:
Step 1: affairs are split
According to the data access requirements of a collection of affairs, affairs are split into multiple basic operations, a basic operation is by [data , transaction number, action type] it indicates, if two basic operations access the same data item, and wherein at least one base This operation is write operation, then it is assumed that the two data item conflicts;In two affairs t1 and t2 at least with a data item be punching Prominent, then it is assumed that the two affairs have dependence;
Step 2: building transaction dependency figure
Initial transaction dependency graph is sky, successively adds all affairs by the sequence of transaction number from small to large and corresponding dependence is arrived Transaction dependency figure;Vertex represents an affairs;When meeting following three conditions, a line is added between affairs t1 and t2: 1. there are dependences between two affairs t1 and t2,2. the transaction number of affairs t1 is less than the transaction number of affairs t2, is 3. not present Another affairs t, so that the transaction number of affairs t is between affairs t1 and t2 and affairs t and affairs t1, t2 have dependence to close System, affairs t1 are known as the prefix vertex of affairs t2;
Step 3: Lothrus apterus affairs set divides
In the transaction dependency figure constructed, source summit is the vertex on no prefix vertex, and corresponding affairs are independent of any Other affairs;The depth of vertex v is the longest path length from source summit to vertex v, and the depth of source summit is zero;With identical The affairs of depth are put into the same set, and the collection that the vertex that depth is k is constituted is collectively referred to as k-set, and the depth of transaction dependency figure is The maximum value of all vertex depth;
Step 4: basic operation is grouped
In each k-set, all read operations are added same group and call 0- group, all write operations are added same group and are claimed For 1- group;Without dependence between operation in 0- group, without dependence between the operation in 1- group;1- group depends on 0 group;
Step 5: affairs execute
Affairs are successively executed according to the sequence of 0-set, 1-set ..., k-set;Inside each affairs set, according to 0- group, 1- The sequence of group executes operation, and an operation is executed by a GPU thread.
CN201810778840.9A 2018-07-16 2018-07-16 Database transaction execution method based on graphic processor Active CN109033301B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810778840.9A CN109033301B (en) 2018-07-16 2018-07-16 Database transaction execution method based on graphic processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810778840.9A CN109033301B (en) 2018-07-16 2018-07-16 Database transaction execution method based on graphic processor

Publications (2)

Publication Number Publication Date
CN109033301A true CN109033301A (en) 2018-12-18
CN109033301B CN109033301B (en) 2021-07-06

Family

ID=64643124

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810778840.9A Active CN109033301B (en) 2018-07-16 2018-07-16 Database transaction execution method based on graphic processor

Country Status (1)

Country Link
CN (1) CN109033301B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110287212A (en) * 2019-06-27 2019-09-27 浪潮商用机器有限公司 A kind of data service handling method, system and associated component
CN110287006A (en) * 2019-06-10 2019-09-27 广州思创科技发展有限公司 A kind of data dispatching method and system
CN116775315A (en) * 2023-08-22 2023-09-19 北京遥感设备研究所 Multi-core CPU concurrent transaction allocation method based on dependency graph

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060080285A1 (en) * 2004-10-13 2006-04-13 Sybase, Inc. Database System with Methodology for Parallel Schedule Generation in a Query Optimizer
CN103077006A (en) * 2012-12-27 2013-05-01 浙江工业大学 Multithreading-based parallel executing method for long transaction
CN103942342A (en) * 2014-05-12 2014-07-23 中国人民大学 Memory database OLTP and OLAP concurrency query optimization method
CN104021145A (en) * 2014-05-16 2014-09-03 华为技术有限公司 Mixed service concurrent access method and device
CN104317850A (en) * 2014-10-14 2015-01-28 北京国双科技有限公司 Data processing method and device
CN106445687A (en) * 2016-09-27 2017-02-22 金蝶软件(中国)有限公司 Large transaction execution method and system
CN108139927A (en) * 2015-10-01 2018-06-08 华为技术有限公司 The routing based on action of affairs in online transaction processing system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060080285A1 (en) * 2004-10-13 2006-04-13 Sybase, Inc. Database System with Methodology for Parallel Schedule Generation in a Query Optimizer
CN103077006A (en) * 2012-12-27 2013-05-01 浙江工业大学 Multithreading-based parallel executing method for long transaction
CN103942342A (en) * 2014-05-12 2014-07-23 中国人民大学 Memory database OLTP and OLAP concurrency query optimization method
CN104021145A (en) * 2014-05-16 2014-09-03 华为技术有限公司 Mixed service concurrent access method and device
CN104317850A (en) * 2014-10-14 2015-01-28 北京国双科技有限公司 Data processing method and device
CN108139927A (en) * 2015-10-01 2018-06-08 华为技术有限公司 The routing based on action of affairs in online transaction processing system
CN106445687A (en) * 2016-09-27 2017-02-22 金蝶软件(中国)有限公司 Large transaction execution method and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
CHENG ZHONG等: "Parallel Identifying(l, d)-Motifs in Biosequences Using CPU and GPU Computing", 《SPRINGER》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110287006A (en) * 2019-06-10 2019-09-27 广州思创科技发展有限公司 A kind of data dispatching method and system
CN110287212A (en) * 2019-06-27 2019-09-27 浪潮商用机器有限公司 A kind of data service handling method, system and associated component
CN116775315A (en) * 2023-08-22 2023-09-19 北京遥感设备研究所 Multi-core CPU concurrent transaction allocation method based on dependency graph
CN116775315B (en) * 2023-08-22 2024-01-02 北京遥感设备研究所 Multi-core CPU concurrent transaction allocation method based on dependency graph

Also Published As

Publication number Publication date
CN109033301B (en) 2021-07-06

Similar Documents

Publication Publication Date Title
CN109033301A (en) A kind of db transaction execution method based on graphics processor
US8442935B2 (en) Extract, transform and load using metadata
US8364751B2 (en) Automated client/server operation partitioning
US20110185359A1 (en) Determining A Conflict in Accessing Shared Resources Using a Reduced Number of Cycles
CN106021484A (en) Customizable multi-mode big data processing system based on memory calculation
CN110209650A (en) The regular moving method of data, device, computer equipment and storage medium
CN103761236A (en) Incremental frequent pattern increase data mining method
CN109508355A (en) A kind of data pick-up method, system and terminal device
US20180357298A1 (en) Performance of Distributed Databases and Database-Dependent Software Applications
CN111897891B (en) Data processing method and device
CN113535258B (en) Pattern file loading method and system
CN112148713B (en) Method and device for data migration between heterogeneous databases
CN108133005A (en) A kind of environmental model analogy method, terminal device and storage medium based on memory database
CN108334565A (en) A kind of data mixing storage organization, data store query method, terminal and medium
CN116560629A (en) Serialization method, device, medium and equipment for data transmission object
CN103246498A (en) Memory storage structures supporting relational data parallel processing and achieving method thereof
CN113434522B (en) Parallel updating method and updating system on state tree oriented to alliance chain
CN109857832A (en) A kind of preprocess method and device of payment data
CN111753027B (en) Method and device for implicit knowledge graph representation facing multiple entities
US20220091831A1 (en) A streaming compiler for automatic adjoint differentiation
CN114138735A (en) Method for quickly loading Janus graph data in batches
CN102063308A (en) Method for controlling processing flow of seismic prospecting data
EP3113038A1 (en) A data handling method
CN110989995A (en) Processing method and system for artificial intelligence application based on open source deep learning framework
GB2539898A (en) A data handling method

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