Processing method, processing device, and processing system for transaction consistency

By introducing balance guard service and heterogeneous system adapter in distributed systems, the heterogeneous system business resources are frozen and converted into TCC two-stage transaction processing, the complexity of transaction consistency processing between distributed systems and heterogeneous systems is solved. Problem, improving efficiency and safety.

CN112541830BActive Publication Date: 2024-12-27INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011610002.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-29
Publication Date
2024-12-27
Estimated Expiration
2040-12-29

AI Technical Summary

Technical Problem

Transaction consistency processing between distributed systems and heterogeneous systems is complex, especially when multiple heterogeneous systems exist, it is difficult to support TCC two-stage transaction processing, which increases system complexity and accounting risks.

Method used

By introducing balance guard service in a distributed system, calling the business subfunctions of heterogeneous systems, freezing business resources, and performing operation in the trial and confirmation phase in the TCC transaction processing mechanism, ensuring transaction consistency, and using heterogeneous system adapters and The transaction-driven manager provides a unified service and transaction view, converted to a TCC two-stage transaction processing.

Benefits of technology

It improves transaction consistency processing efficiency, reduces accounting risks, simplifies the interaction between distributed systems and heterogeneous systems, reduces system complexity, and enhances scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112541830B_ABST
    Figure CN112541830B_ABST
Patent Text Reader

Abstract

The present disclosure provides a processing method, device and system for transaction consistency, which can be used in the financial field. The processing method includes: receiving a service request initiated by a user; in response to the service request, determining a combined service for processing a first transaction corresponding to the service request, and the combined service includes a second sub-service. The second sub-service is a service for performing transaction processing by calling a business sub-function in a second system. The second system provides a business sub-function based on a compensatory transaction processing mechanism of "positive transaction-reversal". In the trial phase of processing the first transaction based on the TCC transaction processing mechanism, the second sub-service is triggered to freeze the business resources to be operated by the called business sub-function in the first system through the balance guard service, so that the second sub-service has the behavior of the trial phase in the TCC transaction processing mechanism. The present disclosure also provides an electronic device and a medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure can be used in the financial field, and more specifically, relates to a processing method, a processing device, and a processing system for transaction consistency, an electronic device, and a computer-readable storage medium. Background Art

[0002] With the rapid development of Internet technology and applications, distributed system technology has been widely used to improve system throughput. A variety of methods have been developed and widely used to ensure transaction consistency within and between distributed systems, such as the compensation type based on "positive transaction-reversal" and the TCC two-stage type based on "try-confirm-cancel". However, due to the solidification of business, heterogeneous systems with non-distributed architectures will coexist with distributed systems for a long time to jointly support various business functions. Transaction consistency between distributed systems and traditional non-distributed heterogeneous systems is more complicated and more prone to transaction errors because transactions are not within the same system framework.

[0003] At present, the means to solve the transaction consistency between distributed systems and heterogeneous systems mostly refer to the transaction consistency processing between traditional systems. When an exception occurs, the distributed system caller initiates the revocation and error processing. However, if heterogeneous systems of multiple configurations are involved at the same time, the distributed system needs to connect to multiple heterogeneous systems, support different communication messages and implement transaction reversal by itself, which greatly increases the complexity of the distributed system. Moreover, the business functions of heterogeneous systems often only provide basic accounting and query functions, and cannot cooperate to provide overly complex transaction functions. When heterogeneous systems or even multiple heterogeneous systems are involved, TCC two-stage transaction processing is usually unable to be provided. Summary of the invention

[0004] In view of this, embodiments of the present disclosure provide a processing method, a processing device and a processing system for transaction consistency, an electronic device, and a computer-readable storage medium that can ensure transaction consistency between systems of different configurations.

[0005] In a first aspect of an embodiment of the present disclosure, a processing method for transaction consistency is provided, which is applied to a first system. The processing method includes: receiving a service request initiated by a user; in response to the service request, determining a combined service for processing a first transaction corresponding to the service request, wherein the combined service includes a second sub-service; the second sub-service is a service for processing transactions by calling a business sub-function in a second system, wherein the second system provides a business sub-function based on a compensation transaction processing mechanism of "positive transaction-reversal"; the first system processes transactions based on a TCC transaction processing mechanism of "try-confirm-cancel"; in the trial phase of processing the first transaction based on the TCC transaction processing mechanism, triggering the second sub-service to freeze the business resources to be operated by the called business sub-function in the first system through a balance guard service, so that the second sub-service has the behavior of the trial phase in the TCC transaction processing mechanism, wherein the balance guard service is a service for obtaining the business resources to be operated by the transaction processing from the second system and freezing the obtained business resources in the first system; and in the confirmation phase of processing the first transaction based on the TCC transaction processing mechanism, if the confirmation validity condition of the first transaction is met, triggering the second sub-service to control the called business sub-function to perform the positive transaction operation.

[0006] According to an embodiment of the present disclosure, the processing method also includes: in the confirmation stage of processing the first transaction based on the TCC transaction processing mechanism, if the confirmation validity condition is not met, triggering the second sub-service to release the business resources frozen by the balance guard service.

[0007] According to an embodiment of the present disclosure, the triggering of the second sub-service to freeze the business resources to be operated by the called business sub-function in the first system through the balance guard service includes: the balance guard service periodically queries the business resources to be operated by the business sub-function of the second system by calling the business query interface of the second system, and synchronously updates the queried business resources to the database of the first system; and the balance guard service shields the first system from operating the queried business resources in the second system.

[0008] According to an embodiment of the present disclosure, the first transaction satisfies the confirmation and effectiveness condition including that the service resources frozen by the second sub-service satisfies the confirmation and effectiveness condition of the first transaction.

[0009] According to an embodiment of the present disclosure, the combined service further includes a first sub-service, wherein the first sub-service is a service based on a “try-confirm-cancel” TCC transaction processing mechanism provided by the first system.

[0010] According to an embodiment of the present disclosure, the processing method further includes: setting a heterogeneous system transaction driver, wherein the heterogeneous system transaction driver includes a heterogeneous system adapter and a transaction driver manager. The heterogeneous system adapter is used to provide a call service for a business sub-function of the second system. The transaction driver manager is used to provide the balance guard service.

[0011] According to an embodiment of the present disclosure, a corresponding heterogeneous system adapter is provided for each configuration of the second system in a hot-plugging manner.

[0012] According to an embodiment of the present disclosure, the first system is a distributed system, and the second system is a non-distributed heterogeneous system.

