[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN112612551A - Method, device, equipment, medium and product for managing distributed transactions - Google Patents

Method, device, equipment, medium and product for managing distributed transactions Download PDF

Info

Publication number
CN112612551A
CN112612551A CN202011640285.7A CN202011640285A CN112612551A CN 112612551 A CN112612551 A CN 112612551A CN 202011640285 A CN202011640285 A CN 202011640285A CN 112612551 A CN112612551 A CN 112612551A
Authority
CN
China
Prior art keywords
transaction
participating
distributed
transactions
configuration file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011640285.7A
Other languages
Chinese (zh)
Inventor
刘长勇
慕悦
孙振华
杨鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
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 Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN202011640285.7A priority Critical patent/CN112612551A/en
Publication of CN112612551A publication Critical patent/CN112612551A/en
Pending legal-status Critical Current

Links

Images

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/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • G06F16/134Distributed indices

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 application provides a management method of distributed transactions. The method comprises the steps of obtaining a configuration file containing a plurality of participation affairs of the distributed affairs, loading a plurality of services participating in the affairs, and calling the plurality of services participating in the affairs to realize the management of the distributed affairs. Therefore, the code reusability of the method is high, the development cost is low, and the efficiency of distributed transaction management is improved.

Description

Method, device, equipment, medium and product for managing distributed transactions
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, a computer-readable storage medium, and a computer program product for managing distributed transactions.
Background
A transaction provides a mechanism to incorporate all operations involved in an activity into an indivisible execution unit. In a distributed system, a traditional transaction cannot directly ensure that all operations in the distributed system are not separable through services provided by a database, and the data consistency is ensured by using the distributed transaction. The distributed transaction can ensure that all operations are committed simultaneously if they are successfully executed, and will roll back all operations as long as any one of them fails to execute.
Participants of the distributed transaction are distributed on different nodes of the distributed system, and overall management of the transaction is required to be carried out through the transaction manager. For example, in a large e-commerce system, the order placing interface usually deducts inventory, deducts a coupon, and generates an order Identifier (ID), and the order service is different from the inventory, coupon, and order ID, and the success or failure of the order placing interface depends not only on the local database operation, but also on the result of a third-party system, and at this time, the distributed transaction ensures that the operations are either all successful or all failed.
As shown in fig. 1, taking the Saga-mode distributed transaction in the transaction scenario as an example, the distributed transaction includes a plurality of participating transactions, each participating transaction having its own commit processing and compensation processing procedures. The distributed transaction will finish the submission of all the participating transactions in turn according to the service scene of the user, if the submission of all the participating transactions is successful, the distributed transaction is submitted; if any one of the participating transactions fails to commit, the distributed transaction compensates for all of the participating transactions that have committed, ensuring that the data returns to the original state.
The currently commonly used distributed transaction framework of the Saga mode in the industry can define a service calling process through a transaction execution process state diagram and generate a JSON state language definition file, a state machine engine of the framework drives and analyzes the JSON state language definition file and coordinates and manages the distributed transactions, and when all participating transactions are successfully submitted, the distributed transactions are submitted globally; when any one of the participating transaction exceptions occurs, the state machine engine executes all the participating compensation processing processes which are already submitted, and the global rollback is carried out.
However, the JSON state language definition file in the scheme has high learning cost, low reusability of codes participating in transactions, inflexibility and high development cost. There is a need in the art to provide a method of managing low-cost distributed transactions that supports multiplexing.
Disclosure of Invention
The application provides a management method of distributed transactions. The method realizes the management of the distributed transaction by acquiring the configuration files of a plurality of participating transactions containing the distributed transaction, loading and calling the services of the plurality of participating transactions. Therefore, the code reusability of the method is high, the development cost is low, and the efficiency of distributed transaction management is improved. The application also provides a device, equipment, a medium and a product corresponding to the method.
In a first aspect, the present application provides a method for managing distributed transactions. The method comprises the following steps:
acquiring a configuration file, wherein the configuration file is configured with a plurality of participating transactions of the distributed transaction;
loading a plurality of services participating in the transaction according to the configuration file;
and calling a plurality of services participating in the transaction to realize the management of the distributed transaction.
In some possible implementations, the configuration file is further configured with a plurality of execution orders to participate in the transaction;
invoking a plurality of services participating in a transaction, comprising:
and calling the services participating in the transaction according to the execution sequence of the transactions.
In some possible implementations, at least two of the plurality of participating transactions in the configuration file can be recombined to form a new distributed transaction.
In some possible implementations, the services participating in the transaction include normal service logic and compensated service logic, wherein the compensated service logic is configured to participate in transaction rollback when execution of the transaction fails.
In some possible implementations, the method further includes:
and executing the compensated service logic in a delayed mode, wherein the execution times of the compensated service logic do not exceed the preset times.
In some possible implementations, the method is performed by a management device of the distributed transaction, the management device integrating a state machine.
In a second aspect, the present application provides an apparatus for managing distributed transactions. The device includes:
the communication unit is used for acquiring a configuration file, and the configuration file is configured with a plurality of participating transactions of the distributed transaction;
the loading unit is used for loading a plurality of services participating in the transaction according to the configuration file;
and the execution unit is used for calling a plurality of services participating in the transaction so as to realize the management of the distributed transaction.
In some possible implementations, the configuration file is further configured with a plurality of execution orders to participate in the transaction;
the execution unit is specifically configured to:
and calling the services participating in the transaction according to the execution sequence of the transactions.
In some possible implementations, at least two of the plurality of participating transactions in the configuration file can be recombined to form a new distributed transaction.
In some possible implementations, the services participating in the transaction include normal service logic and compensated service logic, wherein the compensated service logic is configured to participate in transaction rollback when execution of the transaction fails.
In some possible implementations, the apparatus further includes:
and the delay module is used for delaying the execution of the compensated service logic, and the execution times of the compensated service logic do not exceed the preset times.
In some possible implementations, the device is a management device for distributed transactions, the management device integrating a state machine.
In a third aspect, the present application provides an apparatus comprising a processor and a memory. The processor and the memory communicate with each other. The processor is configured to execute instructions stored in the memory to cause the apparatus to perform a method of managing distributed transactions as in the first aspect or any implementation of the first aspect.
In a fourth aspect, the present application provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and the instructions instruct a device to perform the method for managing distributed transactions according to the first aspect or any implementation manner of the first aspect.
In a fifth aspect, the present application provides a computer program product comprising instructions that, when run on a device, cause the device to perform a method for managing distributed transactions as described in the first aspect or any implementation manner of the first aspect.
The present application can further combine to provide more implementations on the basis of the implementations provided by the above aspects.
According to the technical scheme, the embodiment of the application has the following advantages:
the application provides a management method of distributed transactions. Specifically, the method can define a Saga mode distributed transaction configuration file containing a plurality of participating transactions, complete analysis and loading through a distributed transaction overall coordination service, and realize management of the distributed transactions. Thus, a low-cost management method for distributed transactions with reusable code can be provided.
Further, the method may define participating transactions independently, all providing commit logic and compensation logic, and requiring the provision of a unique index value. The method can define the distributed transaction in the JSON configuration file, determine the execution process, the processing sequence, the compensation parameter and the like of the distributed transaction by configuring the participated transaction, and can also nest other distributed transaction flows by configuring. Because the participating transactions are independent, the JSON configuration file can freely define and combine the participating transactions, so that the participating transactions can be used in different combined transactions, and the development of codes is more flexible and efficient.
Drawings
In order to more clearly illustrate the technical method of the embodiments of the present application, the drawings needed to be used in the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without inventive labor.
FIG. 1 is a transaction flow of a distributed transaction in a transaction scenario;
fig. 2 is a flowchart of a method for managing distributed transactions according to an embodiment of the present application;
fig. 3 is a flowchart of a method for managing distributed transactions according to an embodiment of the present application;
FIG. 4 is a flowchart illustrating normal execution of a participating transaction in processing a distributed transaction according to an embodiment of the present disclosure;
FIG. 5 is a flowchart of a method for processing a distributed transaction involving abnormal execution of the transaction according to an embodiment of the present application;
FIG. 6 is a flowchart illustrating a participating transaction execution timeout for processing a distributed transaction according to an embodiment of the present disclosure;
FIG. 7 is a schematic diagram illustrating a combination of participating transactions for processing a distributed transaction according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a distributed transaction management apparatus according to an embodiment of the present application.
Detailed Description
The scheme in the embodiments provided in the present application will be described below with reference to the drawings in the present application.
The terms "first" and "second" in the embodiments of the present application are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature.
Some technical terms referred to in the embodiments of the present application will be first described.
The Saga model is a long transaction solution, in which each participant in the business process submits a local transaction, and when a participant fails, the previous successful participant is compensated. Both the one-phase forward service and the two-phase compensation service are realized by business development.
The currently commonly used distributed transaction framework of the Saga mode in the industry can define a service calling process through a transaction execution process state diagram and generate a JSON state language definition file, a state machine engine of the framework drives and analyzes the JSON state language definition file and coordinates and manages the distributed transactions, and when all participating transactions are successfully submitted, the distributed transactions are submitted globally; when any one of the participating transaction exceptions occurs, the state machine engine executes all the participating compensation processing processes which are already submitted, and the global rollback is carried out.
However, the JSON state language definition file in the scheme has high learning cost, low reusability of codes participating in transactions, inflexibility and high development cost. There is a need in the art to provide a method of managing low-cost distributed transactions that supports multiplexing.
In view of the above, the present application provides a method for managing distributed transactions. Alternatively, the method may be performed by a management device for distributed transactions, the management device incorporating a state machine.
The state machine is integrated in the device, so that a user does not need to care about the state conversion process of the distributed transaction execution during development, the development difficulty of the user is reduced, the controllability of the system is improved, and the execution efficiency of the distributed transaction is improved.
Specifically, the management device for the distributed transaction parses and loads the configuration file, and sequentially calls a plurality of participating transactions according to the execution sequence of the participating transactions in the configuration file, thereby realizing the management of the distributed transaction. The participating transactions in the application are independently defined from the distributed transactions, conform to the Saga model distributed transaction model, and all participating transactions provide commit logic and compensation logic and provide unique index values. Distributed transactions are defined in a configuration file, which participating transactions need to be executed by the current distributed transaction can be specified through the index values of the participating transactions, the execution sequence of the participating transactions, and the like. In the configuration file, participating transactions can be orchestrated, ordered, and combined into a complete distributed transaction, and a large distributed transaction can also nest small distributed transactions. Thus, a reusable and low-cost management method for distributed transactions can be provided.
For convenience of understanding, the management method of the distributed transaction provided by the embodiment of the present application is specifically described below with reference to the drawings.
Referring to fig. 2, a flow chart of a distributed transaction management method is shown, the method comprising:
s202: the management device of the distributed transaction obtains a configuration file.
The configuration file is configured with a plurality of participating transactions of the distributed transaction.
Optionally, the distributed transaction in the configuration file includes at least two participating transactions.
In some possible implementations, the configuration file is further configured with a plurality of execution orders to participate in the transaction.
Optionally, when configuring a new distributed transaction, a developer does not need to redraw the state diagram to generate the JSON state semantic definition file, and can directly configure which participating transactions are needed for the current distributed transaction, determine the execution sequence of the participating transactions, determine whether the execution flow of other distributed transactions needs to be nested, and complete the logic call of the participating transactions by the management device, thereby reducing the repetitive work and lowering the development cost.
S204: and the management device of the distributed transaction loads a plurality of services participating in the transaction according to the configuration file.
When the configuration file is configured with a plurality of execution sequences participating in the transaction, the management device of the distributed transaction loads a plurality of services participating in the transaction in sequence according to the execution sequence of the participating transactions in the configuration file.
The participating transactions include commit logic and compensation logic, wherein the compensation logic is configured to perform a data rollback upon a failure in execution of the distributed transaction.
In some possible implementations, the participating transaction compensation logic may be executed with a delay or multiple times, but the number of times of execution does not exceed a preset number.
S206: the management device of the distributed transaction calls a plurality of services participating in the transaction to realize the management of the distributed transaction.
Specifically, the management apparatus of the distributed transaction sequentially calls a plurality of services participating in the transaction according to the execution order of the participating transactions of the loaded distributed transaction.
In some possible implementations, the management apparatus for distributed transactions may include two modules, a transaction manager and a transaction coordinator.
The following describes the Saga transaction processing in the distributed management apparatus, as shown in fig. 3, wherein the transaction a is successfully executed, and the transaction B is failed to be executed, so as to compensate for the transaction a. The specific process is as follows:
the user initiates a transaction to the combined transaction, the combined transaction opens a distributed transaction to the transaction manager, the transaction manager collects and collates transaction information, generates a global transaction number, sends the information to the transaction coordinator, and registers the start of the global transaction.
The participating in the execution of the transaction a specifically includes:
the transaction manager receives a notification to start participating transaction A, generates a participating transaction A number, and registers the participating transaction A start with the transaction coordinator. And executing the transaction step, wherein the transaction step is successfully executed, the transaction manager receives the notification of the end of the participation transaction A, and registers the end of the participation transaction A to the transaction coordinator.
The participating in the execution of the transaction B specifically includes:
the transaction manager receives the notification to start participating in transaction B, generates a participating transaction B number, and registers the participating transaction B start with the transaction coordinator. And executing the transaction step, wherein the transaction step is failed to be executed, the transaction manager receives the exception notification of the participation transaction B, and registers the exception of the participation transaction B to the transaction coordinator.
Optionally, the transaction manager may further manage the execution time of the transaction, and trigger the termination state signal for the case of transaction execution timeout, transaction execution abnormal interrupt, and the like.
The transaction coordinator receives the transaction event message sent by the transaction manager, judges the execution state of the current Saga transaction, asynchronously registers the transaction execution information, simultaneously responds whether the current transaction of the transaction manager can be continuously executed or not, and simultaneously manages the compensation and the call of the transaction.
The specific process of performing compensation participation in the transaction a includes:
the transaction coordinator checks a list of the current transaction to be compensated participating transactions, sends a callback compensation participating transaction A to the transaction manager, the transaction manager recovers transaction parameters participating in the transaction A, sends the compensation participating transaction A, executes transaction compensation processing, sends success of participating in the transaction A compensation to the transaction manager, the transaction manager registers success of participating in the transaction A compensation to the transaction coordinator, and the transaction coordinator performs transaction ending processing.
Optionally, the compensation tuning of the transaction may be a delay compensation tuning, or may be a multiple compensation tuning.
Fig. 4 is a flow chart of the present scheme for processing the participation of the distributed transaction in the normal execution of the transaction.
The transaction manager and the transaction coordinator control the execution of the whole transaction, the transaction manager is responsible for informing the transaction coordinator of the opening of the transaction, normally calls a participating transaction A, a participating transaction B and a participating transaction C of the distributed transaction according to the state fed back by the transaction coordinator, then executes according to the execution state of the participating transaction, and under the normal execution flow, the participating transaction A, the participating transaction B and the participating transaction C are sequentially executed until the execution is successful.
Fig. 5 is a flow chart illustrating the present scheme handling a participating transaction execution exception for a distributed transaction.
The transaction manager and the transaction coordinator control the whole transaction to be executed, the transaction manager sends a signal for starting the transaction to the transaction coordinator, then starts the distributed transaction, and executes the participation transaction A, the participation transaction B and the participation transaction C in sequence, and when the participation transaction C is executed, the execution fails. And the transaction coordinator informs the transaction manager of the execution failure, and the transaction manager invokes the compensation transaction participating in the transaction A and the compensation transaction participating in the transaction B to recover the initial state.
Fig. 6 is a flow chart illustrating the participation in transaction execution timeout for processing distributed transactions according to the present scheme.
The transaction manager and the transaction coordinator control the whole transaction to be executed, the transaction manager sends a signal for starting the transaction to the transaction coordinator, then starts the distributed transaction, executes the participation transaction A, the participation transaction B and the participation transaction C in sequence, and when the participation transaction C is executed, the execution is overtime. And the transaction coordinator informs the transaction manager of executing overtime, and the transaction manager invokes the compensation transaction of the transaction A, the transaction B and the transaction C to recover the initial state.
Furthermore, the method can use a configuration mode to complete the combination of various functions participating in the transaction, and then automatically load the services participating in the transaction according to the configuration file, thereby completing the management of the distributed transaction.
Specifically, the embodiment may provide a unified interface for specifying a manner in which to participate in transaction development. The participating transaction interface comprises two methods, one is a commit logic and the other is a compensation logic, and the participating transaction implementing the interface can be assigned a unique index. The execution sequence of the participating transactions of the distributed transactions can be executed according to the sequence configured in the configuration file, and other distributed transactions can be nested in the configuration file and then combined to complete a new combined transaction.
A unified device interface can provide code reuse to application developers. Specifically, the application developer only needs to rewrite the method of the transaction and the transaction in the interface, and can call up the related transaction after the related codes participating in the transaction are developed based on the interface. Furthermore, different participating transactions can be configured, so that different distributed transaction transactions are formed.
Referring to fig. 7, where participating transaction 1 and participating transaction 2 may form a distributed combined transaction a, participating transaction 4, participating transaction 5 and participating transaction 6 may form another distributed combined transaction B, combined transaction a, participating transaction 3 and participating transaction 4 may be combined into a third distributed combined transaction C, which actually contains 4 participating transactions of participating transaction 1, participating transaction 2, participating transaction 3 and participating transaction 4, but may be configured in a manner that combined transaction a is nested by combined transaction C. Meanwhile, three participating transactions of the participating transaction 1, the participating transaction 2 and the participating transaction 4 can be used in different combined transactions, so that the reuse rate of codes and configuration files can be improved, and the transaction development is more flexible and efficient.
The method provided by the embodiment has clear content in the configuration file, clear configuration for each transaction participating in the transaction, correlation with the transaction, friendliness to developers and subsequent code readers, low development and modification cost and high code reuse rate.
The configuration file is obtained through the management device of the distributed transaction, a plurality of services participating in the transaction are loaded according to the configuration file, and then the plurality of services participating in the transaction are called, so that the management of the distributed transaction is realized. Therefore, the distributed transaction can be managed at low cost.
The distributed transaction management device analyzes and loads the configuration file, and sequentially calls a plurality of participating transactions according to the execution sequence of the participating transactions in the configuration file to realize the management of the distributed transactions. The participating transactions in the application are independently defined from the distributed transactions, conform to the Saga model distributed transaction model, and all participating transactions provide commit logic and compensation logic and provide unique index values. Distributed transactions are defined in a configuration file, which participating transactions need to be executed by the current distributed transaction can be specified through the index values of the participating transactions, the execution sequence of the participating transactions, and the like. In the configuration file, participating transactions can be orchestrated, ordered, and combined into a complete distributed transaction, and a large distributed transaction can also nest small distributed transactions. Thus, a reusable and low-cost management method for distributed transactions can be provided.
Moreover, the management device of the distributed transaction is integrated with the state machine, so that the management device is transparent to the development user, reduces the development difficulty of the user and has higher readability.
Corresponding to the above method embodiment, the present application also provides a device for managing distributed transactions, and referring to fig. 8, the device 800 includes: a communication unit 802, a load unit 804, and an execution unit 806.
In some possible implementations, the configuration file is further configured with a plurality of execution orders to participate in the transaction; the execution unit 806 is specifically configured to:
and calling the services participating in the transaction according to the execution sequence of the transactions.
In some possible implementations, at least two of the plurality of participating transactions in the configuration file can be recombined to form a new distributed transaction.
In some possible implementations, the services participating in the transaction include normal service logic and compensated service logic, wherein the compensated service logic is configured to participate in transaction rollback when execution of the transaction fails.
In some possible implementations, the apparatus 800 further includes:
and the delay module is used for delaying the execution of the compensated service logic, and the execution times of the compensated service logic do not exceed the preset times.
In some possible implementations, the device 800 is a management device 800 for distributed transactions, the management device 800 integrating a state machine.
The application provides a device for realizing a management method of distributed transactions. The apparatus includes a processor and a memory. The processor and the memory are in communication with each other. The processor is configured to execute the instructions stored in the memory to cause the device to perform a method of managing distributed transactions.
The present application provides a computer-readable storage medium having stored therein instructions that, when run on a device, cause the device to perform the above-described method of managing distributed transactions.
The present application provides a computer program product comprising instructions which, when run on a device, cause the device to perform the above-described method of managing distributed transactions.
It should be noted that the above-described embodiments of the apparatus are merely schematic, where the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. In addition, in the drawings of the embodiments of the apparatus provided in the present application, the connection relationship between the modules indicates that there is a communication connection therebetween, and may be implemented as one or more communication buses or signal lines.
Through the above description of the embodiments, those skilled in the art will clearly understand that the present application can be implemented by software plus necessary general-purpose hardware, and certainly can also be implemented by special-purpose hardware including special-purpose integrated circuits, special-purpose CPUs, special-purpose memories, special-purpose components and the like. Generally, functions performed by computer programs can be easily implemented by corresponding hardware, and specific hardware structures for implementing the same functions may be various, such as analog circuits, digital circuits, or dedicated circuits. However, for the present application, the implementation of a software program is more preferable. Based on such understanding, the technical solutions of the present application may be substantially embodied in the form of a software product, which is stored in a readable storage medium, such as a floppy disk, a usb disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, an exercise device, or a network device) to execute the method according to the embodiments of the present application.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product.
The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, training device, or data center to another website site, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can store or a data storage device, such as a training device, a data center, etc., that incorporates one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.

