Distributed transaction synchronization method and device and computer equipment
By receiving business orchestration instructions on a low-code platform, generating business processes, configuring a distributed transaction model, determining a synchronization strategy, synchronizing distributed transactions is achieved, and the cumbersome transaction synchronization process in the existing technology is solved, and distributed transaction processing is simplified.
Patent Information
- Application Number
- CN202411843310.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-04-15
AI Technical Summary
Existing low-code products cannot effectively solve transaction problems across services/relationship libraries, resulting in transaction inconsistency. The framework of distributed transaction solutions needs to be implemented through hard coding, with a high learning threshold and is difficult to master in the low-code development model.
It provides a synchronization method for distributed transactions. It receives business orchestration instructions through a visual platform, generates business processes, and configures the transaction mode of distributed transactions at the entrance of the business process, including TCC mode, compensation mode and local transaction table mode, determines the transaction synchronization strategy corresponding to the transaction mode, and completes transaction synchronization according to different synchronization strategies.
It simplifies the transaction synchronization process, reduces the complexity of distributed transaction processing, and enables business personnel to effectively manage distributed transactions in low-code development mode, solving the problem of cumbersome transaction synchronization process.
Smart Images

Figure CN119829223A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of distributed transaction processing, and in particular to a distributed transaction synchronization method and apparatus, and a computer device. Background Art
[0002] Common low-code products on the market cannot solve cross-service / relationship database transaction problems in the process of visually arranging services and interfaces to form logic / business flows. For example, when the AB service is calling a transactional operation, when the actually submitted B transaction is returned to the A service due to a network exception, the result is a timeout exception, which causes the A service to roll back, resulting in inconsistent transactions on both sides; in a long transaction process across multiple services, the post-transaction exception causes the multiple submitted transaction states in the previous process to be unable to roll back, resulting in inconsistent transactions in multiple services. Different application software has different requirements for transaction consistency, reliability, and timeliness (strong consistency, eventual consistency, etc.); different application software also has different business complexity, and the difficulty of implementing compensation business after transaction failure also varies. Some businesses with more complex logic are difficult to design resource reservation / state locking logic before transaction submission, or design compensation / rollback logic after transaction failure. The framework of common distributed transaction solutions needs to be implemented through hard coding, which has a high learning threshold and cannot be mastered by business personnel using the low-code development model; when using it, it can only implement the corresponding distributed transaction solutions through different hard coding in different scenarios. Summary of the invention
[0003] The embodiments of the present application provide a method and apparatus for synchronizing a distributed transaction, and a computer device, so as to at least solve the technical problem that the transaction synchronization process in the related technology is relatively complicated.
[0004] According to one aspect of an embodiment of the present application, a method for synchronizing distributed transactions is provided, comprising: receiving business orchestration instructions through a visualization platform to generate a business process; configuring a transaction mode of the distributed transaction required by the business process at the entrance of the business process, the transaction mode including at least: try-confirm-cancel TCC mode, compensation mode and local transaction table mode; determining a transaction synchronization strategy corresponding to the transaction mode, and completing transaction synchronization according to different synchronization strategies.
[0005] Optionally, different transaction synchronization strategies are determined according to different transaction modes, including: obtaining the running stage of the distributed transaction, the running stage including: a first stage and a second stage, the first stage being a transaction preparation stage, and the second stage being a transaction submission stage; when the running stage is in the first stage, obtaining the type of transaction currently being executed; when the type of transaction currently being executed is a main transaction, completing the processing of the main transaction according to the synchronization strategy of the main transaction corresponding to the transaction mode; when the type of transaction currently being executed is a branch transaction, completing the processing of the branch transaction according to the synchronization strategy of the branch transaction corresponding to the transaction mode; when the running stage is the second stage, determining the synchronization strategy according to the transaction status of the distributed transaction, and completing transaction synchronization according to the synchronization strategy.
[0006] Optionally, the processing of the main transaction is completed according to the main transaction synchronization strategy corresponding to the transaction mode, including: when the transaction mode of the main transaction is not the local transaction table mode, determining the synchronization strategy of the main transaction to record the transaction information of the main transaction, the compensation interface of the main transaction and the processing method of the main transaction, wherein, when the transaction mode of the main transaction is the TCC mode, the synchronization strategy of the main transaction is a confirmation method and a cancellation method, and when the transaction mode of the main transaction is the compensation mode, the synchronization strategy of the main transaction is a rollback method; when the transaction mode of the main transaction is the local transaction table mode, determining the synchronization strategy of the main transaction to record the transaction flow information of the main transaction, and determining the processing method of the main transaction according to the transaction flow information of the main transaction, wherein the processing method of the main transaction is to determine whether to commit or roll back the main transaction according to the transaction flow information of the main transaction.
[0007] Optionally, the method also includes: when the transaction mode of the main transaction is the TCC mode, determining that the business execution method corresponding to the main transaction is an attempt method, and the attempt method is used to attempt to execute the business operation corresponding to the main transaction and reserve resources; when the transaction mode of the main transaction is the compensation mode and the local transaction table mode, determining that the business execution method corresponding to the main transaction is a commit method, and the commit method is used to commit the business corresponding to the main transaction.
[0008] Optionally, when the currently executed transaction type is a branch transaction, the processing of the branch transaction is completed according to a preset branch transaction processing strategy, including: when the transaction mode of the branch transaction is the TCC mode, executing an attempt method of the branch transaction, the attempt method is used to attempt to execute a business operation corresponding to the branch transaction; when the transaction mode of the branch transaction is the compensation mode, executing a commit method of the branch transaction, the commit method is used to commit the business operation corresponding to the branch transaction.
[0009] Optionally, the method further includes: when the transaction mode of the distributed transaction is the TTC mode and the main transaction and the branch transaction have completed the first stage, traverse all transactions in the distributed transaction, and when the transaction status of all transactions is successful, determine global success, call the confirmation interface of all transaction participants in sequence, and confirm the operation of all transactions. When there is a transaction status of execution failure in all transactions, determine global failure, call the cancellation interface of all transaction participants in sequence, and cancel the operation of all transactions; when the transaction mode of the distributed transaction is the compensation mode and the main transaction and the branch transaction have completed the first stage, traverse all transactions in the distributed transaction, and when the transaction status of all transactions is successful, determine global success, and update the transaction status of all transactions to completed; when there is a transaction status of execution failure in all transactions, determine global failure, call the rollback interface of all transaction participants in sequence, perform rollback operation, and synchronize all transactions.
[0010] Optionally, when the running stage is the second stage, the synchronization strategy is determined according to the transaction status of the distributed transaction, and transaction synchronization is completed according to the synchronization strategy, including: obtaining the execution results of all transactions through the root transaction, and determining whether the distributed transaction is globally successful according to the execution results, and when the distributed transaction is globally successful, confirming that all transactions can be committed; when the distributed transaction is globally failed, determining whether there are transaction participants who cannot perform compensation operations, and when there are transaction participants who cannot perform compensation operations, periodically retrying compensation operations until the distributed transaction is globally successful.
[0011] According to another aspect of the embodiment of the present application, a distributed transaction synchronization device is also provided, including: an orchestration module, used to receive business orchestration instructions through a visualization platform and generate a business process; a configuration module, used to configure the transaction mode of the distributed transaction required by the business process at the entrance of the business process, and the transaction mode includes at least: try-confirm-cancel TCC mode, compensation mode and local transaction table mode; a synchronization module, used to determine the transaction synchronization strategy corresponding to the transaction mode, and complete transaction synchronization according to different synchronization strategies.
[0012] According to another aspect of an embodiment of the present application, a computer device is provided, including: a memory and a processor, wherein the memory is used to store program instructions; and the processor is connected to the memory and is used to execute the above-mentioned distributed transaction synchronization method.
[0013] According to another aspect of the embodiments of the present application, a non-volatile storage medium is provided, which includes a stored computer program, wherein the device where the non-volatile storage medium is located executes the above-mentioned distributed transaction synchronization method by running the computer program.
[0014] According to another aspect of the embodiments of the present application, a computer program product is provided, including computer instructions, which implement the above-mentioned distributed transaction synchronization method when executed by a processor.
[0015] In an embodiment of the present application, a business orchestration instruction is received through a visualization platform to generate a business process; a transaction mode of a distributed transaction required for the business process is configured at the entrance of the business process, and the transaction mode includes at least: try-confirm-cancel TCC mode, compensation mode and local transaction table mode; a transaction synchronization strategy corresponding to the transaction mode is determined, and transaction synchronization is completed according to different synchronization strategies, thereby achieving the purpose of orchestrating the business process according to the visualization platform and determining the transaction synchronization strategy based on the pre-configured transaction mode, thereby achieving the technical effect of simplifying the transaction synchronization process, and then solving the technical problem that the transaction synchronization process in the related technology is relatively cumbersome. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0017] Figure 1 It is a hardware structure block diagram of a computer terminal for implementing a distributed transaction synchronization method according to an embodiment of the present application;
[0018] Figure 2 is a flow chart of a distributed transaction synchronization method according to an embodiment of the present application;
[0019] Figure 3 is a flow chart of a configuration period orchestration business process according to an embodiment of the present application;
[0020] Figure 4 It is a business process compilation flowchart according to an embodiment of the present application;
[0021] Figure 5 is another distributed transaction synchronization flow chart according to an embodiment of the present application;
[0022] Figure 6 is a master transaction synchronization flow chart according to an embodiment of the present application;
[0023] Figure 7 is a branch transaction synchronization flow chart according to an embodiment of the present application;
[0024] Figure 8 This is a flow chart for obtaining a global transaction execution result according to an embodiment of the present application;
[0025] Fig. 9 is a flow chart of a second-stage execution method according to an embodiment of the present application;
[0026] Fig.10 is a schematic diagram of the structure of a synchronization device for distributed transactions according to an embodiment of the present application;
[0027] Fig.11 is a schematic diagram of the structure of a distributed transaction synchronization system according to an embodiment of the present application;
[0028] Fig.12 It is a schematic diagram of application service and distributed transaction deployment according to an embodiment of the present application. DETAILED DESCRIPTION
[0029] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0031] The information collected in the embodiments of the present application is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with the relevant laws, regulations and standards of the relevant regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or reject automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered.
[0032] In order to better understand the embodiments of the present application, the technical terms involved in the embodiments of the present application are explained as follows:
[0033] Low-code: Allows end users to develop their own applications using easy-to-understand visual tools instead of the traditional way of writing code. They can build the required functions such as business processes, logic, and data models through visual means without coding. If necessary, they can also add code manually to complete the custom logic that the system cannot implement, and automatically generate executable applications.
[0034] Metadata: Business models, methods, services, system processes, pages and other elements created through visual means within the low-code platform, data assets that are described and stored through structured tags.
[0035] Microservices: A cloud-native architecture for deploying applications on low-code platforms.
[0036] Distributed transactions: transactional operations involving cross-services require that global results and order remain consistent, that is, that global success or failure remain consistent; during transaction retry or rollback after global transaction failure, the execution order must remain consistent with the initial execution order.
[0037] Main transaction: The initiating participant of the transaction.
[0038] Branch transaction: In a cross-service transaction operation, the called transaction participant; the main transaction is a special branch transaction.
[0039] Global transaction: managed by the transaction initiator and the collection of all transaction participants.
[0040] TCC mode: (Try-Confirm-Cancel mode) is a design pattern for distributed transaction processing. The transaction submission process of participants is divided into 2 stages and 3 interfaces, namely the Try logic in stage 1 and the Confirm and Cancel logic in stage 2.
[0041] Compensation mode: The transaction submission process of the participants is divided into two stages and two interfaces, namely the commit logic in stage 1 and the rollback logic in stage 2. In the compensation mode, a business operation is usually designed into two parts: Original operation: This is the main operation that needs to be performed in the business logic, such as deducting the number of goods from the inventory in an e-commerce system. Compensation operation: This is the opposite operation of the original operation, which is used to restore the system to the state before the operation when the original operation fails or needs to be rolled back. For example, if the inventory deduction operation fails, the compensation operation will add the number of goods back to the original inventory.
[0042] Local transaction table mode: Transaction participants do not provide compensation or rollback operations, but only provide business method interfaces; transaction participants manage transaction status locally and record transaction flow and status. Global transaction managers do not participate in the processing of branch transactions.
[0043] In order to solve the problems existing in the related art, the present application embodiment provides a distributed transaction synchronization method, which can be run on Figure 1 In the computer terminal shown, the computer terminal is explained below.
[0044] The distributed transaction synchronization method embodiment provided in the embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 The hardware structure block diagram of a computer terminal for implementing a communication method of an air-space collaborative UAV emergency communication system is shown. Figure 1As shown, the computer terminal 10 may include one or more (102a, 102b, ..., 102n are used to illustrate) processors (the processor may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission module 606 for communication functions connected via a wired and / or wireless network. In addition, it may also include: a display, a keyboard, a cursor control device, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, and a BUS bus. Those skilled in the art can understand that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0045] It should be noted that the one or more processors and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10. As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0046] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the communication method of the air-space collaborative UAV emergency communication system in the embodiment of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, realizing the communication method of the air-space collaborative UAV emergency communication system mentioned above. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0047] The transmission module 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission module 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission module 106 can be a radio frequency (Radio Frequency, RF) module, which is used to communicate with the Internet wirelessly.
[0048] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 .
[0049] It should be noted that, in some optional embodiments, the above Figure 1 The computer terminal shown may include hardware elements (including circuits), software elements (including computer code stored on a computer-readable medium), or a combination of hardware elements and software elements. It should be noted that Figure 1 This is merely one example of a particular embodiment and is intended to illustrate the types of components that may be present in the computer terminal described above.
[0050] In the above-mentioned operating environment, an embodiment of the present application provides an embodiment of a distributed transaction synchronization method. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0051] Figure 2 is a flow chart of a distributed transaction synchronization method according to an embodiment of the present application, such as Figure 2 As shown, the method comprises the following steps:
[0052] Step S202, receiving a business arrangement instruction through a visualization platform and generating a business process;
[0053] In step S202, the visualization platform may be a low-code platform, and the distributed transaction includes: a main transaction and a branch transaction.
[0054] Step S204, configuring the transaction mode of the distributed transaction required by the business process at the entry of the business process, the transaction mode at least including: try-confirm-cancel TCC mode, compensation mode and local transaction table mode;
[0055] In step S204, the Try-Confirm-Cancel (TCC) mode: The TCC mode is a distributed transaction processing mechanism that decomposes a business operation into three phases: Try, Confirm, and Cancel. This mode is designed to ensure that data consistency and transaction atomicity are maintained when executing business operations involving multiple services in a distributed system. Try: In this phase, the service attempts to reserve or lock necessary resources, but does not make substantial changes. The goal is to check the availability of resources and prepare for subsequent operations. Confirm: If the Try phase is successful, the system will perform a Confirm operation to complete the business logic and release the resources reserved in the Try phase. Cancel: If the Try phase is successful but the Confirm phase fails, or if the Try phase detects that the operation cannot be completed, the system will perform a Cancel operation to restore the system to the state before the Try operation and undo the impact of the Try phase. Compensation mode: The compensation mode is a fault-tolerant mechanism used to handle scenarios where business operations fail in distributed systems. It reverses the effect of the original operation and ensures data consistency by designing a compensation operation that is opposite to the original operation. Original Operation: This is the main operation that needs to be performed in the business logic. Compensation Operation: This is the opposite operation of the original operation, which is used to restore the system to the state before the operation when the original operation fails or needs to be rolled back. Local transaction table mode: The local transaction table mode is a technology for dealing with distributed transaction consistency issues. It is particularly suitable for microservice architecture to solve the problem of data consistency during cross-service calls. Transaction start: The initiating service creates a transaction status table or log in the local database and sets the status to initialization. Business operation: The initiating service executes its local business logic and records the operations that need to be performed by external services. Result collection and transaction confirmation: Collect responses from all downstream services. If all operations are successful, update the transaction status to committed; if any operation fails, perform compensation operations according to the transaction status table to restore the business status to the state before the transaction started.
[0056] Step S206, determining a transaction synchronization strategy corresponding to the transaction mode, and completing transaction synchronization according to different synchronization strategies.
[0057] Through the above steps, business orchestration instructions are received through the visualization platform to generate a business process; the transaction mode of the distributed transaction required by the business process is configured at the entrance of the business process, and the transaction mode at least includes: try-confirm-cancel TCC mode, compensation mode and local transaction table mode; the transaction synchronization strategy corresponding to the transaction mode is determined, and transaction synchronization is completed according to different synchronization strategies, thereby achieving the purpose of arranging business processes according to the visualization platform and determining the transaction synchronization strategy based on the pre-configured transaction mode, thereby achieving the technical effect of simplifying the transaction synchronization process, and then solving the technical problem that the transaction synchronization process in the related technology is relatively cumbersome.
[0058] In some embodiments of the present application, the entire process of transaction synchronization can be divided into three stages: configuration period, compilation period and runtime period, wherein, configuration period: configure transaction processing logic on local / remote interface in cross-service interface call in a visual manner. Compilation period: build application, generate business metadata and transaction processing related code. Runtime: execute transaction processing, and coordinate the exception handling process of each branch transaction in real time when an exception occurs. Transaction exceptions that cannot be handled are retried afterwards through scheduling / manual processing in compensation tasks.
[0059] During the configuration phase, Figure 3 As shown, by visually choreographing the business process and taking the interface as the choreography object, the cross-service business process (logical process) can be realized through the logical series connection of the local interface and the remote interface, and the mark supporting distributed transactions and the distributed transaction mode are set at the business process entrance. For example: if the TCC mode is adopted, the confirmation interface and the cancel interface need to be configured at the entrance; if the compensation mode is adopted, the rollback interface needs to be configured; if the local transaction table mode is adopted, there is no need to configure the interface.
[0060] After the business process entry completes the distributed transaction configuration, all remote interface call nodes in the business process also need to configure corresponding distributed transaction nodes; when the process entry is configured with TCC mode, each remote interface node in the business process can be configured with TCC mode or compensation mode; when the process entry is configured with compensation mode, the remote interface node can only be configured with compensation mode; when the process entry adopts the local transaction table mode, the remote interface adopts the local transaction table mode by default.
[0061] It should be noted that the remote interface node is a participant in the transaction.
[0062] After the business process configuration is completed, click Publish Business Process to complete the generation and saving of process data. For process entries and remote interfaces configured with distributed transaction tags, transaction annotations (@Transactional), declared transaction modes (TCC / CPB / LTT), and associated compensation methods (confirm / cancel / rollback) will be automatically marked.
[0063] During compilation, if Figure 4 As shown, the compiler of the low-code platform will fill the process structure, attributes, interface node addresses, parameters, result sets, response codes, transaction modes, compensation interfaces and other information described by the metadata into the code template ftl file to generate the corresponding program file. The source code file is compiled into a bytecode file that runs on the Java virtual machine. When building an application configured for transaction processing, the transaction Client SDK package will be embedded in the application; developers can choose to manually specify the transaction Server service to follow an application and package it into a POD (the most basic unit for deploying and managing container applications) or deploy a Server by default for each main transaction application service. Eventually, the relevant applications will be deployed in a kubernetes (a container orchestration platform) environment.
[0064] In some embodiments of the present application, different transaction synchronization strategies are determined according to different transaction modes, including: obtaining the running stage of the distributed transaction, the running stage including: a first stage and a second stage, the first stage being a transaction preparation stage, and the second stage being a transaction submission stage; when the running stage is in the first stage, obtaining the type of transaction currently being executed; when the type of transaction currently being executed is a main transaction, completing the processing of the main transaction according to the synchronization strategy of the main transaction corresponding to the transaction mode; when the type of transaction currently being executed is a branch transaction, completing the processing of the branch transaction according to the synchronization strategy of the branch transaction corresponding to the transaction mode; when the running stage is the second stage, determining the synchronization strategy according to the transaction status of the distributed transaction, and completing transaction synchronization according to the synchronization strategy.
[0065] For example: During the operation period (operation phase), if Figure 5As shown in the figure, the processing method of requesting the main transaction is based on the transaction type distinction during the configuration period. The TCC mode (Try / Confirm / Cancel) sets the confirm and cancel methods, the compensation mode (Compensable) sets the rollback method, and the local transaction table mode (Local Transaction Table) does not set any compensation interface. The transaction event interceptor is triggered through the transaction aspect. According to different transaction modes, a transaction object is created, and key information such as the service name and root transaction ID of the main method are registered. At the same time, the main method is registered as a transaction participant, and the relevant compensation interface is registered. If the transaction table mode is adopted, there is no need to register the compensation interface, and the local business library is directly used to record the transaction flow. The compensation interface is used to execute the compensation method to synchronize distributed transactions.
[0066] It should be noted that the main method indicates the entry point of the business process and is used to initiate a distributed transaction.
[0067] After completing the registration of transaction participants, execute the transaction method, and after completion, change the branch transaction status (whether the transaction is executed successfully, where the compensation mode is committed if successful / rollbacking if failed, and the TCC mode is confirming if successful / canceling if failed).
[0068] When processing branch transactions, the transaction context interceptor is triggered through the transaction aspect. When calling the remote interface, the context of the main transaction is written into the header information of the http (Hypertext Transfer Protocol) protocol (metadata carried in the HTTP request or response, used to provide detailed information about the request or response), and is obtained by the remote interface through the transaction event interceptor after receiving the request.
[0069] Receive the processing result of the branch transaction, including: triggering the transaction event interceptor through the transaction aspect, creating a branch transaction object according to the root transaction context, creating a branch transaction id, and recording the root transaction id; persisting the branch transaction object, executing the business method, changing the transaction status (committed for success / rollbacking for failure in compensation mode, confirming for success / canceling for failure in TCC mode), and returning the execution result.
[0070] Finally, the global transaction selects the global confirm / cancel / rollback operation based on the execution result of the received transaction.
[0071] The specific steps of completing the processing of the main transaction according to the main transaction synchronization strategy corresponding to the transaction mode include: when the transaction mode of the main transaction is not the local transaction table mode, determining the synchronization strategy of the main transaction to record the transaction information of the main transaction, the compensation interface of the main transaction and the processing method of the main transaction, wherein, when the transaction mode of the main transaction is the TCC mode, the synchronization strategy of the main transaction is a confirmation method and a cancellation method, and when the transaction mode of the main transaction is the compensation mode, the synchronization strategy of the main transaction is a rollback method; when the transaction mode of the main transaction is the local transaction table mode, determining the synchronization strategy of the main transaction to record the flow information of the main transaction, and determining the processing method of the main transaction according to the flow information of the main transaction, wherein the processing method of the main transaction is to determine whether to commit or roll back the main transaction according to the flow information of the main transaction.
[0072] When the transaction mode of the main transaction is the TCC mode, the business execution method corresponding to the main transaction is determined to be an attempt method, and the attempt method is used to attempt to execute the business operation corresponding to the main transaction and reserve resources; when the transaction mode of the main transaction is the compensation mode and the local transaction table mode, the business execution method corresponding to the main transaction is determined to be a commit method, and the commit method is used to commit the business corresponding to the main transaction.
[0073] like Figure 6 As shown, the main transaction processing flow of the first phase is as follows:
[0074] S21: Create a transaction object and record root service, root transaction ID, transaction status and other information through the transaction event interceptor; in the local transaction table mode, record transaction flow information in the local business library through the transaction flow interceptor.
[0075] S22: Register transaction participants, confirm / cancel methods of TCC mode registered participants, rollback methods of compensation mode registered participants, local transaction table mode does not require registration.
[0076] S23: Execute the business method. The TCC mode executes the try method, and the compensation mode and the local transaction table mode execute the commit method. After the main method is executed, the remote methods are executed in sequence.
[0077] S24: Through the transaction context interceptor, the interface of the remote service is registered as a branch transaction participant, and the branch transaction participant does not need to register a compensation method; at the same time, a transaction context object is added to the header information of the http protocol to pass the root transaction context to the branch transaction participant.
[0078] It can be understood that the remote method is a remote interface. The transaction object represents the transaction information of the transaction, including at least: participating microservices, transaction status, transaction ID, etc. Root service: the first service called. Root transaction ID: The root transaction ID represents the unique identifier of the distributed transaction.
[0079] In the case where the currently executed transaction type is a branch transaction, the processing of the branch transaction is completed according to the preset branch transaction processing strategy, including: in the case where the transaction mode of the branch transaction is the TCC mode, executing the attempt method of the branch transaction, the attempt method is used to attempt to execute the business operation corresponding to the branch transaction; in the case where the transaction mode of the branch transaction is the compensation mode, executing the submission method of the branch transaction, the submission method is used to submit the business operation corresponding to the branch transaction. Wherein, in the case where the transaction mode of the distributed transaction is the TTC mode and the main transaction and the branch transaction have completed the first stage, all transactions in the distributed transaction are traversed, and when the transaction status of all transactions is successful, determine the global success, call the confirmation interface of all transaction participants in turn, and confirm the operations of all transactions. When there is a transaction status of execution failure in all transactions, a global failure is determined, and the cancel interfaces of all transaction participants are called in sequence to cancel the operations of all transactions; when the transaction mode of the distributed transaction is the compensation mode and the main transaction and the branch transaction have completed the first stage, all transactions in the distributed transaction are traversed, and when the transaction status of all transactions is successful, a global success is determined, and the transaction status of all transactions is updated to completed; when there is a transaction status of execution failure in all transactions, a global failure is determined, and the rollback interfaces of all transaction participants are called in sequence to perform a rollback operation and synchronize all transactions.
[0080] like Figure 7 As shown, the branch transaction processing flow of the first phase is as follows:
[0081] S31: The remote service creates a branch transaction object through the transaction event interceptor, redundantly adds the root transaction ID, and records the branch transaction information and status; in the local transaction table mode, the transaction flow information is recorded in the local business library through the transaction flow interceptor.
[0082] S32: Register the branch transaction and record the compensation method.
[0083] S33: In TCC mode, execute the Try method of the branch transaction; in compensation mode, execute the commit method of the branch transaction.
[0084] S34: According to the method execution result, the branch transaction state is changed and the execution result is persisted.
[0085] Figure 8 A method of obtaining the result of a global transaction is shown, such as Figure 8 As shown, including:
[0086] S41: Traverse the transaction list and determine whether the transaction status is globally successful or failed.
[0087] S42: According to the last-in-first-out principle, the compensation methods are called in sequence (no compensation is required in the local transaction table mode). In the TCC mode, if the transaction succeeds globally, the state is set to confirming, and the confirm interface is called in sequence. If the transaction fails globally, the state is set to canceling, and the cancel interface is called in sequence. In the compensation mode, if the transaction succeeds globally, the global transaction state is changed and ended. If the transaction fails globally, the state is changed to rollbacking, and the rollback interface is called.
[0088] In the case where the running stage is the second stage, the synchronization strategy is determined according to the transaction status of the distributed transaction, and transaction synchronization is completed according to the synchronization strategy, including: obtaining the execution results of all transactions through the root transaction, and determining whether the distributed transaction is the global success according to the execution results, and in the case where the distributed transaction is the global success, confirming that all transactions can be committed; in the case where the distributed transaction is the global failure, determining whether there is a transaction participant that cannot perform a compensation operation, and in the case where there is a transaction participant that cannot perform a compensation operation, periodically retrying the compensation operation until the distributed transaction is the global success.
[0089] Specifically, Fig. 9 As shown, including:
[0090] S51: The root transaction traverses the transaction list, changes the transaction object status and information according to the global transaction status and transaction type, uses the same interface parameters as the first stage, calls the compensation interface in sequence, and passes the transaction context to the transaction participants through the transaction context interceptor.
[0091] S52: The transaction participant obtains the transaction context and instructions of the second phase through the transaction event interceptor and executes the method call of the second phase. For branch transactions, the parameters of the compensation interface and the first phase business interface must be consistent.
[0092] S53: The root transaction waits for the execution result of the branch transaction to be returned, and determines the global transaction status based on the execution result. For branch transactions that cannot be processed during synchronization, the platform supports the subsequent scheduled task retry compensation interface to ultimately achieve result consistency.
[0093] According to another aspect of the embodiment of the present application, a synchronization device for distributed transactions is also provided. Fig.10 As shown, it includes: an orchestration module 110, which is used to receive business orchestration instructions through a visualization platform and generate a business process; a configuration module 112, which is used to configure the transaction mode of the distributed transaction required by the business process at the entrance of the business process, and the transaction mode at least includes: try-confirm-cancel TCC mode, compensation mode and local transaction table mode; a synchronization module 114, which is used to determine the transaction synchronization strategy corresponding to the transaction mode, and complete transaction synchronization according to different synchronization strategies.
[0094] The synchronization module 114 includes: a synchronization submodule, which is used to determine different transaction synchronization strategies according to different transaction modes, including: obtaining the running stage of the distributed transaction, the running stage includes: a first stage and a second stage, the first stage is a transaction preparation stage, and the second stage is a transaction submission stage; when the running stage is in the first stage, obtaining the type of transaction currently being executed; when the type of transaction currently being executed is a main transaction, completing the processing of the main transaction according to the synchronization strategy of the main transaction corresponding to the transaction mode; when the type of transaction currently being executed is a branch transaction, completing the processing of the branch transaction according to the synchronization strategy of the branch transaction corresponding to the transaction mode; when the running stage is the second stage, determining the synchronization strategy according to the transaction status of the distributed transaction, and completing transaction synchronization according to the synchronization strategy.
[0095] The synchronization submodule includes: a first synchronization unit and a second synchronization unit, the first synchronization unit is used to complete the processing of the main transaction according to the main transaction synchronization strategy corresponding to the transaction mode, including: when the transaction mode of the main transaction is not the local transaction table mode, determining the synchronization strategy of the main transaction to record the transaction information of the main transaction, the compensation interface of the main transaction and the processing method of the main transaction, wherein, when the transaction mode of the main transaction is the TCC mode, the synchronization strategy of the main transaction is a confirmation method and a cancellation method, and when the transaction mode of the main transaction is the compensation mode, the synchronization strategy of the main transaction is a rollback method; when the transaction mode of the main transaction is the local transaction table mode, determining the synchronization strategy of the main transaction to record the flow information of the main transaction, and determining the processing method of the main transaction according to the flow information of the main transaction, wherein the processing method of the main transaction is to determine whether to commit or roll back the main transaction according to the flow information of the main transaction.
[0096] The first synchronization unit also includes: a first execution sub-unit, which is used to determine that the business execution method corresponding to the main transaction is an attempt method when the transaction mode of the main transaction is the TCC mode, and the attempt method is used to attempt to execute the business operation corresponding to the main transaction and reserve resources; when the transaction mode of the main transaction is the compensation mode and the local transaction table mode, determine that the business execution method corresponding to the main transaction is a commit method, and the commit method is used to commit the business corresponding to the main transaction.
[0097] The second synchronization unit is used to complete the processing of the branch transaction according to the preset branch transaction processing strategy when the currently executed transaction type is a branch transaction, including: when the transaction mode of the branch transaction is the TCC mode, executing the attempt method of the branch transaction, the attempt method is used to attempt to execute the business operation corresponding to the branch transaction; when the transaction mode of the branch transaction is the compensation mode, executing the submission method of the branch transaction, the submission method is used to submit the business operation corresponding to the branch transaction.
[0098] The second synchronization unit also includes: a second execution subunit, which is used to traverse all transactions in the distributed transaction when the transaction mode of the distributed transaction is the TTC mode and the main transaction and the branch transaction have completed the first stage, and when the transaction status of all transactions is successful, determine global success, call the confirmation interface of all transaction participants in sequence, and confirm the operation of all transactions. When there is a transaction status of execution failure in all transactions, determine global failure, call the cancellation interface of all transaction participants in sequence, and cancel the operation of all transactions; when the transaction mode of the distributed transaction is the compensation mode and the main transaction and the branch transaction have completed the first stage, traverse all transactions in the distributed transaction, and when the transaction status of all transactions is successful, determine global success, and update the transaction status of all transactions to completed; when there is a transaction status of execution failure in all transactions, determine global failure, call the rollback interface of all transaction participants in sequence, perform rollback operation, and synchronize all transactions.
[0099] The second synchronization unit includes: a global subunit, which is used to determine the synchronization strategy according to the transaction status of the distributed transaction when the running stage is the second stage, and complete transaction synchronization according to the synchronization strategy, including: obtaining the execution results of all transactions through the root transaction, and determining whether the distributed transaction is globally successful according to the execution results, and when the distributed transaction is globally successful, confirming that all transactions can be committed; when the distributed transaction is globally failed, determining whether there are transaction participants who cannot perform compensation operations, and when there are transaction participants who cannot perform compensation operations, retrying compensation operations at a regular interval until the distributed transaction is globally successful.
[0100] The present application also provides a distributed transaction synchronization system for executing the above method, such as Fig.11As shown, it includes: Low-code development platform: application development is carried out through visualization, so that developers with different experience levels can use a graphical user interface to use drag-and-drop components and model-driven logic to create business objects and implement business logic. Applications can be quickly generated without coding or with a small amount of code. The final program language converted from the low code in this case is Java, the application is built using the spring cloud microservice architecture, and the program is compiled into a docker container and runs in the kubernetes environment. Metadata module: a module in the low-code development platform, used to describe the structure and properties of design elements such as modules, business models, fields, page views, interfaces, logical processes, etc. of the program, convert the above information into semi-structured metadata for persistent storage. In this case, the metadata service uses PostgreSql as the database, and the metadata is designed with a json structure and stored in the database in the jsonb format. The visual configuration of distributed transactions will also be described in a structured language and stored in the metadata database. Logical flow orchestration module: a module in the low-code development platform. Developers use visual means to orchestrate and connect model operations, interface calls, and logical flows, and publish them into a complete process that can be executed automatically without interruption; the logical flow follows the Business Process Modeling Notation (BPMN) specification. The logical flow orchestration in this case supports developers to configure transaction processing logic for each interface when arranging cross-service interface calls. And when compiling / building applications, the corresponding distributed transaction processing logic generates corresponding code and is implanted into the application. Transaction management module: a management module on the distributed transaction server side, used to manage the business service registration, query, and deregistration of the current transaction server side; query of abnormal events; query of global transactions and branch transactions. Persistence module: a persistence operation on the distributed transaction server side, providing transaction add, delete, modify, and query (CRUD) interfaces, status modification interfaces, etc. All operations on the transaction library by the transaction client side will send requests to the server side and fall into the library through the persistence module on the server side. Service governance module: Using the Nacos registration center, the distributed transaction server and client both register services with Nacos, and obtain the address list of transaction participants from Nacos. Communication module: The distributed transaction server and client obtain the addresses of transaction participants from the Nacos registration center, and establish long connection communication through the above addresses; the communication protocol uses the netty technology stack, the transaction client initiates a long connection to the transaction server, maintains daily health checks, and initiates a transaction operation request to the server through the long connection channel when a transaction event occurs.Abnormal task module: The task scheduling module on the server side of the distributed transaction regularly scans transaction records in abnormal states, such as a branch transaction in a failed state. According to the execution result of the global transaction, it automatically / manually performs retries to restore to a normal state. Alarm module: The distributed transaction server regularly scans transaction records in abnormal states and sends alarm information to relevant system maintenance personnel. It supports SMS, enterprise WeChat, etc. Transaction proxy module: The core module of the distributed transaction client side. Business applications rely on the proxy module on the client side to mark the interfaces participating in the transaction. When a transaction event occurs, it creates a transaction object, registers transaction participants, and executes the call of the business interface on behalf of the proxy. When initiating a cross-service interface call, it passes the transaction context to the remote service; it processes the commit and rollback of each transaction participant according to the call result of the remote interface, and finally confirms the status of the global transaction. The client and server codes of distributed transactions are implemented in Java, and support applications generated in Java. Annotations are applied to local and remote interfaces to mark them as distributed transaction entries. When the interface is called, the transaction interceptor is triggered by the aspect, and the transaction processing scheme TCC / compensation / local transaction table is dynamically selected according to the transaction context and the registered compensation method. The call of the business remote interface supports the Http protocol, and the transaction context is also passed to the remote interface through annotations applied to the proxy method of the remote interface. In the TCC mode, all transaction participants need to lock business resources or status through the Try interface. After the execution of each branch transaction in the first phase is completed, the main transaction notifies each transaction participant to perform the second phase of confirmation or cancellation according to the global transaction status. The TCC mode requires the implementation of multiple interfaces in stages in terms of business, and requires the reservation of resources and multi-state design, so the development cost is relatively high. In compensation mode, all transaction participants need to design a rollback interface. After the execution of each branch transaction in the first phase is completed, the main transaction handles the global transaction status. When a branch transaction cannot complete the commit operation, the global transaction is judged to have failed, and each transaction participant is notified to perform a rollback operation. For simple single-table operations, such as adding and modifying methods for a single table, the low-code platform will automatically generate a rollback method. In local transaction table mode, all transaction participants do not need to provide compensation methods. They only record transaction flows in the local business database when transaction events occur. The transaction service does not participate in the processing of each branch transaction, and only supports operation and maintenance personnel to manually perform data corrections through detailed data of the transaction flow.
[0101] The present application also provides a schematic diagram of application service and distributed transaction deployment, such as Fig.12As shown, the platform adopts a microservice architecture, builds applications in a containerized manner, and manages the application environment with Kubernetes. The low-code platform configures the interface of the distributed transaction processing logic in the logical flow orchestration during the configuration period, and the SDK and related codes of the distributed transaction client are implanted in the relevant applications. The server is responsible for receiving transaction processing requests from each client, and creating, changing, and deleting transaction objects; the server can be automatically or specified by the user on the application service of a main transaction, and the application service can be built as two containers in one Pod to share server resources. The application implements cluster deployment and load balancing through the multi-copy (replica) mechanism of the Pod. The resources between each Pod are isolated and can run independently. When the server is short of resources, it can be horizontally expanded through the replica definition of the deployment. The load balancing from the transaction client to the server supports two modes: random and round robin.
[0102] An embodiment of the present application also provides a computer device, including: a memory and a processor, wherein the memory is used to store program instructions; and the processor is connected to the memory and is used to execute the above-mentioned distributed transaction synchronization method.
[0103] An embodiment of the present application also provides a non-volatile storage medium, which includes a stored computer program, wherein the device where the non-volatile storage medium is located executes the above-mentioned distributed transaction synchronization method by running the computer program.
[0104] An embodiment of the present application also provides a computer program product, including computer instructions, which, when executed by a processor, implement the steps of the distributed transaction synchronization method in the present application.
[0105] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0106] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0107] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0108] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0109] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0110] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program code.
[0111] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A distributed transaction synchronization method, characterized in that: include: Receive business orchestration instructions through the visualization platform and generate business processes; Configure the transaction mode of the distributed transaction required by the business process at the entrance of the business process, wherein the transaction mode at least includes: try-confirm-cancel TCC mode, compensation mode and local transaction table mode; Determine the transaction synchronization strategy corresponding to the transaction mode, and complete transaction synchronization according to different synchronization strategies.
2. The method according to claim 1, characterized in that Determine different transaction synchronization strategies based on different transaction modes, including: Acquire the running phase of the distributed transaction, the running phase comprising: a first phase and a second phase, the first phase being a transaction preparation phase, and the second phase being a transaction submission phase; When the running phase is in the first phase, obtaining a type of transaction currently being executed; In the case where the currently executed transaction type is a main transaction, completing the processing of the main transaction according to the synchronization strategy of the main transaction corresponding to the transaction mode; In the case where the currently executed transaction type is a branch transaction, completing the processing of the branch transaction according to the synchronization strategy of the branch transaction corresponding to the transaction mode; In a case where the running stage is the second stage, the synchronization strategy is determined according to the transaction state of the distributed transaction, and transaction synchronization is completed according to the synchronization strategy.
3. The method according to claim 2, characterized in that The main transaction is processed according to the main transaction synchronization strategy corresponding to the transaction mode, including: When the transaction mode of the main transaction is not the local transaction table mode, the synchronization strategy of the main transaction is determined to be recording the transaction information of the main transaction, the compensation interface of the main transaction and the processing method of the main transaction, wherein, when the transaction mode of the main transaction is the TCC mode, the synchronization strategy of the main transaction is the confirmation method and the cancellation method, and when the transaction mode of the main transaction is the compensation mode, the synchronization strategy of the main transaction is the rollback method; In the case where the transaction mode of the main transaction is the local transaction table mode, the synchronization strategy of the main transaction is determined to record the transaction flow information of the main transaction, and the processing method of the main transaction is determined according to the transaction flow information of the main transaction, wherein the processing method of the main transaction is to determine whether to commit or roll back the main transaction according to the transaction flow information of the main transaction.
4. The method according to claim 3, characterized in that The method further comprises: In a case where the transaction mode of the main transaction is the TCC mode, determining that the service execution method corresponding to the main transaction is an attempt method, wherein the attempt method is used to attempt to execute the service operation corresponding to the main transaction and reserve resources; In the case where the transaction mode of the main transaction is the compensation mode and the local transaction table mode, it is determined that the business execution method corresponding to the main transaction is a commit method, and the commit method is used to commit the business corresponding to the main transaction.
5. The method according to claim 2, characterized in that: In the case where the currently executed transaction type is a branch transaction, completing the processing of the branch transaction according to a preset branch transaction processing strategy includes: When the transaction mode of the branch transaction is the TCC mode, executing an attempt method of the branch transaction, wherein the attempt method is used to attempt to execute a business operation corresponding to the branch transaction; When the transaction mode of the branch transaction is the compensation mode, a commit method of the branch transaction is executed, where the commit method is used to commit the business operation corresponding to the branch transaction.
6. The method according to claim 5, characterized in that The method further comprises: When the transaction mode of the distributed transaction is the TCC mode and both the main transaction and the branch transaction have completed the first phase, traverse all transactions in the distributed transaction, and when the transaction status of all transactions is successful, determine that the global transaction is successful, and call the confirmation interfaces of all transaction participants in sequence to confirm the operations of all transactions; If any transaction in all transactions is in the failed execution state, the global failure is determined, and the cancellation interfaces of all transaction participants are called in sequence to cancel the operations of all transactions; When the transaction mode of the distributed transaction is the compensation mode and both the main transaction and the branch transaction have completed the first phase, traverse all transactions in the distributed transaction, and when the transaction status of all transactions is successful, determine that the global transaction is successful, and update the transaction status of all transactions to completed; When a transaction in all transactions is in the state of execution failure, a global failure is determined, and the rollback interfaces of all transaction participants are called in sequence to perform the rollback operation and synchronize all transactions.
7. The method according to claim 6, characterized in that In the case where the running stage is the second stage, determining the synchronization strategy according to the transaction state of the distributed transaction, and completing transaction synchronization according to the synchronization strategy, including: Obtaining the execution results of all transactions through the root transaction, and determining whether the distributed transaction is the global success according to the execution results, and confirming that all transactions can be committed if the distributed transaction is the global success; In the case where the distributed transaction fails globally, it is determined whether there are transaction participants that cannot perform compensation operations. If there are transaction participants that cannot perform compensation operations, compensation operations are retried periodically until the distributed transaction succeeds globally.
8. A distributed transaction synchronization device, characterized in that: include: The orchestration module is used to receive business orchestration instructions through the visualization platform and generate business processes; A configuration module, used to configure the transaction mode of the distributed transaction required by the business process at the entrance of the business process, wherein the transaction mode at least includes: a try-confirm-cancel TCC mode, a compensation mode and a local transaction table mode; The synchronization module is used to determine the transaction synchronization strategy corresponding to the transaction mode and complete the transaction synchronization according to different synchronization strategies.
9. A computer device, characterized in that: include: A memory and a processor, wherein the memory is used to store program instructions; The processor is connected to the memory and is used to execute the distributed transaction synchronization method described in any one of claims 1-7.
10. A computer program product comprising computer instructions, characterized in that: When the computer instructions are executed by a processor, the distributed transaction synchronization method described in any one of claims 1 to 7 is implemented.