[0013] Another aspect of the embodiment of the present disclosure provides a processing device for transaction consistency, which is set in a first system. The processing device includes a request receiving module, a service determination module, a trial execution module, and a confirmation execution module. The request receiving module is used to receive a service request initiated by a user. The service determination module is used to respond to the service request and determine a combined service for processing the first transaction corresponding to the service request, wherein the combined service includes a second sub-service; the second sub-service is a service for processing transactions by calling a business sub-function in the second system, wherein the second system provides a business sub-function based on a compensation transaction processing mechanism of "positive transaction-reversal"; the first system processes transactions based on a TCC transaction processing mechanism of "try-confirm-cancel". The trial execution module triggers the second sub-service to freeze the business resources to be operated by the called business sub-function in the first system through the balance guard service during the trial phase of processing the first transaction based on the TCC transaction processing mechanism, so that the second sub-service has the behavior of the trial phase in the TCC transaction processing mechanism, wherein the balance guard service is a service for obtaining business resources to be operated by the transaction processing from the second system and freezing the obtained business resources in the first system. The confirmation execution module is used to trigger the business sub-function called by the second sub-service control to execute the positive transaction operation if the confirmation validity condition of the first transaction is met during the confirmation phase of processing the first transaction based on the TCC transaction processing mechanism.

[0014] According to an embodiment of the present disclosure, the processing device further includes a cancellation operation module. The cancellation operation module is used to trigger the second sub-service to release the business resources frozen by the balance guard service if the confirmation validity condition of the first transaction is not met during the confirmation phase of processing the first transaction based on the TCC transaction processing mechanism.

[0015] Another aspect of the embodiments of the present disclosure provides a processing system for transaction consistency. The processing system includes a system service, a heterogeneous system transaction driver, and a flexible transaction framework. The system service is used to provide one or more services for transaction processing. The heterogeneous system transaction driver includes a heterogeneous system adapter and a transaction driver manager. The heterogeneous system adapter is used to provide a call service for a business sub-function of a second system, wherein the second system provides a business sub-function based on a compensatory transaction processing mechanism of "positive transaction-reversal". The transaction driver manager is used to provide a balance guard service, and the balance guard service is used to obtain business resources to be operated by transaction processing from the second system and freeze the obtained business resources in the first system. The flexible transaction framework is used to: receive a service request initiated by a user; in response to the service request, determine a composite service for processing a first transaction corresponding to the service request, the composite service including a second sub-service; the second sub-service is a service for calling a business sub-function in the second system through the heterogeneous system adapter to perform transaction processing, and the first system processes transactions based on the "try-confirm-cancel" TCC transaction processing mechanism; in the attempt phase of processing the first transaction based on the TCC transaction processing mechanism, trigger the second sub-service to freeze the business resources to be operated by the called business sub-function in the first system through the balance guard service, so that the second sub-service has the behavior of the attempt phase in the TCC transaction processing mechanism, wherein the balance guard service is a service for obtaining business resources to be operated by transaction processing from the second system and freezing the obtained business resources in the first system; and in the confirmation phase of processing the first transaction based on the TCC transaction processing mechanism, if the confirmation effectiveness condition of the first transaction is met, trigger the second sub-service to control the called business sub-function to perform a positive transaction operation.

[0016] According to an embodiment of the present disclosure, the flexible transaction framework is also used to trigger the second sub-service to release the business resources frozen by the balance guard service if the confirmation validity conditions of the first transaction are not met during the confirmation phase of processing the first transaction based on the TCC transaction processing mechanism.

[0017] According to an embodiment of the present disclosure, the heterogeneous system transaction driver includes a plurality of the heterogeneous system adapters, wherein one of the heterogeneous system adapters is responsible for the calling service of a business sub-function in the second system of one configuration.

[0018] According to an embodiment of the present disclosure, each of the heterogeneous system adapters is hot-pluggably arranged in the heterogeneous system transaction driver.

[0019] Another aspect of the embodiment of the present disclosure provides an electronic device. The electronic device includes one or more memories and one or more processors. The memories store executable instructions. The processor executes the executable instructions to implement the processing method described above.

[0020] Another aspect of an embodiment of the present disclosure provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the processing method described above when executed.

[0021] Another aspect of an embodiment of the present disclosure provides a computer program, wherein the computer program includes computer executable instructions, and the instructions are used to implement the processing method described above when executed.

[0022] One or more of the above-mentioned embodiments have the following advantages or beneficial effects: when the first system calls the business sub-function of the second system to perform transaction processing, the business resources to be operated for transaction processing can be obtained from the second system through the balance guard service, and the called and obtained business resources can be frozen in the first system, so that the called business sub-function is mapped to a service with a TCC transaction view in the first system, thereby improving the efficiency of transaction consistency processing and reducing accounting risks. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:

[0024] Figure 1 The application scenario of the processing method and processing device for transaction consistency according to the embodiment of the present disclosure is schematically shown;

[0025] Figure 2 A flowchart of a method for processing transaction consistency according to an embodiment of the present disclosure is schematically shown;

[0026] Figure 3 A schematic diagram of the transaction logic relationship structure of a distributed system and a heterogeneous system cluster according to an embodiment of the present disclosure is shown;

[0027] Figure 4 A schematic diagram of a data flow of transaction consistency processing in a distributed system according to an embodiment of the present disclosure is shown;

[0028] Figure 5 The following schematically shows a logical structure diagram of a heterogeneous system transaction driver according to an embodiment of the present disclosure;

[0029] Figure 6 The following schematically shows a logical structure diagram of a transaction driven manager according to an embodiment of the present disclosure;

[0030] Figure 7 The following schematically shows a logical structure diagram of a heterogeneous system adapter according to an embodiment of the present disclosure;

[0031] Figure 8 A flowchart of a method for processing transaction consistency according to an embodiment of the present disclosure is schematically shown;

[0032] Fig. 9 A block diagram schematically shows a processing device for transaction consistency according to an embodiment of the present disclosure; and

[0033] Fig.10 A block diagram of an electronic device suitable for implementing the processing method for transaction consistency according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0034] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.

[0035] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.

[0036] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.