Claims (10)

1. A method for managing distributed transactions, the method comprising:
obtaining a configuration file, wherein the configuration file is configured with a plurality of participating transactions of the distributed transaction;
loading the plurality of services participating in the transaction according to the configuration file;
and invoking the plurality of services participating in the transaction to realize the management of the distributed transaction.
2. The method of claim 1, wherein the configuration file is further configured with an execution order of the plurality of participating transactions;
the invoking the plurality of services participating in the transaction comprises:
and calling the services of the plurality of participating transactions according to the execution sequence of the plurality of participating transactions.
3. The method of claim 1, wherein at least two of the plurality of participating transactions in the configuration file can be recombined to form a new distributed transaction.
4. The method according to any one of claims 1 to 3, wherein the services participating in the transaction comprise normal service logic and compensated service logic, wherein the compensated service logic is used for transaction rollback when the participating transaction fails to execute.
5. The method of claim 4, further comprising:
and delaying to execute the compensated service logic, wherein the execution times of the compensated service logic do not exceed the preset times.
6. The method according to any of claims 1 to 5, characterized in that it is performed by a management device of the distributed transaction, said management device integrating a state machine.
7. An apparatus for managing distributed transactions, the apparatus comprising:
a communication unit, configured to obtain a configuration file, where the configuration file is configured with a plurality of participating transactions of the distributed transaction;
the loading unit is used for loading the plurality of services participating in the transaction according to the configuration file;
and the execution unit is used for calling the services participating in the transaction so as to realize the management of the distributed transaction.
8. An apparatus, comprising a processor and a memory;
the processor is configured to execute instructions stored in the memory to cause the device to perform the method of any of claims 1 to 6.
9. A computer-readable storage medium comprising instructions that direct a device to perform the method of any of claims 1-6.
10. A computer program product, characterized in that it causes a computer to carry out the method according to any one of claims 1 to 6, when said computer program product is run on a computer.
CN202011640285.7A 2020-12-31 2020-12-31 Method, device, equipment, medium and product for managing distributed transactions Pending CN112612551A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011640285.7A CN112612551A (en) 2020-12-31 2020-12-31 Method, device, equipment, medium and product for managing distributed transactions

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011640285.7A CN112612551A (en) 2020-12-31 2020-12-31 Method, device, equipment, medium and product for managing distributed transactions

