CN108519918A - Distributed transaction processing method based on transaction chain - Google Patents
Distributed transaction processing method based on transaction chain Download PDFInfo
- Publication number
- CN108519918A CN108519918A CN201810210429.1A CN201810210429A CN108519918A CN 108519918 A CN108519918 A CN 108519918A CN 201810210429 A CN201810210429 A CN 201810210429A CN 108519918 A CN108519918 A CN 108519918A
- Authority
- CN
- China
- Prior art keywords
- transaction
- subtransaction
- chain
- sub
- rollback
- 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.)
- Withdrawn
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 8
- 238000000034 method Methods 0.000 abstract description 4
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/4881—Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
Abstract
The invention discloses a distributed transaction processing method based on a transaction chain, which comprises the following steps: according to a plurality of micro services spanned by a main transaction, splitting the main transaction into a plurality of sub transactions which are in one-to-one correspondence with the micro services, wherein the sub transactions form a sub transaction chain which is arranged in order; establishing a transaction state manager for storing the state of the current sub-transaction, wherein the state comprises execution success, execution failure and rollback; binding a transaction state manager to the chain of sub-transactions; executing the sub-transactions according to the sequence of the sub-transaction chain, and entering the next sub-transaction to be executed if the execution is successful until the end; if the execution fails, the current sub-transaction is rolled back, and the previous sub-transaction is informed to roll back, and if the execution fails, the previous sub-transaction is continuously informed to roll back until the completion. Compared with the traditional deployment mode, the distributed transaction deployment method has the advantages that the execution and rollback of the distributed transaction are realized through the sub-transaction chain and the transaction state manager, and the problem of distributed deployment of the transaction is solved.
Description
Technical field
The present invention relates to distributed transaction processing method, especially a kind of distributing real time system side based on affairs chain
Method.
Background technology
In today of big data and micro services prevalence, micro services technology uses increasingly extensive, micro services in application and development
Relative to traditional services, be by a big application service cutting be several or even tens micro services, solve distributed deployment
And scaling problem, service load ability is greatly promoted, but the service that an affairs are related to simultaneously is distributed on different servers,
New challenge is brought to affairs realization.Affairs mainly solve the sequence of operations executed as a whole, when affairs are distributed
To after different server, once it is most crucial it is to be processed be exactly that affairs execute failure, how to handle the rollback behaviour of cross-server
Make.
Invention content
In view of the above technical problems, the object of the present invention is to provide a kind of distributing real time system sides based on affairs chain
Method.
The technical solution adopted by the present invention is:
A kind of distributed transaction processing method based on affairs chain, includes the following steps
The first step:Master transaction is split as and the multiple micro services one by the multiple micro services crossed over according to master transaction
One corresponding multiple subtransactions, and the subtransaction chain of multiple subtransactions composition ordered arrangement;
Second step:Establish transaction status manager, the state for storing current subtransaction, the state be divided into execution at
Work(executes failure and rollback;
Third walks:Transaction status manager and the subtransaction chain are bound, for transaction status manager with it is each
It is communicated between subtransaction;
4th step:Subtransaction is executed according to the sequence of subtransaction chain, is held into next subtransaction if running succeeded
Row, until terminating;If it is executing the failure then current subtransaction of rollback, and notify previous subtransaction rollback, if it is rollback,
Then continue to notify previous subtransaction rollback, until terminating.
The transaction status manager is communicated by Publish-subscribe massage pattern and each subtransaction.
Beneficial effects of the present invention:Relative to conventional deployment mode, the present invention passes through subtransaction chain and transaction status management
Device solves the execution and rollback of distributed transaction, realizes affairs distributed deployment problem.
Description of the drawings
The specific implementation mode of the present invention is described further below in conjunction with the accompanying drawings.
Fig. 1 is multiple micro services schematic diagrames of the specific embodiment of the invention;
Fig. 2 is the logical framework figure of the specific embodiment of the invention;
Fig. 3 is the affairs execution flow chart of the specific embodiment of the invention.
Specific implementation mode
As Figure 1-Figure 2, it is a kind of distributed transaction processing method based on affairs chain of the present invention, including following step
Suddenly
The first step:The multiple micro services (such as ServiceA, ServiceB, ServcieC) crossed over according to master transaction, will
Master transaction be split as with the multiple micro services multiple subtransactions (A, B, C) correspondingly, and multiple subtransactions composition is orderly
The subtransaction chain of arrangement;
Second step:Establish transaction status manager, the state for storing current subtransaction, the state be divided into execution at
Work(executes failure and rollback;
Third walks:Transaction status manager and the subtransaction chain are bound, for transaction status manager with it is each
It is communicated between subtransaction;
4th step:Subtransaction is executed according to the sequence of subtransaction chain, is held into next subtransaction if running succeeded
Row, until terminating;If it is executing the failure then current subtransaction of rollback, and notify previous subtransaction rollback, if it is rollback,
Then continue to notify previous subtransaction rollback, until terminating.
Specifically, the transaction status manager is communicated by Publish-subscribe massage pattern and each subtransaction.
As shown in figure 3, by taking subtransaction C executes failure as an example, it is expanded on further and illustrates affairs implementation procedure elaborate.
Subtransaction A runs succeeded, and gives out information:A- runs succeeded;
Subtransaction B receives message, responds, B runs succeeded, and gives out information:B- runs succeeded;
Subtransaction C receives message, responds, C executes failure, and rollback, gives out information:C- executes failure;
Subtransaction B receives message, responds, and B executes rollback, gives out information:B- rollbacks.
Subtransaction A receives message, responds, and A executes rollback, terminates.
Relative to conventional method, this example realizes distributed transaction by subtransaction chain and transaction status management system and executes
And rollback.
The foregoing is merely the preferred embodiments of the present invention, and the present invention is not limited to the above embodiments, as long as with
Essentially identical means realize that the technical solution of the object of the invention belongs within protection scope of the present invention.
Claims (2)
1. a kind of distributed transaction processing method based on affairs chain, it is characterised in that:Include the following steps
The first step:Master transaction is split as a pair of with the multiple micro services one by the multiple micro services crossed over according to master transaction
The multiple subtransactions answered, and the subtransaction chain of multiple subtransactions composition ordered arrangement;
Second step:Transaction status manager is established, the state for storing current subtransaction, which, which is divided into, runs succeeded, holds
Row failure and rollback;
Third walks:Transaction status manager and the subtransaction chain are bound, for transaction status manager and each sub- thing
It is communicated between business;
4th step:Subtransaction is executed according to the sequence of subtransaction chain, next subtransaction is entered if running succeeded and is executed, directly
To end;If it is executing the failure then current subtransaction of rollback, and notify previous subtransaction rollback, if it is rollback, then after
It is continuous to notify previous subtransaction rollback, until terminating.
2. a kind of distributed transaction processing method based on affairs chain according to claim 1, it is characterised in that:The thing
Business state supervisor passes through Publish-subscribe massage pattern and each subtransaction communicates.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810210429.1A CN108519918A (en) | 2018-03-14 | 2018-03-14 | Distributed transaction processing method based on transaction chain |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810210429.1A CN108519918A (en) | 2018-03-14 | 2018-03-14 | Distributed transaction processing method based on transaction chain |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108519918A true CN108519918A (en) | 2018-09-11 |
Family
ID=63433747
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810210429.1A Withdrawn CN108519918A (en) | 2018-03-14 | 2018-03-14 | Distributed transaction processing method based on transaction chain |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108519918A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109376526A (en) * | 2018-09-27 | 2019-02-22 | 拉扎斯网络科技(上海)有限公司 | Authority control method, device, electronic equipment and computer readable storage medium |
CN109491768A (en) * | 2018-11-21 | 2019-03-19 | 四川长虹电器股份有限公司 | A kind of distributed transaction method for dynamically processing and system based on subtransaction stream |
CN112737858A (en) * | 2020-12-31 | 2021-04-30 | 网络通信与安全紫金山实验室 | Method, system, device and medium for micro-service data consistency in Ipsec tunnel configuration |
JP7196262B1 (en) | 2021-10-25 | 2022-12-26 | エヌ・ティ・ティ・コミュニケーションズ株式会社 | Service provision system and service provision method |
CN115729946A (en) * | 2022-11-24 | 2023-03-03 | 中电金信软件(上海)有限公司 | Method, device, equipment and storage medium for processing distributed transaction |
JP2023064102A (en) * | 2021-10-25 | 2023-05-10 | エヌ・ティ・ティ・コミュニケーションズ株式会社 | Service provision system and service provision method |
-
2018
- 2018-03-14 CN CN201810210429.1A patent/CN108519918A/en not_active Withdrawn
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109376526A (en) * | 2018-09-27 | 2019-02-22 | 拉扎斯网络科技(上海)有限公司 | Authority control method, device, electronic equipment and computer readable storage medium |
CN109491768A (en) * | 2018-11-21 | 2019-03-19 | 四川长虹电器股份有限公司 | A kind of distributed transaction method for dynamically processing and system based on subtransaction stream |
CN112737858A (en) * | 2020-12-31 | 2021-04-30 | 网络通信与安全紫金山实验室 | Method, system, device and medium for micro-service data consistency in Ipsec tunnel configuration |
CN112737858B (en) * | 2020-12-31 | 2022-09-06 | 网络通信与安全紫金山实验室 | Method, system, device and medium for micro-service data consistency in Ipsec tunnel configuration |
JP7196262B1 (en) | 2021-10-25 | 2022-12-26 | エヌ・ティ・ティ・コミュニケーションズ株式会社 | Service provision system and service provision method |
JP2023064102A (en) * | 2021-10-25 | 2023-05-10 | エヌ・ティ・ティ・コミュニケーションズ株式会社 | Service provision system and service provision method |
JP2023063893A (en) * | 2021-10-25 | 2023-05-10 | エヌ・ティ・ティ・コミュニケーションズ株式会社 | Service provision system and service provision method |
JP7296515B2 (en) | 2021-10-25 | 2023-06-22 | エヌ・ティ・ティ・コミュニケーションズ株式会社 | Service provision system and service provision method |
CN115729946A (en) * | 2022-11-24 | 2023-03-03 | 中电金信软件(上海)有限公司 | Method, device, equipment and storage medium for processing distributed transaction |
CN115729946B (en) * | 2022-11-24 | 2024-06-25 | 中电金信软件(上海)有限公司 | Method, device, equipment and storage medium for processing distributed transaction |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108519918A (en) | Distributed transaction processing method based on transaction chain | |
EP3534320A1 (en) | Block chain-based multi-chain management method and system, electronic device, and storage medium | |
CN106503132B (en) | A kind of distributed transaction management method and system | |
US20100036957A1 (en) | Method and System for Implementing Transfer of a Network Session | |
CN104063293B (en) | A kind of data back up method and stream calculation system | |
CN108076098A (en) | A kind of method for processing business and system | |
CN104991824B (en) | A kind of method and system in switching at runtime application data source | |
CN104933520A (en) | Processing method of examination and approval items | |
CN102917052A (en) | Method for distributing resources in cloud computing system | |
CN106776829A (en) | A kind of data guiding system and its method of work | |
CN107040406A (en) | A kind of end cloud cooperated computing system and its fault-tolerance approach | |
CN110716793A (en) | Execution method, device, equipment and storage medium of distributed transaction | |
CN110727508A (en) | Task scheduling system and scheduling method | |
CN105740085A (en) | Fault tolerance processing method and device | |
CN104933202A (en) | Method and device for data extraction, transformation and ETL loading | |
CN103019653A (en) | Linux system-based kernel message delivery method | |
CN107797874A (en) | A kind of resource management-control method based on embedded jetty and spark on yarn frameworks | |
CN109858772A (en) | A kind of processing method of work order, device and system | |
CN104125089A (en) | Network transaction control method and execution method, and network controller and forwarding equipment | |
CN106231235B (en) | Long-distance video meets with method and system under a kind of constrained environment | |
CN105337772A (en) | System and method for backing up and restoring configuration of network equipment | |
CN106681760A (en) | Transaction processing method and device based on client engineering project management system | |
CN104821889B (en) | A kind of processing method and equipment of backup message | |
CN104407917A (en) | JMS (Java messaging service)-based transaction processing method and JMS-based transaction processing device | |
CN109491768A (en) | A kind of distributed transaction method for dynamically processing and system based on subtransaction stream |
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 | ||
WW01 | Invention patent application withdrawn after publication | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20180911 |