[0037] In the case of using expressions such as "at least one of A, B, and C, etc.", it should generally be interpreted in accordance with the meaning of the expression generally understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.). In the case of using expressions such as "at least one of A, B, or C, etc.", it should generally be interpreted in accordance with the meaning of the expression generally understood by those skilled in the art (for example, "a system having at least one of A, B, or C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).

[0038] Figure 1 An application scenario 100 of a processing method and a processing device for transaction consistency according to an embodiment of the present disclosure is schematically shown.

[0039] The application scenario 100 may include a first system 1 and a second system 2. The first system 1 and the second system 2 are systems of different configurations, and their transaction processing mechanisms are different. The first system 1 processes transactions through a "try-confirm-cancel" TCC (try-confirm-cancle) mechanism to ensure transaction consistency, and the second system 2 processes transactions through a "positive transaction-reversal" compensation mechanism to ensure transaction consistency.

[0040] According to an embodiment of the present disclosure, the first system 1 is a distributed system, and the second system 2 is a non-distributed heterogeneous system. The heterogeneous system according to the embodiment of the present disclosure may refer to any non-distributed system, such as a traditional host system, a common web system cluster, a public institution (such as a card organization) standard system, etc.; the embodiments of the present disclosure are collectively referred to as "heterogeneous systems".

[0041] According to other embodiments of the present disclosure, the first system 1 and the second system 2 may be any two systems of different configurations, and the first system 1 is not necessarily limited to a distributed system.

[0042] In some embodiments, when the first system 1 processes a transaction, it needs to call the corresponding business sub-function from the second system 2 to complete it. For example, inter-bank payment services or inter-bank transfers in the financial field require calls and interactions between two banking systems. The second system 2 can provide the first system 1 with a corresponding business sub-function call interface, and can usually also provide the first system 1 with a business resource query interface, allowing the first system 1 to query the balance or status of the corresponding business resources from the second system 2.

[0043] According to an embodiment of the present disclosure, when the first system 1 calls a business sub-function of the second system 2 to perform transaction processing, the business resources to be operated for transaction processing can be obtained from the second system 2 through the balance guard service, and the called and obtained business resources can be frozen in the first system 1, so that the called business sub-function is mapped to a service with a TCC transaction view in the first system 1, thereby improving the efficiency of transaction consistency processing and reducing accounting risks.

[0044] Let's take the common example of one debit and multiple loans in life as an example. For example, a user repays a credit card loan of Bank Y across regions through an account of Bank X. This transaction is a one-debit-multiple-loan transaction, which can be divided into deducting money from the user's account X (recorded as debit A), crediting money to the account of Bank Y (recorded as credit B), and Bank X charging a handling fee from the user's account (recorded as credit C).

[0045] Deductions from the user's X bank account (debit A) and X bank's collection of fees from the user's account (credit C) can be directly processed by X bank's system, while crediting to Y bank's account (credit B) requires X bank's system to call the Y bank's system's crediting function interface. When X bank's system processes transactions using the TCC mechanism and Y bank's system processes transactions using the compensatory mechanism, X bank's system can be regarded as the first system 1 and Y bank's system can be regarded as the second system 2.

[0046] According to the method of the embodiment of the present disclosure, when the system of Bank X calls the business function corresponding to Loan B in the system of Bank Y, the business function corresponding to Loan B can be mapped into a TCC two-phase transaction in the system of Bank X to ensure the consistency of the transaction.

[0047] For example, when the transaction of one debit and multiple loans (debit A, credit B, and credit C) triggers the trial phase, debit A and credit C perform a try operation, and at the same time periodically query the status of the account corresponding to credit B in Bank Y (for example, whether it exists, whether it is valid, and whether the corresponding amount is allowed to be credited), and save these status information in the database of the system of Bank X, and prohibit other transactions of the system of Bank X from querying the account corresponding to credit B in Bank Y, so that the business function corresponding to credit B presents the behavior of the trial phase in the TCC mechanism in the system of Bank X. Next, when the transaction of one debit and multiple loans (debit A, credit B, and credit C) meets the confirmation and effectiveness conditions, the system of Bank Y is notified to perform the account entry operation (i.e., positive transaction) on the business function corresponding to credit B; otherwise, the transaction of one debit and multiple loans (debit A, credit B, and credit C) is rolled back as a whole.

[0048] According to the embodiment of the present disclosure, since no actual entry operation is performed on the account of Bank Y before confirming that the transaction of one debit and multiple loans (debit A, credit B, and credit C) as a whole does not meet the confirmation and effectiveness conditions, there is no need to worry about the problem of finding out that the transaction of one debit and multiple loans as a whole does not meet the confirmation and effectiveness conditions after the advance entry, and the amount entered into the account of Bank Y may have been transferred away, resulting in the problem of being unable to be reversed. In this way, the efficiency of transaction processing consistency can be effectively improved and the risk of accounting errors can be reduced.

[0049] It is understood that the above-mentioned one-debit-multiple-credit (debit A, credit B, and credit C) transaction is only exemplary and not limiting. In practice, a transaction can be any situation such as one-debit-one-credit, multiple-debit-multiple-credit, etc., which is not limited in this disclosure.

[0050] It should be noted that the processing method and processing device for transaction consistency in the embodiments of the present disclosure can be used in the financial field, and can also be used in any field other than the financial field, and the present disclosure does not limit this.

[0051] Figure 2 The flowchart of the processing method for transaction consistency according to the embodiment of the present disclosure is schematically shown. The processing method can be applied to the first system 1.

[0052] like Figure 2 As shown, the processing method for transaction consistency according to the embodiment of the present disclosure may include operations S210 to S260.

[0053] In operation S210, a service request initiated by a user is received. For example, a user initiates a service request to repay a credit card at Bank Y from an account at Bank X through a client at Bank X. The first system 1 receives the service request and processes a first transaction corresponding to the service request.

[0054] In operation S220, in response to the service request, a combined service for processing the first transaction corresponding to the service request is determined. The combined service includes a second sub-service, which is a service for processing transactions by calling a business sub-function in the second system, wherein the second system 2 provides a business sub-function based on a compensatory transaction processing mechanism of "positive transaction-reversal", and the first system 1 processes transactions based on a TCC transaction processing mechanism of "try-confirm-cancel".

[0055] In combination with the above example, the combined service is, for example, a combined service corresponding to debit A, credit B, and credit C. Among them, the second sub-service is, for example, a service that calls the account entry function interface of the system of Bank Y to implement the credit B business. Among them, the service corresponding to debit A and credit C can be called the first sub-service, which is a service based on the "try-confirm-cancel" TCC transaction processing mechanism provided by the first system 1.

[0056] It can be understood that the combined service (the service corresponding to borrowing A, lending B, and lending C) exemplified here includes both the first sub-service based on the TCC transaction processing mechanism provided by the first system 1 and the second sub-service that needs to call the business sub-function of the second system 2. This is only an embodiment. In some embodiments, for example, in extreme cases, the sub-services included in a combined service can all be second sub-services that need to call the business function in the second system 2. In other embodiments, the combined service can include multiple second sub-services that call the business functions of the second system of different configurations.

[0057] In operation S230, during the attempt phase of processing the first transaction based on the TCC transaction processing mechanism, the second sub-service is triggered to freeze the business resources to be operated by the called business sub-function in the first system through the balance guard service, so that the second sub-service has the behavior of the attempt phase in the TCC transaction processing mechanism, wherein the balance guard service is a service for obtaining the business resources to be operated for transaction processing from the second system and freezing the obtained business resources in the first system.

[0058] According to an embodiment of the present disclosure, the balance guard service calls the business query interface of the second system, periodically queries the business resources to be operated by the business sub-function of the second system, and synchronously updates the queried business resources to the database of the first system. At the same time, the balance guard service blocks the first system's operation on the queried business resources in the second system, thereby freezing the business resources to be operated by the second sub-service.

[0059] For example, in the above-mentioned one-debit-multiple-loan transaction (debit A, loan B, and loan C), when the first service corresponding to debit A and loan C executes the try operation of the TCC transaction processing mechanism, the resources or status of the credit card account of the user corresponding to loan B in Bank Y are obtained from the second system 2 through the balance guard service. For example, it is read that the user's credit card account in Bank Y is valid and 20,000 yuan needs to be transferred into it. Then, before the transaction of debit A, loan B, and loan C is completed, the withdrawal or deposit operations of other services of the first system on the user's credit card account in Bank Y are frozen.

[0060] In operation S240, it is determined whether the confirmation and effectiveness conditions of the first transaction are met. When determining whether the confirmation and effectiveness conditions of the first transaction are met, it is necessary to determine whether the business resources in all sub-services in the combined service can ensure the effectiveness of the first transaction. Among them, when determining the second sub-service, it is necessary to determine whether the business resources frozen by the second sub-service meet the confirmation and effectiveness conditions of the first transaction. For example, whether the user's credit card account at Bank Y exists, whether it is valid, and whether the corresponding amount can be credited.

[0061] In operation S250, if the confirmation validity condition of the first transaction is met, the service sub-function called by the second sub-service control is triggered to perform a positive transaction operation.

[0062] In operation S260, if the validation confirmation condition is not met, the second sub-service is triggered to release the business resources frozen by the balance guard service.

[0063] According to the embodiments of the present disclosure, since the first system 1 does not actually operate the business sub-function in the second system 2 when it is determined that the confirmation validity condition is not met, the business resources frozen by the balance guard service are released at this time, and the overall rollback of the transaction can be achieved. This avoids the risk that the "positive transaction" in the second subsystem cannot be reversed if the business resources after the "positive transaction" operation in the second subsystem are processed by other transaction operations during this gap, when the "positive transaction" operation in the second subsystem is found to not meet the confirmation validity condition in the related art.

[0064] According to an embodiment of the present disclosure, before operation S210 to operation S260, the processing method may further include setting a heterogeneous system transaction driver in the first system 1. The heterogeneous system transaction driver includes a heterogeneous system adapter and a transaction driver manager. The heterogeneous system adapter is used to provide a call service for a business sub-function of the second system. The transaction driver manager is used to provide a balance guard service.

[0065] According to the embodiments of the present disclosure, a corresponding heterogeneous system adapter can be set for each configuration of the second system in a hot-plug manner. Through the heterogeneous system adapter, the first system 1 can call the business sub-function of the second system of the corresponding configuration, so that the first system 1 can be connected to the second systems of various configurations, with good scalability.

[0066] According to an embodiment of the present disclosure, the first system 1 may be a distributed system, and the second system 2 may be a heterogeneous system of a non-distributed system. Figures 1 to 8 The transaction processing between the distributed system and the heterogeneous system according to the embodiment of the present disclosure is exemplified.

[0067] Figure 3 The diagram schematically shows a transaction logic relationship structure diagram of a distributed system 310 and a heterogeneous system cluster 320 according to an embodiment of the present disclosure.

[0068] like Figure 3 As shown, according to an embodiment of the present disclosure, the first system 1 is exemplified as a distributed system 310 , and the second system 2 is exemplified as a heterogeneous system cluster 320 .

[0069] Specifically, the distributed system 310 is a system developed according to a distributed architecture, and mainly provides externally distributed system services 311 , a flexible transaction framework 313 , and a heterogeneous system transaction driver 312 .

[0070] The heterogeneous system cluster 320 is a non-distributed architecture system. There are heterogeneous systems 321 of different configurations in the heterogeneous system cluster 320, such as heterogeneous system 321a, heterogeneous system 321b, heterogeneous system 321c... heterogeneous system 321n. Among them, different configurations may include, for example, traditional host systems, ordinary web system clusters, standard systems of public institutions (such as card organizations), etc. Each heterogeneous system can provide a business sub-function interface for the business services of the distributed system 310, and jointly complete the complete transaction processing.

[0071] The distributed system 310 can provide distributed service instances through the system service 311 to complete business functions. Usually, the service instance includes multiple sub-services, which are represented as sub-service 3111a, sub-service 3111b, sub-service 3111c...sub-service 3111n in the figure. In the extreme case, each sub-service calls the business sub-function of heterogeneous systems with different configurations.

[0072] The heterogeneous system transaction driver 312 in the distributed system 310 includes a transaction driver manager 3121 and heterogeneous system adapters 3122 (eg, 3122a ˜ 3122n ); different heterogeneous system adapters 3122 are adapters for making function calls for different heterogeneous systems.

[0073] exist Figure 3 In the illustration, the heterogeneous system transaction driver 312 is embedded in the distributed system 310. According to another embodiment of the present disclosure, the heterogeneous system transaction driver 312 can also be independently deployed as a node of the distributed system cluster, and there is not much difference between the two methods.

[0074] The transaction driver manager 3121 mainly provides a unified service and transaction view for the system service 311, conversion and management of ordinary transactions to distributed transactions, TCC two-stage transaction conversion and management, transaction status management, transaction exception handling and reconciliation management, and provides a unified interface specification for the heterogeneous system adapter 3122; that is, for the distributed service instances of the above-mentioned sub-services 31l1a, ~3111n, after transaction conversion, the business functions provided in the heterogeneous system 321 are regarded as sub-services of the distributed system 310.

[0075] The heterogeneous system adapter 3122 can adapt to support heterogeneous systems of various configurations. Each configuration of the system corresponds to an adapter, which are represented as heterogeneous system adapter 3111a, heterogeneous system adapter 3111b, heterogeneous system adapter 3111c... heterogeneous system adapter 3111n. The heterogeneous system adapter 3122 is an implementation of the interface specification of the transaction driver manager 3121, and provides message protocol conversion between systems. When a new configuration of heterogeneous system is added, the heterogeneous system adapter 3122 is added accordingly. The heterogeneous system adapter 3122 is responsible for connecting and interacting with the corresponding heterogeneous system. It can support hot plugging in implementation and has strong scalability.

[0076] The flexible transaction framework 313 is a framework for managing flexible transactions in the distributed system 310, and is mainly responsible for transaction consistency processing. According to the embodiments of the present disclosure, ordinary distributed services and the view services of the sub-functions of the converted heterogeneous system are constrained by the flexible transaction framework 313 at the same time, making the consistency management of transactions in the distributed system 312 simpler and more effective. For example, the flexible transaction framework 313 can convert the business function of the called heterogeneous system 321 with a compensatory transaction processing mechanism based on "positive transaction-reversal" into a sub-service with the "try-confirm-cancel" behavior characteristics of the TCC transaction processing mechanism in the system service 311.

[0077] Figure 4 The data flow diagram of transaction consistency processing in the distributed system 310 according to an embodiment of the present disclosure is schematically shown.

[0078] like Figure 4 As shown, combined Figure 3 , further explains the transaction consistency processing in the distributed system 310. Take the implementation process of a distributed composite service 111 as an example for overall description. The distributed composite service 111 calls three sub-services SRV1, SRV2, and SRV3 to complete the business function, and each sub-service calls a business sub-function interface of a heterogeneous system. Assuming that an exception occurs in one of the sub-services during the call process (for example, an exception occurs in SRV3), the distributed system 310 compensates for the transaction to maintain transaction consistency.

[0079] Specifically, as mentioned above, the distributed system 310 is a system developed according to a distributed architecture, which mainly provides external distributed services, a flexible transaction framework, and a heterogeneous system transaction driver.

[0080] The flexible transaction framework 313 is a framework for managing flexible transactions in the distributed system 310 and is mainly responsible for transaction consistency management.

[0081] The composite service corresponding to the distributed composite service 111 is named SRV123, for example. The composite service is composed of three sub-services SRV1, SRV2, and SRV3.

[0082] Service call 112 indicates that composite service SRV123 calls sub-service SRV1, and similarly SRV2 and SRV3.

[0083] Service call failure 113 indicates that an exception occurs when composite service SRV123 calls sub-service SRV3.

[0084] The service compensation call 114 is usually initiated by the transaction framework. When the sub-service SRV3 call fails, it initiates the cancellation of SRV1 (SRV1'), and similarly SRV2 (SRV2');

[0085] Subservice 115 actually includes forward module SRV1 and reverse cancellation module SRV1'. Similarly, forward module SRV2 and reverse cancellation module SRV3', forward module SRV3 and reverse cancellation module SRV3'.

[0086] The sub-function of the heterogeneous system is called 116, and the information of the target sub-function is carried during the calling process, and the heterogeneous system transaction driver view service is called.

[0087] The sub-function compensation call 117 for the heterogeneous system is usually initiated by the transaction framework, which calls the heterogeneous system transaction driver view service.

[0088] The implicit call 118 to the view service can be regarded as a call to the view service SRV21 provided by the heterogeneous system transaction driver in the processing of the sub-function call 116 of the heterogeneous system, which can be understood as a sub-service call.

[0089] An implicit compensation call 119 to the view service, usually initiated by the transaction framework, cancels the view service SRV21 (SRV21').

[0090] The heterogeneous system transaction driver 312 is responsible for providing a unified service and transaction view for distributed services, conversion and management of ordinary transactions to distributed transactions, two-phase transaction conversion and management, transaction status management, transaction exception handling and reconciliation management, and providing a unified interface specification for heterogeneous system adapters.

[0091] The transaction driver manager 3121 provides a unified service and transaction view for the caller, converts ordinary transactions from heterogeneous system adapters into distributed transactions, manages transaction status, provides asynchronous retry and reconciliation management when transaction consistency exceptions occur, and provides a unified interface specification for heterogeneous system adapters.

[0092] View service (sub-service) 131, view services SRV21, SRV22 are unified services and transaction views provided by transaction driver manager 3121 to the outside world, and can be regarded as sub-services;

[0093] The heterogeneous system adapters 3122a and 3122b manage the service sub-function calls of the heterogeneous systems 321a and 321b from the transaction driver manager by performing message protocol conversion and initiating the call of the service sub-function interface of the target system;

[0094] The balance guard service GdS is responsible for guarding and maintaining the status / balance of the heterogeneous system 321 during the transaction conversion process. When the status / balance of the heterogeneous system 321 changes, it is marked and updated to ensure that it will not be changed by other transactions during TCC two-phase transaction processing.

[0095] The heterogeneous system cluster 320, as mentioned above, is a traditional non-distributed architecture system, which can provide business sub-function interfaces for business services of distributed systems in various different configurations to jointly complete complete business functions.

[0096] The heterogeneous system sub-function interface call 21 is initiated by the heterogeneous system adapter 3122a, and the sub-function interfaces ITF31 and ITF32 provided by the heterogeneous system 321a are called according to the target interface information;

[0097] The heterogeneous system sub-function interface reversal call 22, when the distributed system transaction is abnormal, initiates a reversal call to correct the transaction of the heterogeneous system 321a;

[0098] The heterogeneous systems 321a and 321b are heterogeneous systems of different configurations.

[0099] The heterogeneous system sub-function interface 24 is a sub-function interface provided by the heterogeneous system 321a, wherein ITF31 and ITF32 usually need to provide corresponding reversal functions or interfaces.

[0100] Figure 5 The logical structure diagram of the heterogeneous system transaction driver 312 according to an embodiment of the present disclosure is schematically shown.

[0101] like Figure 5 As shown, the heterogeneous system transaction driver 312 includes a transaction driver manager 3121 and a heterogeneous system adapter 3122 .

[0102] The transaction driver manager 3121 is responsible for providing a unified service and transaction view for the caller, converting ordinary transactions from heterogeneous system adapters to distributed transactions, managing transaction status, providing asynchronous retry and reconciliation management when transaction consistency exceptions occur, and providing a unified interface specification for heterogeneous system adapters. The transaction driver manager 3121 can provide a balance guard service GdS, which is used to obtain business resources to be operated by transaction processing from the second system and freeze the obtained business resources in the first system.

[0103] The heterogeneous system adapter 3122 provides a calling service for the business sub-function of the second system, for example, it is responsible for the management of message protocol conversion, and initiates the calling of the sub-function interface of the target system.

[0104] Figure 6 The figure schematically shows a logical structure diagram of the transaction driven manager 3121 according to an embodiment of the present disclosure.

[0105] like Figure 6 As shown, according to an embodiment of the present disclosure, the transaction driver manager 3121 may include, for example, a service view management module 601 , a service interface specification management module 602 , and a distributed transaction conversion module 603 .

[0106] The service view management module 601 is used to provide a unified service and transaction view for the distributed system 310 (caller). Usually, the sub-function interface of the heterogeneous system 321 is mapped to an independent distributed service after being processed by the service view, so as to be incorporated into the flexible transaction framework. When the distributed service or sub-service in the above example calls the sub-function of the heterogeneous system, it does not need to care about the characteristics and differences of the target heterogeneous system, but only needs to call the service.

[0107] The service interface specification management module 602 is used to provide a unified interface specification to the heterogeneous system adapter, and can be regarded as a connection middle layer between the service view management module and the heterogeneous system adapter, so that the service view management module can map the heterogeneous system sub-function interface to the distributed service;

[0108] The distributed transaction conversion module 603 is used for converting and managing ordinary transactions from heterogeneous system adapters into distributed transactions, TCC two-phase transaction conversion and management, transaction status management, transaction exception processing and account reconciliation management.

[0109] Compared with the TCC two-stage type and the compensation type of "positive transaction-reversal", the TCC two-stage transaction is used for strongly isolated business involving accounts. Because it is highly dependent on the status of the called party or the balance freezing function, the business functions of heterogeneous systems often only provide basic account entry and query functions, and cannot provide overly complex transaction functions. In the disclosed embodiment, the distributed transaction conversion module 603 can provide a balance guard service Gds, through which the called compensation transaction can be replaced with a TCC two-stage transaction. As a result, when the distributed system 310 processes transactions, it can not distinguish whether it is a service provided by itself or a function of calling a heterogeneous system, and can be processed according to the TCC two-stage transaction to reduce accounting risks.

[0110] Figure 7 The logical structure diagram of a heterogeneous system adapter according to an embodiment of the present disclosure is schematically shown.

[0111] like Figure 7 As shown, the heterogeneous system adapter 3122 according to the embodiment of the present disclosure may include a message manager 701 and a communication protocol converter 702 .

[0112] The message manager 702 is responsible for the management of distributed system messages to heterogeneous system messages, such as converting object-type messages into json messages, xml messages, ISO8583 messages, various gateway messages, etc.

[0113] The communication protocol manager 702 is responsible for initiating sub-function interface calls with heterogeneous systems and performing communications, communication protocol conversion and management.

[0114] Figure 8 A flowchart of a method for processing transaction consistency according to an embodiment of the present disclosure is schematically shown.

[0115] refer to Figure 8 , we continue to use the aforementioned user's cross-regional repayment of a credit card at Bank Y through an account at Bank X, forming a one-debit-multiple-credit transaction as an example. The transaction can be divided into deducting money from the user's account X (recorded as debit A), crediting money to the account at Bank Y (recorded as credit B), and Bank X charging a handling fee from the user's account (recorded as credit C). Figure 8 The service S-ABC is a combined service of the one-debit-multiple-credit transaction, wherein the service SA, the service SB, and the service SC are sub-services corresponding to each sub-transaction of the one-debit-multiple-credit transaction respectively.

[0116] like Figure 8As shown, according to an embodiment of the present disclosure, the transaction driver manager 312 can convert the service SB into a TCC two-phase transaction through the service view. At the same time, since the heterogeneous system 320 does not provide a balance freezing function, the heterogeneous system transaction driver 312 designs a "balance guard service", which is recorded as GdS.

[0117] When the transaction triggers the Try phase, GdS will obtain the business resources that the service SB wants to operate from the heterogeneous system 320, freeze (retain) the obtained business resources in a mapped form, and persist them in the database D. In addition, GdS can automatically query the balance from the heterogeneous system 320 at regular intervals and update it to the database D synchronously. The entire process is executed as follows:

[0118] Step 1: Service SA executes the Try phase (solid triangle arrow) to freeze (or reserve) the funds, and no external operations can be performed on the funds.

[0119] Step 2, the converted service SB also executes the Try phase (solid triangle arrow), and the funds in the form of mapping are frozen and persisted in the database D through the balance guardian service GdS. Other services in the same distributed system 310 cannot operate on this part of the funds; at the same time, considering that the account status / balance in the heterogeneous system can still be operated by other systems outside the distributed system 310, the balance guardian service GdS will automatically query the status / balance from the heterogeneous system 321 and update it to the database D at a fixed time before the SB confirmation phase (solid circular arrow). If the query finds that the status / balance cannot meet the conditions of the transaction confirmation phase, the transaction driver manager 312 is notified to perform SB transaction exception processing, triggering transaction compensation (hollow triangle arrow), thereby triggering the overall rollback of the S-ABC transaction, which can effectively improve the success rate of the system for transaction compensation.

[0120] Step 3: The service SC executes the Try phase (solid triangle arrow), an exception occurs, and its own transaction is rolled back.

[0121] Step 4, when the abnormal transaction is rolled back as a whole, the flexible transaction framework 3113 will release the funds frozen in the mapping form of service SB (hollow triangle arrow in the figure) and release the funds frozen in service SA (hollow triangle arrow). Since the service SB fund operation is not effective in the heterogeneous system 321, service SB can be compensated successfully, ensuring the consistency of the entire transaction and improving the success rate of the system's transaction compensation.

[0122] In the related art, if the service SB corresponding to loan B is treated as a normal "positive transaction-reversal" compensatory transaction, the entire business transaction function cannot be fully implemented in two stages, which will increase the risk of accounting errors. Specifically, it can be manifested as, for example, in the above step 2, since the service SB is a compensatory transaction and cannot perform the Try stage, the service SB will be directly submitted (i.e., commit), so that the funds increased by the creditor will take effect. After that, all external systems can operate the increased funds. Then, if the service SC is abnormal later and the service SA, service SB, and service SC need to be rolled back as a whole, if the funds increased by the creditor in the service SB have been operated (for example, transferred away), the service SB reversal will not be completed, resulting in the inability to ensure the consistency of the entire transaction. By comparison, it can be seen that the embodiment of the present disclosure will convert the service SB into a two-stage transaction with the TCC mechanism based on "try-confirm-cancel" in the distributed system 310 through the combination of adding the balance guardian service GdS and the database D, which greatly improves the transaction processing capability of the distributed system 310 and reduces the error rate of the transaction.

[0123] According to the embodiments of the present disclosure, the compensation service based on "positive transaction-reversal" can be converted into the behavioral characteristics of a two-phase transaction with a TCC mechanism based on "try-confirm-cancel" in the distributed system 310, which greatly simplifies the interaction between the coexistence of the distributed system and the non-distributed heterogeneous system, reduces the complexity of the distributed system and improves the scalability, and can effectively reduce the cost of ensuring transaction consistency, improve the transaction processing capability of the distributed system, and reduce the error rate of transactions.

[0124] Fig. 9 The block diagram of a processing device 900 for transaction consistency according to an embodiment of the present disclosure is schematically shown. The processing device 900 may be arranged in the first system 1 .

[0125] like Fig. 9 As shown, according to an embodiment of the present disclosure, the processing device 900 for transaction consistency may include a request receiving module 910, a service determining module 920, an attempt execution module 930, and a confirmation execution module 940. According to other embodiments of the present disclosure, the processing device may further include a cancellation operation module 950. The processing device 900 may be used to implement the processing method for transaction consistency of the embodiment of the present disclosure.

[0126] The request receiving module 910 is used to receive a service request initiated by a user.

[0127] The service determination module 920 is used to determine, in response to a service request, a combined service for processing a first transaction corresponding to the service request, wherein the combined service includes a second sub-service; the second sub-service is a service for performing transaction processing by calling a business sub-function in a second system, wherein the second system provides a business sub-function based on a compensatory transaction processing mechanism of "positive transaction-reversal"; and the first system processes transactions based on a TCC transaction processing mechanism of "try-confirm-cancel".

[0128] The attempt execution module 930 is used to trigger the second sub-service to freeze the business resources to be operated by the called business sub-function in the first system through the balance guard service during the attempt phase of processing the first transaction based on the TCC transaction processing mechanism, so that the second sub-service has the behavior of the attempt phase in the TCC transaction processing mechanism, wherein the balance guard service is a service used to obtain the business resources to be operated for transaction processing from the second system and freeze the obtained business resources in the first system.

[0129] The confirmation execution module 940 is used to trigger the business sub-function called by the second sub-service control to execute the positive transaction operation if the confirmation validity condition of the first transaction is met during the confirmation phase of processing the first transaction based on the TCC transaction processing mechanism.

[0130] The cancellation operation module 950 is used to trigger the second sub-service to release the business resources frozen by the balance guard service if the confirmation condition is not met during the confirmation phase of processing the first transaction based on the TCC transaction processing mechanism.

[0131] According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits, or at least part of the functions of any one of them can be implemented in one module. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be split into multiple modules for implementation. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be at least partially implemented as hardware circuits, such as field programmable gate arrays (FPGAs), programmable logic arrays (PLAs), systems on chips, systems on substrates, systems on packages, application specific integrated circuits (ASICs), or can be implemented by hardware or firmware in any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, according to the embodiments of the present invention, one or more of the modules, submodules, units, and subunits can be at least partially implemented as computer program modules, and when the computer program modules are run, the corresponding functions can be performed.

[0132] For example, any multiple of the system service 3111, the heterogeneous system transaction driver 312, the transaction driver manager 3121, the heterogeneous system adapter 3122, the service view management module 601, the service interface specification management module 602, the distributed transaction conversion module 603, the message manager 701, the communication protocol manager 702, the request receiving module 910, the service determination module 920, the attempt execution module 930, the confirmation execution module 940, and the cancellation operation module 950 can be combined into one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the system service 3111, the heterogeneous system transaction driver 312, the transaction driver manager 3121, the heterogeneous system adapter 3122, the service view management module 601, the service interface specification management module 602, the distributed transaction conversion module 603, the message manager 701, the communication protocol manager 702, the request receiving module 910, the service determination module 920, the attempt execution module 930, the confirmation execution module 940, and the cancellation operation module 950 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or can be implemented in any one of the three implementation methods of software, hardware and firmware or in an appropriate combination of any of them. Alternatively, at least one of the system service 3111, the heterogeneous system transaction driver 312, the transaction driver manager 3121, the heterogeneous system adapter 3122, the service view management module 601, the service interface specification management module 602, the distributed transaction conversion module 603, the message manager 701, the communication protocol manager 702, the request receiving module 910, the service determination module 920, the attempt execution module 930, the confirmation execution module 940, and the cancellation operation module 950 can be at least partially implemented as a computer program module, which can perform the corresponding function when the computer program module is executed.

[0133] Fig.10 A block diagram of an electronic device 1000 suitable for implementing a processing method for transaction consistency according to an embodiment of the present disclosure is schematically shown. Fig.10 The electronic device 1000 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0134] like Fig.10As shown, the electronic device 1000 according to an embodiment of the present disclosure includes a processor 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage part 1008 into a random access memory (RAM) 1003. The processor 1001 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 1001 may also include an onboard memory for caching purposes. The processor 1001 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.

[0135] In RAM 1003, various programs and data required for the operation of electronic device 1000 are stored. Processor 1001, ROM 1002 and RAM 1003 are connected to each other via bus 1004. Processor 1001 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 1002 and / or RAM 1003. It should be noted that the program can also be stored in one or more memories other than ROM 1002 and RAM 1003. Processor 1001 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.

[0136] According to an embodiment of the present disclosure, the electronic device 1000 may further include an input / output (I / O) interface 1005, which is also connected to the bus 1004. The system 1000 may further include one or more of the following components connected to the I / O interface 1005: an input section 1006 including a keyboard, a mouse, etc.; an output section 1007 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN card, a modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as needed, so that a computer program read therefrom is installed into the storage section 1008 as needed.

[0137] According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1009, and / or installed from the removable medium 1011. When the computer program is executed by the processor 1001, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.

[0138] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.

[0139] According to an embodiment of the present disclosure, a computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present disclosure, a computer-readable storage medium may include the ROM 1002 and / or RAM 1003 described above and / or one or more memories other than ROM 1002 and RAM 1003.

[0140] An embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains a program code for executing the method provided by the embodiment of the present disclosure. When the computer program product runs on an electronic device, the program code is used to enable the electronic device to implement the image recognition method provided by the embodiment of the present disclosure.

[0141] When the computer program is executed by the processor 1001, the above functions defined in the system / device of the embodiment of the present disclosure are executed. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.

[0142] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 1009, and / or installed from the removable medium 1011. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0143] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).