Publications (1)

Publication Number Publication Date
CN112612551A true CN112612551A (en) 2021-04-06

Family

ID=75253195

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011640285.7A Pending CN112612551A (en) 2020-12-31 2020-12-31 Method, device, equipment, medium and product for managing distributed transactions

Country Status (1)

Country Link
CN (1) CN112612551A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102187321A (en) * 2008-10-20 2011-09-14 微软公司 Transaction processing for side-effecting actions in transactional memory
CN106528664A (en) * 2016-10-21 2017-03-22 广东亿迅科技有限公司 Distributed relation database based transaction data monitoring method and system
CN107329809A (en) * 2017-07-05 2017-11-07 国网信息通信产业集团有限公司 A kind of distributed transaction processing method and system towards multi-data source
CN110471746A (en) * 2019-08-22 2019-11-19 中国工商银行股份有限公司 A kind of distributed transaction callback method, apparatus and system
CN111062684A (en) * 2019-11-29 2020-04-24 普元信息技术股份有限公司 System and method for realizing consistent processing of business data and process data under cloud process platform
CN111209092A (en) * 2020-01-09 2020-05-29 江苏艾佳家居用品有限公司 Distributed transaction processing method based on Saga mode
CN111597015A (en) * 2020-04-27 2020-08-28 腾讯科技(深圳)有限公司 Transaction processing method and device, computer equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102187321A (en) * 2008-10-20 2011-09-14 微软公司 Transaction processing for side-effecting actions in transactional memory
CN106528664A (en) * 2016-10-21 2017-03-22 广东亿迅科技有限公司 Distributed relation database based transaction data monitoring method and system
CN107329809A (en) * 2017-07-05 2017-11-07 国网信息通信产业集团有限公司 A kind of distributed transaction processing method and system towards multi-data source
CN110471746A (en) * 2019-08-22 2019-11-19 中国工商银行股份有限公司 A kind of distributed transaction callback method, apparatus and system
CN111062684A (en) * 2019-11-29 2020-04-24 普元信息技术股份有限公司 System and method for realizing consistent processing of business data and process data under cloud process platform
CN111209092A (en) * 2020-01-09 2020-05-29 江苏艾佳家居用品有限公司 Distributed transaction processing method based on Saga mode
CN111597015A (en) * 2020-04-27 2020-08-28 腾讯科技(深圳)有限公司 Transaction processing method and device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
US10453010B2 (en) Computer device, method, and apparatus for scheduling business flow
CN110942387A (en) Method and system for establishing electric ticket business function based on micro-service
CN112099935B (en) Task processing method and device
CN110471746B (en) Distributed transaction callback method, device and system
CN110413428B (en) Account checking data processing method, electronic equipment and storage medium
CN113656116B (en) Business process processing method and device
CN114237994A (en) Test method and system for distributed system, electronic device and storage medium
CN112817710A (en) Timed task processing method, timed task processing system, computer equipment and computer storage medium
CN113094125B (en) Business process processing method, device, server and storage medium
CN110599305A (en) Service processing method, device and storage medium
CN112817995B (en) Data processing method and device, electronic equipment and storage medium
CN108108119A (en) A kind of collocation method and device of expansible storage cluster things
CN115544044A (en) Data consistency keeping method, device, equipment and storage medium
CN116302708A (en) Data backup method, device, equipment and storage medium based on load balancing
CN109976725B (en) Flow program development method and device based on lightweight flow engine
CN111736930B (en) Program front-back end interface calling method and device, computer equipment and storage medium
CN114356596A (en) Message processing method and device for distributed system
CN116643854A (en) Service arrangement method and device, flow controller and task processor
CN112612551A (en) Method, device, equipment, medium and product for managing distributed transactions
US9323509B2 (en) Method and system for automated process distribution
CN110874713B (en) Service state management method and device
CN110109747B (en) Apache Spark-based data exchange method, system and server
CN109901933B (en) Operation method and device of business system, storage medium and electronic device
CN114443232A (en) Transaction management method and device, electronic equipment and storage medium
CN114816684A (en) Business processing method, device, equipment, readable storage medium and product

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