WO2020258665A1 - Process guarantee method and device for distributed transactions - Google Patents

Process guarantee method and device for distributed transactions Download PDF

Info

Publication number
WO2020258665A1
WO2020258665A1 PCT/CN2019/118181 CN2019118181W WO2020258665A1 WO 2020258665 A1 WO2020258665 A1 WO 2020258665A1 CN 2019118181 W CN2019118181 W CN 2019118181W WO 2020258665 A1 WO2020258665 A1 WO 2020258665A1
Authority
WO
WIPO (PCT)
Prior art keywords
sub
processing
subsystem
processes
timeout
Prior art date
Application number
PCT/CN2019/118181
Other languages
French (fr)
Chinese (zh)
Inventor
张兵
夏勇
Original Assignee
深圳前海微众银行股份有限公司
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 深圳前海微众银行股份有限公司 filed Critical 深圳前海微众银行股份有限公司
Publication of WO2020258665A1 publication Critical patent/WO2020258665A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0633Workflow analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/02Banking, e.g. interest calculation or account maintenance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Definitions

  • the present invention relates to the field of computer technology in financial technology (Fintech), and in particular to a process guarantee method and device for distributed transactions.
  • Distributed transaction provides a mechanism to incorporate all operations involved in an activity into an indivisible execution unit. All operations that make up a transaction can only be submitted when all operations can be executed normally, as long as any operation fails. Will cause the rollback of the entire transaction.
  • the existing distributed transaction processing solution usually rolls back the entire pre-processing logic in a reverse order from the failure point of the sub-transaction, which cannot achieve the flexibility and difference of the correction logic.
  • the present application provides a process guarantee method and device for distributed transactions to solve the problem of lack of flexibility in a distributed transaction exception handling mechanism.
  • An embodiment of the present invention provides a process guarantee method for distributed transactions, including:
  • any sub-process of the N sub-processes send the sub-process to the corresponding subsystem, so that the subsystem can process the sub-process;
  • the exception processing includes performing an asymmetric reverse operation on a sub-process that has been successfully processed, and the asymmetric reverse operation is executing a reverse sub-process, and
  • the sub-process is asymmetric to the sub-process that has been processed.
  • the N sub-processes include asynchronous sub-processes; for any of the N sub-processes, the sub-process is sent to the corresponding subsystem, so that all After the subsystem processes the sub-process, it also includes:
  • For the asynchronous sub-process send a result query request to the asynchronous subsystem corresponding to the asynchronous sub-process at a set frequency until the processing result fed back by the asynchronous subsystem is received.
  • the performing exception handling on the sub-process according to the exception handling strategy includes:
  • the monitoring the processing process of the N sub-processes includes:
  • the performing exception handling on the sub-process according to the exception handling strategy includes:
  • timeout exception in the main process and/or the synchronization sub-process feedback the processing process timeout to the calling system and determine the processing status of the time-out sub-process
  • the main process is transferred to batch asynchronous processing.
  • transferring the main process to batch asynchronous processing includes:
  • the step of sending a result query request to the subsystem corresponding to the timeout sub-process after the predetermined interval is executed.
  • the receiving the processing request sent by the calling system includes:
  • the sub-process is sent to the corresponding subsystem, so that after the subsystem processes the sub-process, the include:
  • a process guarantee device for distributed transactions including:
  • the transceiver unit is used to receive the processing request sent by the calling system
  • the configuration unit is configured to determine the main process and N sub-processes according to the processing request, N ⁇ 1;
  • the transceiver unit is further configured to send the sub-process to the corresponding subsystem for any one of the N sub-processes, so that the subsystem can process the sub-process;
  • the monitoring unit is used to monitor the processing of N sub-processes. When an exception occurs in the processing of any sub-process, determine the corresponding exception processing strategy according to the type of the exception, the type of the main process, and the type of the sub-process ;
  • the exception processing unit is configured to perform exception processing on a sub-process according to the exception processing strategy, and the exception processing includes performing an asymmetric reverse operation on a sub-process that has been successfully processed, and the asymmetric reverse operation is executing a reverse sub-process Process, the reverse sub-process is asymmetrical with the processed sub-process.
  • the N sub-processes include asynchronous sub-processes; the transceiver unit is further configured to:
  • For the asynchronous sub-process send a result query request to the asynchronous subsystem corresponding to the asynchronous sub-process at a set frequency until the processing result fed back by the asynchronous subsystem is received.
  • the exception handling unit is configured to:
  • the monitoring unit is configured to monitor the processing time of the main process and each sub-process, if the processing time of the main process and/or any sub-process exceeds the corresponding time Threshold, it is determined that a timeout exception occurs;
  • the exception processing unit is configured to perform a retry process on the asynchronous sub-process when a timeout exception occurs in the asynchronous sub-process; for the time-out exception in the main process and/or the synchronous sub-process, feedback processing to the calling system The process times out, and the processing status of the timeout sub-process is determined; if the processing status of the time-out sub-process is clear, an asymmetric reverse operation is performed on the successfully processed sub-process; if the processing status of the time-out sub-process is not clear, Then the main process is transferred to batch asynchronous processing.
  • the exception handling unit is configured to:
  • the step of sending a result query request to the subsystem corresponding to the timeout sub-process after the predetermined interval is executed.
  • the transceiver unit is configured to:
  • the transceiver unit is configured to:
  • the embodiment of the present invention also provides an electronic device, including:
  • At least one processor and,
  • a memory communicatively connected with the at least one processor; wherein,
  • the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute the method described above.
  • the embodiment of the present invention also provides a non-transitory computer-readable storage medium, the non-transitory computer-readable storage medium storing computer instructions, and the computer instructions are used to make the computer execute the method described above.
  • the processing request sent by the calling system is received, the processing request is parsed, and the corresponding main process and N sub-processes are matched.
  • the sub-processes are sent to the corresponding subsystems in turn, so that the sub-processes are processed by the sub-processes, and the processing processes of the N sub-processes are monitored at the same time.
  • the type, main process type, and sub-process type determine the corresponding exception handling strategy. Exception handling is performed on the sub-process according to the exception handling strategy.
  • the exception handling includes performing an asymmetric reverse operation on the sub-process that has been successfully processed.
  • the asymmetric reverse operation here is to execute the reverse sub-process, and the reverse sub-process is the same as the reverse sub-process.
  • the sub-processes that have been processed are asymmetric.
  • the exception handling of the sub-process can be a symmetric reverse operation or an asymmetric reverse operation.
  • the exception handling strategy can be flexibly set according to the actual situation and scenario, thereby flexibly solving the distributed transaction exception problem .
  • Figure 1 is a schematic structural diagram of a possible system architecture provided by an embodiment of the present invention.
  • FIG. 2 is a schematic flowchart of a method for guaranteeing a distributed transaction process according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of a symmetrical correction provided by a specific embodiment of the present invention.
  • FIG. 4 is a schematic diagram of an asymmetric correction provided by a specific embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of a process guarantee apparatus for distributed transactions according to an embodiment of the present invention.
  • Fig. 6 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention.
  • a system architecture to which the embodiment of the present invention is applicable includes a calling system 101, a transaction processing server 102, and N subsystems 103.
  • the calling system 101 can be a client installed on a terminal or an operating system installed on a server.
  • the terminal can be an electronic device with wireless communication functions such as a mobile phone, a tablet computer, or a dedicated handheld device, or it can be It is a personal computer (PC), notebook computer, server and other wired access devices connected to the Internet.
  • the terminal can be an independent device or a terminal cluster formed by multiple terminals.
  • the terminal can use cloud computing technology for information processing.
  • the transaction processing server 102 may be a network device such as a computer, it may be an independent device, or a server cluster formed by multiple servers.
  • the N subsystems 103 can be installed on N servers respectively, or on less than N servers, that is, there are two or more subsystems 103 installed on the same server.
  • the transaction processing server 102 and the N subsystems 103 can use cloud computing technology for information processing.
  • the calling system 101 can communicate with the transaction processing server 102 through the INTERNET network, or through mobile communication systems and servers such as the Global System for Mobile Communications (GSM), long term evolution (LTE) system, etc. 101 to communicate.
  • the transaction processing server 102 can remotely call the subsystem 103 in RMB, or through other methods such as RPC, or through the Internet, Global System for Mobile Communications (GSM), or long term evolution (long term).
  • a mobile communication system such as an evolution (LTE for short) system communicates with the subsystem 103.
  • Deposit combination transaction system mainly used for the transaction access system for the linkage consumption of current + and deposit balance under the bank support consumption scenario. It can also be used for the linkage consumption of bank deposits and loans, as well as the linkage consumption of cooperative bank deposit accounts and bank deposit accounts .
  • Distributed sub-transactions part of the transaction-type processing logic that constitutes a group of distributed transactions, which can return the processing exceptions to the pre-processing state or the equivalent state through correction or compensation.
  • Main transaction Corresponding to a set of distributed business processing logic, which can be composed of one or more synchronous or asynchronous processing sub-transactions, and has key attributes such as the main transaction type, processing status, correction status, and processing time.
  • Sub-transaction A business processing sub-unit split from a set of distributed business processing logic, corresponding to a distributed sub-transaction, which can be synchronous or asynchronous processing, with processing status, reversing status, and processing type And other business attributes.
  • Active reversal transaction A type of main transaction, a compensation processing mechanism automatically generated by the processing model of this invention when the distributed transaction is abnormal, and the purpose is to make the original main transaction achieve the final business consistency state.
  • the main function of the component of the present invention is to determine the form of the distributed transaction corresponding to this request based on the input information item through the pre-configured processing method of the business, such as the split and definition of sub-transactions, and the remote system interface Of ok.
  • the system can change the form of business processing according to the preset configuration to meet the needs of business changes.
  • Anomaly detection This model recognizes anomaly when the distributed transaction is abnormal.
  • Exception handling decision maker This model generates corresponding exception handling control parameters according to the type of the exception after the occurrence and detection of a distributed transaction exception.
  • the compensation processing mechanism is executed in order to make the data stored in the database reach the final consistency state.
  • the reverse operation includes a rollback operation and/or correction processing.
  • the reverse operation also includes one or more reverse sub-processes, which are symmetrical or asymmetrical with the normal processing sub-processes.
  • the reverse sub-process is a reversal sub-process in the specific business scenario of the embodiment of the present invention.
  • a group of distributed transactions is generally fixed first, denoted as T 1 , T 2 , T 3 ... T n , where T i is an equal sub-transaction.
  • T i is an equal sub-transaction.
  • corresponding compensation sub-transactions C 1 , C 2 , C 3 ... C j are set , where 0 ⁇ j ⁇ n.
  • T 1 , T 2 , T 3 ...T n When executing, it is executed in the order of T 1 , T 2 , T 3 ...T n .
  • an embodiment of the present invention provides a process guarantee method for distributed transactions.
  • the process guarantee method for distributed transactions includes the following steps:
  • Step 201 Receive a processing request sent by the calling system.
  • the system provides a message service interface that can be called externally.
  • the interface can be designed as multiple. Each interface defines the message structure and field meaning and other configuration information. Specifically, the corresponding interface request message field and The definition of the business meaning of the response message fields, including the field type, length, whether it is required, description of use, etc. Therefore, the device in the embodiment of the present invention can receive the processing request sent by the external calling system through the interface, and feedback the response message to the external calling system through the interface.
  • Step 202 Determine the main process and N sub-processes according to the processing request, N ⁇ 1.
  • the request message field and other information of the processing request are analyzed and combined with the configuration service fields controlled by the system to determine whether the processing request is a legal request.
  • the configuration field can be the calling system ID, business request channel number, etc.
  • the corresponding main process and sub-process instances will be matched after parsing and processing according to the business information items carried in the processing request.
  • the type definition of the main process, the sub-process, and the process matching factory class are designed.
  • the main business information items include: requested channel, business scenario ID, partner ID, summary code, account type of the borrower and lender, etc., which can be expanded vertically or horizontally according to actual needs, and finally matched to obtain the main process type.
  • Sub-processes are sub-processes that are determined based on business information items of more dimensions after the main process type is determined. For example, the customer Zhang San paid by scanning the code and bought a cup of coffee for 30 yuan. After analysis, the matching result of the main process is the consumption process, not a refund or other. Furthermore, the sub-process will determine whether it is necessary to link the bank wealth management account and the bank card according to whether Zhang San has a bank wealth management account. Therefore, the sub-processes under the same main process may be different.
  • the sub-process may be a single-card consumption by a bank card; if a bank wealth management account is opened, then the sub-process is a combined consumption of a bank wealth management account and a bank card.
  • the matching of sub-process types is also set through a matrix type, which can be expanded horizontally and vertically according to different business needs.
  • Step 203 For any sub-process in the N sub-processes, send the sub-process to the corresponding subsystem, so that the subsystem can process the sub-process.
  • a processing request will determine a main process and multiple sub-processes linked to it. This is a two-tier transaction model.
  • the main process is mainly used to track and control the progress and status of the overall distributed transaction processing, the correction status, and abnormal information.
  • the sub-process will correspond to a specific interaction with the remote system, and also set the status of the sub-process, the sub-process's correction status, exception information, remote call type and other information.
  • the message of the sub-process can be sent to the corresponding subsystem for remote transaction processing through the remote calling tool.
  • sub-processes 1 and 2 are synchronous processes, that is, they need to be executed immediately and wait for the result to be returned.
  • Sub-process 3 is an asynchronous processing process. You can wait for the previous synchronous sub-processes 1 and 2 to execute successfully and return, and then choose an opportunity to process, and different processes can be performed according to the type of sub-process. In this way, the timeliness of the synchronization operation can be made higher, and the overall throughput of the system can be improved.
  • Step 204 Monitor the processing processes of the N sub-processes. When an exception occurs in the processing process of any sub-process, determine the corresponding exception processing strategy according to the type of the exception, the type of the main process, and the type of the sub-process.
  • the reverse operation process in the embodiment of the present invention is also processed in the manner of the main-sub-process model.
  • the sub-processes of the reverse operation process and the sub-processes of the original process can have a one-to-one correspondence, which we call symmetric reverse operations, or the sub-processes of the reverse operation process and the sub-processes of the original process do not correspond one-to-one.
  • the effect of the execution of the reverse sub-process is the same as the effect of all the atomic processes that have not been executed. We call this asymmetric reverse operation.
  • the following example illustrates the symmetrical reverse operation and the asymmetrical reverse operation with the correction process.
  • the asymmetric correction is not only because the number of offset sub-processes is different from the number of atomic processes, but also the number of offset sub-processes is the same as the number of atomic processes, but there is no one-to-one correspondence. For example, in the above example, It can be divided into three transactions, and each transaction returns 10 yuan to the bank card. This situation is also asymmetrical.
  • Step 205 Perform exception processing on the sub-process according to the exception processing strategy.
  • the exception handling includes performing an asymmetric reverse operation on a sub-process that has been successfully processed.
  • the asymmetric reverse operation is performing a reverse operation sub-process, and the reverse operation sub-process is different from the processed sub-process. symmetry.
  • the reverse operation here can be a rollback operation on the sub-process, a reversal operation on the sub-process, or a reversal operation on the sub-process.
  • the processing request sent by the calling system is received, the processing request is parsed, and the corresponding main process and N sub-processes are matched.
  • the sub-processes are sent to the corresponding subsystems in turn, so that the sub-processes are processed by the sub-processes, and the processing processes of the N sub-processes are monitored at the same time.
  • the type, main process type, and sub-process type determine the corresponding exception handling strategy. Exception handling is performed on the sub-process according to the exception handling strategy.
  • the exception handling includes performing an asymmetric reverse operation on the sub-process that has been successfully processed.
  • the asymmetric reverse operation here is to execute the reverse sub-process, and the reverse sub-process is the same as the reverse sub-process.
  • the sub-processes that have been processed are asymmetric.
  • the exception handling of the sub-process can be a symmetric reverse operation or an asymmetric reverse operation.
  • the exception handling strategy can be flexibly set according to the actual situation and scenario, thereby flexibly solving the distributed transaction exception problem .
  • said receiving the processing request sent by the calling system includes:
  • the number of processing requests received is monitored 24/7.
  • the counter variable is increased by 1.
  • different traffic counters can be set up according to different types of interfaces to target different Configure the high-flow warning value and maximum value for the request type or total system flow.
  • a message warning can be provided; when the maximum value is reached, the limit response message is immediately returned to the calling system to achieve the purpose of system protection.
  • the subsystem provides a message service interface for asynchronous processing, but generally distributed transactions require the subsystem to synchronously feedback the message processing result.
  • the N sub-processes include asynchronous sub-processes; for any one of the N sub-processes, the sub-process is sent to the corresponding subsystem, So that after the subsystem processes the sub-process, it also includes:
  • For the asynchronous sub-process send a result query request to the asynchronous subsystem corresponding to the asynchronous sub-process at a set frequency until the processing result fed back by the asynchronous subsystem is received.
  • the embodiment of the present invention sets an implementation mechanism of asynchronous to synchronous conversion, which better solves the problem that the asynchronous interface of the subsystem cannot meet the requirement of synchronously returning processing results. Specifically, after the asynchronous sub-process is sent to the corresponding asynchronous subsystem, the remote result query interface of the asynchronous subsystem is called according to the serial number of the main process to obtain the processing result of the asynchronous sub-process. If the timeout time of the asynchronous sub-process is not exceeded, wait for a certain time interval and retry the call of the remote result query interface until the specific return result is obtained. In addition, if the result is not obtained by the set timeout time of the asynchronous sub-process, it is directly considered that the asynchronous sub-process has timed out abnormally, and the exception processing logic will be entered.
  • the performing exception handling on the sub-process according to the exception handling strategy includes:
  • the asynchronous sub-process since the execution of the asynchronous sub-process does not need to return the processing result synchronously, in response to the abnormal situation of the asynchronous sub-process, the asynchronous sub-process can be retried.
  • the sub-process can immediately execute the correction processing , It can also be the processing of transferring asynchronous tasks, which can be specifically configured as required, and the configuration table itself can also be horizontally or vertically expanded to meet the needs of the business.
  • the other type of exception is the timeout exception.
  • the monitoring of the processing process of the N sub-processes includes:
  • the performing exception handling on the sub-process according to the exception handling strategy includes:
  • timeout exception in the main process and/or the synchronization sub-process feedback the processing process timeout to the calling system and determine the processing status of the time-out sub-process
  • the main process is transferred to batch asynchronous processing.
  • timeout exceptions are divided into the following different situations.
  • the main flow timeout time and the sub flow timeout time are introduced.
  • the main process timeout time is a system threshold set for the above time period, used to determine whether the execution of a main process has a timeout abnormal situation. If the main process exceeds the set main process timeout time, the calling system returns an exception status code of the main process timeout, which indicates that the process is in an intermediate state of processing timeout.
  • the intermediate state of the processing timeout is regarded as a processing failure to the calling system, and exception handling is required. Specifically, it is necessary to obtain the processing status of the timeout sub-process.
  • the time-out sub-process and the sub-processes that have been successfully processed before the time-out sub-process are subjected to correction processing, here the correction processing It can be either symmetrical or asymmetrical, which ultimately brings the data back to the equivalent state at the beginning of the business. If the timeout sub-process is not processed successfully, there is no need to process the time-out sub-process, and only the sub-processes that have been successfully processed before the time-out sub-process need to be corrected. If the processing status of the timeout sub-process is not clear, the main process should be converted to batch asynchronous processing.
  • the main process that needs batch asynchronous processing should be gathered together, and the processing status can be re-queried at a fixed time every day, and then according to The query results are processed later.
  • Turning the main process with unclear processing status to batch asynchronous processing for continuous subsequent processing operations can ensure that the final results of abnormal transactions meet the consistency of business requirements.
  • Batch asynchronous processing is realized through qrtz timing tasks.
  • different asynchronous processing strategies can be configured, such as task scheduling processing frequency, scheduling time range, scheduling processing thread resources Input etc.
  • the subprocesses are also set with different system thresholds for the timeout status.
  • the processing time of a sub-process is the time from the moment a sub-process is sent to the corresponding subsystem to the current processing time interval.
  • Sub-process timeout means that the time-consuming time recorded by the timer of the sub-process exceeds the system threshold of the timeout period set by the system for the current type of sub-process. Regardless of the timeout of the main process or the timeout of the sub-process that requires synchronous processing, it will affect the processing result of the request. The system will intercept these timeout exceptions and interrupt the execution of the process, and return the process status to timeout.
  • the asynchronous sub-process can be retryed.
  • the retry processing here can be found that the asynchronous sub-process appears When the timeout is abnormal, retry directly, or perform batch asynchronous processing of the asynchronous sub-process, for example, perform the retry processing of the asynchronous sub-process within a fixed time period every day.
  • the embodiment of the present invention provides the invoking system with consistent feedback results. After sending the sub-process to the corresponding subsystem for any one of the N sub-processes, so that the subsystem processes the sub-process, the method further includes:
  • a calling system sends a transaction processing request to the transaction processing server, and the transaction processing server times out and returns a timeout status.
  • the calling system may query the result of the transaction in the transaction processing server according to the specific exception code that has timed out, and it needs to process the returned response message according to the specific transaction status information.
  • the packaging of the feedback response messages can be done as much as possible.
  • the external feedback of the timeout exception code is 000960, because the service needs access to the new downstream subsystem, but the timeout exception code of the newly accessed subsystem is a new value such as XXXTIMEOUT, then the response message format To change it, XXXTIMEOUT needs to be converted and packaged into the timeout exception code 000960 agreed with the calling system, so that the calling system can also recognize it.
  • the system architecture includes client, transaction processing system, and deposit core system. And the financial management system, where the deposit core system and the financial management system are the corresponding subsystems of the sub-transactions.
  • Step S501 The client sends a quick consumption payment request to the transaction processing system.
  • Step S502 The transaction processing system parses the quick consumption payment request, and sends a balance query request to the deposit core system.
  • Step S503 The transaction processing system determines that the balance in the user's bank card is insufficient according to the feedback result of the deposit core system, and the client is set to allow linked consumption of wealth management products, and then sends a balance inquiry request to the wealth management system.
  • Step S504 The transaction processing system determines the sub-processes as "frozen wealth management products", “core one-to-one transfer” and “financial management unfreeze and redeem” according to the feedback result of the wealth management system.
  • Step S505 The transaction processing system sends a request to freeze the wealth management product to the wealth management system. If the financial management system is executed successfully, step 506 is executed. If the execution of the financial management system fails, since it has no effect on the result of the distributed transaction, it does not need to be processed, and the failure result is directly reported to the client. If the execution of the wealth management system expires, the processing result of the request to freeze the wealth management product needs to be verified. If it fails, there is no need to deal with it. If it succeeds, it needs to perform the correction processing, that is, execute the unfreeze of the wealth management product.
  • Step S506 The transaction processing system sends a deduction transfer request to the deposit core system. If the deposit core system is executed successfully, the successful deduction result is fed back to the client, and step 507 is executed. If the implementation of the deposit core system fails, the successful "frozen wealth management products" need to be corrected, that is, the wealth management products are unfrozen. If the deposit core system executes overtime, the processing result of the deduction transfer request needs to be verified. If it fails, the financial product thawing is executed; if it succeeds, the asynchronous redemption is executed and the status is updated. Here, between the sub-process "asynchronous redemption and update status" and the sub-process "freezing financial products" and "core one-to-one transfer” is an asymmetric correction.
  • Step S507 The transaction processing system sends to the wealth management system a request for wealth management thawing and wealth management redemption, where the requests for wealth management thawing and wealth management redemption are asynchronous requests. If the financial management system is executed successfully, the transaction processing system will feedback the successful redemption result to the client. If the financial management system fails to execute, it will switch to batch asynchronous processing and perform retry processing. If the financial management system executes overtime, the processing status needs to be verified and the processing can be manually intervened.
  • the embodiment of the present invention also provides a process guarantee device for distributed transactions, as shown in FIG. 5, including:
  • the transceiver unit 601 is configured to receive a processing request sent by the calling system
  • the configuration unit 602 is configured to determine the main process and N sub-processes according to the processing request, where N ⁇ 1;
  • the transceiver unit 601 is further configured to send the sub-process to the corresponding subsystem for any one of the N sub-processes, so that the subsystem can process the sub-process;
  • the monitoring unit 603 is used to monitor the processing of N sub-processes. When an abnormality occurs in the processing of any sub-process, determine the corresponding exception processing according to the type of the exception, the type of the main process, and the type of the sub-process Strategy
  • the exception processing unit 604 is configured to perform exception processing on the sub-processes according to the exception processing strategy.
  • the exception processing includes performing an asymmetric reverse operation on the sub-processes that have been successfully processed, and the asymmetric reverse operation is performing reverse operations.
  • a sub-process, the reverse sub-process is asymmetric with the processed sub-process.
  • the N sub-processes include asynchronous sub-processes; the transceiver unit 601 is further configured to:
  • For the asynchronous sub-process send a result query request to the asynchronous subsystem corresponding to the asynchronous sub-process at a set frequency until the processing result fed back by the asynchronous subsystem is received.
  • the exception handling unit 604 is configured to:
  • the monitoring unit 603 is configured to monitor the processing time of the main process and each sub-process, and if the processing time of the main process and/or any of the sub-processes exceeds the corresponding time threshold, determine A timeout exception occurred;
  • the exception processing unit 604 is configured to perform retry processing on the asynchronous sub-process when a timeout exception occurs in the asynchronous sub-process; and feedback to the calling system when a time-out exception occurs in the main process and/or the synchronous sub-process
  • the processing process is timed out, and the processing status of the timeout sub-process is determined; if the processing status of the time-out sub-process is clear, an asymmetric reverse operation is performed on the successfully processed sub-process; if the processing status of the time-out sub-process is not clear ,
  • the main process is transferred to batch asynchronous processing.
  • the exception handling unit 604 is configured to:
  • the step of sending a result query request to the subsystem corresponding to the timeout sub-process after the predetermined interval is executed.
  • the transceiver unit 601 is configured to:
  • the transceiver unit 601 is configured to:
  • the present invention also provides an electronic device, as shown in FIG. 6, including:
  • It includes a processor 701, a memory 702, a transceiver 703, and a bus interface 704, wherein the processor 701, the memory 702 and the transceiver 703 are connected through the bus interface 704;
  • the transceiver 703 is configured to receive a processing request sent by the calling system under the control of the processor 701;
  • the processor 701 is configured to read a program in the memory 702 and execute the following method: determine the main process and N sub-processes according to the processing request, N ⁇ 1;
  • the transceiver 703 is further configured to, under the control of the processor 701, for any one of the N sub-processes, send the sub-process to the corresponding subsystem, so that the subsystem can process the sub-process ;
  • the processor 701 is configured to read the program in the memory 702 and execute the following method: monitor the processing process of N sub-processes, and when an exception occurs in the processing process of any sub-process, according to the abnormal type and the type of the main process And the type of the sub-process determines the corresponding exception handling strategy; the exception handling is performed on the sub-process according to the exception handling strategy, and the exception handling includes performing an asymmetric reverse operation on the successfully processed sub-process, and the asymmetric The reverse operation is to execute a reverse sub-process, and the reverse sub-process is asymmetrical to the processed sub-process;
  • the memory 702 is configured to store one or more executable programs, and can store data used by the processor when performing operations;
  • the 704 bus interface provides interfaces, and the processor is responsible for managing the bus architecture and general processing.
  • the bus architecture may include any number of interconnected buses and bridges. Specifically, one or more processors represented by the processor 701 and various circuits of the memory represented by the memory 702 are linked together.
  • the bus architecture can also link various other circuits such as peripherals, voltage regulators, power management circuits, etc., which are all known in the art, and therefore, will not be further described herein.
  • These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
  • the device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
  • the instructions provide steps for implementing functions specified in a flow or multiple flows in the flowchart and/or a block or multiple blocks in the block diagram.