[0144] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0145] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.

[0146] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.

Claims

1. A processing method for transaction consistency, applied to a first system, the processing method comprising: Receive service requests initiated by users; In response to the service request, determining a combined service for processing a first transaction corresponding to the service request, the combined service comprising a second sub-service; the second sub-service is a service for processing a transaction by calling a business sub-function in a second system, wherein the second system provides a business sub-function based on a compensatory transaction processing mechanism of "positive transaction-reversal"; and the first system processes the transaction based on a TCC transaction processing mechanism of "try-confirm-cancel"; In the trial phase of processing the first transaction based on the TCC transaction processing mechanism, triggering the second sub-service to freeze the business resources to be operated by the called business sub-function in the first system through the balance guard service, so that the second sub-service has the behavior of the trial phase in the TCC transaction processing mechanism, wherein the balance guard service is a service for obtaining the business resources to be operated by the transaction processing from the second system and freezing the obtained business resources in the first system; and In the confirmation phase of processing the first transaction based on the TCC transaction processing mechanism, if the confirmation validity condition of the first transaction is met, the service sub-function called by the second sub-service control is triggered to perform a positive transaction operation; The triggering of the second sub-service to freeze the business resources to be operated by the called business sub-function in the first system through the balance guard service includes: The balance guard service periodically queries the status information of the business resources to be operated by the business sub-function of the second system by calling the business query interface of the second system, and synchronously updates the queried status information of the business resources to the database of the first system; and The balance guard service prohibits the first system from operating the business resources in the queried second system.

2. The processing method according to claim 1, wherein: The processing method also includes: During the confirmation phase of processing the first transaction based on the TCC transaction processing mechanism, if the confirmation validity condition is not met, the second sub-service is triggered to release the business resources frozen by the balance guard service.

3. The processing method according to claim 1, wherein: The first transaction meets the confirmation validity condition including: The business resources frozen by the second sub-service meet the confirmation and effectiveness conditions of the first transaction.

4. The processing method according to claim 1, wherein: The combined service also includes a first sub-service, wherein the first sub-service is a service based on a “try-confirm-cancel” TCC transaction processing mechanism provided by the first system.

5. The processing method according to claim 1, wherein: The processing method also includes: Setting a heterogeneous system transaction driver, wherein the heterogeneous system transaction driver includes a heterogeneous system adapter and a transaction driver manager; in, The heterogeneous system adapter is used to provide a calling service for the business sub-function of the second system; The transaction driver manager is used to provide the balance daemon service.

6. The processing method according to claim 5, wherein: The corresponding heterogeneous system adapter is set for each configuration of the second system in a hot-plugging manner.

7. The processing method according to any one of claims 1 to 6, wherein: The first system is a distributed system, and the second system is a non-distributed heterogeneous system.

8. A processing device for transaction consistency, arranged in a first system, wherein: The processing device comprises: A request receiving module, used to receive service requests initiated by users; a service determination module, configured to determine, in response to the service request, a combined service for processing a first transaction corresponding to the service request, wherein the combined service includes a second sub-service; the second sub-service is a service for processing a transaction by calling a business sub-function in a second system, wherein the second system provides a business sub-function based on a compensatory transaction processing mechanism of "positive transaction-reversal"; and the first system processes transactions based on a TCC transaction processing mechanism of "try-confirm-cancel"; an attempt execution module, configured to trigger the second sub-service to freeze the business resources to be operated by the called business sub-function in the first system through the balance guard service during the attempt phase of processing the first transaction based on the TCC transaction processing mechanism, so that the second sub-service has the behavior of the attempt phase in the TCC transaction processing mechanism, wherein the balance guard service is a service for obtaining the business resources to be operated by the transaction processing from the second system and freezing the obtained business resources in the first system; A confirmation execution module, configured to trigger the business sub-function called by the second sub-service control to execute a positive transaction operation if the confirmation validity condition of the first transaction is met during the confirmation phase of processing the first transaction based on the TCC transaction processing mechanism; Wherein, in the trial execution module, the triggering of the second sub-service to freeze the business resources to be operated by the called business sub-function in the first system through the balance guard service includes: The balance guard service periodically queries the status information of the business resources to be operated by the business sub-function of the second system by calling the business query interface of the second system, and synchronously updates the queried status information of the business resources to the database of the first system; and The balance guard service prohibits the first system from operating the business resources in the queried second system.