Landscapes

  • Business, Economics & Management (AREA)
  • Engineering & Computer Science (AREA)
  • Strategic Management (AREA)
  • Human Resources & Organizations (AREA)
  • Accounting & Taxation (AREA)
  • Economics (AREA)
  • Finance (AREA)
  • Marketing (AREA)
  • General Physics & Mathematics (AREA)
  • Development Economics (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • Technology Law (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Educational Administration (AREA)
  • Tourism & Hospitality (AREA)
  • Quality & Reliability (AREA)
  • Operations Research (AREA)
  • Game Theory and Decision Science (AREA)
  • Retry When Errors Occur (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

A process guarantee method and device for distributed transactions, for use in solving the problem that a distributed transaction exception processing mechanism lacks of flexibility. The method comprises: receiving a processing request sent by a calling system (201); determining a main process and N sub-processes according to the processing request (202); for any one sub-process in the N sub-processes, sending the sub-process to a corresponding subsystem, so that the subsystem processes the sub-process (203); monitoring the processing processes of the N sub-processes, and when an exception occurs in the processing process of any sub-process, determining a corresponding exception processing strategy according to the exception type, the main process type, and the sub-process type (204); and according to the exception processing strategy, performing exception processing on the sub-processes, the exception processing comprising performing an asymmetric reverse operation on the successfully processed sub-processes, the asymmetric reverse operation being to perform reverse sub-processes, and the reverse sub-processes and the processed sub-processes being asymmetric (205).

Description

一种分布式事务的流程保障方法及装置Process guarantee method and device for distributed transaction
相关申请的交叉引用Cross references to related applications
本申请要求在2019年06月28日提交中国专利局、申请号为201910580564.X、申请名称为“一种分布式事务的流程保障方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on June 28, 2019, the application number is 201910580564.X, and the application name is "a method and device for process protection of distributed transactions", and the entire content of it is approved The reference is incorporated in this application.
技术领域Technical field
本发明涉及金融科技(Fintech)中的计算机技术领域,尤其涉及一种分布式事务的流程保障方法及装置。The present invention relates to the field of computer technology in financial technology (Fintech), and in particular to a process guarantee method and device for distributed transactions.
背景技术Background technique
随着金融科技,尤其是互联网科技金融的不断发展,越来越多的技术(如分布式、区块链Blockchain、人工智能等)应用在金融领域,但金融业也对技术提出了更高的要求,如针对分布式事务的事务保障过程。With the continuous development of financial technology, especially Internet technology and finance, more and more technologies (such as distributed, blockchain, artificial intelligence, etc.) are applied in the financial field, but the financial industry has also proposed higher technology Requirements, such as the transaction guarantee process for distributed transactions.
分布式事务提供一种机制将一个活动涉及的所有操作纳入到一个不可分割的执行单元,组成事务的所有操作只有在所有操作均能正常执行的情况下方能提交,只要其中任一操作执行失败,都将导致整个事务的回滚。Distributed transaction provides a mechanism to incorporate all operations involved in an activity into an indivisible execution unit. All operations that make up a transaction can only be submitted when all operations can be executed normally, as long as any operation fails. Will cause the rollback of the entire transaction.
现有得到分布式事务处理方案通常是按照从子事务失败点逆向顺序冲正的方式回滚整个前置处理逻辑,无法做到冲正逻辑的灵活性和差异性。The existing distributed transaction processing solution usually rolls back the entire pre-processing logic in a reverse order from the failure point of the sub-transaction, which cannot achieve the flexibility and difference of the correction logic.
发明内容Summary of the invention
本申请提供一种分布式事务的流程保障方法及装置,用以解决分布式事务异常处理机制缺乏灵活性的问题。The present application provides a process guarantee method and device for distributed transactions to solve the problem of lack of flexibility in a distributed transaction exception handling mechanism.
本发明实施例提供的一种分布式事务的流程保障方法,包括:An embodiment of the present invention provides a process guarantee method for distributed transactions, including:
接收调用系统发送的处理请求;Receive processing requests sent by the calling system;
根据所述处理请求确定主流程以及N个子流程,N≥1;Determine the main process and N sub-processes according to the processing request, N≥1;
针对所述N个子流程中的任一子流程,将所述子流程向对应的子系统发送,以使所述子系统对子流程进行处理;For any sub-process of the N sub-processes, send the sub-process to the corresponding subsystem, so that the subsystem can process the sub-process;
对N个子流程的处理过程进行监控,当任一子流程的处理过程出现异常时,根据异常类型、所述主流程的类型以及所述子流程的类型确定对应的异常处理策略;Monitor the processing process of N sub-processes, and when an exception occurs in the processing process of any sub-process, determine the corresponding exception processing strategy according to the exception type, the type of the main process, and the type of the sub-process;
根据所述异常处理策略对子流程进行异常处理,所述异常处理包括对已经处理成功的子流程执行非对称反向操作,所述非对称反向操作为执行反向子流程,所述反向子流程与所述已经处理的子流程非对称。Perform exception processing on a sub-process according to the exception processing strategy, the exception processing includes performing an asymmetric reverse operation on a sub-process that has been successfully processed, and the asymmetric reverse operation is executing a reverse sub-process, and The sub-process is asymmetric to the sub-process that has been processed.
一种可选的实施例中,所述N个子流程中包括异步子流程;所述针对所述N个子流程中的任一子流程,将所述子流程向对应的子系统发送,以使所述子系统对子流程进行处理之后,还包括:In an optional embodiment, the N sub-processes include asynchronous sub-processes; for any of the N sub-processes, the sub-process is sent to the corresponding subsystem, so that all After the subsystem processes the sub-process, it also includes:
针对所述异步子流程,以设置的频率向所述异步子流程对应的异步子系统发送结果查询请求,直至接收到所述异步子系统反馈的处理结果。For the asynchronous sub-process, send a result query request to the asynchronous subsystem corresponding to the asynchronous sub-process at a set frequency until the processing result fed back by the asynchronous subsystem is received.
一种可选的实施例中,所述根据所述异常处理策略对子流程进行异常处理,包括:In an optional embodiment, the performing exception handling on the sub-process according to the exception handling strategy includes:
针对所述异步子流程,执行重试处理。For the asynchronous sub-process, retry processing is performed.
一种可选的实施例中,所述对N个子流程的处理过程进行监控,包括:In an optional embodiment, the monitoring the processing process of the N sub-processes includes:
对所述主流程以及每个子流程的处理时间进行监控,若所述主流程和/或任一子流程的处理时间超过对应的时间阈值,则确定出现超时类异常;Monitoring the processing time of the main process and each sub-process, and if the processing time of the main process and/or any of the sub-processes exceeds a corresponding time threshold, it is determined that a timeout exception occurs;
所述根据所述异常处理策略对子流程进行异常处理,包括:The performing exception handling on the sub-process according to the exception handling strategy includes:
针对异步子流程出现超时类异常,则对所述异步子流程执行重试处理;If a timeout exception occurs in the asynchronous sub-process, retry the asynchronous sub-process;
针对主流程和/或同步子流程出现超时类异常,向所述调用系统反馈处理过程超时,并确定超时子流程的处理状态;Regarding the timeout exception in the main process and/or the synchronization sub-process, feedback the processing process timeout to the calling system and determine the processing status of the time-out sub-process;
若所述超时子流程的处理状态明确,则对已处理成功的子流程执行非对称反向操作;If the processing status of the timeout sub-process is clear, perform an asymmetric reverse operation on the successfully processed sub-process;
若所述超时子流程的处理状态不明确,则对所述主流程转批量异步处理。If the processing status of the timeout sub-process is not clear, the main process is transferred to batch asynchronous processing.
一种可选的实施例中,所述若所述超时子流程的处理状态不明确,则对 所述主流程转批量异步处理,包括:In an optional embodiment, if the processing status of the timeout sub-process is not clear, transferring the main process to batch asynchronous processing includes:
间隔预定时间段后,向所述超时子流程对应的子系统发送结果查询请求;After a predetermined period of time, send a result query request to the subsystem corresponding to the timeout sub-process;
若接收到所述子系统发送的处理成功结果,则对所述超时子流程以及所述超时子流程之前的子流程执行非对称反向操作;If a successful processing result sent by the subsystem is received, perform an asymmetric reverse operation on the timeout subprocess and the subprocess before the timeout subprocess;
若接收到所述子系统发送的处理失败结果,则对所述超时子流程之前的子流程执行非对称反向操作;If the processing failure result sent by the subsystem is received, perform an asymmetric reverse operation on the sub-process before the time-out sub-process;
若接收到所述子系统发送的处理结果不明确反馈,则执行所述间隔预定时间段后,向所述超时子流程对应的子系统发送结果查询请求的步骤。If an unclear feedback of the processing result sent by the subsystem is received, the step of sending a result query request to the subsystem corresponding to the timeout sub-process after the predetermined interval is executed.
一种可选的实施例中,所述接收调用系统发送的处理请求,包括:In an optional embodiment, the receiving the processing request sent by the calling system includes:
统计接收到的处理请求的数量;Count the number of processing requests received;
若所述处理请求的数量大于流量预警值,则向所述调用系统发送预警消息,并控制向所述调用系统反馈响应报文的时间。If the number of processing requests is greater than the traffic warning value, an warning message is sent to the invoking system, and the time for feedback of response messages to the invoking system is controlled.
一种可选的实施例中,所述针对所述N个子流程中的任一子流程,将所述子流程向对应的子系统发送,以使所述子系统对子流程进行处理之后,还包括:In an optional embodiment, for any one of the N sub-processes, the sub-process is sent to the corresponding subsystem, so that after the subsystem processes the sub-process, the include:
接收子系统反馈的响应消息;Receive response messages fed back by the subsystem;
将所述响应消息格式化,得到响应报文;Format the response message to obtain a response message;
将所述响应报文向所述调用系统发送。Sending the response message to the calling system.
一种分布式事务的流程保障装置,包括:A process guarantee device for distributed transactions, including:
收发单元,用于接收调用系统发送的处理请求;The transceiver unit is used to receive the processing request sent by the calling system;
配置单元,用于根据所述处理请求确定主流程以及N个子流程,N≥1;The configuration unit is configured to determine the main process and N sub-processes according to the processing request, N≥1;
所述收发单元,还用于针对所述N个子流程中的任一子流程,将所述子流程向对应的子系统发送,以使所述子系统对子流程进行处理;The transceiver unit is further configured to send the sub-process to the corresponding subsystem for any one of the N sub-processes, so that the subsystem can process the sub-process;
监控单元,用于对N个子流程的处理过程进行监控,当任一子流程的处理过程出现异常时,根据异常类型、所述主流程的类型以及所述子流程的类型确定对应的异常处理策略;The monitoring unit is used to monitor the processing of N sub-processes. When an exception occurs in the processing of any sub-process, determine the corresponding exception processing strategy according to the type of the exception, the type of the main process, and the type of the sub-process ;
异常处理单元,用于根据所述异常处理策略对子流程进行异常处理,所 述异常处理包括对已经处理成功的子流程执行非对称反向操作,所述非对称反向操作为执行反向子流程,所述反向子流程与所述已经处理的子流程非对称。The exception processing unit is configured to perform exception processing on a sub-process according to the exception processing strategy, and the exception processing includes performing an asymmetric reverse operation on a sub-process that has been successfully processed, and the asymmetric reverse operation is executing a reverse sub-process Process, the reverse sub-process is asymmetrical with the processed sub-process.
一种可选的实施例中,所述N个子流程中包括异步子流程;所述收发单元,还用于:In an optional embodiment, the N sub-processes include asynchronous sub-processes; the transceiver unit is further configured to:
针对所述异步子流程,以设置的频率向所述异步子流程对应的异步子系统发送结果查询请求,直至接收到所述异步子系统反馈的处理结果。For the asynchronous sub-process, send a result query request to the asynchronous subsystem corresponding to the asynchronous sub-process at a set frequency until the processing result fed back by the asynchronous subsystem is received.
一种可选的实施例中,所述异常处理单元,用于:In an optional embodiment, the exception handling unit is configured to:
针对所述异步子流程,执行重试处理。For the asynchronous sub-process, retry processing is performed.
一种可选的实施例中,所述监控单元,用于对所述主流程以及每个子流程的处理时间进行监控,若所述主流程和/或任一子流程的处理时间超过对应的时间阈值,则确定出现超时类异常;In an optional embodiment, the monitoring unit is configured to monitor the processing time of the main process and each sub-process, if the processing time of the main process and/or any sub-process exceeds the corresponding time Threshold, it is determined that a timeout exception occurs;
所述异常处理单元,用于针对异步子流程出现超时类异常,则对所述异步子流程执行重试处理;针对主流程和/或同步子流程出现超时类异常,向所述调用系统反馈处理过程超时,并确定超时子流程的处理状态;若所述超时子流程的处理状态明确,则对已处理成功的子流程执行非对称反向操作;若所述超时子流程的处理状态不明确,则对所述主流程转批量异步处理。The exception processing unit is configured to perform a retry process on the asynchronous sub-process when a timeout exception occurs in the asynchronous sub-process; for the time-out exception in the main process and/or the synchronous sub-process, feedback processing to the calling system The process times out, and the processing status of the timeout sub-process is determined; if the processing status of the time-out sub-process is clear, an asymmetric reverse operation is performed on the successfully processed sub-process; if the processing status of the time-out sub-process is not clear, Then the main process is transferred to batch asynchronous processing.
一种可选的实施例中,所述异常处理单元,用于:In an optional embodiment, the exception handling unit is configured to:
间隔预定时间段后,向所述超时子流程对应的子系统发送结果查询请求;After a predetermined period of time, send a result query request to the subsystem corresponding to the timeout sub-process;
若接收到所述子系统发送的处理成功结果,则对所述超时子流程以及所述超时子流程之前的子流程执行非对称反向操作;If a successful processing result sent by the subsystem is received, perform an asymmetric reverse operation on the timeout subprocess and the subprocess before the timeout subprocess;
若接收到所述子系统发送的处理失败结果,则对所述超时子流程之前的子流程执行非对称反向操作;If the processing failure result sent by the subsystem is received, perform an asymmetric reverse operation on the sub-process before the time-out sub-process;
若接收到所述子系统发送的处理结果不明确反馈,则执行所述间隔预定时间段后,向所述超时子流程对应的子系统发送结果查询请求的步骤。If an unclear feedback of the processing result sent by the subsystem is received, the step of sending a result query request to the subsystem corresponding to the timeout sub-process after the predetermined interval is executed.
一种可选的实施例中,所述收发单元,用于:In an optional embodiment, the transceiver unit is configured to:
统计接收到的处理请求的数量;Count the number of processing requests received;
若所述处理请求的数量大于流量预警值,则向所述调用系统发送预警消息,并控制向所述调用系统反馈响应报文的时间。If the number of processing requests is greater than the traffic warning value, an warning message is sent to the invoking system, and the time for feedback of response messages to the invoking system is controlled.
一种可选的实施例中,所述收发单元,用于:In an optional embodiment, the transceiver unit is configured to:
接收子系统反馈的响应消息;Receive response messages fed back by the subsystem;
将所述响应消息格式化,得到响应报文;Format the response message to obtain a response message;
将所述响应报文向所述调用系统发送。Sending the response message to the calling system.
本发明实施例还提供一种电子设备,包括:The embodiment of the present invention also provides an electronic device, including:
至少一个处理器;以及,At least one processor; and,
与所述至少一个处理器通信连接的存储器;其中,A memory communicatively connected with the at least one processor; wherein,
所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如上所述的方法。The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute the method described above.
本发明实施例还提供一种非暂态计算机可读存储介质,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令用于使所述计算机执行如上所述的方法。The embodiment of the present invention also provides a non-transitory computer-readable storage medium, the non-transitory computer-readable storage medium storing computer instructions, and the computer instructions are used to make the computer execute the method described above.
本发明实施例中,接收调用系统发送的处理请求,对处理请求进行解析,匹配出对应的主流程和N个子流程。对于N个子流程,依次将子流程向对应子系统发送,以使子系统对子流程进行处理,同时对N个子流程的处理过程进行监控,当任一子流程的处理过程出现异常时,根据异常类型、主流程类型以及子流程类型确定对应的异常处理策略。根据异常处理策略对子流程进行异常处理,其中,异常处理包括对已经处理成功的子流程执行非对称反向操作,这里的非对称反向操作为执行反向子流程,且反向子流程与已经处理的子流程非对称。本发明实施例中,对子流程的异常处理可以是对称式反向操作,也可以是非对称式反向操作,可以根据实际情况和场景灵活设置异常处理策略,从而灵活地解决分布式事务异常问题。In the embodiment of the present invention, the processing request sent by the calling system is received, the processing request is parsed, and the corresponding main process and N sub-processes are matched. For N sub-processes, the sub-processes are sent to the corresponding subsystems in turn, so that the sub-processes are processed by the sub-processes, and the processing processes of the N sub-processes are monitored at the same time. When an exception occurs in the processing of any sub-process, according to the exception The type, main process type, and sub-process type determine the corresponding exception handling strategy. Exception handling is performed on the sub-process according to the exception handling strategy. The exception handling includes performing an asymmetric reverse operation on the sub-process that has been successfully processed. The asymmetric reverse operation here is to execute the reverse sub-process, and the reverse sub-process is the same as the reverse sub-process. The sub-processes that have been processed are asymmetric. In the embodiment of the present invention, the exception handling of the sub-process can be a symmetric reverse operation or an asymmetric reverse operation. The exception handling strategy can be flexibly set according to the actual situation and scenario, thereby flexibly solving the distributed transaction exception problem .
附图说明Description of the drawings
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中 所需要使用的附图作简要介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly describe the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings needed in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings may be obtained from these drawings without creative labor.
图1为本发明实施例提供的一种可能的系统构架的结构示意图;Figure 1 is a schematic structural diagram of a possible system architecture provided by an embodiment of the present invention;
图2为本发明实施例提供的一种分布式事务的流程保障方法的流程示意图;2 is a schematic flowchart of a method for guaranteeing a distributed transaction process according to an embodiment of the present invention;
图3为本发明具体实施例提供的对称式冲正的示意图;FIG. 3 is a schematic diagram of a symmetrical correction provided by a specific embodiment of the present invention;
图4为本发明具体实施例提供的非对称式冲正的示意图;FIG. 4 is a schematic diagram of an asymmetric correction provided by a specific embodiment of the present invention;
图5为本发明实施例提供的一种分布式事务的流程保障装置的结构示意图;FIG. 5 is a schematic structural diagram of a process guarantee apparatus for distributed transactions according to an embodiment of the present invention;
图6为本发明实施例提供的电子设备的结构示意图。Fig. 6 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention.
具体实施方式Detailed ways
为了使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明作进一步地详细描述,显然,所描述的实施例仅仅是本发明一部份实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. . Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of the present invention.
如图1所示,本发明实施例所适用的一种系统架构,包括调用系统101、交易处理服务器102以及N个子系统103。其中,调用系统101可以为安装于终端上的客户端,也可以为安装于服务器上的操作系统,终端可以是手机、平板电脑或者是专用的手持设备等具有无线通信功能的电子设备,也可以是个人计算机(personal computer,简称PC),笔记本电脑,服务器等有线接入方式连接上网的设备。终端可以是一个独立的设备,也可以是多个终端所形成的终端集群。优选地,终端可以采用云计算技术进行信息处理。交易处理服务器102可以是计算机等网络设备,可以是一个独立的设备,也可以是多个服务器所形成的服务器集群。N个子系统103可以分别安装于N个服务器 上,也可以安装于少于N个服务器上,即存在两个或多个子系统103安装于同一个服务器上的情况。优选地,交易处理服务器102以及N个子系统103可以采用云计算技术进行信息处理。As shown in FIG. 1, a system architecture to which the embodiment of the present invention is applicable includes a calling system 101, a transaction processing server 102, and N subsystems 103. Among them, the calling system 101 can be a client installed on a terminal or an operating system installed on a server. The terminal can be an electronic device with wireless communication functions such as a mobile phone, a tablet computer, or a dedicated handheld device, or it can be It is a personal computer (PC), notebook computer, server and other wired access devices connected to the Internet. The terminal can be an independent device or a terminal cluster formed by multiple terminals. Preferably, the terminal can use cloud computing technology for information processing. The transaction processing server 102 may be a network device such as a computer, it may be an independent device, or a server cluster formed by multiple servers. The N subsystems 103 can be installed on N servers respectively, or on less than N servers, that is, there are two or more subsystems 103 installed on the same server. Preferably, the transaction processing server 102 and the N subsystems 103 can use cloud computing technology for information processing.
调用系统101可以通过INTERNET网络与交易处理服务器102进行通信,也可以通过全球移动通信系统(Global System for Mobile Communications,简称GSM)、长期演进(long term evolution,简称LTE)系统等移动通信系统与服务器101进行通信。交易处理服务器102可以RMB的方式远程调用子系统103,也可以通过其它方式如RPC进行调用,也可以通过INTERNET网络、全球移动通信系统(Global System for Mobile Communications,简称GSM)、长期演进(long term evolution,简称LTE)系统等移动通信系统与子系统103进行通信。The calling system 101 can communicate with the transaction processing server 102 through the INTERNET network, or through mobile communication systems and servers such as the Global System for Mobile Communications (GSM), long term evolution (LTE) system, etc. 101 to communicate. The transaction processing server 102 can remotely call the subsystem 103 in RMB, or through other methods such as RPC, or through the Internet, Global System for Mobile Communications (GSM), or long term evolution (long term). A mobile communication system such as an evolution (LTE for short) system communicates with the subsystem 103.
为了便于理解,下面对本发明实施例中可能涉及的名词进行定义和解释。For ease of understanding, the following defines and explains the terms that may be involved in the embodiments of the present invention.
存款组合交易系统:主要用于银行支撑消费场景下联动活期+和存款余额联动消费的交易接入系统,也可用于银行存款结合贷款联动消费,以及合作行存款账户与银行存款账户联动消费的场景。Deposit combination transaction system: mainly used for the transaction access system for the linkage consumption of current + and deposit balance under the bank support consumption scenario. It can also be used for the linkage consumption of bank deposits and loans, as well as the linkage consumption of cooperative bank deposit accounts and bank deposit accounts .
分布式子事务:构成一组分布式事务的一部分事务型处理逻辑,可以通过冲正或补偿方式使处理异常的情况回到处理前的状态或等价的状态。Distributed sub-transactions: part of the transaction-type processing logic that constitutes a group of distributed transactions, which can return the processing exceptions to the pre-processing state or the equivalent state through correction or compensation.
主交易:对应一组分布式的业务处理逻辑,可以由一个或多个同步或异步处理的子交易共同构成,并有主交易类型,处理状态,冲正状态,处理时间等关键性的属性。Main transaction: Corresponding to a set of distributed business processing logic, which can be composed of one or more synchronous or asynchronous processing sub-transactions, and has key attributes such as the main transaction type, processing status, correction status, and processing time.
子交易:一组分布式的业务处理逻辑中拆分出来的一个业务处理子单元,对应到一次分布式子事务,可以是同步处理也可以是异步处理,具有处理状态,冲正状态,处理类型等多个业务属性。Sub-transaction: A business processing sub-unit split from a set of distributed business processing logic, corresponding to a distributed sub-transaction, which can be synchronous or asynchronous processing, with processing status, reversing status, and processing type And other business attributes.
主动冲正交易:主交易的一种,由该发明的处理模型在分布式事务出现异常时自动产生的一种补偿处理机制,目的是让原主交易达到最终的业务一致性状态。Active reversal transaction: A type of main transaction, a compensation processing mechanism automatically generated by the processing model of this invention when the distributed transaction is abnormal, and the purpose is to make the original main transaction achieve the final business consistency state.
流程决策控制器:本发明的构成部件,主要功能是基于输入信息项通过 业务预先配置好的处理方式确定本次请求对应的分布式事务的形态,例如子事务的分拆和明确,远程系统接口的确定。系统可以根据预设的配置来改变业务处理的形态以适应业务变化的需求。Process decision controller: The main function of the component of the present invention is to determine the form of the distributed transaction corresponding to this request based on the input information item through the pre-configured processing method of the business, such as the split and definition of sub-transactions, and the remote system interface Of ok. The system can change the form of business processing according to the preset configuration to meet the needs of business changes.
异常探测:本模型在分布式事务出现异常时系统进行异常的识别。Anomaly detection: This model recognizes anomaly when the distributed transaction is abnormal.
异常处理决策器:本模型在分布式事务异常出现并探测到后,根据异常的类型,结合预先配置好的异常处理控制参数生成对应的。Exception handling decision maker: This model generates corresponding exception handling control parameters according to the type of the exception after the occurrence and detection of a distributed transaction exception.
反向操作:在数据处理过程中出现异常后,执行的补偿处理机制,为了让数据库中存储的数据达到最终一致性的状态。在本发明实施例的具体业务场景中,反向操包括回滚操作和/或冲正处理。反向操作中也包含一个或多个反向子流程,与正常处理的子流程成对称状或者非对称状。反向子流程在本发明实施例的具体业务场景中,为冲正子流程。Reverse operation: After an exception occurs in the data processing process, the compensation processing mechanism is executed in order to make the data stored in the database reach the final consistency state. In the specific business scenario of the embodiment of the present invention, the reverse operation includes a rollback operation and/or correction processing. The reverse operation also includes one or more reverse sub-processes, which are symmetrical or asymmetrical with the normal processing sub-processes. The reverse sub-process is a reversal sub-process in the specific business scenario of the embodiment of the present invention.
现有技术中,为了实现分布式事务,一般会先固定好一组分布式事务,记为T 1、T 2、T 3…T n,其中T i是平等的子事务。对应每个子事务会设置对应的补偿子事务C 1、C 2、C 3…C j,其中0<j<n。执行时,按照T 1、T 2、T 3…T n的顺序执行。如果在执行子事务T j时出现了异常,则除了对子事务T j需要进行回滚操作,还需要对子事务T j之前的子事务执行冲正,即执行设置的补偿子事务,执行的顺序为C j-1、C j-2、…C 2、C 1。现有技术中,子事务的冲正只能按照固定的流程执行,没有灵活性。 In the prior art, in order to implement distributed transactions, a group of distributed transactions is generally fixed first, denoted as T 1 , T 2 , T 3 ... T n , where T i is an equal sub-transaction. Corresponding to each sub-transaction, corresponding compensation sub-transactions C 1 , C 2 , C 3 … C j are set , where 0<j<n. When executing, it is executed in the order of T 1 , T 2 , T 3 …T n . If a transaction occurs when performing sub abnormal T j, in addition to the pair T j transaction rollback is required, but also the sub-sub-transaction executed before the transaction T j Reversal, the compensation is performed subtransactions provided, performed The order is C j-1 , C j-2 , ... C 2 , C 1 . In the prior art, the reconciliation of sub-transactions can only be executed according to a fixed process, and there is no flexibility.
为了解决上述问题,基于上述架构,本发明实施例提供了一种分布式事务的流程保障方法,如图2所示,本发明实施例提供的分布式事务的流程保障方法包括以下步骤:In order to solve the above problems, based on the above architecture, an embodiment of the present invention provides a process guarantee method for distributed transactions. As shown in FIG. 2, the process guarantee method for distributed transactions provided by the embodiment of the present invention includes the following steps:
步骤201、接收调用系统发送的处理请求。Step 201: Receive a processing request sent by the calling system.
具体实施过程中,系统提供可以对外调用的消息服务接口,接口可以设计为多个,每个接口定义了消息的结构和字段含义等配置信息,具体地,设置了对应的接口请求报文字段和响应报文字段的业务含义定义,还包括字段的类型、长度、是否必填、使用描述等说明。从而本发明实施例中的设备可以通过接口接收外部调用系统发送的处理请求,并通过接口向外部调用系统 反馈响应报文。In the specific implementation process, the system provides a message service interface that can be called externally. The interface can be designed as multiple. Each interface defines the message structure and field meaning and other configuration information. Specifically, the corresponding interface request message field and The definition of the business meaning of the response message fields, including the field type, length, whether it is required, description of use, etc. Therefore, the device in the embodiment of the present invention can receive the processing request sent by the external calling system through the interface, and feedback the response message to the external calling system through the interface.
步骤202、根据所述处理请求确定主流程以及N个子流程,N≥1。Step 202: Determine the main process and N sub-processes according to the processing request, N≥1.
具体实施过程中,一个新的处理请求进入后,通过解析处理请求的请求报文字段等信息,结合系统控制的配置业务字段,确定该处理请求是否为合法的请求,配置的字段可以为调用系统的ID、业务请求渠道号等等。In the specific implementation process, after a new processing request is entered, the request message field and other information of the processing request are analyzed and combined with the configuration service fields controlled by the system to determine whether the processing request is a legal request. The configuration field can be the calling system ID, business request channel number, etc.
一个合法的处理请求接收后,根据处理请求所携带的业务信息项,经过解析处理,将匹配出对应的主流程和子流程实例。本发明实施例中设计有主流程、子流程的类型定义,以及流程匹配工厂类。After a legal processing request is received, the corresponding main process and sub-process instances will be matched after parsing and processing according to the business information items carried in the processing request. In the embodiment of the present invention, the type definition of the main process, the sub-process, and the process matching factory class are designed.
对于主流程而言,主要的业务信息项包括:请求的渠道、业务场景ID、合作方ID、摘要代码、借贷双方账号类型等,可以根据实际需要纵向或横向扩充,最后匹配得到主流程类型。For the main process, the main business information items include: requested channel, business scenario ID, partner ID, summary code, account type of the borrower and lender, etc., which can be expanded vertically or horizontally according to actual needs, and finally matched to obtain the main process type.
子流程是在主流程类型确定后根据更多一些维度的业务信息项,确定的细分流程。举例来说,客户张三通过扫码支付,买了一杯咖啡30元。经解析后,主流程匹配结果是消费流程,而不是退款或其它。进而,子流程则会根据张三是否有银行理财账户来确定是否需要联动银行理财账户和银行卡。因此,同一个主流程下的子流程可能不一样。如果没有开通银行理财账户,那么子流程可能是银行卡单卡消费;如果开通了银行理财账户,那么子流程则是银行理财账户与银行卡的联动消费。子流程类型的匹配也是通过一个矩阵类设定的,根据业务需要不同可以横向和纵向扩充。Sub-processes are sub-processes that are determined based on business information items of more dimensions after the main process type is determined. For example, the customer Zhang San paid by scanning the code and bought a cup of coffee for 30 yuan. After analysis, the matching result of the main process is the consumption process, not a refund or other. Furthermore, the sub-process will determine whether it is necessary to link the bank wealth management account and the bank card according to whether Zhang San has a bank wealth management account. Therefore, the sub-processes under the same main process may be different. If a bank wealth management account is not opened, then the sub-process may be a single-card consumption by a bank card; if a bank wealth management account is opened, then the sub-process is a combined consumption of a bank wealth management account and a bank card. The matching of sub-process types is also set through a matrix type, which can be expanded horizontally and vertically according to different business needs.
步骤203、针对所述N个子流程中的任一子流程,将所述子流程向对应的子系统发送,以使所述子系统对子流程进行处理。Step 203: For any sub-process in the N sub-processes, send the sub-process to the corresponding subsystem, so that the subsystem can process the sub-process.
具体实施过程中,一个处理请求,会确定一个主流程和下挂的多个子流程,这是一个双层交易的模型。主流程主要用来跟踪控制整体分布式事务处理的进度和状态、冲正状态、异常信息等。子流程则会对应到一个具体的与远程系统的交互,同样设定有子流程状态、子流程的冲正状态、异常信息、远程调用类型等等信息。本发明实施例中可以按照子流程处理步骤以及对应的子流程的信息,通过远程调用工具将子流程的报文发送到相应的子系统进 行远程事务处理。In the specific implementation process, a processing request will determine a main process and multiple sub-processes linked to it. This is a two-tier transaction model. The main process is mainly used to track and control the progress and status of the overall distributed transaction processing, the correction status, and abnormal information. The sub-process will correspond to a specific interaction with the remote system, and also set the status of the sub-process, the sub-process's correction status, exception information, remote call type and other information. In the embodiment of the present invention, according to the processing steps of the sub-process and the information of the corresponding sub-process, the message of the sub-process can be sent to the corresponding subsystem for remote transaction processing through the remote calling tool.
多个子流程之间可以是同步处理的也可以是异步处理的。以张三买咖啡的例子说明,假定张三银行卡余额为10元,同时也有理财产品的份额为100元,那么针对这次买咖啡的消费请求生成的主流程为消费流程,子流程则会包含:Multiple sub-processes can be processed synchronously or asynchronously. Take the example of Zhang San buying coffee. Assuming that Zhang San’s bank card balance is 10 yuan, and the share of wealth management products is 100 yuan, then the main process generated for this consumption request to buy coffee is the consumption process, and the sub-processes will be contain:
1、到银行理财系统冻结理财产品的份额20元;1. Go to the bank's wealth management system to freeze the share of wealth management products at 20 yuan;
2、到存款核心系统进行分组一对一转账交易30元,其中10元从银行卡出金,20元从在途清算资金出金;2. Go to the deposit core system for group one-to-one transfer transactions of 30 yuan, of which 10 yuan is withdrawn from the bank card, and 20 yuan is withdrawn from the cleared funds in transit;
3、到银行理财系统进行理财产品的份额赎回处理,并完成在途清算资金的清算处理。3. Go to the bank's wealth management system to process the share redemption of wealth management products, and complete the settlement process of the in-transit liquidation funds.
以上三个子流程中,子流程1和2是同步流程,也即需要即刻执行并等待返回结果。子流程3则是异步处理流程,可以等前面的同步子流程1和2都执行成功并返回了之后,再择机进行处理,并根据子流程的类型可以进行不同的处理。这样,可以让同步处理操作的时效性更高,提高系统的整体吞吐量。Among the above three sub-processes, sub-processes 1 and 2 are synchronous processes, that is, they need to be executed immediately and wait for the result to be returned. Sub-process 3 is an asynchronous processing process. You can wait for the previous synchronous sub-processes 1 and 2 to execute successfully and return, and then choose an opportunity to process, and different processes can be performed according to the type of sub-process. In this way, the timeliness of the synchronization operation can be made higher, and the overall throughput of the system can be improved.
步骤204、对N个子流程的处理过程进行监控,当任一子流程的处理过程出现异常时,根据异常类型、所述主流程的类型以及所述子流程的类型确定对应的异常处理策略。Step 204: Monitor the processing processes of the N sub-processes. When an exception occurs in the processing process of any sub-process, determine the corresponding exception processing strategy according to the type of the exception, the type of the main process, and the type of the sub-process.
具体来说,本发明实施例中的反向操作流程,同样采取主子流程模型的方式进行处理。同时反向操作流程的子流程和原流程的子流程可以是一一对应,我们称为对称式反向操作,也可以反向操作流程的子流程和原流程的子流程不一一对应的,但是反向子流程执行完的效果与全部原子流程未执行的效果等同,我们称之为非对称式反向操作。下面以冲正流程举例说明对称式反向操作和非对称式反向操作。Specifically, the reverse operation process in the embodiment of the present invention is also processed in the manner of the main-sub-process model. At the same time, the sub-processes of the reverse operation process and the sub-processes of the original process can have a one-to-one correspondence, which we call symmetric reverse operations, or the sub-processes of the reverse operation process and the sub-processes of the original process do not correspond one-to-one. However, the effect of the execution of the reverse sub-process is the same as the effect of all the atomic processes that have not been executed. We call this asymmetric reverse operation. The following example illustrates the symmetrical reverse operation and the asymmetrical reverse operation with the correction process.
对称式冲正:Symmetrical punching:
假如张三买咖啡时,自己银行余额有30元,足够买一杯咖啡,那么实际上的主流程为消费流程,子流程只有一个,即“核心一对一转账”,不需要联 动银行理财账户,所有的消费金额均从银行卡出金。假定,存款核心从银行卡出金消费出现异常,但此时张三的银行卡中已转出金额30元,那么需要设置对应的冲正子流程,且冲正子流程也是一个,即“核心一对一冲正”,只需要到存款核心冲正原来的那笔消费交易即可。这种情况下,原流程和冲正流程是完全对称的,如图3所示。If Zhang San buys coffee, his bank balance is 30 yuan, enough to buy a cup of coffee, then the actual main process is the consumption process, and there is only one sub-process, namely the "core one-to-one transfer", and there is no need to link bank financial accounts. All consumption amounts are withdrawn from the bank card. Assuming that the deposit core withdrawing money from the bank card is abnormal, but Zhang San’s bank card has transferred the amount of 30 yuan at this time, then the corresponding reconciliation sub-process needs to be set up, and the reconciliation sub-process is also one, that is, "core pair "One charge", you only need to go to the core of the deposit to charge the original consumer transaction. In this case, the original process and the correction process are completely symmetrical, as shown in Figure 3.
非对称式冲正:Asymmetrical punching:
如果张三的银行卡余额为10元,不足30,银行理财产品中有100元,那么实际上的主流程为消费流程,子流程有三个,即“冻结理财产品”、“核心一对一转账”和“理财解冻并赎回”。但是在原流程完成后,外部发起了冲正交易,若是对称式冲正,需要针对三个子流程设置三个冲正子流程,即“理财产品解冻”、“核心一对一冲正”和“理财产品买入”,即向银行卡中退回10元,并重新买入20元的理财产品。而非对称式冲正,可以设置一个冲正子流程,例如为“核心一对一转账”,直接向银行卡中退回30元,那么对应的冲正子流程只有一个,而原子流程有三个,从而是非对称式的,如图4所示。此时对于张三而言,其资产并没有减少,即冲正后的效果与原子流程未执行的效果等同,而操作过程相较于对称式冲正,则极大地进行了简化。需要说明的是,非对称式冲正不仅为冲正子流程的数量与原子流程的数量不同,也可以是冲正子流程的数量与原子流程的数量一致,但不一一对应,例如上述例子中,可以分三笔,每笔向银行卡中退回10元,这种情况也属于非对称式冲正。If Zhang San’s bank card balance is 10 yuan, which is less than 30, and the bank’s wealth management products have 100 yuan, then the actual main process is the consumption process, and there are three sub-processes, namely "freezing financial products" and "core one-to-one transfer "And "Financial management unfreeze and redeem." However, after the original process is completed, an external reversal transaction is initiated. If it is a symmetric reversal, three reversal sub-processes need to be set up for the three sub-processes, namely "defrosting of financial products", "core one-to-one reversal" and "financial products "Buy" means to return 10 yuan to the bank card and re-purchase 20 yuan of financial products. Instead of asymmetric reconciliation, you can set up a reconciliation sub-process, such as "core one-to-one transfer", and directly refund 30 yuan to the bank card, then there is only one corresponding reconciliation sub-process, and there are three atomic processes, so it is right and wrong Symmetrical, as shown in Figure 4. For Zhang San at this time, his assets have not been reduced, that is, the effect after the correction is equivalent to the effect of the atomic process is not executed, and the operation process is greatly simplified compared with the symmetrical correction. It should be noted that the asymmetric correction is not only because the number of offset sub-processes is different from the number of atomic processes, but also the number of offset sub-processes is the same as the number of atomic processes, but there is no one-to-one correspondence. For example, in the above example, It can be divided into three transactions, and each transaction returns 10 yuan to the bank card. This situation is also asymmetrical.
步骤205、根据所述异常处理策略对子流程进行异常处理。所述异常处理包括对已经处理成功的子流程执行非对称反向操作,所述非对称反向操作为执行反向操作子流程,所述反向操作子流程与所述已经处理的子流程非对称。Step 205: Perform exception processing on the sub-process according to the exception processing strategy. The exception handling includes performing an asymmetric reverse operation on a sub-process that has been successfully processed. The asymmetric reverse operation is performing a reverse operation sub-process, and the reverse operation sub-process is different from the processed sub-process. symmetry.
这里的反向操作,可以为对子流程的回滚操作,也可以为对子流程的冲正操作,也可以为对子流程的冲账操作。The reverse operation here can be a rollback operation on the sub-process, a reversal operation on the sub-process, or a reversal operation on the sub-process.
本发明实施例中,接收调用系统发送的处理请求,对处理请求进行解析,匹配出对应的主流程和N个子流程。对于N个子流程,依次将子流程向对应 子系统发送,以使子系统对子流程进行处理,同时对N个子流程的处理过程进行监控,当任一子流程的处理过程出现异常时,根据异常类型、主流程类型以及子流程类型确定对应的异常处理策略。根据异常处理策略对子流程进行异常处理,其中,异常处理包括对已经处理成功的子流程执行非对称反向操作,这里的非对称反向操作为执行反向子流程,且反向子流程与已经处理的子流程非对称。本发明实施例中,对子流程的异常处理可以是对称式反向操作,也可以是非对称式反向操作,可以根据实际情况和场景灵活设置异常处理策略,从而灵活地解决分布式事务异常问题。In the embodiment of the present invention, the processing request sent by the calling system is received, the processing request is parsed, and the corresponding main process and N sub-processes are matched. For N sub-processes, the sub-processes are sent to the corresponding subsystems in turn, so that the sub-processes are processed by the sub-processes, and the processing processes of the N sub-processes are monitored at the same time. When an exception occurs in the processing of any sub-process, according to the exception The type, main process type, and sub-process type determine the corresponding exception handling strategy. Exception handling is performed on the sub-process according to the exception handling strategy. The exception handling includes performing an asymmetric reverse operation on the sub-process that has been successfully processed. The asymmetric reverse operation here is to execute the reverse sub-process, and the reverse sub-process is the same as the reverse sub-process. The sub-processes that have been processed are asymmetric. In the embodiment of the present invention, the exception handling of the sub-process can be a symmetric reverse operation or an asymmetric reverse operation. The exception handling strategy can be flexibly set according to the actual situation and scenario, thereby flexibly solving the distributed transaction exception problem .
进一步地,为了控制消息流量,减少系统压力,本发明实施例中,所述接收调用系统发送的处理请求,包括:Further, in order to control message flow and reduce system pressure, in the embodiment of the present invention, said receiving the processing request sent by the calling system includes:
统计接收到的处理请求的数量;Count the number of processing requests received;
若所述处理请求的数量大于流量预警值,则向所述调用系统发送预警消息,并控制向所述调用系统反馈响应报文的时间。If the number of processing requests is greater than the traffic warning value, an warning message is sent to the invoking system, and the time for feedback of response messages to the invoking system is controlled.
具体实施过程中,将全天候监听接收到的处理请求的数量,接收到一个新的处理请求时,计数器变量增加1,同时,也可以根据接口的类型不同,设立不同的流量计数器,从而针对不同的请求类型或总的系统流量配置高流量预警值和最大值。当某类型请求的数量或总的处理请求的数量触发预警值时,可以提供消息预警;当达到最大值时,将限制响应报文立即返回给调用系统,以达到系统保护的目的。In the specific implementation process, the number of processing requests received is monitored 24/7. When a new processing request is received, the counter variable is increased by 1. At the same time, different traffic counters can be set up according to different types of interfaces to target different Configure the high-flow warning value and maximum value for the request type or total system flow. When the number of a certain type of request or the total number of processing requests triggers the warning value, a message warning can be provided; when the maximum value is reached, the limit response message is immediately returned to the calling system to achieve the purpose of system protection.
现有技术中,子系统提供异步处理的消息服务接口,但是一般分布式事务要求子系统同步反馈消息处理结果。为了解决这一问题,本发明实施例中,所述N个子流程中包括异步子流程;所述针对所述N个子流程中的任一子流程,将所述子流程向对应的子系统发送,以使所述子系统对子流程进行处理之后,还包括:In the prior art, the subsystem provides a message service interface for asynchronous processing, but generally distributed transactions require the subsystem to synchronously feedback the message processing result. In order to solve this problem, in the embodiment of the present invention, the N sub-processes include asynchronous sub-processes; for any one of the N sub-processes, the sub-process is sent to the corresponding subsystem, So that after the subsystem processes the sub-process, it also includes:
针对所述异步子流程,以设置的频率向所述异步子流程对应的异步子系统发送结果查询请求,直至接收到所述异步子系统反馈的处理结果。For the asynchronous sub-process, send a result query request to the asynchronous subsystem corresponding to the asynchronous sub-process at a set frequency until the processing result fed back by the asynchronous subsystem is received.
本发明实施例设置了异步转同步的实现机制,较好地解决了子系统的异 步接口无法满足同步返回处理结果的要求。具体地,将异步子流程发送至对应的异步子系统之后,根据主流程的流水号调用异步子系统的远程结果查询接口,获取异步子流程的处理结果。如未超过异步子流程的超时时间,则等待一定的时间间隔后,重试远程结果查询接口的调用,直到获取具体的返回结果。此外,若到设定的异步子流程的超时时间仍未获取到结果,则直接认为该异步子流程超时异常,将进入到异常处理逻辑。The embodiment of the present invention sets an implementation mechanism of asynchronous to synchronous conversion, which better solves the problem that the asynchronous interface of the subsystem cannot meet the requirement of synchronously returning processing results. Specifically, after the asynchronous sub-process is sent to the corresponding asynchronous subsystem, the remote result query interface of the asynchronous subsystem is called according to the serial number of the main process to obtain the processing result of the asynchronous sub-process. If the timeout time of the asynchronous sub-process is not exceeded, wait for a certain time interval and retry the call of the remote result query interface until the specific return result is obtained. In addition, if the result is not obtained by the set timeout time of the asynchronous sub-process, it is directly considered that the asynchronous sub-process has timed out abnormally, and the exception processing logic will be entered.
进一步地,所述根据所述异常处理策略对子流程进行异常处理,包括:Further, the performing exception handling on the sub-process according to the exception handling strategy includes:
针对所述异步子流程,执行重试处理。For the asynchronous sub-process, retry processing is performed.
具体地,由于异步子流程的执行不需同步返回处理结果,因此,针对异步子流程出现异常的情况,可以对该异步子流程执行重试处理。Specifically, since the execution of the asynchronous sub-process does not need to return the processing result synchronously, in response to the abnormal situation of the asynchronous sub-process, the asynchronous sub-process can be retried.
在主流程或者子流程的执行过程中,如果明确发生业务异常或者技术性的异常,例如,转账时发生的账务状态异常、数据库异常等,本发明实施例中,可以子流程立即执行冲正处理,也可以是转异步任务的处理,具体可以根据需要进行配置,配置表本身也可以进行横向或纵向的扩展以适应业务的需要。During the execution of the main process or sub-process, if it is clear that business or technical anomalies occur, for example, abnormal accounting status or database abnormality occurred during transfer, in the embodiment of the present invention, the sub-process can immediately execute the correction processing , It can also be the processing of transferring asynchronous tasks, which can be specifically configured as required, and the configuration table itself can also be horizontally or vertically expanded to meet the needs of the business.
另一类异常则为超时类异常。所述对N个子流程的处理过程进行监控,包括:The other type of exception is the timeout exception. The monitoring of the processing process of the N sub-processes includes:
对所述主流程以及每个子流程的处理时间进行监控,若所述主流程和/或任一子流程的处理时间超过对应的时间阈值,则确定出现超时类异常;Monitoring the processing time of the main process and each sub-process, and if the processing time of the main process and/or any of the sub-processes exceeds a corresponding time threshold, it is determined that a timeout exception occurs;
所述根据所述异常处理策略对子流程进行异常处理,包括:The performing exception handling on the sub-process according to the exception handling strategy includes:
针对异步子流程出现超时类异常,则对所述异步子流程执行重试处理;If a timeout exception occurs in the asynchronous sub-process, retry the asynchronous sub-process;
针对主流程和/或同步子流程出现超时类异常,向所述调用系统反馈处理过程超时,并确定超时子流程的处理状态;Regarding the timeout exception in the main process and/or the synchronization sub-process, feedback the processing process timeout to the calling system and determine the processing status of the time-out sub-process;
若所述超时子流程的处理状态明确,则对已处理成功的子流程执行非对称反向操作;If the processing status of the timeout sub-process is clear, perform an asymmetric reverse operation on the successfully processed sub-process;
若所述超时子流程的处理状态不明确,则对所述主流程转批量异步处理。If the processing status of the timeout sub-process is not clear, the main process is transferred to batch asynchronous processing.
具体实施过程中,超时类异常又分为以下不同的情况。本发明实施例中 引入主流程超时时间和子流程超时时间。从接收到一个处理请求开始计时,到当前处理时间,主流程超时时间即针对上述时间段设置的一个系统阈值,用于判断一个主流程的执行是否出现超时的异常情况。如果主流程超过了设置的主流程超时时间,则对调用系统返回主流程超时的异常状态码,标识出该流程处于一个处理超时的中间状态。处理超时的中间状态对调用系统而言认为是处理失败,需要进行异常处理。具体地,需要获取超时子流程的处理状态,若超时子流程已经处理成功,则对于该超时子流程以及该超时子流程之前的已经处理成功的子流程,实施冲正处理,这里的冲正处理可以是对称式冲正也可以是非对称式冲正,最终使数据回到业务起始的等价状态。若超时子流程未处理成功,则对该超时子流程无需处理,只需对该超时子流程之前的已经处理成功的子流程实施冲正处理。而对于该超时子流程的处理状态不明确的,则对主流程转批量异步处理,例如,将需要批量异步处理的主流程集中起来,在每天固定的时间段进行处理状态的重新查询,再根据查询结果进行后续处理。将处理状态不明确的主流程转为批量异步处理方式进行持续的后续处理操作,可以确保异常交易的最终结果达到业务要求的一致性。In the specific implementation process, timeout exceptions are divided into the following different situations. In the embodiment of the present invention, the main flow timeout time and the sub flow timeout time are introduced. From the time when a processing request is received, to the current processing time, the main process timeout time is a system threshold set for the above time period, used to determine whether the execution of a main process has a timeout abnormal situation. If the main process exceeds the set main process timeout time, the calling system returns an exception status code of the main process timeout, which indicates that the process is in an intermediate state of processing timeout. The intermediate state of the processing timeout is regarded as a processing failure to the calling system, and exception handling is required. Specifically, it is necessary to obtain the processing status of the timeout sub-process. If the time-out sub-process has been processed successfully, the time-out sub-process and the sub-processes that have been successfully processed before the time-out sub-process are subjected to correction processing, here the correction processing It can be either symmetrical or asymmetrical, which ultimately brings the data back to the equivalent state at the beginning of the business. If the timeout sub-process is not processed successfully, there is no need to process the time-out sub-process, and only the sub-processes that have been successfully processed before the time-out sub-process need to be corrected. If the processing status of the timeout sub-process is not clear, the main process should be converted to batch asynchronous processing. For example, the main process that needs batch asynchronous processing should be gathered together, and the processing status can be re-queried at a fixed time every day, and then according to The query results are processed later. Turning the main process with unclear processing status to batch asynchronous processing for continuous subsequent processing operations can ensure that the final results of abnormal transactions meet the consistency of business requirements.
批量异步处理是通过qrtz定时任务的方式来实现,针对不同类型的批量异步处理的主流程,可以配置不同的异步处理策略,例如任务的调度处理频度、调度的时间范围、调度处理的线程资源投入等。Batch asynchronous processing is realized through qrtz timing tasks. For different types of batch asynchronous processing main processes, different asynchronous processing strategies can be configured, such as task scheduling processing frequency, scheduling time range, scheduling processing thread resources Input etc.
与主流程超时状态类似,子流程也设置有不同的超时状态的系统阈值。子流程的处理时间为从一个子流程发往对应的子系统那一刻开始计时,到当前的处理时间间隔。子流程超时即子流程的计时器所记录的耗时时长超过系统针对当前类型的子流程设置的超时时间系统阈值。不管主流程超时还是要求同步处理的子流程超时,都会影响请求的处理结果,系统将拦截到这些超时的异常并中断流程的执行,对外返回流程状态超时。Similar to the timeout status of the main process, the subprocesses are also set with different system thresholds for the timeout status. The processing time of a sub-process is the time from the moment a sub-process is sent to the corresponding subsystem to the current processing time interval. Sub-process timeout means that the time-consuming time recorded by the timer of the sub-process exceeds the system threshold of the timeout period set by the system for the current type of sub-process. Regardless of the timeout of the main process or the timeout of the sub-process that requires synchronous processing, it will affect the processing result of the request. The system will intercept these timeout exceptions and interrupt the execution of the process, and return the process status to timeout.
此外,对于异步子流程出现超时类异常,由于该异步子流程的超时不影响当前请求的处理结果,因此,可以对异步子流程执行重试处理,这里的重试处理可以是发现异步子流程出现超时异常时,直接进行重试,也可以将该 异步子流程执行批量异步处理,例如在每天固定的时间段内执行异步子流程的重试处理。当然,也可以根据配置对异步子流程执行冲正处理。In addition, for an asynchronous sub-process with a timeout exception, since the timeout of the asynchronous sub-process does not affect the processing result of the current request, the asynchronous sub-process can be retryed. The retry processing here can be found that the asynchronous sub-process appears When the timeout is abnormal, retry directly, or perform batch asynchronous processing of the asynchronous sub-process, for example, perform the retry processing of the asynchronous sub-process within a fixed time period every day. Of course, you can also perform offset processing on asynchronous sub-processes according to the configuration.
进一步地,本发明实施例向调用系统提供格式一致的反馈结果。所述针对所述N个子流程中的任一子流程,将所述子流程向对应的子系统发送,以使所述子系统对子流程进行处理之后,还包括:Further, the embodiment of the present invention provides the invoking system with consistent feedback results. After sending the sub-process to the corresponding subsystem for any one of the N sub-processes, so that the subsystem processes the sub-process, the method further includes:
接收子系统反馈的响应消息;Receive response messages fed back by the subsystem;
将所述响应消息格式化,得到响应报文;Format the response message to obtain a response message;
将所述响应报文向所述调用系统发送。Sending the response message to the calling system.
举例来说,某调用系统向交易处理服务器发送交易处理请求,交易处理服务器处理请求超时,返回了超时状态。调用系统可能会根据超时的特定异常码再到交易处理服务器中查询交易的结果,则需要根据具体的交易状态信息将返回的响应消息进行加工处理。For example, a calling system sends a transaction processing request to the transaction processing server, and the transaction processing server times out and returns a timeout status. The calling system may query the result of the transaction in the transaction processing server according to the specific exception code that has timed out, and it needs to process the returned response message according to the specific transaction status information.
另外反馈的响应消息的包装可以尽量做到,出现系统变动特别是出现新的系统语义时,经过消息格式化后,对外提供一致的稳定的输出结果。例如:超时异常码对外反馈的是000960,因为业务的需求又接入了新的下游方子系统,但是新接入的子系统的超时异常码是一个新的值比如XXXTIMEOUT,那么将响应消息格式化则需要将XXXTIMEOUT转化包装成跟调用系统约定的超时异常码000960,从而调用系统也能够识别到。In addition, the packaging of the feedback response messages can be done as much as possible. When there are system changes, especially when new system semantics appear, after message formatting, consistent and stable output results are provided to the outside world. For example, the external feedback of the timeout exception code is 000960, because the service needs access to the new downstream subsystem, but the timeout exception code of the newly accessed subsystem is a new value such as XXXTIMEOUT, then the response message format To change it, XXXTIMEOUT needs to be converted and packaged into the timeout exception code 000960 agreed with the calling system, so that the calling system can also recognize it.
为了更清楚地理解本发明,下面以具体实施例对上述流程进行详细描述,本发明具体实施例中,具体场景为用户使用手机进行快捷支付,系统架构包括客户端、交易处理系统、存款核心系统和理财系统,其中,存款核心系统和理财系统分别为子交易对应的子系统。In order to understand the present invention more clearly, the above process will be described in detail with specific embodiments below. In specific embodiments of the present invention, the specific scenario is that users use mobile phones to make quick payments. The system architecture includes client, transaction processing system, and deposit core system. And the financial management system, where the deposit core system and the financial management system are the corresponding subsystems of the sub-transactions.
具体实施例的步骤如下所示,包括:The steps of the specific embodiment are as follows, including:
步骤S501:客户端向交易处理系统发送快捷消费支付请求。Step S501: The client sends a quick consumption payment request to the transaction processing system.
步骤S502:交易处理系统解析快捷消费支付请求,向存款核心系统发送余额查询请求。Step S502: The transaction processing system parses the quick consumption payment request, and sends a balance query request to the deposit core system.
步骤S503:交易处理系统根据存款核心系统反馈的结果,确定用户银行 卡中余额不足,且客户端设置为允许理财产品联动消费,则向理财系统发送余额查询请求。Step S503: The transaction processing system determines that the balance in the user's bank card is insufficient according to the feedback result of the deposit core system, and the client is set to allow linked consumption of wealth management products, and then sends a balance inquiry request to the wealth management system.
步骤S504:交易处理系统根据理财系统反馈的结果,确定子流程分别为“冻结理财产品”、“核心一对一转账”和“理财解冻并赎回”。Step S504: The transaction processing system determines the sub-processes as "frozen wealth management products", "core one-to-one transfer" and "financial management unfreeze and redeem" according to the feedback result of the wealth management system.
步骤S505:交易处理系统向理财系统发送冻结理财产品请求。若理财系统执行成功,则执行步骤506。若理财系统执行失败,由于对分布式事务的结果没有影响,因此不用处理,直接向客户端反馈失败结果。若理财系统执行超时,则需要对冻结理财产品请求的处理结果进行核实,若失败则无需处理,若成功,则需执行冲正处理,即执行理财产品解冻。Step S505: The transaction processing system sends a request to freeze the wealth management product to the wealth management system. If the financial management system is executed successfully, step 506 is executed. If the execution of the financial management system fails, since it has no effect on the result of the distributed transaction, it does not need to be processed, and the failure result is directly reported to the client. If the execution of the wealth management system expires, the processing result of the request to freeze the wealth management product needs to be verified. If it fails, there is no need to deal with it. If it succeeds, it needs to perform the correction processing, that is, execute the unfreeze of the wealth management product.
步骤S506:交易处理系统向存款核心系统发送扣款转账请求。若存款核心系统执行成功,则向客户端反馈扣款成功结果,并执行步骤507。若存款核心系统执行失败,则需要对已成功的“冻结理财产品”执行冲正处理,即执行理财产品解冻。若存款核心系统执行超时,则需要对扣款转账请求的处理结果进行核实,若失败则执行理财产品解冻,若成功,则执行异步赎回并更新状态。这里冲正子流程“异步赎回并更新状态”与子流程“冻结理财产品”和“核心一对一转账”之间即为非对称式冲正。Step S506: The transaction processing system sends a deduction transfer request to the deposit core system. If the deposit core system is executed successfully, the successful deduction result is fed back to the client, and step 507 is executed. If the implementation of the deposit core system fails, the successful "frozen wealth management products" need to be corrected, that is, the wealth management products are unfrozen. If the deposit core system executes overtime, the processing result of the deduction transfer request needs to be verified. If it fails, the financial product thawing is executed; if it succeeds, the asynchronous redemption is executed and the status is updated. Here, between the sub-process "asynchronous redemption and update status" and the sub-process "freezing financial products" and "core one-to-one transfer" is an asymmetric correction.
步骤S507:交易处理系统向理财系统发送理财解冻和理财赎回的请求,其中理财解冻和理财赎回的请求为异步请求。若理财系统执行成功,则交易处理系统向客户端反馈赎回成功结果。若理财系统执行失败,则转批量异步处理,执行重试处理。若理财系统执行超时,则需要对处理状态进行核实,并可以人工干预处理。Step S507: The transaction processing system sends to the wealth management system a request for wealth management thawing and wealth management redemption, where the requests for wealth management thawing and wealth management redemption are asynchronous requests. If the financial management system is executed successfully, the transaction processing system will feedback the successful redemption result to the client. If the financial management system fails to execute, it will switch to batch asynchronous processing and perform retry processing. If the financial management system executes overtime, the processing status needs to be verified and the processing can be manually intervened.
本发明实施例还提供了一种分布式事务的流程保障装置,如图5所示,包括:The embodiment of the present invention also provides a process guarantee device for distributed transactions, as shown in FIG. 5, including:
收发单元601,用于接收调用系统发送的处理请求;The transceiver unit 601 is configured to receive a processing request sent by the calling system;
配置单元602,用于根据所述处理请求确定主流程以及N个子流程,N≥1;The configuration unit 602 is configured to determine the main process and N sub-processes according to the processing request, where N≥1;
所述收发单元601,还用于针对所述N个子流程中的任一子流程,将所述子流程向对应的子系统发送,以使所述子系统对子流程进行处理;The transceiver unit 601 is further configured to send the sub-process to the corresponding subsystem for any one of the N sub-processes, so that the subsystem can process the sub-process;
监控单元603,用于对N个子流程的处理过程进行监控,当任一子流程的处理过程出现异常时,根据异常类型、所述主流程的类型以及所述子流程的类型确定对应的异常处理策略;The monitoring unit 603 is used to monitor the processing of N sub-processes. When an abnormality occurs in the processing of any sub-process, determine the corresponding exception processing according to the type of the exception, the type of the main process, and the type of the sub-process Strategy
异常处理单元604,用于根据所述异常处理策略对子流程进行异常处理,所述异常处理包括对已经处理成功的子流程执行非对称反向操作,所述非对称反向操作为执行反向子流程,所述反向子流程与所述已经处理的子流程非对称。The exception processing unit 604 is configured to perform exception processing on the sub-processes according to the exception processing strategy. The exception processing includes performing an asymmetric reverse operation on the sub-processes that have been successfully processed, and the asymmetric reverse operation is performing reverse operations. A sub-process, the reverse sub-process is asymmetric with the processed sub-process.
可选的,所述N个子流程中包括异步子流程;所述收发单元601,还用于:Optionally, the N sub-processes include asynchronous sub-processes; the transceiver unit 601 is further configured to:
针对所述异步子流程,以设置的频率向所述异步子流程对应的异步子系统发送结果查询请求,直至接收到所述异步子系统反馈的处理结果。For the asynchronous sub-process, send a result query request to the asynchronous subsystem corresponding to the asynchronous sub-process at a set frequency until the processing result fed back by the asynchronous subsystem is received.
可选的,所述异常处理单元604,用于:Optionally, the exception handling unit 604 is configured to:
针对所述异步子流程,执行重试处理。For the asynchronous sub-process, retry processing is performed.
可选的,所述监控单元603,用于对所述主流程以及每个子流程的处理时间进行监控,若所述主流程和/或任一子流程的处理时间超过对应的时间阈值,则确定出现超时类异常;Optionally, the monitoring unit 603 is configured to monitor the processing time of the main process and each sub-process, and if the processing time of the main process and/or any of the sub-processes exceeds the corresponding time threshold, determine A timeout exception occurred;
所述异常处理单元604,用于针对异步子流程出现超时类异常,则对所述异步子流程执行重试处理;针对主流程和/或同步子流程出现超时类异常,向所述调用系统反馈处理过程超时,并确定超时子流程的处理状态;若所述超时子流程的处理状态明确,则对已处理成功的子流程执行非对称反向操作;若所述超时子流程的处理状态不明确,则对所述主流程转批量异步处理。The exception processing unit 604 is configured to perform retry processing on the asynchronous sub-process when a timeout exception occurs in the asynchronous sub-process; and feedback to the calling system when a time-out exception occurs in the main process and/or the synchronous sub-process The processing process is timed out, and the processing status of the timeout sub-process is determined; if the processing status of the time-out sub-process is clear, an asymmetric reverse operation is performed on the successfully processed sub-process; if the processing status of the time-out sub-process is not clear , The main process is transferred to batch asynchronous processing.
可选的,所述异常处理单元604,用于:Optionally, the exception handling unit 604 is configured to:
间隔预定时间段后,向所述超时子流程对应的子系统发送结果查询请求;After a predetermined period of time, send a result query request to the subsystem corresponding to the timeout sub-process;
若接收到所述子系统发送的处理成功结果,则对所述超时子流程以及所述超时子流程之前的子流程执行非对称反向操作;If a successful processing result sent by the subsystem is received, perform an asymmetric reverse operation on the timeout subprocess and the subprocess before the timeout subprocess;
若接收到所述子系统发送的处理失败结果,则对所述超时子流程之前的子流程执行非对称反向操作;If the processing failure result sent by the subsystem is received, perform an asymmetric reverse operation on the sub-process before the time-out sub-process;
若接收到所述子系统发送的处理结果不明确反馈,则执行所述间隔预定时间段后,向所述超时子流程对应的子系统发送结果查询请求的步骤。If an unclear feedback of the processing result sent by the subsystem is received, the step of sending a result query request to the subsystem corresponding to the timeout sub-process after the predetermined interval is executed.
可选的,所述收发单元601,用于:Optionally, the transceiver unit 601 is configured to:
统计接收到的处理请求的数量;Count the number of processing requests received;
若所述处理请求的数量大于流量预警值,则向所述调用系统发送预警消息,并控制向所述调用系统反馈响应报文的时间。If the number of processing requests is greater than the traffic warning value, an warning message is sent to the invoking system, and the time for feedback of response messages to the invoking system is controlled.
可选的,所述收发单元601,用于:Optionally, the transceiver unit 601 is configured to:
接收子系统反馈的响应消息;Receive response messages fed back by the subsystem;
将所述响应消息格式化,得到响应报文;Format the response message to obtain a response message;
将所述响应报文向所述调用系统发送。Sending the response message to the calling system.
基于相同的原理,本发明还提供一种电子设备,如图6所示,包括:Based on the same principle, the present invention also provides an electronic device, as shown in FIG. 6, including:
包括处理器701、存储器702、收发机703、总线接口704,其中处理器701、存储器702与收发机703之间通过总线接口704连接;It includes a processor 701, a memory 702, a transceiver 703, and a bus interface 704, wherein the processor 701, the memory 702 and the transceiver 703 are connected through the bus interface 704;
收发机703,用于在处理器701的控制下接收调用系统发送的处理请求;The transceiver 703 is configured to receive a processing request sent by the calling system under the control of the processor 701;
处理器701,用于读取存储器702中的程序,执行下列方法:根据所述处理请求确定主流程以及N个子流程,N≥1;The processor 701 is configured to read a program in the memory 702 and execute the following method: determine the main process and N sub-processes according to the processing request, N≥1;
收发机703,还用于在处理器701的控制下针对所述N个子流程中的任一子流程,将所述子流程向对应的子系统发送,以使所述子系统对子流程进行处理;The transceiver 703 is further configured to, under the control of the processor 701, for any one of the N sub-processes, send the sub-process to the corresponding subsystem, so that the subsystem can process the sub-process ;
处理器701,用于读取存储器702中的程序,执行下列方法:对N个子流程的处理过程进行监控,当任一子流程的处理过程出现异常时,根据异常类型、所述主流程的类型以及所述子流程的类型确定对应的异常处理策略;根据所述异常处理策略对子流程进行异常处理,所述异常处理包括对已经处理成功的子流程执行非对称反向操作,所述非对称反向操作为执行反向子流程,所述反向子流程与所述已经处理的子流程非对称;The processor 701 is configured to read the program in the memory 702 and execute the following method: monitor the processing process of N sub-processes, and when an exception occurs in the processing process of any sub-process, according to the abnormal type and the type of the main process And the type of the sub-process determines the corresponding exception handling strategy; the exception handling is performed on the sub-process according to the exception handling strategy, and the exception handling includes performing an asymmetric reverse operation on the successfully processed sub-process, and the asymmetric The reverse operation is to execute a reverse sub-process, and the reverse sub-process is asymmetrical to the processed sub-process;
存储器702,用于存储一个或多个可执行程序,可以存储所述处理器在执行操作时所使用的数据;The memory 702 is configured to store one or more executable programs, and can store data used by the processor when performing operations;
704总线接口,提供接口,处理器负责管理总线架构和通常的处理。The 704 bus interface provides interfaces, and the processor is responsible for managing the bus architecture and general processing.
其中,在图6中,总线构架可以包括任意数量的互联的总线和桥,具体由处理器701代表的一个或多个处理器和存储器702代表的存储器的各种电路链接在一起。总线架构还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路链接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。Wherein, in FIG. 6, the bus architecture may include any number of interconnected buses and bridges. Specifically, one or more processors represented by the processor 701 and various circuits of the memory represented by the memory 702 are linked together. The bus architecture can also link various other circuits such as peripherals, voltage regulators, power management circuits, etc., which are all known in the art, and therefore, will not be further described herein.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to flowcharts and/or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and/or block in the flowchart and/or block diagram, and the combination of processes and/or blocks in the flowchart and/or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing equipment to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing equipment are generated It is a device that realizes the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device. The device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment. The instructions provide steps for implementing functions specified in a flow or multiple flows in the flowchart and/or a block or multiple blocks in the block diagram.
尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。Although the preferred embodiments of the present invention have been described, those skilled in the art can make additional changes and modifications to these embodiments once they learn the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present invention.
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要 求及其等同技术的范围之内,则本发明也意图包括这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. In this way, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and equivalent technologies, the present invention is also intended to include these modifications and variations.

Claims (22)

  1. 一种分布式事务的流程保障方法,其特征在于,包括:A process guarantee method for distributed transactions is characterized in that it includes:
    接收调用系统发送的处理请求;Receive processing requests sent by the calling system;
    根据所述处理请求确定主流程以及N个子流程,N≥1;Determine the main process and N sub-processes according to the processing request, N≥1;
    针对所述N个子流程中的任一子流程,将所述子流程向对应的子系统发送,以使所述子系统对子流程进行处理;For any sub-process of the N sub-processes, send the sub-process to the corresponding subsystem, so that the subsystem can process the sub-process;
    对N个子流程的处理过程进行监控,当任一子流程的处理过程出现异常时,根据异常类型、所述主流程的类型以及所述子流程的类型确定对应的异常处理策略;Monitor the processing process of N sub-processes, and when an exception occurs in the processing process of any sub-process, determine the corresponding exception processing strategy according to the exception type, the type of the main process, and the type of the sub-process;
    根据所述异常处理策略对子流程进行异常处理,所述异常处理包括对已经处理成功的子流程执行非对称反向操作,所述非对称反向操作为执行反向子流程,所述反向子流程与所述已经处理的子流程非对称。Perform exception processing on a sub-process according to the exception processing strategy, the exception processing includes performing an asymmetric reverse operation on a sub-process that has been successfully processed, and the asymmetric reverse operation is executing a reverse sub-process, and The sub-process is asymmetric to the sub-process that has been processed.
  2. 如权利要求1所述的方法,其特征在于,所述N个子流程中包括异步子流程;所述针对所述N个子流程中的任一子流程,将所述子流程向对应的子系统发送,以使所述子系统对子流程进行处理之后,还包括:The method according to claim 1, wherein the N sub-processes include asynchronous sub-processes; for any one of the N sub-processes, the sub-process is sent to the corresponding subsystem , So that after the subsystem processes the sub-process, it also includes:
    若所述子流程为异步子流程,则以设置的频率向所述异步子流程对应的异步子系统发送结果查询请求,直至接收到所述异步子系统反馈的处理结果。If the sub-process is an asynchronous sub-process, a result query request is sent to the asynchronous subsystem corresponding to the asynchronous sub-process at a set frequency until the processing result fed back by the asynchronous sub-process is received.
  3. 如权利要求2所述的方法,其特征在于,所述根据所述异常处理策略对子流程进行异常处理,包括:The method according to claim 2, wherein the performing exception handling on the sub-process according to the exception handling strategy comprises:
    针对所述异步子流程,执行重试处理。For the asynchronous sub-process, retry processing is performed.
  4. 如权利要求1所述的方法,其特征在于,所述对N个子流程的处理过程进行监控,包括:The method of claim 1, wherein the monitoring the processing of the N sub-processes comprises:
    对所述主流程以及每个子流程的处理时间进行监控,若所述主流程和/或任一子流程的处理时间超过对应的时间阈值,则确定出现超时类异常;Monitoring the processing time of the main process and each sub-process, and if the processing time of the main process and/or any of the sub-processes exceeds a corresponding time threshold, it is determined that a timeout exception occurs;
    所述根据所述异常处理策略对子流程进行异常处理,包括:The performing exception handling on the sub-process according to the exception handling strategy includes:
    针对异步子流程出现超时类异常,则对所述异步子流程执行重试处理;If a timeout exception occurs in the asynchronous sub-process, retry the asynchronous sub-process;
    针对主流程和/或同步子流程出现超时类异常,向所述调用系统反馈处理过程超时,并确定超时子流程的处理状态;Regarding the timeout exception in the main process and/or the synchronization sub-process, feedback the processing process timeout to the calling system and determine the processing status of the time-out sub-process;
    若所述超时子流程的处理状态明确,则对已处理成功的子流程执行非对称反向操作;If the processing status of the timeout sub-process is clear, perform an asymmetric reverse operation on the successfully processed sub-process;
    若所述超时子流程的处理状态不明确,则对所述主流程转批量异步处理。If the processing status of the timeout sub-process is not clear, the main process is transferred to batch asynchronous processing.
  5. 如权利要求4所述的方法,其特征在于,所述若所述超时子流程的处理状态不明确,则对所述主流程转批量异步处理,包括:The method of claim 4, wherein if the processing status of the timeout sub-process is not clear, transferring the main process to batch asynchronous processing includes:
    间隔预定时间段后,向所述超时子流程对应的子系统发送结果查询请求;After a predetermined period of time, send a result query request to the subsystem corresponding to the timeout sub-process;
    若接收到所述子系统发送的处理成功结果,则对所述超时子流程以及所述超时子流程之前的子流程执行非对称反向操作;If a successful processing result sent by the subsystem is received, perform an asymmetric reverse operation on the timeout subprocess and the subprocess before the timeout subprocess;
    若接收到所述子系统发送的处理失败结果,则对所述超时子流程之前的子流程执行非对称反向操作;If the processing failure result sent by the subsystem is received, perform an asymmetric reverse operation on the sub-process before the time-out sub-process;
    若接收到所述子系统发送的处理结果不明确反馈,则执行所述间隔预定时间段后,向所述超时子流程对应的子系统发送结果查询请求的步骤。If an unclear feedback of the processing result sent by the subsystem is received, the step of sending a result query request to the subsystem corresponding to the timeout sub-process after the predetermined interval is executed.
  6. 如权利要求1所述的方法,其特征在于,所述接收调用系统发送的处理请求,包括:The method according to claim 1, wherein the receiving a processing request sent by the calling system comprises:
    统计接收到的处理请求的数量;Count the number of processing requests received;
    若所述处理请求的数量大于流量预警值,则向所述调用系统发送预警消息,并控制向所述调用系统反馈响应报文的时间。If the number of processing requests is greater than the traffic warning value, an warning message is sent to the invoking system, and the time for feedback of response messages to the invoking system is controlled.
  7. 如权利要求1至6任一项所述的方法,其特征在于,所述针对所述N个子流程中的任一子流程,将所述子流程向对应的子系统发送,以使所述子系统对子流程进行处理之后,还包括:The method according to any one of claims 1 to 6, wherein for any one of the N sub-processes, the sub-process is sent to a corresponding subsystem, so that the sub-process is After the system processes the sub-process, it also includes:
    接收子系统反馈的响应消息;Receive response messages fed back by the subsystem;
    将所述响应消息格式化,得到响应报文;Format the response message to obtain a response message;
    将所述响应报文向所述调用系统发送。Sending the response message to the calling system.
  8. 一种分布式事务的流程保障装置,其特征在于,包括:A process guarantee device for distributed transactions is characterized in that it includes:
    收发单元,用于接收调用系统发送的处理请求;The transceiver unit is used to receive the processing request sent by the calling system;
    配置单元,用于根据所述处理请求确定主流程以及N个子流程,N≥1;The configuration unit is configured to determine the main process and N sub-processes according to the processing request, N≥1;
    所述收发单元,还用于针对所述N个子流程中的任一子流程,将所述子流程向对应的子系统发送,以使所述子系统对子流程进行处理;The transceiver unit is further configured to send the sub-process to the corresponding subsystem for any one of the N sub-processes, so that the subsystem can process the sub-process;
    监控单元,用于对N个子流程的处理过程进行监控,当任一子流程的处理过程出现异常时,根据异常类型、所述主流程的类型以及所述子流程的类型确定对应的异常处理策略;The monitoring unit is used to monitor the processing of N sub-processes. When an exception occurs in the processing of any sub-process, determine the corresponding exception processing strategy according to the type of the exception, the type of the main process, and the type of the sub-process ;
    异常处理单元,用于根据所述异常处理策略对子流程进行异常处理,所述异常处理包括对已经处理成功的子流程执行非对称反向操作,所述非对称反向操作为执行反向子流程,所述反向子流程与所述已经处理的子流程非对称。The exception processing unit is configured to perform exception processing on a sub-process according to the exception processing strategy, and the exception processing includes performing an asymmetric reverse operation on a sub-process that has been successfully processed, and the asymmetric reverse operation is executing a reverse sub-process Process, the reverse sub-process is asymmetrical to the processed sub-process.
  9. 如权利要求8所述的装置,其特征在于,所述N个子流程中包括异步子流程;所述收发单元,还用于:The apparatus according to claim 8, wherein the N sub-processes include asynchronous sub-processes; the transceiver unit is further configured to:
    针对所述异步子流程,以设置的频率向所述异步子流程对应的异步子系统发送结果查询请求,直至接收到所述异步子系统反馈的处理结果。For the asynchronous sub-process, send a result query request to the asynchronous subsystem corresponding to the asynchronous sub-process at a set frequency until the processing result fed back by the asynchronous subsystem is received.
  10. 如权利要求9所述的装置,其特征在于,所述异常处理单元,用于The device according to claim 9, wherein the abnormal processing unit is configured to
    针对所述异步子流程,执行重试处理。For the asynchronous sub-process, retry processing is performed.
  11. 如权利要求8所述的装置,其特征在于,所述监控单元,用于对所述主流程以及每个子流程的处理时间进行监控,若所述主流程和/或任一子流程的处理时间超过对应的时间阈值,则确定出现超时类异常;The device according to claim 8, wherein the monitoring unit is configured to monitor the processing time of the main process and each sub-process, if the processing time of the main process and/or any sub-process If the corresponding time threshold is exceeded, it is determined that a timeout exception occurs;
    所述异常处理单元,用于针对异步子流程出现超时类异常,则对所述异步子流程执行重试处理;针对主流程和/或同步子流程出现超时类异常,向所述调用系统反馈处理过程超时,并确定超时子流程的处理状态;若所述超时子流程的处理状态明确,则对已处理成功的子流程执行非对称反向操作;若所述超时子流程的处理状态不明确,则对所述主流程转批量异步处理。The exception processing unit is configured to perform a retry process on the asynchronous sub-process when a timeout exception occurs in the asynchronous sub-process; for the time-out exception in the main process and/or the synchronous sub-process, feedback processing to the calling system The process times out, and the processing status of the timeout sub-process is determined; if the processing status of the time-out sub-process is clear, an asymmetric reverse operation is performed on the successfully processed sub-process; if the processing status of the time-out sub-process is not clear, Then the main process is transferred to batch asynchronous processing.
  12. 如权利要求11所述的装置,其特征在于,所述异常处理单元,用于:The device according to claim 11, wherein the exception processing unit is configured to:
    间隔预定时间段后,向所述超时子流程对应的子系统发送结果查询请求;After a predetermined period of time, send a result query request to the subsystem corresponding to the timeout sub-process;
    若接收到所述子系统发送的处理成功结果,则对所述超时子流程以及所 述超时子流程之前的子流程执行非对称反向操作;If a successful processing result sent by the subsystem is received, perform an asymmetric reverse operation on the timeout subprocess and the subprocess before the timeout subprocess;
    若接收到所述子系统发送的处理失败结果,则对所述超时子流程之前的子流程执行非对称反向操作;If the processing failure result sent by the subsystem is received, perform an asymmetric reverse operation on the sub-process before the time-out sub-process;
    若接收到所述子系统发送的处理结果不明确反馈,则执行所述间隔预定时间段后,向所述超时子流程对应的子系统发送结果查询请求的步骤。If an unclear feedback of the processing result sent by the subsystem is received, the step of sending a result query request to the subsystem corresponding to the timeout sub-process after the predetermined interval is executed.
  13. 如权利要求8所述的装置,其特征在于,所述收发单元,用于:The device according to claim 8, wherein the transceiver unit is configured to:
    统计接收到的处理请求的数量;Count the number of processing requests received;
    若所述处理请求的数量大于流量预警值,则向所述调用系统发送预警消息,并控制向所述调用系统反馈响应报文的时间。If the number of processing requests is greater than the traffic warning value, an warning message is sent to the invoking system, and the time for feedback of response messages to the invoking system is controlled.
  14. 如权利要求8至13任一项所述的装置,其特征在于,所述收发单元,用于:The device according to any one of claims 8 to 13, wherein the transceiver unit is configured to:
    接收子系统反馈的响应消息;Receive response messages fed back by the subsystem;
    将所述响应消息格式化,得到响应报文;Format the response message to obtain a response message;
    将所述响应报文向所述调用系统发送。Sending the response message to the calling system.
  15. 一种电子设备,其特征在于,包括:处理器、存储器、收发机、总线接口,其中处理器、存储器与收发机之间通过总线接口连接;An electronic device, characterized by comprising: a processor, a memory, a transceiver, and a bus interface, wherein the processor, the memory and the transceiver are connected through the bus interface;
    所述收发机,用于在所述处理器的控制下接收调用系统发送的处理请求;The transceiver is configured to receive a processing request sent by the calling system under the control of the processor;
    所述处理器,用于读取所述存储器中的程序,执行下列方法:根据所述处理请求确定主流程以及N个子流程,N≥1;The processor is configured to read the program in the memory and execute the following method: determine the main process and N sub-processes according to the processing request, N≥1;
    所述收发机,用于在所述处理器的控制下针对所述N个子流程中的任一子流程,将所述子流程向对应的子系统发送,以使所述子系统对子流程进行处理;The transceiver is configured to send the sub-process to the corresponding subsystem for any one of the N sub-processes under the control of the processor, so that the subsystem performs the sub-process deal with;
    所述处理器,用于读取所述存储器中的程序,执行下列方法:对N个子流程的处理过程进行监控,当任一子流程的处理过程出现异常时,根据异常类型、所述主流程的类型以及所述子流程的类型确定对应的异常处理策略;根据所述异常处理策略对子流程进行异常处理,所述异常处理包括对已经处理成功的子流程执行非对称反向操作,所述非对称反向操作为执行反向子流 程,所述反向子流程与所述已经处理的子流程非对称;The processor is configured to read the program in the memory, and execute the following method: monitor the processing process of N sub-processes, and when an exception occurs in the processing process of any sub-process, according to the abnormal type and the main process The type of the sub-process and the type of the sub-process determine the corresponding exception handling strategy; perform exception handling on the sub-process according to the exception handling strategy, and the exception handling includes performing an asymmetric reverse operation on the successfully processed sub-process, the An asymmetric reverse operation is to execute a reverse sub-process, and the reverse sub-process is asymmetric to the processed sub-process;
    所述存储器,用于存储一个或多个可执行程序,可以存储所述处理器在执行操作时所使用的数据;The memory is used to store one or more executable programs, and can store data used by the processor when performing operations;
    所述总线接口,用于提供接口。The bus interface is used to provide an interface.
  16. 如权利要求15所述的电子设备,其特征在于,所述N个子流程中包括异步子流程;所述收发机,还用于:The electronic device according to claim 15, wherein the N sub-processes include asynchronous sub-processes; the transceiver is further used for:
    若所述子流程为异步子流程,则以设置的频率向所述异步子流程对应的异步子系统发送结果查询请求,直至接收到所述异步子系统反馈的处理结果。If the sub-process is an asynchronous sub-process, the result query request is sent to the asynchronous subsystem corresponding to the asynchronous sub-process at a set frequency until the processing result fed back by the asynchronous sub-process is received.
  17. 如权利要求16所述的电子设备,其特征在于,所述处理器,还用于:The electronic device of claim 16, wherein the processor is further configured to:
    针对所述异步子流程,执行重试处理。For the asynchronous sub-process, retry processing is performed.
  18. 如权利要求15所述的电子设备,其特征在于,所述处理器,具体用于:The electronic device according to claim 15, wherein the processor is specifically configured to:
    对所述主流程以及每个子流程的处理时间进行监控,若所述主流程和/或任一子流程的处理时间超过对应的时间阈值,则确定出现超时类异常;Monitoring the processing time of the main process and each sub-process, and if the processing time of the main process and/or any of the sub-processes exceeds a corresponding time threshold, it is determined that a timeout exception occurs;
    针对异步子流程出现超时类异常,则对所述异步子流程执行重试处理;If a timeout exception occurs in the asynchronous sub-process, retry the asynchronous sub-process;
    针对主流程和/或同步子流程出现超时类异常,向所述调用系统反馈处理过程超时,并确定超时子流程的处理状态;Regarding the timeout exception in the main process and/or the synchronization sub-process, feedback the processing process timeout to the calling system and determine the processing status of the time-out sub-process;
    若所述超时子流程的处理状态明确,则对已处理成功的子流程执行非对称反向操作;If the processing status of the timeout sub-process is clear, perform an asymmetric reverse operation on the successfully processed sub-process;
    若所述超时子流程的处理状态不明确,则对所述主流程转批量异步处理。If the processing status of the timeout sub-process is not clear, the main process is transferred to batch asynchronous processing.
  19. 如权利要求18所述的电子设备,其特征在于,所述收发机,还用于间隔预定时间段后,向所述超时子流程对应的子系统发送结果查询请求;The electronic device according to claim 18, wherein the transceiver is further configured to send a result query request to the subsystem corresponding to the timeout sub-process after a predetermined period of time has passed;
    所述处理器,还用于若接收到所述子系统发送的处理成功结果,则对所述超时子流程以及所述超时子流程之前的子流程执行非对称反向操作;若接收到所述子系统发送的处理失败结果,则对所述超时子流程之前的子流程执行非对称反向操作;若接收到所述子系统发送的处理结果不明确反馈,则执行所述间隔预定时间段后,向所述超时子流程对应的子系统发送结果查询请 求的步骤。The processor is further configured to perform an asymmetric reverse operation on the timeout subprocess and the subprocess before the timeout subprocess if the processing success result sent by the subsystem is received; if the subprocess is received If the processing result sent by the subsystem fails, an asymmetric reverse operation is performed on the sub-process before the timeout sub-process; if an unclear feedback of the processing result sent by the subsystem is received, it will execute after the predetermined interval , The step of sending a result query request to the subsystem corresponding to the timeout sub-process.
  20. 如权利要求15所述的电子设备,其特征在于,所述收发机,还用于:The electronic device according to claim 15, wherein the transceiver is further used for:
    统计接收到的处理请求的数量;Count the number of processing requests received;
    若所述处理请求的数量大于流量预警值,则向所述调用系统发送预警消息,并控制向所述调用系统反馈响应报文的时间。If the number of processing requests is greater than the traffic warning value, an warning message is sent to the invoking system, and the time for feedback of response messages to the invoking system is controlled.
  21. 如权利要求15至20任一项所述的电子设备,其特征在于,所述收发机,还用于:The electronic device according to any one of claims 15 to 20, wherein the transceiver is further used for:
    接收子系统反馈的响应消息;Receive response messages fed back by the subsystem;
    将所述响应消息格式化,得到响应报文;Format the response message to obtain a response message;
    将所述响应报文向所述调用系统发送。Sending the response message to the calling system.
  22. 一种非暂态计算机可读存储介质,其特征在于,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令用于使所述计算机执行权利要求1-7任一所述方法。A non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to make the computer execute the method of any one of claims 1-7 .
PCT/CN2019/118181 2019-06-28 2019-11-13 Process guarantee method and device for distributed transactions WO2020258665A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910580564.XA CN110288255A (en) 2019-06-28 2019-06-28 A kind of logistics method and device of distributed transaction
CN201910580564.X 2019-06-28

Publications (1)

Publication Number Publication Date
WO2020258665A1 true WO2020258665A1 (en) 2020-12-30

Family

ID=68019847

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/118181 WO2020258665A1 (en) 2019-06-28 2019-11-13 Process guarantee method and device for distributed transactions

Country Status (2)

Country Link
CN (1) CN110288255A (en)
WO (1) WO2020258665A1 (en)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110288255A (en) * 2019-06-28 2019-09-27 深圳前海微众银行股份有限公司 A kind of logistics method and device of distributed transaction
CN110930110B (en) * 2019-10-31 2022-06-07 东软集团股份有限公司 Distributed flow monitoring method and device, storage medium and electronic equipment
CN111277639B (en) * 2020-01-16 2022-08-09 中国建设银行股份有限公司 Method and device for maintaining data consistency
CN111340340B (en) * 2020-02-17 2023-10-20 腾讯科技(深圳)有限公司 Event processing method and device
CN111367628B (en) * 2020-03-05 2023-05-23 中国银行股份有限公司 Distributed transaction processing method and device, message producer and consumer system
CN111414266B (en) * 2020-03-23 2024-04-05 浪潮通用软件有限公司 Synchronous and asynchronous communication method and device for distributed transaction
CN111866171B (en) * 2020-07-30 2023-08-22 中国工商银行股份有限公司 Message processing method, device, electronic equipment and medium
CN112435004A (en) * 2020-11-20 2021-03-02 金蝶软件(中国)有限公司 Method and device for realizing service flow processing
CN112839110B (en) * 2021-03-05 2023-03-10 紫光云技术有限公司 Method for realizing problem processing based on network overtime in distributed system
CN113051008A (en) * 2021-04-01 2021-06-29 金蝶软件(中国)有限公司 Interface request processing method and device, computer equipment and storage medium
CN113111077A (en) * 2021-04-16 2021-07-13 中国工商银行股份有限公司 Consistency control method, consistency control device, electronic equipment, consistency control medium and program product
CN113065967A (en) * 2021-05-18 2021-07-02 中国农业银行股份有限公司 Multi-mode service processing method, device and equipment
CN113297357B (en) * 2021-07-27 2021-11-16 北京健康之家科技有限公司 Asynchronous processing method and device for business process data
CN113724082B (en) * 2021-08-30 2024-04-30 上海浦东发展银行股份有限公司 Accounting processing method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104462370A (en) * 2014-12-09 2015-03-25 北京百度网讯科技有限公司 Distributed task scheduling system and method
CN106775959A (en) * 2016-12-06 2017-05-31 上海亿账通互联网科技有限公司 Distributed transaction processing method and system
CN108519920A (en) * 2018-03-14 2018-09-11 口碑(上海)信息技术有限公司 A kind of scheduling retries method and device
CN109785042A (en) * 2018-12-13 2019-05-21 深圳平安财富宝投资咨询有限公司 Abnormality eliminating method, server, storage medium and the device of distributed deployment
CN110288255A (en) * 2019-06-28 2019-09-27 深圳前海微众银行股份有限公司 A kind of logistics method and device of distributed transaction

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102045682B (en) * 2009-10-19 2014-03-12 中兴通讯股份有限公司 Method and system for handling abnormal transactions of payment services
CN106445644B (en) * 2016-08-30 2019-11-05 中国民生银行股份有限公司 Treating method and apparatus based on the distributed transaction that an improved stage submits
CN107819861A (en) * 2017-11-16 2018-03-20 中国银行股份有限公司 Business data processing method, apparatus and system
CN108459919B (en) * 2018-03-29 2022-04-15 中信百信银行股份有限公司 Distributed transaction processing method and device
CN108958894B (en) * 2018-06-14 2022-05-10 创新先进技术有限公司 Distributed transaction processing method, system, transaction manager and terminal equipment
CN109003069B (en) * 2018-07-27 2022-05-10 创新先进技术有限公司 Resource rollback method and device
CN109254840A (en) * 2018-08-28 2019-01-22 中国邮政储蓄银行股份有限公司 Business compensation method and device, system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104462370A (en) * 2014-12-09 2015-03-25 北京百度网讯科技有限公司 Distributed task scheduling system and method
CN106775959A (en) * 2016-12-06 2017-05-31 上海亿账通互联网科技有限公司 Distributed transaction processing method and system
CN108519920A (en) * 2018-03-14 2018-09-11 口碑(上海)信息技术有限公司 A kind of scheduling retries method and device
CN109785042A (en) * 2018-12-13 2019-05-21 深圳平安财富宝投资咨询有限公司 Abnormality eliminating method, server, storage medium and the device of distributed deployment
CN110288255A (en) * 2019-06-28 2019-09-27 深圳前海微众银行股份有限公司 A kind of logistics method and device of distributed transaction

Also Published As

Publication number Publication date
CN110288255A (en) 2019-09-27

Similar Documents

Publication Publication Date Title
WO2020258665A1 (en) Process guarantee method and device for distributed transactions
US11682070B2 (en) Systems and methods for estimating past and prospective attribute values associated with a user account
CN107038645B (en) Service processing method, device and system and server
CN112650764A (en) Cross-chain data processing method, device, equipment and storage medium
CN107358425A (en) The calculating of tranaction costs and method of payment and device, transaction platform and storage medium
CN111400283B (en) Data processing method, system, electronic equipment and storage medium
CN110335154A (en) It is a kind of based on accounting processing method, equipment and the system of depositing guard system
WO2020243904A1 (en) Refund method, transaction system, account system, and storage medium
CN116051106B (en) Abnormal order processing method and device
WO2020093874A1 (en) Method and device for foreign exchange purchase transactions
US20170094027A1 (en) Targeted file transfer tracker process
US8850034B1 (en) Service request fast fail circuit breaker
CN111242762A (en) Financial product purchasing method, device and system
US11520802B2 (en) Systems and methods for data format conversion
CN109492016A (en) A kind of exchange settlement method and device
CN110263063B (en) Asset query method and server
JP2002352070A (en) System for increasing processing speed of stock transaction
CN108876590A (en) The group technology and system of night transaction amended record
CN111796854B (en) Module hot upgrading method and device, electronic equipment and readable storage medium
KR20160025796A (en) Apparatus for exchanging money piece by piece and method thereof
CN114004701A (en) Method and device for generating transaction result, electronic equipment and storage medium
CN110428315B (en) Data transmission method and device in asynchronous calling process of summary check subsystem
CN111367680A (en) Job task allocation method, device, server, system and storage medium
US9092258B2 (en) Task concurrency limiter
TWI665634B (en) Exchange transaction management system and a management method thereof

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19934413

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 19.04.2022)

122 Ep: pct application non-entry in european phase

Ref document number: 19934413

Country of ref document: EP

Kind code of ref document: A1