9. The processing device according to claim 8, wherein: The processing device also includes: The cancellation operation module is used to trigger the second sub-service to release the business resources frozen by the balance guard service if the confirmation conditions of the first transaction are not met during the confirmation phase of processing the first transaction based on the TCC transaction processing mechanism.

10. A processing system for transaction consistency, arranged in a first system, wherein: The processing system comprises: System services, which provide one or more services for performing transaction processing; Heterogeneous system transaction drivers, including: A heterogeneous system adapter, used to provide a calling service for a business sub-function of a second system; wherein the second system provides a business sub-function based on a compensatory transaction processing mechanism of "positive transaction-reversal"; The transaction driver manager is used to provide a balance guard service, wherein the balance guard service is used to obtain business resources to be operated by transaction processing from the second system and freeze the obtained business resources in the first system; Flexible transaction framework for: Receive service requests initiated by users; In response to the service request, determining a composite service for processing a first transaction corresponding to the service request, the composite service comprising a second sub-service; the second sub-service is a service for processing a transaction by invoking a business sub-function in the second system through the heterogeneous system adapter, and the first system processes the transaction based on a TCC transaction processing mechanism of "try-confirm-cancel"; In the trial phase of processing the first transaction based on the TCC transaction processing mechanism, triggering the second sub-service to freeze the business resources to be operated by the called business sub-function in the first system through the balance guard service, so that the second sub-service has the behavior of the trial phase in the TCC transaction processing mechanism, wherein the balance guard service is a service for obtaining the business resources to be operated by the transaction processing from the second system and freezing the obtained business resources in the first system; and In the confirmation phase of processing the first transaction based on the TCC transaction processing mechanism, if the confirmation validity condition of the first transaction is met, the service sub-function called by the second sub-service control is triggered to perform a positive transaction operation; Wherein, in the flexible transaction framework, triggering the second sub-service to freeze the business resources to be operated by the called business sub-function in the first system through the balance guard service includes: The balance guard service periodically queries the status information of the business resources to be operated by the business sub-function of the second system by calling the business query interface of the second system, and synchronously updates the queried status information of the business resources to the database of the first system; and The balance guard service prohibits the first system from operating the business resources in the queried second system.

11. The processing system according to claim 10, wherein: The heterogeneous system transaction driver includes a plurality of the heterogeneous system adapters, wherein one of the heterogeneous system adapters is responsible for the calling service of a business sub-function in the second system of one configuration.

12. The processing system according to claim 10, wherein: Each of the heterogeneous system adapters is hot-pluggably arranged in the heterogeneous system transaction driver.

13. An electronic device comprising: One or more memories storing executable instructions; as well as One or more processors execute the executable instructions to implement the processing method according to any one of claims 1 to 7.

14. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the processing method according to any one of claims 1 to 7.